User:TheGrimme/HideRefDeskHeader.js

// // http://en.wikipedia.org/wiki/User:TheGrimme // Hides the header info at the top of reference desk pages GPL, en:User:TheGrimme

// hook if(isOnRefDeskPage) {   addOnloadHook(HideRefDeskHeader); }

//init function HideRefDeskHeader { // For now, get all tables and remove the first one with this border var tables = document.getElementsByTagName("TABLE"); var removedTable = null; for(var i=0; i < tables.length; i++) {       var table = tables[i]; var match = "1px solid rgb(170, 170, 170)" if(table.style.border == match) {           table.style.display = "none"; removedTable = table; break; }   }    // Move the table of contents into the old spot. Best use of space var toc = document.getElementById("toc"); if(toc != null && removedTable != null) {       var tocParent = toc.parentNode; var removedParent = removedTable.parentNode; removedParent.appendChild(tocParent.removeChild(toc)); } }

function isOnRefDeskPage {	var isOnRefDeskPage = false; var location = window.location.pathname; var needle = "wiki/Wikipedia:Reference_desk/"; if(location.indexOf(needle) != -1) {		isOnRefDeskPage = true; }	return isOnRefDeskPage; }

//