function editorGetTextArea(a){return jQuery("#editor_textarea_"+a)[0]}function editorGetPreviewArea(a){return jQuery("#editor_preview_"+a)[0]}function editorGetForm(a){var b=editorGetIFrame(a);if(b){for(var c=b.parentNode;"FORM"!=c.nodeName;)c=c.parentNode;return"FORM"==c.nodeName?c:void 0}}function editorGetContent_xe(a){var b="";if("html"==editorMode[a]){var c=editorGetTextArea(a);if(!c)return"";b=c.value}else{var d=editorGetIFrame(a);if(!d)return"";b=jQuery(d.contentWindow.document.body).html().replace(/^
]*)>$/i,"")}return b}function editorGetSelectedNode(a){var b,c,d=editorGetIFrame(a);return b=d.contentWindow,b.document.selection?(c=b.document.selection.createRange(),jQuery("
",b.target),xPreventDefault(a),xStopPropagation(a);break;case 13:if(xIE4Up){if("On"!=b.target.parentElement.document.designMode)return;return c=b.target.parentElement.document.selection.createRange(),c.pasteHTML("
"),c.select(),a.cancelBubble=!0,void(a.returnValue=!1)}break;case 98:editorDo("Bold",null,b.target),xPreventDefault(a),xStopPropagation(a);break;case 105:editorDo("Italic",null,b.target),xPreventDefault(a),xStopPropagation(a);break;case 117:editorDo("Underline",null,b.target),xPreventDefault(a),xStopPropagation(a);break;case 100:editorDo("RemoveFormat",null,b.target),xPreventDefault(a),xStopPropagation(a)}}}}}function editorDo(a,b,c){var d=null;if("object"==typeof c)d=xIE4Up?c.parentElement.document:c.parentNode;else{var e=editorGetIFrame(c);d=e.contentWindow.document}var f=d.body.getAttribute("editor_sequence");editorMode[f]||("object"==typeof c?c.focus():editorFocus(c),d.execCommand(a,!1,b),"object"==typeof c?c.focus():editorFocus(c))}function editorChangeFontName(a,b){var c=a.options[a.selectedIndex].value;c&&(editorDo("FontName",c,b),a.selectedIndex=0)}function editorChangeFontSize(a,b){var c=a.options[a.selectedIndex].value;c&&(editorDo("FontSize",c,b),a.selectedIndex=0)}function editorUnDo(a,b){editorDo("undo","",b),a.selectedIndex=0}function editorReDo(a,b){editorDo("redo","",b),a.selectedIndex=0}function editorChangeHeader(a,b){var c=a.options[a.selectedIndex].value;c&&(c="<"+c+">",editorDo("formatblock",c,b),a.selectedIndex=0)}function editorChangeMode(a,b){if("html"==a||""==a){var c=new Date;c.setTime(c.getTime()+6048e8),xSetCookie("editor_mode",a,c)}var d=editorGetIFrame(b);if(d){var e=editorGetTextArea(b),f=editorGetPreviewArea(b),g=d.contentWindow.document,h=null;if("html"==editorMode[b]?(h=e.value,g.body.innerHTML=e.value):"preview"==editorMode[b]?(h=e.value,f.contentWindow.document.body.innerHTML=""):(h=g.body.innerHTML,e.value=h,h=h.replace(/
/gi,"
\n"),h=h.replace(/
\n\n/gi,"
\n")),"html"==a&&e)f.style.display="none",xGetElementById("fileUploader_"+b)&&(xGetElementById("fileUploader_"+b).style.display="block"),e.value=h,xWidth(e,xWidth(d.parentNode)),xHeight(e,xHeight(d.parentNode)),editorMode[b]="html",xGetElementById("xeEditor_"+b)&&(xGetElementById("xeEditor_"+b).className="xeEditor html",xGetElementById("use_rich_"+b).className="",xGetElementById("preview_html_"+b).className="",xGetElementById("use_html_"+b).className="active");else if("preview"==a&&f){f.style.display="",xGetElementById("fileUploader_"+b)&&(xGetElementById("fileUploader_"+b).style.display="none");var i=xGetElementById("preview_form");i||(i=xCreateElement("form"),i.id="preview_form",i.method="post",i.action=request_uri,i.target="editor_preview_"+b,xInnerHtml(i,''),document.body.appendChild(i)),i.content.value=h,i.submit(),xWidth(f,xWidth(d.parentNode)),editorMode[b]="preview",xGetElementById("xeEditor_"+b)&&(xGetElementById("xeEditor_"+b).className="xeEditor preview",xGetElementById("use_rich_"+b).className="",xGetElementById("preview_html_"+b).className="active",xGetElementById("use_html_"+b)&&(xGetElementById("use_html_"+b).className=""))}else f.style.display="none",xGetElementById("fileUploader_"+b)&&(xGetElementById("fileUploader_"+b).style.display="block"),g.body.innerHTML=h,editorMode[b]=null,xGetElementById("xeEditor_"+b)&&(xGetElementById("xeEditor_"+b).className="xeEditor rich",xGetElementById("use_rich_"+b).className="active",xGetElementById("preview_html_"+b).className="",xGetElementById("use_html_"+b)&&(xGetElementById("use_html_"+b).className=""))}}function closeEditorInfo(a){xGetElementById("editorInfo_"+a).style.display="none";var b=new Date;b.setTime(b.getTime()+6048e8),xSetCookie("EditorInfo","1",b)}function showEditorHelp(a,b){jQuery("#helpList_"+b).toggleClass("open")}function showEditorExtension(a,b){var c="#editorExtension_"+b,d=new xEvent(a);jQuery(c).hasClass("extension2")?(jQuery(c).addClass("open"),d.pageX<=xWidth("editor_component_"+b)?jQuery("#editor_component_"+b).css("right","auto").css("left",0):jQuery("#editor_component_"+b).css("right",0).css("left","auto")):jQuery(c).attr("class","extension2")}function showPreviewContent(a){if("undefined"!=typeof a&&"undefined"!=typeof _editorFontColor[a]){var b=editorGetPreviewArea(a);b.contentWindow.document.body.style.color=_editorFontColor[a]}}function setPreviewHeight(a){var b=xGetElementById("editor_preview_"+a).contentWindow.document.body.scrollHeight;400>b&&(b=400),xHeight("editor_preview_"+a,b+20)}function getAutoSavedSrl(a){var b=a.editor_sequence,c=a.key,d=editorGetForm(b);d[c].value=a.document_srl,uploadSettingObj[b]&&editorUploadInit(uploadSettingObj[b],!0)}var _editorFontColor=[];
//# sourceMappingURL=editor.min.map