User:Bookofjude's Sock/monobook.js

/* */ // Javascript UTC Clock by User:Alphax (see accompanying CSS)

// Navigation popups by User:Lupin document.write(' ');

popupAdminLinks=true; popupFixDabs=true; //

// Instaview document.write(' '); InstaView.conf.user.name = 'Pathoschild'; //

// User:Ilmari Karonen/userboxes.js document.write('<'+'script type="text/javascript" src="'              + 'http://en.wikipedia.org/w/index.php?title=User:Ilmari Karonen/userboxes.js'               + '&action=raw&ctype=text/javascript&dontcountme=s"><'+'/script>'); //

// Add purge to tabs function addPurge{ var x = document.getElementById('ca-history'); if(!x) return; if(x.children) x = x.children[0].href; else x = x.childNodes[0].href; addLink("p-cactions", x.replace(/=history/, "=purge"), 'purge', 'ca-purge', 'Purge the internal cache for this page', 0); }

if (window.addEventListener) window.addEventListener("load", addPurge, false); else if (window.attachEvent) window.attachEvent("onload", addPurge); //

// /**** Add LI link (function) ****/ // function addlilink(tabs, url, name, id, title, key){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); tabs.appendChild(li); if(id) {      if(key && title) {          ta[id] = [key, title]; }      else if(key) {          ta[id] = [key, '']; }      else if(title) {          ta[id] = ['', title]; }  }   // re-render the title and accesskeys from existing code in wikibits.js   akeytt; return li; } //

// /**** Add tab (function) ****/ function addTab(url, name, id, title, key){ var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; return addlilink(tabs, url, name, id, title, key); } //

// Incomplete scripts /**** Experimental admin toolbox (disabled -- incomplete) ****/ /* document.write(' '           + ' Admin toolbox '            + 'test'           + 'test'           + 'test'           + ''           + '</div)');

if (window.addEventListener) window.addEventListener("load",myLoadFuncs,false); else if (window.attachEvent) window.attachEvent("onload",myLoadFuncs); else {   window.previousLoadFunction = window.onload; window.onload = function {       window.previousLoadFunction; myLoadFuncs; } }

/**** Load custom functions ****/

function myLoadFuncs {   if(!document.getElementById) return; // add a clock var toplinks = document.getElementById('p-personal').getElementsByTagName('ul')[0]; addlilink(toplinks, '#', '', 'utcdate'); showtime; }

/**** Get a clock that autoupdates! ****/

function showtime {   var timerID; var now = new Date; var timeValue = now.toUTCString.replace(/GMT/, "UTC"); document.getElementById('utcdate').firstChild.innerHTML = timeValue; timerID = setTimeout('showtime', 100); }

/* */