Changes

Jump to navigation Jump to search

MediaWiki:Common.js

928 bytes removed, 11:17, 23 April 2010
smoother look
/****************************************/
/************************************/
/** Countdown **/
/* CURVED ETC */
function updatetimer(i) { var now = new Date(); var then = timers[i].eventdate; var diff = count=Mathrounded_corners, #wikia_page, #search_box, #link_box, #navigation_widget, #sidebar_1 dl, .floor((thencommunity_details, #page_bar, .getTime()-now.getTime())/1000); // catch bad date strings if(isNaN(diff)) wk_blogs_title { timers[i] -moz-border-radius-topright: 0.firstChild.nodeValue = '** ' + timers[i].eventdate + ' **' 8em; return; } // determine plus/minus if(diff<0) { diff = -moz-border-radius-diff; var tpm = ' '; } else { var tpm = ' '; } // calcuate the diff var left = (diff%60) + ' seconds'; diff=Math.floor(diff/60); if(diff > bottomright: 0) left = (diff%60) + ' minutes ' + left; diff=Math.floor(diff/60)8em; if(diff > -moz-border-radius-topleft: 0) left = (diff%24) + ' hours ' + left; diff=Math.floor(diff/24)8em; if(diff > -moz-border-radius-bottomleft: 0) left = diff + ' days ' + left timers[i].firstChild.nodeValue = tpm + left; // a setInterval() is more efficient, but calling setTimeout() // makes errors break the script rather than infinitely recurse timeouts[i] = setTimeout('updatetimer(' + i + ')',1000)8em;
}
function checktimers() { //hide 'nocountdown' and show 'countdown' var nocountdowns = getElementsByClassName(document.rounded_corners, #wikia_page, #catlinks, #search_field, #search_box, #link_box, #navigation_widget, #sidebar_1 dl, .community_details, 'span'#page_bar, 'nocountdown').wk_blogs_title { -moz-border-radius-topright: 0.4em; for(var i in nocountdowns) nocountdowns[i] -moz-border-radius-bottomright: 0.style4em; -moz-border-radius-topleft: 0.display = 'none'4em; var countdowns = getElementsByClassName(document, 'span', 'countdown') -moz-border-radius-bottomleft: 0.4em; for(var i in countdowns) countdowns[i].style.display = 'inline'}   #page_tabs li{ -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; //set up global objects timers and timeouts. height: 26px; timers = getElementsByClassName(document, 'span', 'countdowndate') line-height: 25px; //global timeouts = new Array() margin-top: 4px; // generic holder for the timeouts, global if(timers.length == 0) return background: #ffffff; for(var i in timers) { border:1px solid #ffffff; timers[i].eventdate = new Date(timers[i].firstChild.nodeValue) border-bottom: none; updatetimer(i) position:relative; //start it up } top:1px;
}
addOnloadHook(checktimers);  // ************************END CURVED ***************// - end - Experimental javascript timer// ***************************************

Navigation menu