User:Π/monobook.js
From RationalWiki
< User:Π
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Clear the cache in Tools → Preferences
function curse() { var bads = document.getElementsByTagName("a"); var i; for (i=0;i<bads.length;++i) { if (bads[i].getAttribute("href")=="/wiki/User:ConservapediaUndergroundResistor" && bads[i].childNodes.length > 0) { bads[i].innerHTML = "CUR"; } if (bads[i].getAttribute("title")=="User talk:ConservapediaUndergroundResistor" && bads[i].childNodes.length > 0 && bads[i].childNodes[0].nodeName == "FONT") { bads[i].innerHTML = ""; } else if (bads[i].getAttribute("title")=="User talk:ConservapediaUndergroundResistor" && bads[i].childNodes.length > 0 && bads[i].childNodes[0].nodeName == "SUP") { bads[i].innerHTML = ""; } if (bads[i].getAttribute("title")=="User:CUR" && bads[i].childNodes.length > 0 && bads[i].childNodes[0].nodeName == "FONT") { bads[i].innerHTML = "CUR"; } if (bads[i].getAttribute("title")=="Special:Contributions/ConservapediaUndergroundResistor" && bads[i].childNodes.length > 0 && bads[i].childNodes[0].nodeName == "FONT") { bads[i].innerHTML = ""; } } } addOnloadHook(curse); addOnloadHook(function () { if (wgPageName =="User_talk:Π"){ var x; if (!(x = document.getElementById('ca-edit') )) return; var url; if (!(url = x.getElementsByTagName('a')[0] )) return; if (!(url = url.href )) return; var y = addPortletLink('p-cactions', url+"§ion=1", '1', 'ca-edit-1', 'Edit the first section of this page', '1', x.nextSibling.nextSibling); y.className = x.className; // steal classes from the the edit tab... x.className = 'istalk'; // ...and make the edit tab have no right margin // exception: don't steal the "selected" class unless actually editing section 1: if (/(^| )selected( |$)/.test(y.className)) { if (!document.editform || !document.editform.wpSection || document.editform.wpSection.value != "1") { y.className = y.className.replace(/(^| )selected( |$)/g, "$1"); x.className += ' selected'; } } } });