User:TheFearow/monobook.js

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";  } }