Misplaced Pages

User:Δ/Sandbox.js: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< User:Δ Browse history interactively← Previous editNext edit →Content deleted Content added
Revision as of 18:27, 10 September 2006 view sourceBetacommand (talk | contribs)86,927 edits finished Myspace removal code← Previous edit Revision as of 18:28, 10 September 2006 view source Betacommand (talk | contribs)86,927 edits finished Myspace removal codeNext edit →
Line 1: Line 1:
//Written by ], thanks to ] and ] for help with this! //Written by ], thanks to ] and ] for help with this!
//Modified by ] with help from ] //Modified by ]
// BEGIN MYSPACE LINK REMOVAL CODE // BEGIN MYSPACE LINK REMOVAL CODE
//check if we are editing and we want to myspace //check if we are editing and we want to myspace

Revision as of 18:28, 10 September 2006

//Written by ], thanks to ] and ] for help with this!
//Modified by ]
// BEGIN MYSPACE LINK REMOVAL CODE
//check if we are editing and we want to myspace
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('myspace=1') != -1) {
  function myspace() {
    document.getElementById('wpSummary').value = "Removing Myspace link as unverifiable";
        var contents = document.getElementById('wpTextbox1').value;
        var newcontents = contents.replace(/(\*\s*?)?\/g, "");
        document.getElementById('wpTextbox1').value = newcontents;
        document.getElementById('wpDiff').click();
        document.getElementById('wpWatchthis').checked = "";
}
    addOnloadHook(function(){ myspace(); });
}
//Check if it's article to add the tab
if(wgCanonicalNamespace == "") {
  addOnloadHook(function(){ 
   var taburl = "http://en.wikipedia.org/search/?title="+wgPageName+"&action=edit&myspace=1";
   addTab(taburl, "Remove Myspace!", "ca-myspace", "This is to kill Myspace Links"); 
  });
}
//END MYSPACE LINK REMOVAL CODE