User:PanSola/monobook.js

/* * */

var debugMSG = "";

function debugToolsInit { var debugDiv = document.createElement("div"); debugDiv.id = 'debugDiv'; document.getElementById('bodyContent').appendChild(debugDiv); debugDiv.style.background='yellow'; debugDiv.style.clear='both'; debugDiv.style.display = 'none'; } function debug(message){ debugMSG += message + ' '; }

function printDebug{ var debugDiv = document.getElementById('debugDiv'); debugDiv.innerHTML += debugMSG; debugDiv.style.display = 'block'; debugMSG = ""; }

addOnloadHook(debugToolsInit); /* */

/* * Overwrites the original function in http://gw.gamewikis.org/skins/common/sorttable.js  * with MediaWiki:sortable_mod.js function sortableTables { if (getElementsByClassName(document, "table", "sortable").length != 0) { document.write(' '); } }

/* 1.2

/* A function to fix the CSS problems due to IE7 not implementing display:table-cell; */ function hideColFix { var browserName=navigator.appName; var browserVer =parseInt(navigator.appVersion);

//	if (browserName=="Microsoft Internet Explorer" && browserVer >= 7){ fixTable("hidecol1",0); fixTable("hidecol2",1); fixTable("hidecol3",2); fixTable("hidecol4",3); fixTable("hidecol5",4); fixTable("hidecol6",5); fixTable("hidecol7",6); fixTable("hidecol8",7); fixTable("hidecol9",8); fixTable("hidecol10",9); //	} } function fixTable(className, idx){ var theTables = getElementsByClassName(document, "table", className); debug("Meep! " + className); debug("num tables = " + theTables.length); for (var i=0; i < theTables.length; i++){ var curTable = theTables[i]; var theRows = curTable.rows; if (theRows[0].cells.length < idx) continue; // not enough columns, skip

curTable.className = curTable.className.replace(className, ''); for (var j=0; j < theRows.length; j++){ theRows[j].cells[idx].style.display='none'; }	} } addOnloadHook(hideColFix);