Commit graph

14 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
Sébastien Beyou 253eb5e85a Replace use of deprecated $.debounce()
Bug: T213426
Change-Id: I1502a1bd68ea260e94a47fcce047bafce3e47f0b
2021-04-30 00:49:27 +00:00
Reedy 5ef98e8775 Convert to manifest_version 2
Bug: T252470
Change-Id: I22b8c6151272a81a58ffcab3730e247f175646ed
2020-05-12 00:03:08 +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
Kunal Mehta 431f955a81 Move classes to includes/
Change-Id: Ia65adfc9d9d6a117d8d4fc711e97414328b42440
2018-02-24 13:57:32 -08:00
zoranzoki21 fab2eacd44 Removed deprecated position statements from resource loader module
Bug: T184257
Change-Id: I6c7f04d69a0d7871012ebe37954ad7f8b4694dbc
2018-02-12 15:55:45 +01:00
Max Semenik 84b7716487 Don't use deprecated Sanitizer::escapeId()
Change-Id: I99ce7bdea39c0b6fe0daed7c0be5fec0c8680321
2017-10-24 14:25:40 -07:00
Umherirrender 7ffb957f31 Prefer descriptionmsg over description in extension.json
Change-Id: If5f4e779c9c4663edab3f4dc26b7cdcb22cd5609
2017-01-27 20:19:58 +01:00
Tim Starling f7491d3484 Add parser tests
Change-Id: I718b0e0c1dd0a4507e77abc7e2cb88800ae2176a
2016-07-08 16:20:57 +10:00
Kunal Mehta 5a03081a98 Set license-name to "MIT-Licence"
Follows-up d5dbe717b, which accidentally lost all licensing information.

Bug: T106642
Change-Id: I44024a0041040bbff42afceb650170af1d0b6c66
2015-08-24 00:39:42 +05:30
Florian 3a640f0368 Add mobile target to styles module
Bug: T103274
Change-Id: If3b63deb85840ad9ca88068815cfdc6e3c265004
2015-06-21 21:10:19 +02:00
Kunal Mehta 87092c8732 Set manifest_version in extension.json
Bug: T100745
Change-Id: I33fd8c9e44015c5df2e0bbf2afaa8c7b487f37d5
2015-05-28 20:39:14 -07:00
Kunal Mehta 562fa9c684 Re-apply a6a7dc02e5
Got lost in rebasing d5dbe717b6

Change-Id: I9ae3f702ff3e1aa7b5cb9c600e40e4044b0f2368
2015-05-04 15:23:31 -07:00
Florian d5dbe717b6 Convert InputBox.php to extension.json for extension registration
Bug: T87931
Change-Id: Ib3cd4714c842ebf17da5b1f0932fd886dbc65c66
2015-05-04 13:25:16 -07:00