Common.js – MediaWiki

From Bohemia Interactive Community
Revision as of 21:09, 31 July 2006 by Hardrock (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/**
 * Remove the H1 headline on scripting command pages
 */
window.onload = function()
{
  var divs = document.getElementsByTagName("div");
  var hide = false;

  for(var i=0; i<divs.length; i++)
  {
    if(divs[i].className=="command_description")
    {
      hide = true;
    }
  }

  if(hide)
  {
    var hs = document.getElementsByTagName("h1");

    for(var i=0; i<hs.length; i++)
    {
      if(hs[i].className=="firstHeading")
      {
        hs[i].style.display = "none";
      }
    }
  }
}