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 editContent deleted Content added
Revision as of 03:24, 18 October 2006 view sourceBetacommand (talk | contribs)86,927 editsNo edit summary← Previous edit Latest revision as of 15:48, 7 February 2021 view source Amorymeltzer (talk | contribs)Autopatrolled, Interface administrators, Oversighters, Administrators63,403 editsm Remove legacy globals per phab:T72470 (via WP:JWB
(10 intermediate revisions by 2 users not shown)
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 MYSPACE LINK REMOVAL CODE // BEGIN prodspec LINK REMOVAL CODE
//check if we are editing and we want to myspace //check if we are editing and we want to prodspec
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('myspace=1') != -1) { if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('prodspec=1') != -1) {
function myspace() { function prodspec() {
document.getElementById('wpSummary').value = "Removing Myspace link as unverifiable and against policy ]"; document.getElementById('wpSummary').value = "Removing prodspec link as unverifiable and against policy ]";
var reason = prompt("Which warning do you wish to issue?");
var contents = document.getElementById('wpTextbox1').value;
document.editform.wpTextbox1.value = '{{subst:' + 'prod|'+ reason + '}}\n' + document.editform.wpTextbox1.value;
var newcontents = contents.replace(/(\*\s*?)?\/g, "");
document.editform.wpSummary.value = 'This page has been proposed for deletion and will be deleted in 5 days if no one objects.';
document.getElementById('wpTextbox1').value = newcontents;
document.getElementById('wpDiff').click(); document.getElementById('wpSave').click();
document.getElementById('wpWatchthis').checked = ""; document.getElementById('wpWatchthis').checked = "true";
} }
addOnloadHook(function(){ myspace(); }); addOnloadHook(function(){ prodspec(); });
} }
//Check if it's article to add the tab //Check if it's article to add the tab
if(wgCanonicalNamespace == "") { if(mw.config.get('wgCanonicalNamespace') == "") {
addOnloadHook(function(){ addOnloadHook(function(){
var taburl = "http://en.wikipedia.org/search/?title="+wgPageName+"&action=edit&myspace=1"; var taburl = "http://en.wikipedia.org/search/?title="+mw.config.get('wgPageName')+"&action=edit&prodspec=1";
addTab(taburl, "Remove Myspace!", "ca-myspace", "This is to kill Myspace Links"); addTab(taburl, "Prod!", "ca-prodspec", "This PRODs articles");
}); });
} }
//END MYSPACE LINK REMOVAL CODE
////////////////////////////////////////////////
//Written by ], thanks to ] and ] for help with this!
//Modified by ]
// BEGIN google LINK REMOVAL CODE
//check if we are editing and we want to google
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('google=1') != -1) {
function google() {
document.getElementById('wpSummary').value = "Removing google 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(){ google(); });
}
//Check if it's article to add the tab
if(wgCanonicalNamespace == "") {
addOnloadHook(function(){
var taburl = "http://en.wikipedia.org/search/?title="+wgPageName+"&action=edit&google=1";
addTab(taburl, "Remove google!", "ca-google", "This is to kill google Links");
});
}
//END google LINK REMOVAL CODE

Latest revision as of 15:48, 7 February 2021

//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"); 
  });
}