MediaWiki:Common.js

From Moonlight Design
Revision as of 23:26, 29 September 2007 by Stevenlawrance (talk | contribs)
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.
/* Any JavaScript here will be loaded for all users on every page load. */

// Highlight every other line in the software tables
var orig_onload = window.onload;
window.onload = function(e) {
    if (orig_onload != null) {
        orig_onload(e);
    }
    var tables = document.getElementsByTagName("table");
    var rows;
    for (var t = 0; t < tables.length; t++) {
        if (tables[t].className.indexOf("software") >= 0) {
            rows = tables[t].rows;
            for (var r = 0; r < rows.length; r++) {
                if (r % 2 == 1) {
                    rows[r].className = "grayrow";
                }
            }
        }
    }
}