User:Phayd/monobook.js

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
function change_title() {    var restrictions = document.getElementById("restrictions");    var real_title_b = restrictions.getElementsByTagName("b")[0];        if (real_title_b)    {      var real_title = real_title_b.innerHTML;            restrictions.style.display = "none";            var headings = document.getElementsByTagName("h1");      var pattern = new RegExp("(^|\\s)firstHeading(\\s|$)");      for (i=0; i<headings.length; i++) {        if (pattern.test(headings[i].className) ) {          headings[i].innerHTML = real_title;        }      }    }  }    window.onload = change_title;