User:Rydmen/monobook.js

/* Any JavaScript here will be loaded for users using the MonoBook skin */ /** Anon tips and donation banner ************************** * *  Description: This implements an anon tips / donation banner. It includes a workaround for *              the Z-index bug found in Internet Explorer. It correctly places the anon notice *              on the page, even under IE6. See this Google search for more information about the bug: *              http://www.google.com/search?q=z-index+ie6+bug * Maintainers: User:Gmaxwell, User:MZMcBride */ if(wgUserName == null) addOnloadHook((function { if(document.getElementById('siteNotice') || window.siteNoticeValue || window.wgNotice) return var message=new Array; message[0]='Your continued donations keep Wikipedia running!'; message[1]='Make a donation to Wikipedia and give the gift of knowledge!'; message[2]='Wikipedia is sustained by people like you. Please donate today.'; message[3]='Help us improve Wikipedia by supporting it financially.'; message[4]='You can support Wikipedia by making a tax-deductible donation.' message[5]='Help us provide free content to the world by donating today!'; message[6]='Learn more about using Wikipedia for research.'; message[7]='Ten things you may not know about Wikipedia.'; message[8]='<a href="http://en.wikipedia.org/wiki/Wikipedia:Ten_things_you_may_not_know_about_images_on_Wikipedia" title="Wikipedia:Ten things you may not know about images on Wikipedia">Ten things you may not know about images on Wikipedia.</a>'; message[9]='<a href="http://en.wikipedia.org/wiki/Wikipedia:Citing_Wikipedia" title="Wikipedia:Citing Wikipedia">Learn more about citing Wikipedia.</a>'; message[10]='Have questions? <a href="http://en.wikipedia.org/wiki/Wikipedia:Questions" title="Wikipedia:Questions">Find out how to ask questions and get answers.</a>'; message[11]='<a href="http://en.wikipedia.org/wiki/Wikipedia:Basic_navigation" title="Wikipedia:Basic navigation">Find out more about navigating Wikipedia and finding information.</a>'; message[12]='<a href="http://en.wikipedia.org/wiki/Wikipedia:Contributing_to_Wikipedia" title="Wikipedia:Contributing to Wikipedia">Interested in contributing to Wikipedia?</a>'; var weightLimit = 6; var biasPercent = 0.815; var whichMessage = (Math.random < biasPercent) ? weightLimit : message.length; whichMessage = Math.floor(Math.random * whichMessage); var wrapper = document.getElementById("globalWrapper"); if (wrapper) { var div = document.createElement('div'); div.id = "anon-banner"; div.style.cssText = "position:absolute; z-index:40; left:155px; top:1px; clear:both; float:left; font-size:90%; font-style:italic; white-space:nowrap"; div.innerHTML = message[whichMessage]; wrapper.insertBefore(div, wrapper.firstChild); } })); /** Topbar content fix with sitenotice / CentralNotice ************************** * *  Description: This fixes the location of topbar content (e.g., featured  *               content star) when the sitenotice or CentralNotice is active. * Maintainers: User:TheDJ, User:MZMcBride */ if((navigator.userAgent.indexOf("MSIE 6")==-1) && (wgAction == 'submit' || wgAction == 'view')) addOnloadHook(function {   if(!document.getElementById('siteNotice') && !window.siteNoticeValue && !window.wgNotice) return    appendCSS('#bodyContent { position:relative; } \n.topicon, #protected-icon{ position:absolute; top:-2em !important;}\n#coordinates{ position:absolute; top:1px !important; }'); })