User:MJBurrage/monaco.js

/***** DavidClock ******************************************************************* addOnloadHook( function { var static = true;  var tick = 60;  /* If the user has not declared "window.davidClock = x;"     then none of these if-cases become true, and the defaults     above will be used. */  if( window.davidClock >= 0 ) {    tick = window.davidClock;  }  else if( window.davidClock < 0 ) {    static = false;    tick = 0 - window.davidClock;  }  /* Optimised ticker for 60 seconds or longer tick intervals. */  function updateTimeMinutes {    var now = new Date;    linkNode.innerHTML = now.toUTCString.substring(17,22);    setTimeout( updateTimeMinutes, tick * 1000 );  };  /* Optimised ticker for 1-59 seconds tick intervals. */  function updateTimeSeconds {    var now = new Date;    linkNode.innerHTML = now.toUTCString.substring(17,25);    setTimeout( updateTimeSeconds, tick * 1000 );  };  /* Start the ticking clock. */  if( tick ) {    var tabNode = addPortletLink( 'p-personal', wgScriptPath + '/index.php?title=' + encodeURIComponent(wgPageName) + '&action=purge', '', 'pt-utcticker', 'Purge the page' );   tabNode.style.fontWeight = 'bolder';    var linkNode = tabNode.getElementsByTagName("a")[0];    if( tick >= 60 ) {      updateTimeMinutes;    }    else {      updateTimeSeconds;    }  }  /* Create the static clock. */  if( static ) {    if( tick ) {   /* Make it an edit section 0 link. */      var link = wgScriptPath + '/index.php?title='         + encodeURIComponent(wgPageName) + '&action=edit&section=0';      var linkTooltip = 'Edit section 0';    }    else {   /* Make it a purge link. */      var link = wgScriptPath + '/index.php?title='         + encodeURIComponent(wgPageName) + '&action=purge';      var linkTooltip = 'Purge the page';    }    var now = new Date;    var linkText = now.toUTCString.substring(17,22);    addPortletLink( 'p-personal', link, linkText, 'pt-utcstatic', linkTooltip );  } } );  /* End DavidClock */
 * Rellotge a la part superior dreta de les pàgines (zona d'enllaços personals).****
 * Documentació completa a wikipedia:User:Davidgothberg/clock.******************