User:Qwerfjkl/scripts/RETF.js

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/RETF.js&action=raw&ctype=text/javascript');

//

// Make sure the utilities module is loaded (will only load if not already)

mw.loader.using( 'mediawiki.util', function () {

// Wait for the page to be parsed

$( document ).ready( function () {

if (document.editform) {

var link = mw.util.addPortletLink( 'p-tb', '#', 'RegExTypoFix', 'ca-regExTypoFix', 'Fix typos');

$( link ).click( function ( event ) {

event.preventDefault();

doFixTyposRETF();

} );

}

} );

} );

function doFixTyposRETF() {

document.editform.wpTextbox1.value = RETF.replace(document.editform.wpTextbox1.value);

document.editform.wpSummary.value = "Fixed typos via script";

//document.editform.submit();

document.editform.wpDiff.click()

}

//