rem: tinyMCE.handleVisualAid(tinyMCE.selectedInstance.contentWindow.document.body, true, tinyMCE.settings['visual']); 
add: tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(), true, tinyMCE.settings['visual']);   if (tinyMCE.isGecko && tinyMCE.settings['document_base_url'] != "" + document.location.href && e.type == "keyup" && e.ctrlKey && e.keyCode == 86) tinyMCE.selectedInstance.fixBrokenURLs(); 
context: function TinyMCE_handleEvent(e) {	//window.status = e.type + " " + e.target.nodeName + " " + (e.relatedTarget ? e.relatedTarget.nodeName : "");	switch (e.type) {		case "submit":			var formObj = tinyMCE.isMSIE ? window.event.srcElement : e.target;			// Disable all UI form elements that TinyMCE created			for (var i=0; i<formObj.elements.length; i++) {				var elementId = formObj.elements[i].name ? formObj.elements[i].name : formObj.elements[i].id;				if (elementId.indexOf('mce_editor_') == 0)					formObj.elements[i].disabled = true;			}			tinyMCE.triggerSave();			return;		case "reset":			var formObj = tinyMCE.isMSIE ? window.event.srcElement : e.target;			for (var i=0; i<document.forms.length; i++) {				if (document.forms[i] == formObj)					window.setTimeout('TinyMCE_resetForm(' + i + ');', 10);			}			return;		case "paste":			if (tinyMCE.settings['auto_cleanup_word'])				window.setTimeout("tinyMCE.execInstanceCommand('" + e.target.editorId + "', 'mceCleanupWord', false, null);", 1);			break;		case "beforecut":		case "beforepaste":			if (tinyMCE.selectedInstance)				tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");			break;		case "keypress":			if (e.target.editorId) {				tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];			} else {				if (e.target.ownerDocument.editorId)					tinyMCE.selectedInstance = tinyMCE.instances[e.target.ownerDocument.editorId];			}			// Insert space instead of &nbsp;/*			if (tinyMCE.isGecko && e.charCode == 32) {				if (tinyMCE.selectedInstance._insertSpace()) {					// Cancel event					e.preventDefault();					return false;				}			}*/			// Insert P element			if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && e.keyCode == 13 && !e.shiftKey) {				// Insert P element instead of BR				if (tinyMCE.selectedInstance._insertPara()) {					// Cancel event					e.preventDefault();					return false;				}			}			// Handle backspace			if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) {				// Insert P element instead of BR				if (tinyMCE.selectedInstance._handleBackSpace()) {					// Cancel event					e.preventDefault();					return false;				}			}			// Mozilla custom key handling			if (!tinyMCE.isMSIE && e.ctrlKey && tinyMCE.settings['custom_undo_redo']) {				if (e.charCode == 120 || e.charCode == 118) { // Ctrl+X, Ctrl+V					tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");					return;				}				if (tinyMCE.settings['custom_undo_redo_keyboard_shortcuts']) {					if (e.charCode == 122) { // Ctrl+Z						tinyMCE.selectedInstance.execCommand("Undo");						// Cancel event						e.preventDefault();						return false;					}					if (e.charCode == 121) { // Ctrl+Y						tinyMCE.selectedInstance.execCommand("Redo");						// Cancel event						e.preventDefault();						return false;					}				}				if (e.charCode == 98) { // Ctrl+B					tinyMCE.selectedInstance.execCommand("Bold");					// Cancel event					e.preventDefault();					return false;				}				if (e.charCode == 105) { // Ctrl+I					tinyMCE.selectedInstance.execCommand("Italic");					// Cancel event					e.preventDefault();					return false;				}				if (e.charCode == 117) { // Ctrl+U					tinyMCE.selectedInstance.execCommand("Underline");					// Cancel event					e.preventDefault();					return false;				}			}			if (tinyMCE.settings['custom_undo_redo']) {				// Check if it's a position key press				var keys = new Array(13,45,36,35,33,34,37,38,39,40);				var posKey = false;				for (var i=0; i<keys.length; i++) {					if (keys[i] == e.keyCode) {						tinyMCE.selectedInstance.typing = false;						posKey = true;						break;					}				}				// Add typing undo level				if (!tinyMCE.selectedInstance.typing && !posKey) {					tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");					tinyMCE.selectedInstance.typing = true;				}			}			//window.status = e.keyCode;			//window.status = e.type + " " + e.target.nodeName;			// Return key pressed			if (tinyMCE.isMSIE && tinyMCE.settings['force_br_newlines'] && e.keyCode == 13) {				if (e.target.editorId)					tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];				if (tinyMCE.selectedInstance) {					var sel = tinyMCE.selectedInstance.contentWindow.document.selection;					var rng = sel.createRange();					if (tinyMCE.getParentElement(rng.parentElement(), "li") != null)						return false;					// Cancel event					e.returnValue = false;					e.cancelBubble = true;					// Insert BR element					rng.pasteHTML("<br />");					rng.collapse(false);					rng.select();					tinyMCE.triggerNodeChange(false);					return false;				}			}			// Backspace or delete			if (e.keyCode == 8 || e.keyCode == 46) {				tinyMCE.selectedElement = e.target;				tinyMCE.linkElement = tinyMCE.getParentElement(e.target, "a");				tinyMCE.imgElement = tinyMCE.getParentElement(e.target, "img");				tinyMCE.triggerNodeChange(false);			}			return false;		break;		case "keyup":		case "keydown":			if (e.target.editorId)				tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];			else				return;			// Handle backspace			if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) {				// Insert P element instead of BR				if (tinyMCE.selectedInstance._handleBackSpace()) {					// Cancel event					e.preventDefault();					return false;				}			}			tinyMCE.selectedElement = null;			tinyMCE.selectedNode = null;			var elm = tinyMCE.selectedInstance.getFocusElement();			tinyMCE.linkElement = tinyMCE.getParentElement(elm, "a");			tinyMCE.imgElement = tinyMCE.getParentElement(elm, "img");			tinyMCE.selectedElement = elm;			// Update visualaids on tabs			if (tinyMCE.isGecko && e.type == "keyup" && e.keyCode == 9)				tinyMCE.handleVisualAid(tinyMCE.selectedInstance.contentWindow.document.body, true, tinyMCE.settings['visual']);			// Insert space instead of &nbsp;/*			if (e.type == "keydown" && e.keyCode == 32) {				if (tinyMCE.selectedInstance._insertSpace()) {					// Cancel event					e.returnValue = false;					e.cancelBubble = true;					return false;				}			}*/			// MSIE custom key handling			if (tinyMCE.isMSIE && tinyMCE.settings['custom_undo_redo']) {				// Check if it's a position key press				var keys = new Array(13,45,36,35,33,34,37,38,39,40);				var posKey = false;				for (var i=0; i<keys.length; i++) {					if (keys[i] == e.keyCode) {						tinyMCE.selectedInstance.typing = false;						posKey = true;						break;					}				}				// Add typing undo level (unless pos keys or shift, alt, ctrl, capslock)				if (!tinyMCE.selectedInstance.typing && !posKey && (e.keyCode < 16 || e.keyCode > 18 && e.keyCode != 255)) {					tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");					tinyMCE.selectedInstance.typing = true;					tinyMCE.triggerNodeChange(false);				}				if (posKey && e.type == "keyup")					tinyMCE.triggerNodeChange(false);				var ctrlKeys = new Array(66,73,85,86,88); // B/I/U/V/X				var keys = new Array(8,46); // Backspace,Delete				for (var i=0; i<keys.length; i++) {					if ((ctrlKeys[i] == e.keyCode && e.ctrlKey) || keys[i] == e.keyCode) {						tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");						tinyMCE.triggerNodeChange(false);						return true;					}				}				if (tinyMCE.settings['custom_undo_redo_keyboard_shortcuts']) {					if (e.keyCode == 90 && e.ctrlKey && e.type == "keydown") { // Ctrl+Z						tinyMCE.selectedInstance.execCommand("Undo");						tinyMCE.triggerNodeChange(false);						// Cancel event						e.returnValue = false;						e.cancelBubble = true;						return false;					}					if (e.keyCode == 89 && e.ctrlKey && e.type == "keydown") { // Ctrl+Y						tinyMCE.selectedInstance.execCommand("Redo");						tinyMCE.triggerNodeChange(false);						// Cancel event						e.returnValue = false;						e.cancelBubble = true;						return false;					}				}			}			// Check if it's a position key press			var keys = new Array(13,45,36,35,33,34,37,38,39,40);			var posKey = false;			for (var i=0; i<keys.length; i++) {				if (keys[i] == e.keyCode) {					posKey = true;					break;				}			}			// Trigger some nodechange on keyup			if (posKey && e.type == "keyup")				tinyMCE.triggerNodeChange(false);		break;		case "mousedown":		case "mouseup":		case "click":		case "focus":			// Check instance event trigged on			var targetBody = tinyMCE.getParentElement(e.target, "body");			for (var instanceName in tinyMCE.instances) {				var instance = tinyMCE.instances[instanceName];				// Reset design mode if lost (on everything just in case)				instance.autoResetDesignMode();				if (instance.contentWindow.document.body == targetBody) {					tinyMCE.selectedInstance = instance;					tinyMCE.selectedElement = e.target;					tinyMCE.linkElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "a");					tinyMCE.imgElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "img");					// Reset typing					tinyMCE.selectedInstance.typing = false;					break;				}			}			// Reset selected node			if (e.type != "focus")				tinyMCE.selectedNode = null;			tinyMCE.triggerNodeChange(false);			// Just in case			if (!tinyMCE.selectedInstance && e.target.editorId)				tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];			// Was it alt click on link			if (e.target.nodeName.toLowerCase() == "a" && e.type == "click" && e.altKey) {				var evalCode = "" + tinyMCE.cleanupEventStr(e.target.getAttribute("mce_onclick"));				// Remove any return too				eval(evalCode.replace('return false;', ''));			}			return false;		break;    } // end switch} // end function
meta: 5314	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5314/914f29b169169eaf678616905b5062afd73de30a/tiny_mce_src.js/buggy/www/extras/tinymce/jscripts/tiny_mce/tiny_mce_src.js