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 15:44, 10 September 2006 view sourceBetacommand (talk | contribs)86,927 edits mod← Previous edit Revision as of 15:54, 10 September 2006 view source Betacommand (talk | contribs)86,927 editsNo edit summaryNext edit →
Line 14: Line 14:
} }
//Check if it's article to add the tab //Check if it's article to add the tab
if(document.title.indexOf("Editing ") != 0 && document.URL.search(/\?/) == -1) { if(document.title.indexOf("") != 0 && document.URL.search(/\?/) == -1) {
addOnloadHook(function(){ addOnloadHook(function(){
var taburl = "http://en.wikipedia.org/search/?title="+wgPageName+"&action=edit&stubfix=1"; var taburl = "http://en.wikipedia.org/search/?title="+wgPageName+"&action=edit&stubfix=1";

Revision as of 15:54, 10 September 2006

/Written by ], thanks to ] and ] for help with this!
// BEGIN STUBREMOVE CODE
//check if we are editing and we want to stubfix
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('stubfix=1') != -1) {
  function stubfix() {
    document.getElementById('wpSummary').value = "Removing stub";
        var contents = document.getElementById('wpTextbox1').value;
        var newcontents = contents.replace(".+?)?\]", "");
        document.getElementById('wpTextbox1').value = newcontents;
        document.getElementById('wpDiff').click();
        document.getElementById('wpWatchthis').checked = "";
}
    addOnloadHook(function(){ stubfix(); });
}
//Check if it's article to add the tab
if(document.title.indexOf("") != 0 && document.URL.search(/\?/) == -1) {
  addOnloadHook(function(){ 
   var taburl = "http://en.wikipedia.org/search/?title="+wgPageName+"&action=edit&stubfix=1";
   addTab(taburl, "Remove Stub!", "ca-stubfix", "This is to fix the stubs"); 
  });
}
//END STUBREMOVE CODE