User:Humppake/monobook.js

var links_default; var links_visited; var links_hover; var links_active; var links_new; var links_toc;

var links_show = false;

window.onload = function { document['onkeydown'] = detectEvent;

links_default = document.styleSheets[2].cssRules[3].styleSheet.cssRules[1].style; links_visited = document.styleSheets[2].cssRules[3].styleSheet.cssRules[2].style; links_hover = document.styleSheets[2].cssRules[3].styleSheet.cssRules[3].style; links_active = document.styleSheets[2].cssRules[3].styleSheet.cssRules[4].style; links_new = document.styleSheets[2].cssRules[3].styleSheet.cssRules[5].style; links_toc = document.styleSheets[2].cssRules[3].styleSheet.cssRules[6].style; }

function toggleLinks { if (!links_show) { links_default.setProperty('color', '#002BB8', null); links_default.setProperty('text-decoration', 'underline', null); links_default.setProperty('cursor', 'pointer', null);

links_toc.setProperty('display', 'inline', null);

links_show = true; } else { links_default.setProperty('color', '#000000', null); links_default.setProperty('text-decoration', 'none', null); links_default.setProperty('cursor', 'default', null);

links_toc.setProperty('display', 'none', null);

links_show = false; } return false; }

function detectEvent(e) { var evt = e || window.event; if (evt.keyCode == 16 && evt.charCode == 0) return toggleLinks; /*	else if (evt.keyCode == 32 && evt.charCode == 0) return toggleLinks; */ else if (evt.keyCode == 32 && evt.charCode == 160) return toggleLinks; else return true; }