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}"+"}", "sampleText": "Software title"}; } /* correct faulty page names */ 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; }; YAHOO.util.Event.onContentReady('bodyContent', function{if(document.getElementById("properpagename")){ document.title = document.getElementById("properpagename").innerHTML + " :: Mac OS X Wiki"; $$("firstHeading")[0].innerHTML = document.getElementById("properpagename").innerHTML; }}); /* Software Categories */ YAHOO.util.Event.onContentReady('bodyContent', function{if(document.getElementById("categorysoftwareicons")){ /*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;"); }} }});