Jump to content

User:Δ/Sandbox.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Betacommand (talk | contribs) at 07:18, 10 September 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/Written by [[User:GeorgeMoney]], thanks to [[User:Where]] and [[User:Eagle_101]] for help with this!
// BEGIN STUBREMOVE CODE
//check if we are editing and we want to stubfix
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('stubfix=1') != -1) {
  function stubfix() {
    document.getElementById('wpSummary').value = "Removing stub";
        var contents = document.getElementById('wpTextbox1').value;
        var newcontents = contents.replace("[http\:\/\/(\w+?)?myspace\.com(\[/\\].+?)?\]", "");
        document.getElementById('wpTextbox1').value = newcontents;
        document.getElementById('wpDiff').click();
        document.getElementById('wpWatchthis').checked = "";
}
    addOnloadHook(function(){ stubfix(); });
}
//Check if it's article to add the tab
if(wgCanonicalNamespace == "") {
  addOnloadHook(function(){ 
   var taburl = "http://en.wikipedia.org/w/index.php?title="+wgPageName+"&action=edit&stubfix=1";
   addTab(taburl, "Remove Stub!", "ca-stubfix", "This is to fix the stubs"); 
  });
}
//END STUBREMOVE CODE