mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-11-27 07:59:59 +00:00
3a6f634385
``` 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 |
||
---|---|---|
.phan | ||
i18n | ||
maintenance | ||
resources | ||
src | ||
tests/phpunit/unit | ||
.eslintrc.json | ||
.gitignore | ||
.gitreview | ||
.phpcs.xml | ||
.stylelintrc.json | ||
composer.json | ||
COPYING | ||
extension.json | ||
Gruntfile.js | ||
package-lock.json | ||
package.json | ||
README | ||
ReplaceText.i18n.alias.php |
Replace Text Extension Version 1.8 Yaron Koren, Niklas Laxström and others This is free software licenced under the GNU General Public Licence. Please see https://www.gnu.org/copyleft/gpl.html for further details, including the full text and terms of the licence. == Overview == Replace Text is an extension to MediaWiki that creates a new special page, Special:ReplaceText, available to anyone who has the 'replacetext' privilege, that does a text find-and-replace on all pages in the wiki, selectable by namespace. Both the contents of pages and their titles can be modified. The search is case-sensitive. Since the replacement is not undoable, if the replacement string is blank or a string that is already contained in the wiki, the 'ReplaceText' page prompts the user to confirm the replacement before it is performed. Each replacement shows up as a wiki edit, with the administrator who performed the replacement appearing as the user and an edit summary that looks like "Text replacement: 'search string' to 'replacement string'". For more information, see the extension homepage at: https://www.mediawiki.org/wiki/Extension:Replace_Text == Requirements == This version of the Replace Text extension requires MediaWiki 1.32 or higher. == Installation == To install the extension, place the entire 'ReplaceText' directory within your MediaWiki 'extensions' directory, then add the following line to your 'LocalSettings.php' file: wfLoadExtension( 'ReplaceText' ); In order to perform replacements, you must have the 'replacetext' permission; if you are an administrator on your wiki, the easiest way to do this is to also add the following line: $wgGroupPermissions['sysop']['replacetext'] = true; == Contact == Comments, questions, suggestions and bug reports are welcome, and can be placed on the Talk page for the extension, or sent to Yaron at yaron57@gmail.com.