Utilizator:Anneto/UTCceas.js

De la Wikipedia, enciclopedia liberă

Notă: După salvare, trebuie să treceți peste cache-ul browser-ului pentru a vedea modificările.

  • Mozilla, Google Chrome, Safari, Konqueror: țineți apăsat Shift în timp ce apăsați butonul Reload (sau apăsați Ctrl-Shift-R).
  • Internet Explorer: apăsați Ctrl-F5.
  • Opera: apăsați F5.
$ (function ()
{
  var 
<noinclude>[[Categorie:Utilizator:Anneto]]</noinclude>personal = 'p-personal';
  if (!document.getElementById (personal)) personal = 'personal'; // Vector...
  if (!document.getElementById (personal)) return; // Old skins: don't do anything
  var liveClock =
    addPortletLink (
        personal
      , mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=' + wgPageName + '&action=purge'
      , ""
      , 'utcdate');
  if (!liveClock) return; // Paranoia
  if (skin !== "vector") { //large font looks like crap on vector
    liveClock.style.fontSize = 'larger';
  }
  liveClock.style.fontWeight = 'bolder';
 
  function showTime ()
  {
    var now = new Date();
    var hh  = now.getUTCHours() + 2;
    if(hh>=24)
		hh=hh - 24;
    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);
    liveClock.firstChild.replaceChild (document.createTextNode (time), liveClock.firstChild.firstChild);
    window.setTimeout (showTime, 1000);
  }
 
  showTime();
});