Difference between revisions of "User:Tsumetai/monobook.js"

From Conservapedia
Jump to navigation Jump to search
(testing again)
(No difference)

Revision as of 13:57, March 21, 2007

addOnloadHook(function(){
 var h2s = document.getElementsByTagName('H2');
 var h2 = h2s[0];
 if (!h2) return;
 if (h2.parentNode.id == 'toctitle') h2 = h2s[1];
 if (!h2) return;
 var span = h2.firstChild;
 if (!span || span.className != 'editsection') return;
 var zero = span.cloneNode(true);
 var h1 = document.getElementsByTagName('H1')[0];
 h1.insertBefore(zero, h1.firstChild);
 var a = zero.getElementsByTagName('A')[0];
 a.title = a.title.replace(/:.*$/,': 0');
 a.setAttribute('href', a.href.replace(/&section=1/,'&section=0'));
})