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 23:24, 13 September 2006 view sourceBetacommand (talk | contribs)86,927 editsm Revert to revision 75056998 by Betacommand.← Previous edit Revision as of 11:37, 14 September 2006 view source Betacommand (talk | contribs)86,927 editsNo edit summaryNext 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 MYSPACE LINK REMOVAL CODE // BEGIN ApproveBot LINK REMOVAL CODE
//check if we are editing and we want to myspace //check if we are editing and we want to ApproveBot
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('ApproveBot=1') != -1) {
function myspace() { function ApproveBot() {
document.getElementById('wpSummary').value = "Removing Myspace link as unverifiable and against policy ]"; document.getElementById('wpSummary').value = "Removing ApproveBot link as unverifiable and against policy ]";
var contents = document.getElementById('wpTextbox1').value; var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
var newcontents = contents.replace(/(\*\s*?)?\/g, "");
document.getElementById('wpTextbox1').value = newcontents; t.value += '\n';
t.value +=":] '''Approved''' " + "~" + "~" + "~" + "~";
document.getElementById('wpDiff').click();
f.wpSummary.value = "approved";
document.getElementById('wpWatchthis').checked = ""; document.getElementById('wpWatchthis').checked = "";
} }
addOnloadHook(function(){ myspace(); }); addOnloadHook(function(){ ApproveBot(); });
} }
//Check if it's article to add the tab //Check if it's article to add the tab
if (document.title.indexOf("Bot") == 0 || document.title.indexOf("User talk:") == 0) {
if(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="+wgPageName+"&action=edit&ApproveBot=1";
addTab(taburl, "Remove Myspace!", "ca-myspace", "This is to kill Myspace Links"); addTab(taburl, "Remove ApproveBot!", "ca-ApproveBot", "This is to kill ApproveBot Links");
}); });
} }
//END MYSPACE LINK REMOVAL CODE //END ApproveBot LINK REMOVAL CODE

Revision as of 11:37, 14 September 2006

//Written by ], thanks to ] and ] for help with this!
//Modified by ]
// 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 ]";
        var f = document.editform, t = f.wpTextbox1;
        if (t.value.length > 0)
        t.value += '\n';
        t.value +=":] '''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/search/?title="+wgPageName+"&action=edit&ApproveBot=1";
   addTab(taburl, "Remove ApproveBot!", "ca-ApproveBot", "This is to kill ApproveBot Links"); 
  });
}
//END ApproveBot LINK REMOVAL CODE