Thread:Thailog/@comment-3562424-20120512035537/@comment-3562424-20120904035205

bleh sorry for the huge wait. The following code should work. Please ping me if you have any problems with it:

(function {	window.Countdowns = {		version: '1.0',		timers: [],		updatetimer: function (i) {			var now = new Date, then = window.Countdowns.timers[i].eventdate, diff = Math.floor((then.getTime-now.getTime)/1000), left;			// catch bad date strings			if(isNaN(diff)) { 				window.Countdowns.timers[i].firstChild.nodeValue = '** ' + window.Countdowns.timers[i].eventdate + ' **' ;				return;			}			// determine plus/minus			if(diff<0) diff = -diff;			// calculate the diff			// seconds			left = (diff%60) + ($(diff%60)[0] === 1) ? 'second' : 'seconds';			// minutes			diff = Math.floor(diff/60);			left = (diff%60) + ($(diff%60)[0] === 1) ? 'minute' : 'minutes' + ', ' + 'and' + left;			// hours			diff = Math.floor(diff/60);			left = (diff%24) + ($(diff%24)[0]) === 1 ? 'hour' : 'hours' + ', ' + left;			// days			diff = Math.floor(diff/24);			left = diff + ($(diff)[0] === 1) ? 'day' : 'days' + ', ' + left; window.Countdowns.timers[i].firstChild.nodeValue = left; // a setInterval is more efficient, but calling setTimeout // makes errors break the script rather than infinitely recurse setTimeout('window.Countdowns.updatetimer(' + i + ')',1000); },		checktimers: function { // set up timers window.Countdowns.timers = []; if(window.Countdowns.timers.length === 0) return; for(var i in window.Countdowns.timers) { if (window.Countdowns.timers[i]) window.Countdowns.timers[i].eventdate = new Date(window.Countdowns.timers[i].firstChild.nodeValue).getTime; if (window.Countdowns.timers[i].eventdate > new Date.getTime) window.Countdowns.updatetimer(i); //start }			// hide 'nocountdown' and show 'countdown' document.getElementById('yjusticenocountdown').style.display = 'none'; document.getElementById('yjusticecountdown').style.display = 'inline'; }	};	addOnloadHook(window.Countdowns.checktimers); });

Here's how to use it. Firstly, where you have the huge timer for the episodes put  WITH NOTHING INSIDE OF IT. For the text that acts as the fallback for non js users, put FALLBACK TEXT HERE. Then for the times, use the same syntax as you do with the regular countdown code, except put it in the variable that says timers: [], like this timers: ['date1', 'date2', date3'], and so on. Note: The quotes and comma postioning is very important. Then, whenever a new episode comes, just add it at the end of the list. (Order is important too- the farthest episodes away should be at the right side of the brackets). Whenever you want to remove past episodes, you can- as long as the list is in chronological order, having previous episodes won't matter. If this was a tl;dr, ping me when the 3rd season starts and give me temp admin rights for 5 minutes so I can set everything up. Hope this helps and REALLY sorry about the wait.