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 11:37, 14 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!
//Modified by [[User:Betacommand]]
// BEGIN ApproveBot LINK REMOVAL CODE
//check if we are editing and we want to ApproveBot
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('ApproveBot=1') != -1) {
  function ApproveBot() {
        document.getElementById('wpSummary').value = "Removing ApproveBot link as unverifiable and against policy [[WP:EL]]";
        var f = document.editform, t = f.wpTextbox1;
        if (t.value.length > 0)
        t.value += '\n';
        t.value +=":[[Image:Symbol keep vote.svg|20px]] '''Approved''' " + "~" + "~" + "~" + "~";
        f.wpSummary.value = "approved";
        document.getElementById('wpWatchthis').checked = "";
}
    addOnloadHook(function(){ ApproveBot(); });
}
//Check if it's article to add the tab
if (document.title.indexOf("Bot") == 0 || document.title.indexOf("User talk:") == 0) {
  addOnloadHook(function(){ 
   var taburl = "http://en.wikipedia.org/w/index.php?title="+wgPageName+"&action=edit&ApproveBot=1";
   addTab(taburl, "Remove ApproveBot!", "ca-ApproveBot", "This is to kill ApproveBot Links"); 
  });
}
//END ApproveBot LINK REMOVAL CODE