case "mceImage": var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "", halign = ""; var title = "", onmouseover = "", onmouseout = "", action = "insert"; var img = tinyMCE.imgElement; var inst = tinyMCE.getInstanceById(editor_id);  if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") { img = tinyMCE.selectedElement; tinyMCE.imgElement = img; var parent = tinyMCE.selectedElement.parentNode; var parentClassName = parent.className; if (parent.nodeName.toLowerCase() == "div") { halign = parentClassName.substring(3, parentClassName.length); } }  if (img) {  if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0) return true;  src = tinyMCE.getAttrib(img, 'src'); alt = tinyMCE.getAttrib(img, 'alt');   if (alt == "") alt = tinyMCE.getAttrib(img, 'title');   if (tinyMCE.isGecko) { var w = img.style.width; if (w != null && w != "") img.setAttribute("width", w);  var h = img.style.height; if (h != null && h != "") img.setAttribute("height", h); }  border = tinyMCE.getAttrib(img, 'border'); hspace = tinyMCE.getAttrib(img, 'hspace'); vspace = tinyMCE.getAttrib(img, 'vspace'); width = tinyMCE.getAttrib(img, 'width'); height = tinyMCE.getAttrib(img, 'height'); align = tinyMCE.getAttrib(img, 'align');  onmouseover = tinyMCE.getAttrib(img, 'onmouseover'); onmouseout = tinyMCE.getAttrib(img, 'onmouseout'); title = tinyMCE.getAttrib(img, 'title');   if (tinyMCE.isMSIE) { width = img.attributes['width'].specified ? width : ""; height = img.attributes['height'].specified ? height : ""; }  src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");  src = src.substring(src.lastIndexOf("/") + 1, src.length);   mceRealSrc = tinyMCE.getAttrib(img, 'mce_src'); if (mceRealSrc != "") { src = mceRealSrc;  if (tinyMCE.getParam('convert_urls')) src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);"); src = src.substring(src.lastIndexOf("/") + 1, src.length); }  action = "update"; }  var template = new Array();  template['file'] = 'image.htm'; template['width'] = 550; template['height'] = 400 + (tinyMCE.isMSIE ? 25 : 0);  if (inst.settings['insertimage_callback']) { var returnVal = eval(inst.settings['insertimage_callback'] + "(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);"); if (returnVal && returnVal['src']) TinyMCE_WikieditorTheme.insertImage(returnVal['src'], returnVal['width'], returnVal['height'], returnVal['align']); } else { tinyMCE.openWindow(template, {editor_id : editor_id, scrollbars : 'yes', resizable : 'no', mce_windowresize: false, src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align, halign : halign, title : title, onmouseover : onmouseover, onmouseout : onmouseout, action : action, inline : "yes"}); }  return true;  case "wikiAttachment": var href = "", action = "insert"; var template = new Array();  template['file'] = 'attachment.htm'; template['width'] = 550; template['height'] = 400 + (tinyMCE.isMSIE ? 25 : 0);  tinyMCE.openWindow(template, {editor_id : editor_id, href : href, action : action, inline : "yes", scrollbars : 'yes',  resizable : 'no', mce_windowresize: false});  return true;  case "wikiMacro": var template = new Array();  template['file'] = 'macro.htm'; template['width'] = 520; template['height'] = 300;  tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "insert", scrollbars : 'yes',  resizable : 'no', mce_windowresize: false});  return true;  
    execCommand : function(editor_id, element, command, user_interface, value) {        switch (command) {            case "mceLink":                var inst = tinyMCE.getInstanceById(editor_id);				var doc = inst.getDoc();				var selectedText = "";				if (tinyMCE.isMSIE) {					var rng = doc.selection.createRange();					selectedText = rng.text;				} else					selectedText = inst.getSel().toString();				if (!tinyMCE.linkElement) {					if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0))						return true;				}				var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";                var text = "";                if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length > 0))                    text = selectedText;                if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")					tinyMCE.linkElement = tinyMCE.selectedElement;				// Is anchor not a link				if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")					tinyMCE.linkElement = null;				if (tinyMCE.linkElement) {                    if (tinyMCE.isMSIE) {				    	text = tinyMCE.linkElement.innerHTML;				    } else                        text = tinyMCE.linkElement.text;                                        href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href');                    target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target');					title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title');					onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');					style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');					// Try old onclick to if copy/pasted content					if (onclick == "")						onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');					onclick = tinyMCE.cleanupEventStr(onclick);					href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");					// Use mce_href if defined					mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');					if (mceRealHref != "") {						href = mceRealHref;						if (tinyMCE.getParam('convert_urls'))							href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");					}					action = "update";				}                var template = new Array();				template['file'] = 'link.htm';				template['width'] = 600;				if (tinyMCE.isMSIE) {                    template['height'] = 550;                } else {                    template['height'] = 530;                }                // Language specific width and height addons				template['width'] += tinyMCE.getLang('lang_insert_link_delta_width', 0);				template['height'] += tinyMCE.getLang('lang_insert_link_delta_height', 0);				if (inst.settings['insertlink_callback']) {					var returnVal = eval(inst.settings['insertlink_callback'] + "(href, target, title, onclick, action, style_class);");					if (returnVal && returnVal['href'])						TinyMCE_WikieditorTheme._insertLink(returnVal['href'], returnVal['target'], returnVal['title'], returnVal['onclick'], returnVal['style_class']);				} else {					tinyMCE.openWindow(template, {editor_id : editor_id, action : action, text : text, href : href, target : target, title : title, onclick : onclick, action : action, className : style_class, inline : "yes", scrollbars : 'yes',  resizable : 'no', mce_windowresize: false});				}				return true;            case "mceForeColor":                var template = new Array();                var elm = tinyMCE.selectedInstance.getFocusElement();                var inputColor = tinyMCE.getAttrib(elm, "color");                if (inputColor == '')                    inputColor = elm.style.color;                if (!inputColor)                    inputColor = "#000000";                template['file'] = 'color_picker.htm';                template['width'] = 220;                template['height'] = 190;                tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "forecolor", input_color : inputColor});                return true;            case "mceBackColor":				var template = new Array();				var elm = tinyMCE.selectedInstance.getFocusElement();				var inputColor = elm.style.backgroundColor;				if (!inputColor)					inputColor = "#000000";				template['file'] = 'color_picker.htm';				template['width'] = 220;				template['height'] = 190;				template['width'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width', 0);				template['height'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height', 0);				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "HiliteColor", input_color : inputColor});				//mceBackColor			    return true;            default :                return wikiEditor.execCommand(editor_id, element, command, user_interface, value);        }    },
6184	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/6184/168567720c31d5b15b0ea97b6155cc1929b2b8e5/editor_template.js/buggy/xwiki-platform-web/standard/src/main/webapp/tiny_mce/themes/wikieditor/editor_template.js