rem: name	: txt, element : el, enabled : true, active	: false, text	: btn[2], cmd	: btn[3], state	: setButtonStatus, context : btn[4] || null 
add: name	: txt, element : el, enabled : true, active	: false, text	: btn[2], cmd	: btn[3], state	: setButtonStatus, context : btn[4] || null 
context: 	function createButton(txt) {		// the element that will be created		var el = null;		var btn = null;		switch (txt) {		    case "separator":			el = document.createElement("div");			el.className = "separator";			break;		    case "space":			el = document.createElement("div");			el.className = "space";			break;		    case "linebreak":			newLine();			return false;		    case "textindicator":			el = document.createElement("div");			el.appendChild(document.createTextNode("A"));			el.className = "indicator";			el.title = HTMLArea.I18N.tooltips.textindicator;			var obj = {				name	: txt, // the button name (i.e. 'bold')				element : el, // the UI element (DIV)				enabled : true, // is it enabled?				active	: false, // is it pressed?				text	: false, // enabled in text mode?				cmd	: "textindicator", // the command ID				state	: setButtonStatus // for changing state			};			tb_objects[txt] = obj;			break;		    default:			btn = editor.config.btnList[txt];		}		if (!el && btn) {			el = document.createElement("div");			el.title = btn[0];			el.className = "button";			// let's just pretend we have a button object, and			// assign all the needed information to it.			var obj = {				name	: txt, // the button name (i.e. 'bold')				element : el, // the UI element (DIV)				enabled : true, // is it enabled?				active	: false, // is it pressed?				text	: btn[2], // enabled in text mode?				cmd	: btn[3], // the command ID				state	: setButtonStatus, // for changing state				context : btn[4] || null // enabled in a certain context?			};			tb_objects[txt] = obj;			// handlers to emulate nice flat toolbar buttons			HTMLArea._addEvent(el, "mouseover", function () {				if (obj.enabled) {					HTMLArea._addClass(el, "buttonHover");				}			});			HTMLArea._addEvent(el, "mouseout", function () {				if (obj.enabled) with (HTMLArea) {					_removeClass(el, "buttonHover");					_removeClass(el, "buttonActive");					(obj.active) && _addClass(el, "buttonPressed");				}			});			HTMLArea._addEvent(el, "mousedown", function (ev) {				if (obj.enabled) with (HTMLArea) {					_addClass(el, "buttonActive");					_removeClass(el, "buttonPressed");					_stopEvent(is_ie ? window.event : ev);				}			});			// when clicked, do the following:			HTMLArea._addEvent(el, "click", function (ev) {				if (obj.enabled) with (HTMLArea) {					_removeClass(el, "buttonActive");					_removeClass(el, "buttonHover");					obj.cmd(editor, obj.name, obj);					_stopEvent(is_ie ? window.event : ev);				}			});			var img = document.createElement("img");			img.src = editor.imgURL(btn[1]);			img.style.width = "18px";			img.style.height = "18px";			el.appendChild(img);		} else if (!el) {			el = createSelect(txt);		}		if (el) {			var tb_cell = document.createElement("td");			tb_row.appendChild(tb_cell);			tb_cell.appendChild(el);		} else {			alert("FIXME: Unknown toolbar item: " + txt);		}		return el;	};
meta: 6230	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6230/e9ff05661c4fa38c1e8ce4b72bf5b0a3bb5e0842/htmlarea.js/buggy/phpgwapi/js/htmlarea/htmlarea.js