MediaWiki:Gadget-UTCLiveClock.js: Difference between revisions

no edit summary
(Created page with "/** * Warning! Global gadget file! * * This gadget adds a clock in the personal toolbar that shows the current time * in UTC, and also provides a link to purge the curren...")
 
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 42:
 
// Set the time.
var hh = now.getUTCHoursgetHours();
var mm = now.getUTCMinutesgetMinutes();
var ss = now.getUTCSecondsgetSeconds();
var time = padWithZeroes( hh ) + ':' + padWithZeroes( mm ) + ':' + padWithZeroes( ss );
$target.text( time );
Line 56:
// good. By scheduling 100 ms after the tick, we will always be about 100 ms
// late, but we are also very likely to display a new time every second.
var ms = now.getUTCMillisecondsgetMilliseconds();
setTimeout( function () {
showTime( $target );
Line 65:
// Set CSS styles. We do this here instead of on the CSS page because some
// wikis load this page directly, without loading the accompanying CSS.
mw.util.addCSS( '#utcdatedate a { font-weight:bolder; font-size:120%; }' );
 
// Reset whitespace that was set in the peer CSS gadget; this prevents the
Line 78:
mw.util.getUrl( null, { action: 'purge' } ),
'',
'utcdatedate'
);
if ( !node ) {