User:Connel MacKenzie/monobook.js

// function setCookie(cookieName, cookieValue) { var today = new Date; var expire = new Date; var nDays = 30; expire.setTime( today.getTime + (3600000 * 24 * nDays) ); document.cookie = cookieName + "=" + escape(cookieValue) + ";path=/w" + ";expires="+expire.toGMTString; document.cookie = cookieName + "=" + escape(cookieValue) + ";path=/wiki" + ";expires="+expire.toGMTString; }

function getCookie(cookieName) { var start = document.cookie.indexOf( cookieName + "=" ); if ( start == -1 ) return ""; var len = start + cookieName.length + 1; if ( ( !start ) &&   ( cookieName != document.cookie.substring( 0, cookieName.length ) ) ) {       return ""; } var end = document.cookie.indexOf( ";", len ); if ( end == -1 ) end = document.cookie.length; return unescape( document.cookie.substring( len, end ) ); }

function deleteCookie(cookieName) { if ( getCookie(cookieName) ) { document.cookie = cookieName + "=" + ";path=/w" + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; document.cookie = cookieName + "=" + ";path=/wiki" + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; } }

document.write('<\/'             + 'script>');

document.write('<\/'             + 'script>');

document.write('');

// add "favorites" to navigation box thing on left column function addToNav { var lastnav = document.getElementById('n-sitesupport'); var newnav; var newa;

// get page title var pagetitle = document.getElementById('content').getElementsByTagName('h1').item(0).firstChild.nodeValue; if (pagetitle.search(/Search/) != -1) { pagetitle = document.getElementById('contentSub').firstChild.nodeValue; pagetitle = pagetitle.replace(/For query /g, ""); pagetitle = pagetitle.replace(/\"/g, ""); }  pagetitle = pagetitle.replace(/Editing /g, "");  var pageexternal = pagetitle.replace(/\ /g, "_");  var pageext =      pagetitle.replace(/\ /g, "+");

//wikt:pagetitle newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/wiki/wikt:' + pageexternal; newa.appendChild(document.createTextNode('wikt: ' + pagetitle)); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav); ta['wikt: ' + pagetitle] = new Array('','Wiktionary quicklink for this same title');

//wikt:Special:Recentchanges - quick and dirty way to get back to Wikt: when above link is broken (i.e. namespace, or page on wikt: won't exist.) newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/wiki/wikt:Special:Recentchanges'; newa.appendChild(document.createTextNode('wikt: Special:RC')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav); ta['wikt: Special:RC'] = new Array('','Wiktionary quicklink for this Special:Recentchanges'); }

function reformatMyPage { addToNav ; }

var hack = 'failed'; var hack_pagetitle =''; if (window.addEventListener) window.addEventListener("load",reformatMyPage,false); else if (window.attachEvent) window.attachEvent("onload",reformatMyPage);

//