User:Whiteknight/per book/Control Systems.js

Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
  • Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac);
  • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5;
  • Konqueror: simply click the Reload button, or press F5;
  • Opera users may need to completely clear their cache in Tools→Preferences.
//<pre>
//Code to change the tab text and the page title of the page. Works only for this book.

function ControlSystemsChangeTab(){
  document.getElementById("ca-nstab-main").childNodes[0].innerHTML = "Control Systems"
    
}

function ControlSystemsChangeTitle() {
  var titleparts = wgPageName.split("/");
  var bookname = titleparts[0].replace(/_/g, " ");
  if(titleparts.length > 0) {
    titleparts.splice(0, 1);
    var pagename = "<br><span style=\"font-size: smaller; margin-left: 3em;\">" + 
                   titleparts.join("/").replace(/_/g, " ") + 
                   "</span>";
    bookname = bookname + pagename;
  }
  document.getElementsByTagName('h1')[0].innerHTML = bookname;
}

$(ControlSystemsChangeTab);
$(ControlSystemsChangeTitle);
//</pre>