User:Alanbly/monobook.js

//A clock that autoupdates //From the user scripts project function showtime {   var timerID; var now = new Date; var timeValue = now.toUTCString.substring(0,22) + " UTC"; if (document.getElementById('utcdate')) {document.getElementById('utcdate').firstChild.innerHTML = timeValue;} timerID = setTimeout('showtime', 1000); } function loadclock { try { var toplinks = document.getElementById('p-personal').getElementsByTagName('ul')[0]; addlilink(toplinks, mw.config.get('wgScript') + '?title=' + mw.config.get('wgPageName').replace(/&/g,'%26') + '&action=purge', '', 'utcdate'); showtime; }catch (e) {} } addOnloadHook(loadclock);

// Stats Tab $( function {  var time = new Date;  var month = (time.getUTCMonth+1).toString;  if (month<10) { month = "0"+ month; }  var year = time.getUTCFullYear.toString;  mw.util.addPortletLink('p-cactions', 'http://stats.grok.se/en/'+year+month+'/' +mw.config.get('wgPageName'), "stats", "ca-stats", "See article stats"); });

// Minor Edit by Default if(mw.config.get('wgAction') == 'edit') { $(function minorEdit {      document.getElementById('wpMinoredit').checked = true;    } )}