This matches modern practice a little better: the InputBoxHooks class
can (eventually) contain the service objects needed by this extension
and make them available to the hooks. It also avoids the need to
explicitly name this class and its namespace.
Followup-To: Iaaff18b50619f490a4437be7f4d95845c8e0eedb
Change-Id: I07a574eca2d0012e3f7e6172d75cffd34392b1b4
This is a pre-patch for I5144fd6c54 to add a namespace for InputBox and
making sure that this still works, independently of what we're doing
later.
Change-Id: Iaaff18b50619f490a4437be7f4d95845c8e0eedb
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
$params['title'] can be an array if someone has messed with the query
parameters.
Use WebRequest::getText(), which guarantees strings (and which is
already used for 'prefix' earlier in this method).
Change-Id: I7b974067fdee22fc42c07fad98af4619fa850269
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
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
Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0)
instead of the HTML/XML entitiy  .
Bug: T154300
Change-Id: Ica1a16c7114ec2c5bea04b21f14cf083eb4e417b
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