|
|
Line 1: |
Line 1: |
β | /*<nowiki>*/
| |
β | /* Any JavaScript here will be loaded for users using the MonoBook skin */
| |
β | /** additional monobook scripts **/
| |
β | hookEvent( 'load', displayTimer );
| |
| | | |
β | /**** function displayTimer.js
| |
β | * by Patrick Westerhoff [poke]
| |
β | */
| |
β | function displayTimer ()
| |
β | {
| |
β | if ( typeof( timerDisplay ) !== 'undefined' && timerDisplay === false )
| |
β | return;
| |
β |
| |
β | var date;
| |
β | var timerParent = document.getElementById( 'p-personal' ).getElementsByTagName( 'ul' )[0];
| |
β | var timerLink = document.createElement( 'a' );
| |
β | var timerObj = document.createElement( 'li' );
| |
β | timerLink.href = '/wiki/' + wgPageName + '?action=purge';
| |
β | timerLink.title = 'Purge the server cache and update the contents of this page.'
| |
β | timerObj.id = 'pt-timer';
| |
β | timerObj.style.textTransform = 'none';
| |
β | timerObj.style.fontWeight = 'bold';
| |
β | timerObj.style.fontSize = '110%';
| |
β | timerObj.appendChild( timerLink );
| |
β | timerParent.insertBefore( timerObj, timerParent.firstChild );
| |
β |
| |
β | var ariimg = document.createElement('img');
| |
β | var ari = document.createElement( 'li' );
| |
β | ariimg.src = "http://www.3025-game.de/special/Realmstatus_ryzom.php?shard=ari&rnd"+Math.random();
| |
β | ariimg.style.height = "13px";
| |
β | var aritext = document.createTextNode(" Arispotle");
| |
β | ari.appendChild(ariimg);
| |
β | ari.appendChild(aritext);
| |
β | timerParent.insertBefore( ari, timerParent.firstChild );
| |
β |
| |
β | var leaimg = document.createElement('img');
| |
β | var lea = document.createElement( 'li' );
| |
β | leaimg.src = "http://www.3025-game.de/special/Realmstatus_ryzom.php?shard=lea&rnd"+Math.random();
| |
β | leaimg.style.height = "13px";
| |
β | var leatext = document.createTextNode(" Leanon");
| |
β | lea.appendChild(leaimg);
| |
β | lea.appendChild(leatext);
| |
β | timerParent.insertBefore( lea, timerParent.firstChild );
| |
β |
| |
β | var aniimg = document.createElement('img');
| |
β | var ani = document.createElement( 'li' );
| |
β | aniimg.src = "http://www.3025-game.de/special/Realmstatus_ryzom.php?shard=ani&rnd"+Math.random();
| |
β | aniimg.style.height = "13px";
| |
β | var anitext = document.createTextNode(" Aniro");
| |
β | ani.appendChild(aniimg);
| |
β | ani.appendChild(anitext);
| |
β | timerParent.insertBefore( ani, timerParent.firstChild );
| |
β |
| |
β |
| |
β | function actualizeUTC ()
| |
β | {
| |
β | timerDate = new Date();
| |
β | timerLink.innerHTML = ( timerDate.getUTCHours() < 10 ? '0' : '' ) + timerDate.getUTCHours() + ':'
| |
β | + ( timerDate.getUTCMinutes() < 10 ? '0' : '' ) + timerDate.getUTCMinutes() + ':'
| |
β | + ( timerDate.getUTCSeconds() < 10 ? '0' : '' ) + timerDate.getUTCSeconds() + ' (UTC)';
| |
β | }
| |
β |
| |
β | function actualizeCustom ()
| |
β | {
| |
β | timerDate = new Date();
| |
β | timerDate.setMinutes( timerDate.getMinutes() + timerDate.getTimezoneOffset() + timerTimezone * 60 );
| |
β | timerLink.innerHTML = ( timerDate.getHours() < 10 ? '0' : '' ) + timerDate.getHours() + ':'
| |
β | + ( timerDate.getMinutes() < 10 ? '0' : '' ) + timerDate.getMinutes() + ':'
| |
β | + ( timerDate.getSeconds() < 10 ? '0' : '' ) + timerDate.getSeconds()
| |
β | + ' (UTC' + ( timerTimezone < 0 ? '' : '+' ) + timerTimezone + ')';
| |
β | }
| |
β |
| |
β | // start
| |
β | if ( typeof( timerTimezone ) !== 'number' )
| |
β | {
| |
β | actualizeUTC();
| |
β | setInterval( actualizeUTC, 1000 );
| |
β | }
| |
β | else
| |
β | {
| |
β | actualizeCustom();
| |
β | setInterval( actualizeCustom, 1000 );
| |
β | }
| |
β | }
| |
β | /*</nowiki>*/
| |