User:The Goblin/monobook.js

From Homestar Runner Wiki

< User:The Goblin(Difference between revisions)
Jump to: navigation, search
(Well, don't I feel like an idiot.)
(Let's try that modification)
 
(includes 6 intermediate revisions)
Line 1: Line 1:
  // include utility functions
  // 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>');
  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>');
 +
// include sandbox reset button
 +
document.write('<script type="text/javascript" src="/index.php?title=User:The_Goblin/sandreset.js&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"></script>');
 +
// include
 +
document.write('<script type="text/javascript" src="http://en.wikipedia.org/wiki/User:AzaToth/morebits.js?action=raw&amp;ctype=text/javascript&amp;dontcountme=s"></script>');
 +
// include
 +
document.write('<script type="text/javascript" src="http://en.wikipedia.org/wiki/User:AzaToth/twinklefluff.js?action=raw&amp;ctype=text/javascript&amp;dontcountme=s"></script>');
 +
 +
importScript('User:AzaToth/morebits.js');
 +
  function addValidatorLink()
  function addValidatorLink()
Line 13: Line 22:
  addOnloadHook(addValidatorLink);
  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>');
+
addOnloadHook(function () {
-
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>');
+
  if((location.href.indexOf("Special:Contributions")!=-1||
-
 
+
      location.href.indexOf("Special%3AContributions")!=-1)
-
 
+
    &&location.href.indexOf("&ais523")==-1&&location.href.indexOf("?ais523")==-1)
-
function resetSandbox() {
+
  {
-
  if(UrlParameters["sandboxreset"] == 'reset' && wgPageName == "HRWiki:Sandbox" && wgAction == "edit") {
+
     var i,li,a;
-
     document.forms["editform"].wpTextbox1.value = ""; //Add the base text for the sandbox
+
    li=document.getElementById("bodyContent");
-
     document.forms["editform"].wpSummary.value = "Reset the Sandbox"; //Make a descriptive edit summary
+
     //li.getElementsByTagName("ul")[0].tagName="ol";
-
     document.forms["editform"].wpMinoredit.checked = true; //Make it a minor edit
+
     li=li.getElementsByTagName("li");
-
     if(UrlParameters["indirect"] == '1' && wgPageName == "HRWiki:Sandbox" && wgAction == "edit") { //If you've clicked on the toolbox link
+
     i=-1;
-
       window.setTimeout(function() { document.forms["editform"].wpDiff.click(); }, 200); //Load the diff if you are resetting it per the toolbox link
+
    a=new Array();
-
       var save = confirm("Save? (click \"OK\" to save; \"cancel\" to abort)") // Do you want to make these changes?
+
    while(++i<li.length)
-
       if(save == true) {
+
    {
-
        window.setTimeout(function() { document.forms["editform"].wpSave.click(); }, 500); //Submit it!
+
       var s,t;
-
       } else { location.href = "http://en.wikipedia.org/wiki/Wikipedia:Sandbox"; } // Go back two pages if you don't want to save it
+
      t=li[i].innerHTML.match(/"\/([^"]*)"/)[1];
-
    } else {
+
      if(li[i].getElementsByTagName("strong").length>0)
-
    window.setTimeout(function() { document.forms["editform"].wpSave.click(); }, 200); //Submit it!
+
        s="#CCCCFF";
 +
       else
 +
        s="#FFCCCC";
 +
       if(a[t]!=undefined) s=(a[t]=="#CCCCFF"?"#CCFFFF":"#FFFFCC"); else a[t]=s;
 +
       li[i].innerHTML="<SPAN STYLE='background-color:"+s+"'>"+li[i].innerHTML+"</SPAN>";
     }
     }
   }
   }
-
}
 
-
 
-
 
-
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);
 

Current revision as of 23:12, 21 January 2008

 // 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>');
 // include sandbox reset button
 document.write('<script type="text/javascript" src="/index.php?title=User:The_Goblin/sandreset.js&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"></script>');
 // include
 document.write('<script type="text/javascript" src="http://en.wikipedia.org/wiki/User:AzaToth/morebits.js?action=raw&amp;ctype=text/javascript&amp;dontcountme=s"></script>');
 // include
 document.write('<script type="text/javascript" src="http://en.wikipedia.org/wiki/User:AzaToth/twinklefluff.js?action=raw&amp;ctype=text/javascript&amp;dontcountme=s"></script>');

importScript('User:AzaToth/morebits.js');


 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);

addOnloadHook(function () {
  if((location.href.indexOf("Special:Contributions")!=-1||
      location.href.indexOf("Special%3AContributions")!=-1)
     &&location.href.indexOf("&ais523")==-1&&location.href.indexOf("?ais523")==-1)
  {
    var i,li,a;
    li=document.getElementById("bodyContent");
    //li.getElementsByTagName("ul")[0].tagName="ol";
    li=li.getElementsByTagName("li");
    i=-1;
    a=new Array();
    while(++i<li.length)
    {
      var s,t;
      t=li[i].innerHTML.match(/"\/([^"]*)"/)[1];
      if(li[i].getElementsByTagName("strong").length>0)
        s="#CCCCFF";
      else
        s="#FFCCCC";
      if(a[t]!=undefined) s=(a[t]=="#CCCCFF"?"#CCFFFF":"#FFFFCC"); else a[t]=s;
      li[i].innerHTML="<SPAN STYLE='background-color:"+s+"'>"+li[i].innerHTML+"</SPAN>";
    }
  }
});
Personal tools