ഉപയോക്താവ്:Sadik Khalid/friendlyclock.js
ശ്രദ്ധിക്കുക: സേവ് ചെയ്തശേഷം മാറ്റങ്ങൾ കാണാനായി താങ്കൾക്ക് ബ്രൗസറിന്റെ കാഷെ ഒഴിവാക്കേണ്ടി വന്നേക്കാം.
- ഫയർഫോക്സ് / സഫാരി: Reload ബട്ടൺ അമർത്തുമ്പോൾ Shift കീ അമർത്തി പിടിക്കുകയോ, Ctrl-F5 അല്ലെങ്കിൽ Ctrl-R (മാക്കിന്റോഷിൽ ⌘-R ) എന്ന് ഒരുമിച്ച് അമർത്തുകയോ ചെയ്യുക
- ഗൂഗിൾ ക്രോം: Ctrl-Shift-R (മാക്കിന്റോഷിൽ ⌘-Shift-R ) അമർത്തുക
- ഇന്റർനെറ്റ് എക്സ്പ്ലോറർ: Refresh ബട്ടൺ അമർത്തുമ്പോൾ Ctrl കീ അമർത്തിപിടിക്കുക. അല്ലെങ്കിൽ Ctrl-F5 അമർത്തുക
- ഓപ്പറ: Menu → Settings എടുക്കുക (മാക്കിൽ Opera → Preferences) എന്നിട്ട് Privacy & security → Clear browsing data → Cached images and files ചെയ്യുക.
// If FriendlyConfig aint exist.
if( typeof( FriendlyConfig ) == 'undefined' ) {
FriendlyConfig = {};
}
/**
FriendlyConfig.enableClock ( boolean )
*/
if( typeof( FriendlyConfig.enableClock ) == 'undefined' ) {
FriendlyConfig.enableClock = true;
}
/**
FriendlyConfig.clockStyle ( String )
*/
if( typeof( FriendlyConfig.clockStyle ) == 'undefined' ) {
FriendlyConfig.clockStyle = 'dynamic';
}
friendlyclock = {
showClock: function() {
var query = {
'action': 'purge',
'title': wgPageName
};
friendlyclock.clockNode = mw.util.addPortletLink( 'p-personal', mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?' + QueryString.create( query ), '--:--:-- UTC', 'friendly-clock', 'Purge this page', '' );
friendlyclock.clockNode.style.fontSize = 'normal';
friendlyclock.clockNode.style.fontWeight = 'bold';
friendlyclock.clockNode.style.textTransform = 'uppercase';
friendlyclock.updateTime();
if( FriendlyConfig.clockStyle != 'static' ) {
friendlyclock.intervalId = window.setInterval(friendlyclock.updateTime, 1000);
}
},
updateTime: function() {
if( !friendlyclock.clockNode ) {
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) + ' UTC';
friendlyclock.clockNode.firstChild.innerHTML = time;
}
}
$( function() {
if( FriendlyConfig.enableClock ) {
friendlyclock.showClock();
}
}
);