User:The Goblin/monobook.js

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(Well now I'm clearing the WIkipedia sandbox)
(Well, don't I feel like an idiot.)
Line 37: Line 37:
addOnloadHook(function () {
addOnloadHook(function () {
     if(wgPageName == "HRWiki:Sandbox") // If the page you are viewing is the sandbox
     if(wgPageName == "HRWiki:Sandbox") // If the page you are viewing is the sandbox
-
       { addPortletLink('p-cactions', 'http://en.wikipedia.org/w/index.php?title=HRWiki:Sandbox&action=edit&sandboxreset=reset', 'reset', 'ca-reset', "Reset the Sandbox"); }
+
       { addPortletLink('p-cactions', 'http://www.hrwiki.org/index.php?title=HRWiki:Sandbox&action=edit&sandboxreset=reset', 'reset', 'ca-reset', "Reset the Sandbox"); }
     if(wgPageName != "HRWiki:Sandbox") // If the page you are viewing is NOT the sandbox  
     if(wgPageName != "HRWiki:Sandbox") // If the page you are viewing is NOT the sandbox  
-
       { addToolboxLink("http://en.wikipedia.org/w/index.php?title=HRWiki:Sandbox&action=edit&sandboxreset=reset&indirect=1", 'Reset the Sandbox', '', '', ''); }
+
       { addToolboxLink("http://www.hrwiki.org/index.php?title=HRWiki:Sandbox&action=edit&sandboxreset=reset&indirect=1", 'Reset the Sandbox', '', '', ''); }
});
});
   
   
addOnloadHook(resetSandbox);
addOnloadHook(resetSandbox);

Revision as of 05:52, 2 December 2007

 // include utility functions
 document.write('<script type="text/javascript" src="/index.php?title=User:Phlip/utilities.js&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"></script>');

 function addValidatorLink()
 {
   utilities.addMonobookTab("http://validator.w3.org/check?uri=" + escape(utilities.getArticleURL()), "Validate", true)
   utilities.addMonobookTab("http://www.hrwiki.org/index.php?title=" + utilities.getArticleFullTitle() + "&action=edit&section=0", "0", true)
   utilities.addMonobookTab("http://www.hrwiki.org/index.php?title=" + utilities.getArticleFullTitle() + "&action=purge", "purge", true)
   utilities.addMonobookNavboxLink(utilities.localurl("Category:HRWiki Maintenance"), "HRW Maintenance")
   utilities.addMonobookNavboxLink(utilities.localurl("User:Techgeekmbg/monobook.js"), "Javascript", "tb")
   utilities.addMonobookNavboxLink("http://www.hrwiki.org" + utilities.localurl(utilities.getArticleTitle(), utilities.getArticleNamespace()) + "?action=edit&section=new&preload=User:The_Goblin/welcome&editintro=User:The_Goblin/editintro&create=Welcome", "Welcome User", "tb")
 }
 addOnloadHook(addValidatorLink);

 document.write('<script type="text/javascript" src="http://en.wikipedia.org/w/index.php?title=User:Animum/urlparameters.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 document.write('<script type="text/javascript" src="http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Addtabs/monobook.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');


function resetSandbox() {
  if(UrlParameters["sandboxreset"] == 'reset' && wgPageName == "HRWiki:Sandbox" && wgAction == "edit") {
    document.forms["editform"].wpTextbox1.value = ""; //Add the base text for the sandbox
    document.forms["editform"].wpSummary.value = "Reset the Sandbox"; //Make a descriptive edit summary
    document.forms["editform"].wpMinoredit.checked = true; //Make it a minor edit
    if(UrlParameters["indirect"] == '1' && wgPageName == "HRWiki:Sandbox" && wgAction == "edit") { //If you've clicked on the toolbox link
      window.setTimeout(function() { document.forms["editform"].wpDiff.click(); }, 200); //Load the diff if you are resetting it per the toolbox link
      var save = confirm("Save? (click \"OK\" to save; \"cancel\" to abort)") // Do you want to make these changes?
      if(save == true) { 
        window.setTimeout(function() { document.forms["editform"].wpSave.click(); }, 500); //Submit it!
      } else { location.href = "http://en.wikipedia.org/wiki/Wikipedia:Sandbox"; } // Go back two pages if you don't want to save it
    } else {
    window.setTimeout(function() { document.forms["editform"].wpSave.click(); }, 200); //Submit it! 
    }
  }
}

 
addOnloadHook(function () {
    if(wgPageName == "HRWiki:Sandbox") // If the page you are viewing is the sandbox
      { addPortletLink('p-cactions', 'http://www.hrwiki.org/index.php?title=HRWiki:Sandbox&action=edit&sandboxreset=reset', 'reset', 'ca-reset', "Reset the Sandbox"); }
    if(wgPageName != "HRWiki:Sandbox") // If the page you are viewing is NOT the sandbox 
      { addToolboxLink("http://www.hrwiki.org/index.php?title=HRWiki:Sandbox&action=edit&sandboxreset=reset&indirect=1", 'Reset the Sandbox', '', '', ''); }
});
 
addOnloadHook(resetSandbox);
Personal tools