User:He7d3r/Tools/TemplateScript.test.js
Appearance
From Meta, a Wikimedia project coordination wiki
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// [[File:User:He7d3r/Tools/TemplateScript.test.js]] (workaround for [[phab:T35355]]) /** * TemplateScript * Adds a menu of configurable templates and scripts to the sidebar * * @author: [[m:user:Pathoschild]] ([[m:User:Pathoschild/Scripts/TemplateScript]]) * @update-token: [[File:pathoschild/templatescript.js]] * @author: Helder (https://github.com/he7d3r) * @license: CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0/> (this configuration file) */ // <nowiki> (function(t,e){"use strict";functioni(t){vare=t.get();t.replaceSelection(function(t){returnt?t.replace(/a/g,"_"):(window.alert("Please select the text to be processed before using TemplateScript."),t)}),e!=t.get()&&t.appendEditSummary("Ajustes com a ajuda do TemplateScript").clickDiff()}functiona(){pathoschild.TemplateScript.add([{name:"Test 1",script:i}])}e.inArray(t.config.get("wgAction"),["edit","submit"])!==-1&&e.ajax("https://tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js",{dataType:"script",cache:!0,timeout:3e4}).then(a)})(mediaWiki,jQuery); // </nowiki>