Lompat ke isi

MediaWiki:Gadget-UTCLiveClock.js: Perbedaan antara revisi

Dari Wikipedia bahasa Indonesia, ensiklopedia bebas
Konten dihapus Konten ditambahkan
Kenrick95 (bicara | kontrib)
kTidak ada ringkasan suntingan
Kenrick95 (bicara | kontrib)
Tidak ada ringkasan suntingan
Baris 23: Baris 23:
var ss = now.getUTCSeconds();
var ss = now.getUTCSeconds();
var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss );
var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss );
$("#utcdate").children().html(time);
liveClock.node.firstChild.textContent = time;


window.setTimeout(showTime, 1000);
window.setTimeout(showTime, 1000);

Revisi per 19 Januari 2015 14.08

function liveClock()
{

	liveClock.node = mw.util.addPortletLink( 'p-personal',
		mw.config.get('wgServer')
		+ mw.config.get('wgScriptPath')
		+ '/index.php?title='
		+ mw.config.get('wgPageName')
		+ '&action=purge', '', 'utcdate' )[0];
	// liveClock.node.style.fontSize = 'larger';
	liveClock.node.style.fontWeight = 'bolder';
	

	showTime();
}
$(liveClock);

function showTime()
{
    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 );
	$("#utcdate").children().html(time);

    window.setTimeout(showTime, 1000);
}