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.
// <pre><nowiki>

/*************
*** Regex menu framework (gadget version)
*** by [[m:user:Pathoschild]] <http://meta.wikimedia.org/wiki/User:Pathoschild/Scripts/Regex_menu_framework>
*************/

document.write('<script type="text/javascript" src="'
  + 'http://meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/Regex_menu_framework.js' 
  + '&action=raw&ctype=text/javascript"></script>');


/* menu links */
// In the function below, add more lines like "regexTool('link text','function_name()')" to add
// links to the sidebar menu. The function name is the function defined in rfmscripts() below.
function rmflinks() {
        regexTool('Custom regex','custom()'); // a default tool which performs regex input in a dynamic form
        regexTool('redirect to talk','redirtalk()');
        regexTool('Standardization and cleanup','standardize()');
}
 
/* scripts */
// Below, define the functions linked to from rmflinks() above. These functions can use any JavaScript,
// but there is a set of simplified tools documented at
// http://meta.wikimedia.org/wiki/User:Pathoschild/Scripts/Regex_menu_framework .
/* Redirect to talk page */
function redirtalk() {
	// replace all with redirect
	editbox.value = '#REDIRECT [[{{subst:TALKPAGENAME}}]]';
	setreason('Redirected to talk page');
}

/* Standardize page */
document.write('<script type="text/javascript" src="'
  + 'http://en.wikisource.org/w/index.php?title=User:Pathoschild/standardise.js'
  + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// </nowiki></pre>