MediaWiki:Gadget-utcClock.js

var i18n = { en: { linkTitle: 'Click to purge the server cache for the current wiki page' },	fr: { linkTitle: 'Cliquer pour purger le cache du serveur pour la page actuelle du wiki' } };

var wgUserLanguage = mw.config.get( 'wgUserLanguage' );

var lang = function ( message ) { if( i18n[wgUserLanguage] && i18n[wgUserLanguage][message] ) { return i18n[wgUserLanguage][message]; } else if ( i18n['en'] && i18n['en'][message] ) { return i18n['en'][message]; } else { return message; } }

var linkPurge = mw.config.get( 'wgScript' ) + '?title=' + encodeURIComponent( mw.config.get( 'wgPageName' ) ) + '&action=purge';

var clockStyle = 'font-weight:bolder; color:#fff; font-size:170%;';

$('.netbar-right').prepend(''); var $target = $('.dateNode'); showTime;

function showTime { var now = new Date; var hh = now.getUTCHours; var mm = now.getUTCMinutes; var ss = now.getUTCSeconds; var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss ); $target.text( time ); var ms = now.getUTCMilliseconds; setTimeout( function {		showTime;	}, 1100 - ms ); }