MediaWiki:Gadget-UTCLiveClock.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 25:
* 5. Add the following code to your wiki's [[MediaWiki:Gadgets-definition]]:
*
* * LiveClockUTCLiveClock[ResourceLoader|type=general|dependencies=mediawiki.util,mediawiki.api|peers=UTCLiveClock-pagestyles]|UTCLiveClock.js|UTCLiveClock.css
* * LiveClockUTCLiveClock-pagestyles[hidden|skins=vector,monobook]|UTCLiveClock-pagestyles.css
*
*/
Line 42:
 
// Set the time.
var hh = now.getLocalHoursgetlocalHours();
var mm = now.getLocalMinutesgetlocalMinutes();
var ss = now.getLocalSecondsgetlocalSeconds();
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.getMillisecondsgetUTCMilliseconds();
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( '#dateutcdate a { font-weight:bolder; font-size:120%; }' );
 
// Reset whitespace that was set in the peer CSS gadget; this prevents the