利用者:Jkr2255/UTCClock-cologneblue.js
表示
お知らせ: 保存した後、ブラウザのキャッシュをクリアしてページを再読み込みする必要があります。
多くの Windows や Linux のブラウザ
- Ctrl を押しながら F5 を押す。
Mac における Safari
Mac における Chrome や Firefox
- ⌘ Cmd と ⇧ Shift を押しながら R を押す。
詳細についてはWikipedia:キャッシュを消すをご覧ください。
( function( $, undefined ) {
var $target;
function showTime( $target ) {
var dateNode = UTCLiveClockConfig.node;
if( !dateNode ) {
return;
}
var now = new Date();
var hh = now.getUTCHours();
var mm = now.getUTCMinutes();
var ss = now.getUTCSeconds();
if ( $target === undefined ) {
$target = $( dateNode ).find( 'a:first' );
}
var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss );
$target.text( time );
setTimeout( function(){
showTime( $target );
}, 1000 );
}
function liveClock() {
if ( window.UTCLiveClockConfig === undefined ) {
window.UTCLiveClockConfig = {};
}
/*
var portletId = UTCLiveClockConfig.portletId || 'p-personal';
var nextNode = UTCLiveClockConfig.nextNodeId ? document.getElementById( UTCLiveClockConfig.nextNodeId ) : undefined;
UTCLiveClockConfig.node = mw.util.addPortletLink(
portletId,
wgScript + '?title=' + encodeURIComponent( wgPageName ) + '&action=purge',
'',
'utcdate',
undefined,
undefined,
nextNode
);
*/
return; // [[phab:T72470]]
var $purge=$('<a></a>').attr("href",wgScript + '?title=' + encodeURIComponent( wgPageName ) + '&action=purge');
UTCLiveClockConfig.node=$('<span id="utcdate"> | </span>').appendTo("#syslinks").append($purge);
if( !UTCLiveClockConfig.node ) {
return;
}
showTime();
}
$( document ).ready( liveClock );
} )( jQuery );