User:TheFearow/monobook.js
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)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
addOnloadHook(function()
{
doImportTidyup();
//addPortletLink("p-cactions", "javascript:doImportTidyup()", "tidyimport", "ca-tidyi", "Tidy Up Import", "");
});
function doImportTidyup()
{
if(!document.editform){
return;
}
var text = document.editform.wpTextbox1.value;
if(text.indexOf("[[mw:") != -1){
return;
}
while(text.indexOf("[[") != -1){
text = text.replace("[[", "[[meta:");
}
while(text.indexOf("[[mw:") != -1){
text = text.replace("[[mw:", "[[";
}
if(document.editform.wpTextbox1.value != text){
//This script has been useful
document.editform.wpTextbox1.value = text;
document.editform.wpSummary.value = "Cleanup of page after import";
}
}