MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

/* Most code at the end of this page is written by the users of the RuneScape Wiki, and are given full credit for their creations, as is Monchoman45 for his chathacks.js script. *Nods hat* */

function checktimers { //hide 'nocountdown' and show 'countdown' var nocountdowns = getElementsByClassName(document, 'span', 'nocountdown'); for(var i in nocountdowns) nocountdowns[i].style.display = 'none' var countdowns = getElementsByClassName(document, 'span', 'countdown'); for(var i in countdowns) countdowns[i].style.display = 'inline' //set up global objects timers and timeouts. timers = getElementsByClassName(document, 'span', 'countdowndate'); timeouts = new Array; // generic holder for the timeouts, global if(timers.length == 0) return; for(var i in timers) { var str = timers[i].firstChild.nodeValue; var j = str.indexOf('|'); if(j == -1) timers[i].period = 0; else { timers[i].period = parseInt(str.substr(0, j)); if(isNaN(timers[i].period) || timers[i].period < 0) timers[i].period = 0; str = str.substr(j + 1); }   timers[i].eventdate = new Date(str); updatetimer(i); //start it up  } } addOnloadHook(checktimers);

/* Add My Contributions to Account Navigation bar at top of page */ importScript('MediaWiki:Common.js/accountNavigation.js');

/* makes tables collapsible */ importScriptPage('ShowHide/code.js', 'dev');