MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */ if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/macosx/images/8/8f/Button.WikiNameError.png", "speedTip": "Wrong title due to wiki limitations", "tagOpen": "{"+"{wikinameerror|", "tagClose": "}"+"}", "sampleText": "Correct title"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/macosx/images/9/98/Button.SoftwareInfomationBox.png", "speedTip": "Software information infobox", "tagOpen": "{"+"{softwareinfomation|name=", "tagClose": "|money=£294832|company=Apple|currentversion=4883.382|download=http://www.google.com|category=Dunno}"+"}", "sampleText": "Software title"}; } /* correct faulty page names */ function addGlobalStyle(css) { var head, style; head = document.getElementsByTagName('head')[0]; if (!head) { alert("There was a problem with YouTube Wider Watching!");return } style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = css; head.appendChild(style); } function $$(cl) { var retnode = []; var myclass = new RegExp('\\b'+cl+'\\b'); var elem = document.getElementsByTagName('*'); for (var i = 0; i < elem.length; i++) { var classes = elem[i].className; if (myclass.test(classes)) retnode.push(elem[i]); } return retnode; }; /* Software Categories */ YAHOO.util.Event.onContentReady('bodyContent', function{ if(document.getElementById("properpagename")){  document.getElementById("properpagename-notice").innerHTML = ""; // empty notice   document.title = document.getElementById("properpagename").innerHTML + " :: Mac OS X Wiki";   $$("firstHeading")[0].innerHTML = document.getElementById("properpagename").innerHTML; } if(document.getElementById("categorysoftwareicons")){  document.getElementById("categorysoftwareicons").innerHTML = "";  /*load it in*/  var lists = document.getElementById("mw-pages").getElementsByTagName("li");  for(var i in lists){   if(i < lists.length){    lists[i].setAttribute("style", "line-height: 24px; list-style-image: url(/thumb.php?f="+lists[i].getElementsByTagName("a")[0].pathname.substr(6)+".png&w=24); margin-left: 15px; padding-left: 0px;");   }  } } /* Old stuff */ if(document.getElementById("veryoldpage")){ /* Apply yellow dated look */ document.getElementById("veryoldpage").innerHTML = ""; document.getElementById("ca-nstab-main").innerHTML = "Old Page"; addGlobalStyle(".color1, .color1 a, .yui-panel .hd { background-color: #FFFF66; color: black; }"); } });