Commit graph

12 commits

Author SHA1 Message Date
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
Daimona Eaytoy c52e9fe34b Stop using deprecated Language methods
Change-Id: Idd3a255c60bb0c615e819a56f86b3d36377a0469
2021-02-27 14:22:36 +00:00
libraryupgrader 9d4a98e655 build: Updating mediawiki/mediawiki-codesniffer to 33.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate
* MediaWiki.Commenting.PropertyDocumentation.WrongStyle

Additional changes:
* Dropped .inc files from .phpcs.xml (T200956).
* Added the `wikimedia/mediawiki` profile in .eslintrc.json (T262222).

Change-Id: Ic7e903cc97b3766fcff467b382caf2a5a6bc5089
2020-11-04 02:06:23 +00: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
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
DannyS712 13a0039996 Use lowercase for primitive type 'string'
Change-Id: I374868a5a83164c6f1f225b1daac56e58bb81679
2020-03-20 15:58:55 +00:00
Derick Alangi aab9a97c96 Avoid usage of deprecated $wgContLang global (dep in 1.32)
Change-Id: I1c3d9b6d9de3c7ef24f24f45aad9510be3f8b588
2019-09-02 09:55:37 +01:00
Fomafix 025f373d8a Use \u{00A0} instead of &#160;
Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0)
instead of the HTML/XML entitiy &#160;.

Bug: T154300
Change-Id: Ica1a16c7114ec2c5bea04b21f14cf083eb4e417b
2019-05-13 19:12:09 +02:00
Max Semenik 10cfa1cda5 Parser::getConverterLanguage() is deprecated
Change-Id: Id09eac3cd681471f26993885b2f3e752ba87694a
2019-03-15 14:58:48 -07:00
Brian Wolff 252fed5d27 Fix a phan-taint-check false positive
phan-taint-check gets confused when you escape a variable and
assign the escaped version to the same name as the unescaped
version.

Change-Id: I1bf4d64e68bff516b5f8b6266d85f67020008433
2018-05-04 21:02:10 +00:00
Kunal Mehta 431f955a81 Move classes to includes/
Change-Id: Ia65adfc9d9d6a117d8d4fc711e97414328b42440
2018-02-24 13:57:32 -08:00
Renamed from InputBox.classes.php (Browse further)