MediaWiki:Gadget-UTCLiveClock.js: Difference between revisions

Content deleted Content added
Amalthea (talk | contribs)
Allow configuring where the clock goes
Amalthea (talk | contribs)
m formatting
Line 1:
function liveClock()
{
if (typeof(UTCLiveClockConfig)=='undefined') UTCLiveClockConfig = {};
var portletId = UTCLiveClockConfig.portletId || 'p-personal';
var nextNode = UTCLiveClockConfig.nextNodeId ? document.getElementById(UTCLiveClockConfig.nextNodeId) : undefined;
liveClock.node = addPortletLink( portletId, wgServer + wgScriptPath + '/index.php?title=' + encodeURIComponent(wgPageName) + '&action=purge', '', 'utcdate', undefined, undefined, nextNode );
liveClock.node.style.fontSize = 'larger';
Line 19:
return;
}
var now = new Date();
var hh = now.getUTCHours();
var mm = now.getUTCMinutes();
Line 26:
dateNode.firstChild.replaceChild( document.createTextNode( time ), dateNode.firstChild.firstChild );
window.setTimeout(showTime, 1000);
}