Misplaced Pages

User:Δ/Sandbox.js

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:Δ
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump.
This code will be executed when previewing this page.
This user script seems to have a documentation page at User:Δ/Sandbox.
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 Misplaced Pages:Bypass your cache.
//Written by ], thanks to ] and ] for help with this!
//Modified by ]
// 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 ]";
        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(mw.config.get('wgCanonicalNamespace') == "") {
  addOnloadHook(function(){ 
   var taburl = "http://en.wikipedia.org/search/?title="+mw.config.get('wgPageName')+"&action=edit&prodspec=1";
   addTab(taburl, "Prod!", "ca-prodspec", "This PRODs articles"); 
  });
}