Commit graph

20 commits

Author SHA1 Message Date
Jon Robson 3bf7584c51 Refactor logic for component rendering
Result is exactly same, but mediawiki ui markup is
centralized to a single function.

Bug: T353371
Change-Id: If021e39beb48246985edf40dc94e2442e9fc49ee
2024-04-05 12:26:53 +00:00
C. Scott Ananian 3d8bbe8f87 Repair a broken parser test
Before Ia72c960b2c7914342eb4d5e3e63f2d6af14719ad the parser test
framework wasn't setting the user language correctly when a variant
was requested, which meant that the UX text was being selected from
the base language, not the user's preferred variant.

Depends-On: I0c9c9fec920f7cb028d935e552a8f11475a23ba7
Change-Id: I7ab40a1d9adc6478c2fe99f44c8f51cbe4ac23a0
2023-02-15 15:54:58 +00:00
C. Scott Ananian 8f992cf5ef Temporarily disable a broken parser test
The fix for this issue is in Ia72c960b2c7914342eb4d5e3e63f2d6af14719ad
but we have to temporarily disable the test in order to break a cyclic
dependency.

Change-Id: I318c2fb8694c90efef07f1e2951c6d9aa6b3e82f
2023-01-26 14:25:53 -05:00
Fomafix a30577bdfb Rename language codes sr-ec and sr-el to sr-Cyrl and sr-Latn in tests
sr-ec and sr-el are not conform to BCP 47.
BCP 47 explicit mentions sr-Latn and sr-Cyrl as examples.

MediaWiki already supports both the old language codes 'sr-ec' and
'sr-el' and the new language codes 'sr-Cyrl' and 'sr-Latn' as language
codes for variants.

Bug: T117845
Change-Id: I59fd307664769efb8a6e4c47a866c3b1dd17ed5d
2023-01-02 22:05:36 +00:00
Subramanya Sastry 1ab6d0493f Get rid of +tidy references from parser tests
Bug: T198214
Change-Id: I0dbe2b47e052bf5a42604431d8f04794d3c461e0
2021-09-30 13:46:57 -05:00
Timo Tijhof 93351fb7d9 Use native <input required> instead of JS-based disabled toggling
Remove the JavaScript module and its logic to toggle the disabled
state on the submit button. Instead, let the browser handle this
natively by setting the `required` attribute, which naturally prevents
early submissions.

Retain the current styling for 99% of cases by using the
:required:invalid selector to target the submit button to make it
appear disabled. This slight duplication of styles is needed because,
despite the form effectively being disabled natively, the core
mediawiki-ui styles only account for :disabled on the button directly
and not e.g. inherited via form:invalid. It is also unclear whether
we would want that, since there is some value to be had from having
the form give a consistent look with a progressive button that can
be submitted even at the wrong time to yield an assistive message to
the required field, so hence handling this locally for now instead of
with a generalised approach.

In order to use the required true/false idiom, I have switched the
generating of the HTML string from the old Xml::element method
to Html::element. This means there is no need to store it in an array
first and conditionally set it since true/false will result in absence
or required="" as needed.

As side-effect from this, redundant attributes like value="" and
type="text" are ommitted from the output, just as MediaWiki core does
more generally.

Bug: T283303
Change-Id: I2c75e09dd3f89fa11fca311b4e1f8133946b01b1
2021-05-21 21:04:02 +01:00
Greg Rundlett 1e76fa3fc2 Adding CSS class to hook into SearchSuggest feature
Fixes Bug: T260437

This commit updates unit tests

Change-Id: I36c8c9837c4d1d0beff8ebdb5e86d55937a9e512
2020-08-18 12:40:03 -04:00
C. Scott Ananian a9d0e1fff8 Add newline at end of parser tests file
The new parser tests file parser seems to require it.

Change-Id: I8ab4a8c59ed1b6837dba428f96a8ba0084b7fb68
2020-08-04 14:23:54 -04:00
jenkins-bot d6d9e032c5 Merge "Provide an aria-label attribute option to the input textbox" 2020-04-24 23:37:49 +00:00
Akinwale Alagbe 0d6c2bfc6b Provide an aria-label attribute option to the input textbox
Provide an option to supply the aria-label attribute to the inputbox to 
allow generated markup be accessible to screen readers
<inputbox>
    type=search
    width=120
    buttonlabel=Search
    arialabel=Search this wiki
</inputbox>

Bug: T242354
Change-Id: I40c62bc9889a4912b43244ec65e628ec8bc8533f
2020-04-24 23:05:16 +00:00
C. Scott Ananian e1751bfd26 Update parserTests to v2 (tidy by default)
Bug: T249137
Change-Id: I746ee2b985537dc6bbb8a114e21cd11a683e0f74
2020-04-01 15:44:44 -04:00
zoranzoki21 02f1a2705f Upgrade InputBox extension to use newer phan
Bug: T216922
Change-Id: I64e8a4e97e6d7e8216845b3cc912239c69107dd7
2019-03-02 21:02:16 +01:00
Umherirrender 1e200ba116 Update extensions to take advantage of parser test autodiscovery
Bug: T170037
Change-Id: I537f8b2679bc546606856e4bf031efcd52cb381e
2018-04-13 20:15:44 +02:00
jenkins-bot 2739368322 Merge "Update parser tests for RemexHtml as tidy implementation" 2018-03-06 22:27:45 +00:00
Kunal Mehta 6deecac4c2 Add phan configuration
Change-Id: I220a6da9d506a754d4e502bd4bd3178949b73f5f
2018-02-24 13:57:36 -08:00
Kunal Mehta 91763b61f3 Update parser tests for RemexHtml as tidy implementation
Bug: T188167
Depends-On: Ic7c34d57a300dbd36a37f03fbfe33391b2950b44
Change-Id: Id2ed22063dbf40af6d470d6879a79d8df5ab49d8
2018-02-23 22:31:26 -08:00
Brian Wolff b9e0005c71 Have inputbox langconvert certain attributes
This approximates the behaviour prior to core change for
T119158. It will language convert the options: default,
buttonlabel, searchbuttonlabel, and placeholder if they
contain a "-{".

The old behaviour was to handle the insides
of -{ glossary rules here }- and convert text if there was a
glossary rule both prior to the beginning of the attribute and
prior to the end of the attribute (So default=foo-{}-bar-{}-baz
only bar would be converted). I believe that just looking for
-{ is probably close enough. It also opens the question of if these
options should always be language converted, but I'll leave that
for someone else to decide.

Bug: T180485
Change-Id: I3aa10890950afce445075e895baf6b10327bc222
2017-11-21 04:13:53 +00:00
Sam Tarling cba46734e1 Add tour parameter
Add an optional tour parameter with adds `&tour=[x]` to the local Special:Search URL
Remove whitespace error
Add test
Modify test HTML (x3)

Bug: T174077
Change-Id: Iaaf1d04e1939bd555cacd4ea3ac4390d7e43b19d
2017-09-02 15:51:23 +01:00
Florian Schmidt a7c83858c6 Don't add url parameters to an input box, if the parameter is empty
If a parameter isn't set, it shouldn't be added to the form.

Bug: T147048
Change-Id: I7e5aa21528fbc98e9e4d52baca93870f213d4c15
2017-07-27 02:29:35 +00:00
Tim Starling f7491d3484 Add parser tests
Change-Id: I718b0e0c1dd0a4507e77abc7e2cb88800ae2176a
2016-07-08 16:20:57 +10:00