MediaWiki:Gadget-liquidnormtalk.js

try { // containerize gadget, to protect other gadgets if this one goes wrong

$(function { try { //lqt_header_content lqt-talkpage-header lqt-new-thread lqt-edit-form lqt_toc if (!document.getElementById('commentary-header-lqt')) return;

var b = document.getElementById('bodyContent'); b.className += ' no-lqt'; var ap = b.getElementsByTagName('h2')[1] if (!ap) return var contents = b.getElementsByTagName('h2')[0]; var container = document.createElement('div');

container.id = 'lqt-tools-crap';

var toc = getElementsByClassName(b, 'table', 'lqt_toc'); if (toc.length === 0) return; //no comments, doesn't really work. container.appendChild(getElementsByClassName(b, 'div', 'lqt-talkpage-header')[0]); container.appendChild(getElementsByClassName(b, 'div', 'lqt-new-thread')[0]); container.appendChild(contents); container.appendChild(toc[0]);

ap.parentNode.insertBefore(container, ap);

container.style.display = 'none'; var li = document.createElement('li'); li.innerHTML = '[Show/hide LQT tools&darr;]'; getElementsByClassName(b, 'ul', 'lqt_header_commands')[0].appendChild(li);

//to give an edit link (since we're hiding reply) var b= document.getElementById('bodyContent'); var a = getElementsByClassName(b, 'ul', 'lqt_threadlevel_commands'); var li, d; for (var i = 0; i < a.length; i++) { li = document.createElement('li'); d = document.createElement('a'); d.appendChild(document.createTextNode('Reply/Edit')); d.href= getElementsByClassName(a[i].nextSibling, 'li', 'lqt-command-link')[0].getElementsByTagName('a')[0].href; li.appendChild(d); a[i].appendChild(li); }

}

catch (e) {} }); function toggleLQTTools { var l = document.getElementById('lqt-tools-crap'); var b = document.getElementById('bodyContent'); if (b.className.indexOf('no-lqt') !== -1) { b.className = b.className.replace(/\s?no-lqt/, ''); } else { b.className += ' no-lqt'; } if (l.style.display === 'none') l.style.display = 'block'; else l.style.display = 'none'; return (void 0);

}

} catch (e) { // containerize gadget, to protect other gadgets if this one goes wrong // ignore }