All pastes #659462 Raw Edit

Anonymous

public javascript v1 · immutable
#659462 ·published 2007-08-16 09:04 UTC
rendered paste body
config.macros.tableHighlight = {}config.macros.tableHighlight.handler = function(place, macroName, params, wikifier, paramString, tiddler) {	var tables = place.getElementsByTagName("table");	if(tables[0]) { // DEBUG: check tables.length instead?		for(var i = 0; i < tables.length; i++) {			var cells = tables[i].getElementsByTagName("td");			for (var j = 0; j < cells.length; j++){				cells[i].onmouseover = function() { highlight(this); };				cells[i].onmouseout = function() { unhighlight(this); };			}		}	}}function highlight(el) {	alert(this + ": over"); // DEBUG: for testing purposes only	addClass(el, "active");	el.style.backgroundColor = "#F00 !important"; // DEBUG: for testing purposes only}function unhighlight(el) {	alert(this + ": out"); // DEBUG: for testing purposes only	removeClass(el, "active");	el.style.backgroundColor = ""; // DEBUG: for testing purposes only}