User:Aude/monobook.js

From Wikipedia, the free encyclopedia

If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
/* document.write('<div style="position:absolute;z-index:3;top:5em;width:98%; auto 0; background:transparent; text-align:right;padding-right: 4px;font-style: italic;font-weight:bold;"><a href="http://wikimania2007.wikimedia.org/wiki/Registration">Early registration</a> for <a href="http://wikimania2007.wikimedia.org/wiki/Main Page">Wikimania 2007</a> is open.</div>'); */
 
// [[User:Zocky/PicturePopups.js]] - please include this line 
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Zocky/PicturePopups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
/* Modify page styles, making it easier for me to edit certain pages 
when I am at a coffeeshop or other public place near certain places */
 
document.write('<script type="text/javascript" src="' + 
   'http://en.wikipedia.org/w/index.php?title=User:Aude/cat911.js' + 
   '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
addOnloadHook(function(){
   var mystatus = "doing fine";
   var headings = document.getElementsByTagName("h1");
   var head2 = document.getElementsByTagName("h2");
   var head3 = document.getElementsByTagName("h3");
   var head4 = document.getElementsByTagName("h4");
   var images = document.getElementsByTagName("img");
   var i, done = false;
 
if (mystatus == "coffee") {
 
   for (i = 1; ((!done) && (i <= headings.length)); i++)
    {
        if (headings[i - 1].className == "firstHeading")
        {
            done = true;
 
            for (var j = 0; j < pgTitle.length; j++) {
                var pgTalk = "Talk:" + pgTitle[j];
                if ((wgTitle == pgTitle[j] || wgTitle == pgTalk))
                {
                    for (var o = 0; o < images.length; o++) {
                       images[o].style.display = "none";
                    }
 
                    headings[i - 1].style.display = "none";
                    document.getElementById("bodyContent").style.paddingTop = "4em";
                    document.getElementById("bodyContent").style.fontSize = "90%";
                    document.getElementById("siteSub").style.display = "none";
                    for (var l = 0; l < head2.length; l++) {
                       head2[l].style.fontSize = "85%";
                    }
                    for (var m = 0; m < head3.length; m++) {
                       head3[m].style.fontSize = "85%";
                    }
                    for (var n = 0; n < head4.length; n++) {
                       head4[n].style.fontSize = "85%";
                    }
 
                    // create div and set innerHTML to link
                    var divContainer = document.createElement("div");
                    divContainer.innerHTML = '<div id="title-override" class="topicon" style="font-size: 188%; padding-top: 0.5em; padding-bottom: 0.1em; float: left; position: absolute; left: 0.5em; top: 1px; width: 90%; border-bottom: 1px solid #aaa;background: {{#ifeq:{{PAGENAME}}|{{FULLPAGENAME}}|white|#F8FCFF}}; display:none">Sandbox</div>';
 
                    // insert divContainer into the DOM before the h1
                    document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
                }
            }
        }
    }
}
});
//