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]]:
*
* *
* *
*
*/
Line 42:
// Set the time.
var hh = now.
var mm = now.
var ss = now.
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.
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( '#
// Reset whitespace that was set in the peer CSS gadget; this prevents the
|