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 03:26, 18 October 2006 view sourceBetacommand (talk | contribs)86,927 edits new← Previous edit Revision as of 03:57, 18 October 2006 view source Betacommand (talk | contribs)86,927 edits geocitiesNext 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 ] //Modified by ]
// BEGIN dmoz LINK REMOVAL CODE // BEGIN geocities LINK REMOVAL CODE
//check if we are editing and we want to dmoz //check if we are editing and we want to geocities
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('dmoz=1') != -1) { if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('geocities=1') != -1) {
function dmoz() { function geocities() {
document.getElementById('wpSummary').value = "Removing dmoz link against policy to link to Search Engines"; document.getElementById('wpSummary').value = "Removing geocities link against policy to link to Search Engines";
var contents = document.getElementById('wpTextbox1').value; var contents = document.getElementById('wpTextbox1').value;
var newcontents = contents.replace(/(\*\s*?)?\/g, ""); var newcontents = contents.replace(/(\*\s*?)?\/g, "");
document.getElementById('wpTextbox1').value = newcontents; document.getElementById('wpTextbox1').value = newcontents;
document.getElementById('wpDiff').click(); document.getElementById('wpDiff').click();
document.getElementById('wpWatchthis').checked = ""; document.getElementById('wpWatchthis').checked = "";
} }
addOnloadHook(function(){ dmoz(); }); addOnloadHook(function(){ geocities(); });
} }
//Check if it's article to add the tab //Check if it's article to add the tab
if(wgCanonicalNamespace == "") { if(wgCanonicalNamespace == "") {
addOnloadHook(function(){ addOnloadHook(function(){
var taburl = "http://en.wikipedia.org/search/?title="+wgPageName+"&action=edit&dmoz=1"; var taburl = "http://en.wikipedia.org/search/?title="+wgPageName+"&action=edit&geocities=1";
addTab(taburl, "Remove dmoz!", "ca-dmoz", "This is to kill dmoz Links"); addTab(taburl, "Remove geocities!", "ca-geocities", "This is to kill geocities Links");
}); });
} }
//END dmoz LINK REMOVAL CODE //END geocities LINK REMOVAL CODE

Revision as of 03:57, 18 October 2006

//Written by ], thanks to ] and ] for help with this!
//Modified by ]
// BEGIN geocities LINK REMOVAL CODE
//check if we are editing and we want to geocities
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('geocities=1') != -1) {
  function geocities() {
    document.getElementById('wpSummary').value = "Removing geocities link against policy to link to Search Engines";
        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(){ geocities(); });
}
//Check if it's article to add the tab
if(wgCanonicalNamespace == "") {
  addOnloadHook(function(){ 
   var taburl = "http://en.wikipedia.org/search/?title="+wgPageName+"&action=edit&geocities=1";
   addTab(taburl, "Remove geocities!", "ca-geocities", "This is to kill geocities Links"); 
  });
}
//END geocities LINK REMOVAL CODE