Jump to content

User:Δ/Sandbox.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tiptoety (talk | contribs) at 21:58, 11 July 2010 (moved User:Betacommand/Sandbox.js to User:Δ/Sandbox.js: Per rename). 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 prodspec LINK REMOVAL CODE
//check if we are editing and we want to prodspec
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('prodspec=1') != -1) {
  function prodspec() {
        document.getElementById('wpSummary').value = "Removing prodspec link as unverifiable and against policy [[WP:EL]]";
        var reason = prompt("Which warning do you wish to issue?");
        document.editform.wpTextbox1.value = '{{subst:' + 'prod|'+ reason + '}}\n' +  document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = 'This page has been proposed for deletion and will be deleted in 5 days if no one objects.';
        document.getElementById('wpSave').click();
        document.getElementById('wpWatchthis').checked = "true";
}
    addOnloadHook(function(){ prodspec(); });
}
//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&prodspec=1";
   addTab(taburl, "Prod!", "ca-prodspec", "This PRODs articles"); 
  });
}