Commit graph

12 commits

Author SHA1 Message Date
Timo Tijhof 3a6f634385 SpecialReplaceText: Migrate deprecated Xml usage to Html class
```
Xml::textarea( $name, $content, $cols = 40, $rows = 5, $attribs );

Xml::input( $name, $size = false, $value = false, $attribs );

Xml::checkLabel( $label, $name, $id, $checked = false, $attribs );
```

For examples of trouble with Xml::checkLabel, see also I61c8f67127 in
CentralAuth and I33bf6ab5e0 in MediaWiki core. For improved clarify,
I'm replacing most of these with Html::element().

While at it, I'm also migrating `<input id=…><label for=…>…</label>`
to the simpler `<label><input>…</label>` form where this is easy to
do.

ext.ReplaceTextStyles.less has styles for label/input inside
`.ext-replacetext-search-togglebox`, which this patch leaves unchanged.

ext.ReplaceText.js refers to the IDs of namespace checkboxes,
which this change keeps in-tact. In the future, the namespace
checkbox HTML could be simplified further if the JS code selects by
`name` instead of `id`.

Test Plan:
* Given `wfLoadExtension('ReplaceText');` in LocalSettings.php,
  and a Main_Page containing the word "installed".
* View Special:ReplaceText, verify it renders without errors,
  and each label is click-associated with its checkbox.
* Find "Main", Replace "Minor",
  tick "(Main)" namespace, tick "Replace text in page titles".
* Continue
* Verify the checkboxes under "For moved pages:" are also
  associated with their labels.

Change-Id: I2060961115b7af23dcf086ed03bfa3f159f5302c
2024-03-27 03:07:52 +00:00
Yaron Koren e1da9e2d63 Replace "Announce changes" option with (inverse) "Mark as bot"
Bug: T200334
Change-Id: I5b588e0dda95812543b270fbc5aece14a5583c83
2023-08-08 16:13:07 +00:00
Fomafix 78e75ed030 Change CSS identifiers
Apply CSS coding conventions from:
https://www.mediawiki.org/wiki/Manual:Coding_conventions/CSS#Naming

* Use class instead of id.
* Use class names with the prefix "ext-replacetext-".
* Remove stylelint rule:
    "selector-max-id": null
* Add stylelint rule:
    "selector-class-pattern": "^client-nojs$|^ext-replacetext-"

Change-Id: Ia7e3d41030aba7287716a219acbe6115e8fcbe46
2021-09-08 11:53:43 +00:00
Fomafix db88090ca6 Generate toggle buttons in HTML instead of JavaScript
This change ensures that the toggle buttons are already present while
loading.

Change-Id: I9453de8e540a75436029a3383721d0b6d73786ae
2021-09-07 20:33:39 -07:00
Yaron Koren 7c5dfae496 Change some interface elements to use OOUI
Change-Id: Ic55f2b173948aad50ae24279b630315ecf8faf1c
2021-07-08 18:16:20 +00:00
Fomafix 978c8ead5b Simplify checkbox inverting
Change-Id: Ic44987189a024e1f07e38907ce7208f9ab3a4d10
2021-07-03 07:22:29 +00:00
libraryupgrader e150d1ca6c build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 34.0.0 → 35.0.0
* mediawiki/minus-x: 1.1.0 → 1.1.1

npm:
* eslint-config-wikimedia: 0.17.0 → 0.18.1

Change-Id: I65d4f456cb19d45ee6da21d8fb3e61ee87e9d5e5
2021-01-30 09:22:05 +00:00
Fomafix a316c0f08f Avoid using core module 'mediawiki.special.search'
The core module 'mediawiki.special.search' contains more functions
which are not needed here and which causes an error message in the
JavaScript console. (T211384)

This change copies the used part of module 'mediawiki.special.search'
to the local module 'ext.ReplaceText'.

The CSS file for the style module 'ext.ReplaceTextStyles' is renamed
from ext.ReplaceText.css to ext.ReplaceTextStyles.css to make
ext.ReplaceText.css free for the CSS part of module 'ext.ReplaceText'.

Bug: T211384
Change-Id: I41225ccdf8a95a7c501fb6eea99abbd08353f4ea
2018-12-22 20:32:33 +01:00
Fomafix 7ec8d23740 Remove obsolete aliases from closures
Bug: T208951
Change-Id: Ie7580aef0af9f6cffed4826b0ae46d4b99446ae1
2018-12-06 18:42:31 +01:00
Fomafix 75ddb5fea0 Use private function instead of attaching the function to window
Change-Id: Ie6f8d0cdf0cf8842ff756839951b4b4bdbade942
2018-12-06 18:31:50 +01:00
Cindy Cicalese 288bd4f5e2 Remove inline JavaScript
Bug:T191546
Change-Id: I14306c05b50a4a9319ed31f8e714a8cab629ca73
2018-04-30 17:41:30 +00:00
Cindy Cicalese 3c36f7452a Update CI files, dir structure, remove inline JS.
Bug:T191546
Bug:T191919
Change-Id: Ia7ed03a98972262d164fd131bcb84994ad279c7f
2018-04-11 17:21:08 +00:00