v50 Steam/Premium information for editors
- v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
- Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.
Difference between revisions of "User:Emi/clock.js"
< User:Emi
Jump to navigation
Jump to search
(Created page with 'function liveClock() { if (typeof(UTCLiveClockConfig)=='undefined') UTCLiveClockConfig = {}; var portletId = UTCLiveClockConfig.portletId || 'p-personal'; var nextNode = UTCL…') |
|||
Line 7: | Line 7: | ||
showTime(); | showTime(); | ||
+ | |||
+ | if ($('.p-googleadsense').height() == 0) | ||
+ | alert("You are blocking my beautiful adverts, you swine!"); | ||
+ | |||
} | } | ||
addOnloadHook(liveClock) | addOnloadHook(liveClock) |
Revision as of 17:15, 12 August 2010
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 );
showTime();
if ($('.p-googleadsense').height() == 0)
alert("You are blocking my beautiful adverts, you swine!");
}
addOnloadHook(liveClock)
function showTime()
{
var dateNode = liveClock.node;
if( !dateNode ) {
return;
}
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 );
dateNode.firstChild.replaceChild( document.createTextNode( time + " " ), dateNode.firstChild.firstChild );
window.setTimeout(showTime, 1000);
}