User:Chaduvari/monobook.js

//

// add link

// access keys overpowered // override unchangeable commands ta['n-recentchanges'] = new Array('s','Recent changes'); ta['n-mainpage'] = new Array('p','Visit the Main Page');

// disable pains ta['ca-edit'] = new Array('','You can edit this page.'); ta['ca-watch'] = new Array('','Add this page to your watchlist'); ta['pt-logout'] = new Array('','Log out'); ta['ca-move'] = new Array('','Move this page'); ta['ca-talk'] = new Array('','Discussion about the content page');

// add several links to Nav box, from Connel, expanded and adapted (and correctly spelled parlour) // 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, "+"); // Prefix index newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/wiki/Special:Prefixindex'; newa.appendChild(document.createTextNode('All pages')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

// New pages newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/wiki/Special:Newpages'; newa.appendChild(document.createTextNode('New pages')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

// Wanted pages newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/wiki/Special:Wantedpages'; newa.appendChild(document.createTextNode('Wanted pages')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

// Inflection templates newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/wiki/Wiktionary:Inflection templates'; newa.appendChild(document.createTextNode('Inflection templates')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

// a: (webster's 1913 & 1828) newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='http://machaut.uchicago.edu/?action=search&word=' + pageext + '&resource=Webster\'s&quicksearch=on'; newa.appendChild(document.createTextNode('ARTFL')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

// de: newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/wiki/de:' + pagetitle; newa.appendChild(document.createTextNode('German Wikt')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

// fr: newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/wiki/fr:' + pagetitle; newa.appendChild(document.createTextNode('French Wikt')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

// it: newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/wiki/it:' + pagetitle; newa.appendChild(document.createTextNode('Italian Wikt')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

// pl: newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/wiki/pl:' + pagetitle; newa.appendChild(document.createTextNode('Polish Wikt')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

// pr: (Google print) newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='http://print.google.com/print?q=' + pageext + '&btnG=Google+Search'; newa.appendChild(document.createTextNode('Google print')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

// raw: (raw text version, opens in .php, set to wordpad) newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/w/index.php?title=' + pagetitle + '&action=raw'; newa.appendChild(document.createTextNode('Raw text')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

// w: (wikipedia) newnav = document.createElement('li'); newa = document.createElement('a'); newa.href='/wiki/w:Special:Search/' + pagetitle; newa.appendChild(document.createTextNode('Wikipedia')); newnav.appendChild(newa); lastnav.parentNode.appendChild(newnav);

}

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);

// plus tab for BP, TR, RFD, RFV, RFC, TTBC function addPlusToBeerParlour { // get page title var pagetitle = document.getElementById('content').getElementsByTagName('h1').item(0).firstChild.nodeValue;

if ((pagetitle.search(/^Wiktionary:Beer parlour$/) != -1) || (pagetitle.search(/^Wiktionary:Tea room$/) != -1) || (pagetitle.search(/^Wiktionary:Requests for deletion$/) != -1) || (pagetitle.search(/^Wiktionary:Requests for verification$/) != -1) || (pagetitle.search(/^Wiktionary:Requests for cleanup$/) != -1) || (pagetitle.search(/^Wiktionary:Translations to be checked$/) != -1)) {

// find the spot to add our new tab var edittabli = document.getElementById('ca-edit');

// create the plus tab var plustabli = document.createElement('li'); plustabli.id = 'ca-addsection'; var plustablink = document.createElement('a'); ta['ca-addsection'] = new Array('+','Add a comment to this discussion.');

plustablink.href = '/w/index.php?title=' + pagetitle + '&action=edit&section=new'; plustablink.appendChild(document.createTextNode('+')); plustabli.appendChild(plustablink);

// add the plus tab edittabli.className = 'istalk'; edittabli.parentNode.insertBefore(plustabli, edittabli.nextSibling); } }

// add "edit section 0" to top page tabs function addEditSection0 { if (!document.getElementById) return; x = document.getElementById('ca-edit'); if(!x) return; y = document.createElement('LI'); y.id = 'ca-edit-0'; if (x.className == 'selected') { if (/&action=edit&section=0$/.test(window.location.href)) { x.className = 'istalk'; y.className = 'selected'; } else { x.className = 'selected istalk'; } } else if (x.className == 'selected istalk') { if (/&action=edit&section=0$/.test(window.location.href)) { x.className = 'istalk'; y.className = 'selected istalk'; } else { y.className = 'istalk'; } } else { y.className = x.className; x.className = 'istalk'; } z = document.createElement('A'); if (x.children) { z.href = x.children[0].href + '&section=0'; z.appendChild(document.createTextNode('0')); y.appendChild(z); document.getElementById('p-cactions').children[1].insertBefore(y,x.nextSibling); } else { z.href = x.childNodes[0].href + '&section=0'; z.appendChild(document.createTextNode('0')); y.appendChild(z); document.getElementById('p-cactions').childNodes[3].insertBefore(y,x.nextSibling); } }

if (document.title.indexOf("Editing ") == -1) { addOnloadHook(addEditSection0); }

//