User:Beep21/monaco.js

/* Test if an element has a certain class ************************************** The following is copied from from Wikipedia's Common.js, section "Test if an element has a certain class" found at http://en.wikipedia.org/wiki/MediaWiki:Common.js. It is maintained there by Wikimedia users "Mike Dillon", "R. Koot", and "SG." You can find a full list of Common.js editors at http://en.wikipedia.org/wiki/MediaWiki:Common.js. This was done under the terms of the CC-BY-SA with permission. */ var hasClass = (function {    var reCache = {};    return function (element, className) {        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);   }; });

//changes to title formatting var bp_h1 = document.getElementsByTagName("h1") var bp_h1index = 0 var bp_title var bp_titlestyle while (bp_h1index < bp_h1.length) { if(hasClass(bp_h1[bp_h1index],"firstHeading")   {    bp_title = bp_h1[bp_h1index]    break   } } bp_title.innerHTML = "> " + wgPageName + '' bp_title.style.fontFamily = "courier, monospace"