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"); fixTable("hidecol2"); fixTable("hidecol3"); fixTable("hidecol4"); fixTable("hidecol5"); fixTable("hidecol6"); fixTable("hidecol7"); fixTable("hidecol8"); fixTable("hidecol9"); fixTable("hidecol10"); //	} } function fixTable(className){ var theTables = getElementsByClassName(document, "table", className); debug("Meep! " + className); debug("num tables = " + theTables.length); for (var i=0; i < theTables.length; i++){ theTables.className = ""; /*		var theRows = theTables[i].rows; for (var j=0; j < theRows.length; j++){ var theCells = theRows[j].cells; for (var k=0; k < theCells.length; k++){ theCells[k].display = 'block'; debug("    k = " +k); }		}	} } addOnloadHook(hideColFix);