From f8dd9888f659f41aaf723e03e8bdaece2c9a40ae Mon Sep 17 00:00:00 2001 From: devjin Date: Mon, 5 Mar 2012 09:04:39 +0000 Subject: [PATCH] issue 671 added function of editor resize by contents height git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10316 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/editor/skins/xpresseditor/editor.html | 3 ++ .../skins/xpresseditor/js/Xpress_Editor.js | 38 +++++++++++++++ .../skins/xpresseditor/js/xe_interface.js | 4 +- .../skins/xpresseditor/js/xpresseditor.js | 42 ++++++++++++++++- .../skins/xpresseditor/js/xpresseditor.min.js | 46 ++++++++++--------- 5 files changed, 109 insertions(+), 24 deletions(-) diff --git a/modules/editor/skins/xpresseditor/editor.html b/modules/editor/skins/xpresseditor/editor.html index 7822738ff..9b94a3788 100644 --- a/modules/editor/skins/xpresseditor/editor.html +++ b/modules/editor/skins/xpresseditor/editor.html @@ -422,6 +422,9 @@
  • + diff --git a/modules/editor/skins/xpresseditor/js/Xpress_Editor.js b/modules/editor/skins/xpresseditor/js/Xpress_Editor.js index 9e5e2358b..edaa27491 100644 --- a/modules/editor/skins/xpresseditor/js/Xpress_Editor.js +++ b/modules/editor/skins/xpresseditor/js/Xpress_Editor.js @@ -5047,6 +5047,44 @@ xe.XE_EditingModeToggler = $.Class({ } } }); + +xe.XE_Editorresize = $.Class({ + name : "XE_Editorresize", + $init : function(elAppContainer, oWYSIWYGIFrame){ + this.inputArea = $('.xpress_xeditor_editing_area_container', elAppContainer).get(0); + this.oVerticalResizer = $('.xpress_xeditor_editingArea_verticalResizer', elAppContainer).get(0); + this.oCheckBox = $('#editorresize', elAppContainer).get(0); + this.oIframe = oWYSIWYGIFrame; + var self = this; + $(oWYSIWYGIFrame).load(function(){ + self.oIframeBody = $(oWYSIWYGIFrame).contents().find('body'); + }); + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.registerBrowserEvent(this.oCheckBox, 'change', 'XE_TOGGLE_EDITOR_RESIZE'); + }, + $ON_XE_TOGGLE_EDITOR_RESIZE : function(){ + if(this.oCheckBox.checked == true){ + if(this._prevHeight == undefined) + this._prevHeight = this.inputArea.style.height; + + this.oVerticalResizer.style.display = 'none'; + this.oApp.registerBrowserEvent(this.oIframeBody, 'keydown', 'XE_EDITOR_RESIZE'); + + this.inputArea.style.height = this.oIframe.style.height = this.oIframeBody[0].scrollHeight + 'px'; + }else{ + $(this.oIframeBody).unbind('keydown'); + + this.oVerticalResizer.style.display = 'block'; + this.inputArea.style.height = this._prevHeight; + this.oIframe.style.height = this._prevHeight; + } + }, + $ON_XE_EDITOR_RESIZE : function(){ + this.inputArea.style.height = this.oIframe.style.height = this.oIframeBody[0].scrollHeight + 'px'; + } +}); //} /** * @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message diff --git a/modules/editor/skins/xpresseditor/js/xe_interface.js b/modules/editor/skins/xpresseditor/js/xe_interface.js index 5dcf4a25b..e4aa341e0 100644 --- a/modules/editor/skins/xpresseditor/js/xe_interface.js +++ b/modules/editor/skins/xpresseditor/js/xe_interface.js @@ -101,7 +101,9 @@ function editorStart_xe(editor_sequence, primary_key, content_key, editor_height oEditor.registerPlugin(new xe.XE_EditingModeToggler(elAppContainer)); } - + if(jQuery("#editorresize").length) { + oEditor.registerPlugin(new xe.XE_Editorresize(elAppContainer, oWYSIWYGIFrame)); + } //oEditor.registerPlugin(new xe.XE_Preview(elAppContainer)); if (!jQuery.browser.msie && !jQuery.browser.opera) { diff --git a/modules/editor/skins/xpresseditor/js/xpresseditor.js b/modules/editor/skins/xpresseditor/js/xpresseditor.js index 1c5337cc7..dd502a6fa 100644 --- a/modules/editor/skins/xpresseditor/js/xpresseditor.js +++ b/modules/editor/skins/xpresseditor/js/xpresseditor.js @@ -5047,6 +5047,44 @@ xe.XE_EditingModeToggler = $.Class({ } } }); + +xe.XE_Editorresize = $.Class({ + name : "XE_Editorresize", + $init : function(elAppContainer, oWYSIWYGIFrame){ + this.inputArea = $('.xpress_xeditor_editing_area_container', elAppContainer).get(0); + this.oVerticalResizer = $('.xpress_xeditor_editingArea_verticalResizer', elAppContainer).get(0); + this.oCheckBox = $('#editorresize', elAppContainer).get(0); + this.oIframe = oWYSIWYGIFrame; + var self = this; + $(oWYSIWYGIFrame).load(function(){ + self.oIframeBody = $(oWYSIWYGIFrame).contents().find('body'); + }); + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.registerBrowserEvent(this.oCheckBox, 'change', 'XE_TOGGLE_EDITOR_RESIZE'); + }, + $ON_XE_TOGGLE_EDITOR_RESIZE : function(){ + if(this.oCheckBox.checked == true){ + if(this._prevHeight == undefined) + this._prevHeight = this.inputArea.style.height; + + this.oVerticalResizer.style.display = 'none'; + this.oApp.registerBrowserEvent(this.oIframeBody, 'keydown', 'XE_EDITOR_RESIZE'); + + this.inputArea.style.height = this.oIframe.style.height = this.oIframeBody[0].scrollHeight + 'px'; + }else{ + $(this.oIframeBody).unbind('keydown'); + + this.oVerticalResizer.style.display = 'block'; + this.inputArea.style.height = this._prevHeight; + this.oIframe.style.height = this._prevHeight; + } + }, + $ON_XE_EDITOR_RESIZE : function(){ + this.inputArea.style.height = this.oIframe.style.height = this.oIframeBody[0].scrollHeight + 'px'; + } +}); //} /** * @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message @@ -5867,7 +5905,9 @@ function editorStart_xe(editor_sequence, primary_key, content_key, editor_height oEditor.registerPlugin(new xe.XE_EditingModeToggler(elAppContainer)); } - + if(jQuery("#editorresize").length) { + oEditor.registerPlugin(new xe.XE_Editorresize(elAppContainer, oWYSIWYGIFrame)); + } //oEditor.registerPlugin(new xe.XE_Preview(elAppContainer)); if (!jQuery.browser.msie && !jQuery.browser.opera) { diff --git a/modules/editor/skins/xpresseditor/js/xpresseditor.min.js b/modules/editor/skins/xpresseditor/js/xpresseditor.min.js index fad98e862..e49d39c3b 100644 --- a/modules/editor/skins/xpresseditor/js/xpresseditor.min.js +++ b/modules/editor/skins/xpresseditor/js/xpresseditor.min.js @@ -1,5 +1,5 @@ -(function(c){function m(a){function b(a){return function(){return a.apply(this.$this,arguments)}}a=a.prototype;this.prototype.$super={};for(var d in a)a.propertyIsEnumerable(d)&&("undefined"==typeof this.prototype[d]&&(this.prototype[d]=a[d]),this.prototype.$super[d]=c.isFunction(a[d])?b(a[d]):a[d]);return this}c.extend({Class:function(a){function b(){"undefined"!=typeof this.$super&&(this.$super.$this=this);c.isFunction(this.$init)&&this.$init.apply(this,arguments)}b.prototype=a;b.constructor=b; -b.extend=m;return b},$:function(a){return"string"==typeof a?"<"==a.substring(0,1)?c(a).get(0):c("#"+a).get(0):a},fnBind:function(a,b){var d=c.makeArray(arguments);d.shift();d.shift();return function(){var e=d.concat(c.makeArray(arguments));return a.apply(b,e)}}});c.browser.nVersion=parseFloat(c.browser.version);"undefined"==typeof window.xe&&(window.xe={});xe.XpressCore=c.Class({name:"XpressCore",$init:function(a){a=!a?{}:c.Class({}).extend({oDebugger:null}).extend(a);a.oDebugger&&(this.oDebugger= +(function(c){function o(a){function b(a){return function(){return a.apply(this.$this,arguments)}}a=a.prototype;this.prototype.$super={};for(var d in a)a.propertyIsEnumerable(d)&&("undefined"==typeof this.prototype[d]&&(this.prototype[d]=a[d]),this.prototype.$super[d]=c.isFunction(a[d])?b(a[d]):a[d]);return this}c.extend({Class:function(a){function b(){"undefined"!=typeof this.$super&&(this.$super.$this=this);c.isFunction(this.$init)&&this.$init.apply(this,arguments)}b.prototype=a;b.constructor=b; +b.extend=o;return b},$:function(a){return"string"==typeof a?"<"==a.substring(0,1)?c(a).get(0):c("#"+a).get(0):a},fnBind:function(a,b){var d=c.makeArray(arguments);d.shift();d.shift();return function(){var e=d.concat(c.makeArray(arguments));return a.apply(b,e)}}});c.browser.nVersion=parseFloat(c.browser.version);"undefined"==typeof window.xe&&(window.xe={});xe.XpressCore=c.Class({name:"XpressCore",$init:function(a){a=!a?{}:c.Class({}).extend({oDebugger:null}).extend(a);a.oDebugger&&(this.oDebugger= a.oDebugger,this.oDebugger.oApp=this);this.commandQueue=[];this.oCommandMap={};this.oDisabledCommand={};this.aPlugins=[];this.appStatus=xe.APP_STATUS.NOT_READY;this.registerPlugin(this)},exec:function(a,b,d){if(this.appStatus==xe.APP_STATUS.NOT_READY)return this.commandQueue[this.commandQueue.length]={msg:a,args:b,event:d},!0;this.exec=this._exec;this.exec(a,b,d)},delayedExec:function(a,b,d,e){a=c.fnBind(this.exec,this,a,b,e);setTimeout(a,d)},_exec:function(a,b,d){return(this._exec=this.oDebugger? this._execWithDebugger:this._execWithoutDebugger).call(this,a,b,d)},_execWithDebugger:function(a,b,d){this.oDebugger.log_MessageStart(a,b);d=this._doExec(a,b,d);this.oDebugger.log_MessageEnd(a,b);return d},_execWithoutDebugger:function(a,b,d){return this._doExec(a,b,d)},_doExec:function(a,b,d){var e=!1;if(!this.oDisabledCommand[a]){var c=[];if(b&&b.length)for(var e=b.length,g=0;gd.length)return a;d=this._constructClonedTree(d, b);if(b=b.firstChild)for(var b=b.firstChild,e;b;)e=b.nextSibling,a.appendChild(b),b=e;d=this._splitTextEndNodes({oStartContainer:d.oStartContainer,iStartOffset:this.startOffset,oEndContainer:d.oEndContainer,iEndOffset:this.endOffset});d.oStartContainer&&d.oStartContainer.previousSibling&&xe.DOMFix.parentNode(d.oStartContainer).removeChild(d.oStartContainer.previousSibling);d.oEndContainer&&d.oEndContainer.nextSibling&&xe.DOMFix.parentNode(d.oEndContainer).removeChild(d.oEndContainer.nextSibling); -return a},_constructClonedTree:function(a,b){var d=null,e=null,c=this.startContainer,g=this.endContainer;_recurConstructClonedTree=function(a,b,j,o){if(0>b)return b;var j=b-1,n=a[b].cloneNode(!1);a[b]==c&&(d=n);for(a[b]==g&&(e=n);0<=j&&xe.DOMFix.parentNode(a[j])==a[b];)j=this._recurConstructClonedTree(a,j,a[b],n,d,e);o.insertBefore(n,o.firstChild);return j};a[a.length]=xe.DOMFix.parentNode(a[a.length-1]);_recurConstructClonedTree(a,a.length-1,a[a.length-1],b);return{oStartContainer:d,oEndContainer:e}}, +return a},_constructClonedTree:function(a,b){var d=null,e=null,c=this.startContainer,g=this.endContainer;_recurConstructClonedTree=function(a,b,j,n){if(0>b)return b;var j=b-1,m=a[b].cloneNode(!1);a[b]==c&&(d=m);for(a[b]==g&&(e=m);0<=j&&xe.DOMFix.parentNode(a[j])==a[b];)j=this._recurConstructClonedTree(a,j,a[b],m,d,e);n.insertBefore(m,n.firstChild);return j};a[a.length]=xe.DOMFix.parentNode(a[a.length-1]);_recurConstructClonedTree(a,a.length-1,a[a.length-1],b);return{oStartContainer:d,oEndContainer:e}}, cloneRange:function(){return this._copyRange(new xe.W3CDOMRange(this._document))},_copyRange:function(a){a.collapsed=this.collapsed;a.commonAncestorContainer=this.commonAncestorContainer;a.endContainer=this.endContainer;a.endOffset=this.endOffset;a.startContainer=this.startContainer;a.startOffset=this.startOffset;a._document=this._document;return a},collapse:function(a){a?(this.endContainer=this.startContainer,this.endOffset=this.startOffset):(this.startContainer=this.endContainer,this.startOffset= this.endOffset);this._updateRangeInfo()},compareBoundaryPoints:function(a,b){switch(a){case xe.W3CDOMRange.START_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,b.startContainer,b.startOffset);case xe.W3CDOMRange.START_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,b.startContainer,b.startOffset);case xe.W3CDOMRange.END_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,b.endContainer,b.endOffset);case xe.W3CDOMRange.END_TO_START:return this._compareEndPoint(this.startContainer, this.startOffset,b.endContainer,b.endOffset)}},_findBody:function(a){if(!a)return null;for(;a;){if("BODY"==a.tagName)return a;a=xe.DOMFix.parentNode(a)}return null},_compareEndPoint:function(a,b,d,e){if(!a||this._findBody(a)!=this._document.body)a=this._document.body,b=0;if(!d||this._findBody(d)!=this._document.body)d=this._document.body,e=0;var c=this._getCommonAncestorContainer(a,d);if(a!=c){for(;(oTmpNode=xe.DOMFix.parentNode(a))!=c;)a=oTmpNode;b=this._getPosIdx(a)+0.5}if(d!=c){for(;(oTmpNode= @@ -31,8 +31,8 @@ c.Class({setWindow:function(a){this._window=a;this._document=a.document},$init:f getStartNode:function(){return this.collapsed?3==this.startContainer.nodeType?0==this.startOffset||this.startContainer.nodeValue.length<=this.startOffset?null:this.startContainer:null:3==this.startContainer.nodeType?this.startOffset>=this.startContainer.nodeValue.length?this._getNextNode(this.startContainer):this.startContainer:this.startOffset>=xe.DOMFix.childNodes(this.startContainer).length?this._getNextNode(this.startContainer):xe.DOMFix.childNodes(this.startContainer)[this.startOffset]},getEndNode:function(){return this.collapsed? this.getStartNode():3==this.endContainer.nodeType?0==this.endOffset?this._getPrevNode(this.endContainer):this.endContainer:0==this.endOffset?this._getPrevNode(this.endContainer):xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]},getNodeAroundRange:function(a,b){if(this.collapsed&&this.startContainer&&3==this.startContainer.nodeType)return this.startContainer;if(!this.collapsed||this.startContainer&&3==this.startContainer.nodeType)return this.getStartNode();var d,e,c;e=this.startOffset>=xe.DOMFix.childNodes(this.startContainer).length? this._getNextNode(this.startContainer):xe.DOMFix.childNodes(this.startContainer)[this.startOffset];d=0==this.endOffset?this._getPrevNode(this.endContainer):xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1];a?(c=d,!c&&!b&&(c=e)):(c=e,!c&&!b&&(c=d));return c},_getXPath:function(a){for(var b="";a&&1==a.nodeType;)b="/"+a.tagName+"["+this._getPosIdx4XPath(a)+"]"+b,a=xe.DOMFix.parentNode(a);return b},_getPosIdx4XPath:function(a){for(var b=0,d=a.previousSibling;d;d=d.previousSibling)d.tagName==a.tagName&& -b++;return b},_evaluateXPath:function(a,b){for(var a=a.substring(1,a.length-1),d=a.split(/\//),e=b.body,c=2;c=b&&0<=a?!0:bIncludePartlyIncluded?1==d||-1==c?!1:!0:!1},isNodeInRange:function(a,b,d){var c=new xe.XpressRange(this._window);d&&a.firstChild?(c.setStartBefore(a.firstChild),c.setEndAfter(a.lastChild)):c.selectNode(a);return isRangeInRange(c,b)},pasteHTML:function(a){if(""==a)this.deleteContents();else{var b=this._document.createElement("DIV"); b.innerHTML=a;for(var a=b.firstChild,d=b.lastChild,c=this.cloneRange(),f=c.placeStringBookmark();b.lastChild;)this.insertNode(b.lastChild);this.setEndNodes(a,d);c.moveToBookmark(f);c.deleteContents();c.removeStringBookmark(f)}},toString:function(){this.toString=xe.W3CDOMRange.prototype.toString;return this.toString()},toHTMLString:function(){var a=this._document.createElement("DIV");a.appendChild(this.cloneContents());return a.innerHTML},findAncestorByTagName:function(a){for(var b=this.commonAncestorContainer;b&& b.tagName!=a;)b=xe.DOMFix.parentNode(b);return b},selectNodeContents:function(a){if(a){var b=a.firstChild?a.firstChild:a,a=a.lastChild?a.lastChild:a;3==b.nodeType?this.setStart(b,0):this.setStartBefore(b);3==a.nodeType?this.setEnd(a,a.nodeValue.length):this.setEndAfter(a)}},styleRange:function(a,b,d){d=this._getStyleParentNodes(d);if(!(1>d.length)){for(var e,f,g=0;gf.nodeValue.length&&f.nextSibling;)c-=f.nodeValue.length,f=f.nextSibling;b&&f.nextSibling&&3==f.nextSibling.nodeType&&c==f.nodeValue.length&&(c-=f.nodeValue.length,f=f.nextSibling);d=f}else d=a.parentElement(),c=h;return{oContainer:d,iOffset:c}}};xe.DOMFix=new (c.Class({$init:function(){c.browser.msie|| c.browser.opera?(this.childNodes=this._childNodes_Fix,this.parentNode=this._parentNode_Fix):(this.childNodes=this._childNodes_Native,this.parentNode=this._parentNode_Native)},_parentNode_Native:function(a){return a.parentNode},_parentNode_Fix:function(a){if(!a)return a;for(;a.previousSibling;)a=a.previousSibling;return a.parentNode},_childNodes_Native:function(a){return a.childNodes},_childNodes_Fix:function(a){var b=null,d=0;if(a){b=[];for(a=a.firstChild;a;)b[d++]=a,a=a.nextSibling}return b}})); @@ -116,7 +116,7 @@ $ON_CHECK_STYLE_CHANGE:function(){this._getStyle()},$ON_RESET_STYLE_STATUS:funct _assignHTMLObjects:function(a){this.elFontNameSelect=c("SELECT.xpress_xeditor_ui_fontName_select",a).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFontNameSelect,"change","SET_FONTNAME_FROM_SELECT_UI");this.elFontNameSelect.selectedIndex=0},$ON_MSG_STYLE_CHANGED:function(a,b){"fontFamily"==a&&(this.elFontNameSelect.value=b.toLowerCase(),0>this.elFontNameSelect.selectedIndex&&(this.elFontNameSelect.selectedIndex=0))},$ON_SET_FONTNAME_FROM_SELECT_UI:function(){var a=this.elFontNameSelect.value; a&&(this.oApp.exec("SET_WYSIWYG_STYLE",[{fontFamily:a}]),this.oApp.exec("CHECK_STYLE_CHANGE",[]))}});xe.XE_LineHeight=c.Class({name:"XE_LineHeight",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(){},$ON_SET_LINEHEIGHT:function(a){this.setLineHeight(a)},getLineHeight:function(){var a=this._getSelectedNodes(!1),b,d,e;if(0==a.length)return-1;var f=a.length;0==f?e=-1:(d=this._getLineWrapper(a[0]),e=this._getWrapperLineheight(d));var g=this.oSelection.getStartNode();if(0

    ":c.browser.firefox?"


    ":"

     

    ",b='',f=this.oColumnInput.value,g=0;g\n";e=this.oRowInput.value;a='';for(g=0;g
    "}});xe.XE_EditingModeToggler=c.Class({name:"XE_EditingModeToggler",$init:function(a){this._assignHTMLObjects(a)}, _assignHTMLObjects:function(a){a=c.$(a)||document;this.elModeToggleButton=c("BUTTON.xpress_xeditor_mode_toggle_button",a).get(0);this.welModeToggleButton=c(this.elModeToggleButton)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elModeToggleButton,"click","EVENT_TOGGLE_EDITING_MODE",[])},$ON_EVENT_TOGGLE_EDITING_MODE:function(){"WYSIWYG"==this.oApp.getEditingMode()?this.oApp.exec("CHANGE_EDITING_MODE",["HTMLSrc"]):this.oApp.exec("CHANGE_EDITING_MODE",["WYSIWYG"])},$ON_CHANGE_EDITING_MODE:function(a){"HTMLSrc"== -a?(this.welModeToggleButton.addClass("active").parent("span").addClass("active"),this.oApp.exec("DISABLE_ALL_UI",[])):(this.welModeToggleButton.removeClass("active").parent("span").removeClass("active"),this.oApp.exec("ENABLE_ALL_UI",[]))}});xe.XpressCore.oMessageMap={"XE_EditingAreaManager.onExit":"%uB0B4%uC6A9%uC774%20%uBCC0%uACBD%uB418%uC5C8%uC2B5%uB2C8%uB2E4.","XE_FontColor.invalidColorCode":"%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff", +a?(this.welModeToggleButton.addClass("active").parent("span").addClass("active"),this.oApp.exec("DISABLE_ALL_UI",[])):(this.welModeToggleButton.removeClass("active").parent("span").removeClass("active"),this.oApp.exec("ENABLE_ALL_UI",[]))}});xe.XE_Editorresize=c.Class({name:"XE_Editorresize",$init:function(a,b){this.inputArea=c(".xpress_xeditor_editing_area_container",a).get(0);this.oVerticalResizer=c(".xpress_xeditor_editingArea_verticalResizer",a).get(0);this.oCheckBox=c("#editorresize",a).get(0); +this.oIframe=b;var d=this;c(b).load(function(){d.oIframeBody=c(b).contents().find("body")})},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.oCheckBox,"change","XE_TOGGLE_EDITOR_RESIZE")},$ON_XE_TOGGLE_EDITOR_RESIZE:function(){!0==this.oCheckBox.checked?(void 0==this._prevHeight&&(this._prevHeight=this.inputArea.style.height),this.oVerticalResizer.style.display="none",this.oApp.registerBrowserEvent(this.oIframeBody,"keydown","XE_EDITOR_RESIZE"),this.inputArea.style.height=this.oIframe.style.height= +this.oIframeBody[0].scrollHeight+"px"):(c(this.oIframeBody).unbind("keydown"),this.oVerticalResizer.style.display="block",this.inputArea.style.height=this._prevHeight,this.oIframe.style.height=this._prevHeight)},$ON_XE_EDITOR_RESIZE:function(){this.inputArea.style.height=this.oIframe.style.height=this.oIframeBody[0].scrollHeight+"px"}});xe.XpressCore.oMessageMap={"XE_EditingAreaManager.onExit":"%uB0B4%uC6A9%uC774%20%uBCC0%uACBD%uB418%uC5C8%uC2B5%uB2C8%uB2E4.","XE_FontColor.invalidColorCode":"%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff", "XE_BGColor.invalidColorCode":"%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff","XE_Hyperlink.invalidURL":"%uC785%uB825%uD558%uC2E0%20URL%uC774%20%uC62C%uBC14%uB974%uC9C0%20%uC54A%uC2B5%uB2C8%uB2E4."};regex_handler=/<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig;regex_font_color=/color\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i; regex_font_face=/face\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i;regex_font_size=/size\s*=(?:\s*"(\d+)"|\s*'(\d+)'|(\d+))/i;regex_style=/style\s*=\s*(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i;regex_font_weight=/font-weight\s*:\s*([a-z]+);?/i;regex_font_style=/font-style\s*:\s*italic;?/i;regex_font_decoration=/text-decoration\s*:\s*([a-z -]+);?/i;regex_jquery=/jQuery\d+\s*=(\s*"\d+"|\d+)/ig;regex_quote_attr=/([\w-]+\s*=(?:\s*"[^"]+"|\s*'[^']+'))|([\w-]+)=([^\s]+)/g;var p="area,br,col,embed,hr,img,input,param".split(","); xe.XE_XHTMLFormatter=c.Class({name:"XE_XHTMLFormatter",$ON_MSG_APP_READY:function(){this.oApp.addConverter("WYSIWYG_TO_IR",this.TO_IR);this.oApp.addConverter("HTMLSrc_TO_IR",this.TO_IR);this.oApp.addConverter("IR_TO_HTMLSrc",this.IR_TO);this.oApp.addConverter("IR_TO_WYSIWYG",this.IR_TO)},TO_IR:function(a){var b=[];c.browser.msie&&(a=a.replace(regex_jquery,""),a=a.replace(/<(\w+) ([^>]+)>/g,function(a,b,c){return"<"+b+" "+c.replace(regex_quote_attr,function(a,b,c,d){return b?b:/^"/.test(d)||/"$/.test(d)? @@ -182,26 +184,26 @@ $ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFormatSelect, a.toLowerCase()&&(this.elFormatSelect.selectedIndex=0)},$ON_SET_FORMAT_FROM_SELECT_UI:function(){var a=this.elFormatSelect.value;a&&(c.browser.msie&&(a="<"+a+">"),this.oApp.exec("EXECCOMMAND",["FormatBlock",!1,a]),this.oApp.exec("CHECK_STYLE_CHANGE",[]))}});xe.XE_Table=c.Class({_startSel:null,_endSel:null,$ON_MSG_APP_READY:function(){this._doc=c(this.oApp.getWYSIWYGDocument());this.$FnMouseDown=c.fnBind(this._mousedown,this);this.$FnMouseUp=c.fnBind(this._mouseup,this);this.$FnMouseMove=c.fnBind(this._mousemove, this);this._doc.mousedown(this.$FnMouseDown);this._endSel=this._startSel=null;this.oApp.exec("REGISTER_UI_EVENT",["merge_cells","click","MERGE_CELLS"]);this.oApp.exec("REGISTER_UI_EVENT",["split_col","click","CELL_SPLIT_BY_COL"]);this.oApp.exec("REGISTER_UI_EVENT",["split_row","click","CELL_SPLIT_BY_ROW"]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+alt+m","MERGE_CELLS"]);this.$super.$ON_MSG_APP_READY()},$ON_MERGE_CELLS:function(){var a="",b=c(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"), d=this;if(b.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Merge"]);b.each(function(){a+=c(this).html()}).eq(0).html(a);var e=0;b.eq(0).nextAll("td,th").andSelf().filter(".xe_selected_cell").each(function(){e+=d._getSpan(this,"col")});this._getRect(b.eq(0));var f=b.eq(0).parent("tr"),g=b.eq(b.length-1).parent("tr"),h=b.parents("table").eq(0).find("tr"),f=h.index(g.get(0))-h.index(f.get(0))+this._getSpan(b.eq(b.length-1),"row");b.eq(0).attr("colSpan",e).attr("rowSpan",f);b.slice(1).remove()}}, -$ON_CELL_SPLIT_BY_ROW:function(){var a=c(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),b=a.parents("table").eq(0),d=this;if(a.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Row"]);var e=this._getRect(a.eq(0)).top,f=this._getRect(a.eq(a.length-1)).bottom;(a=b.find("td,th").filter(function(){var a=d._getRect(c(this));return!(a.bottom<=e||a.top>=f)})).filter(".xe_selected_cell").each(function(){var b=c(this),e=b.parent("tr"),f=d._getSpan(b,"row"),j=d._getRect(b),l= -[],n=b.clone().html("
    "),m=1,p=1;1=j.bottom?!1:!0}).each(function(){var a=c(this),b=d._getSpan(a,"row")+1;l.push(function(){a.attr("rowSpan",b)})}),c.browser.msie?e.after(e.clone().empty().get(0).outerHTML):e.after(e.clone().empty()));f=e.nextAll("tr");f.length?(e=f.eq(m-1).children("td,th").filter(function(){return d._getRect(c(this)).left> -j.left}),c.browser.msie?e.length?e.eq(0).before(n.get(0).outerHTML):f.eq(m-1).append(n.get(0).outerHTML):e.length?e.slice(0,1).before(n):f.slice(m-1,1).append(n)):e.after(e.clone().empty().append(n));c.each(l,function(){this()})})}},$ON_CELL_SPLIT_BY_COL:function(){var a=c(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),b=a.parents("table").slice(0,1),d=this;(new Date).getTime();if(a.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Column"]);var e=a.eq(0).parent("tr"), -f=this._getRect(e.find(".xe_selected_cell:first")).left,g=this._getRect(e.find(".xe_selected_cell:last")).right;(a=b.find("td,th").filter(function(){var a=d._getRect(c(this));return!(a.right<=f||a.left>=g)})).filter(".xe_selected_cell").each(function(){var b=c(this),e=d._getSpan(b,"col"),f=b.clone().html("
    ");if(1=n.right?!1:!0}).each(function(){var a=c(this);a.attr("colSpan",d._getSpan(a,"col")+1)});f.attr("colSpan",1)}c.browser.msie?b.after(f.get(0).outerHTML):b.after(f)})}},$ON_CHECK_STYLE_CHANGE:function(){var a=this.oApp,b=this._startSel&&this._startSel.is(".xe_selected_cell")?"ENABLE_UI":"DISABLE_UI";c.each(["merge_cells","split_col","split_row"],function(){a.exec(b,[this])})},_mousedown:function(a){var b=c(a.target).parents().andSelf().filter("td,th,table"),d=this.oApp,e=this;c("td.xe_selected_cell", +$ON_CELL_SPLIT_BY_ROW:function(){var a=c(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),b=a.parents("table").eq(0),d=this;if(a.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Row"]);var e=this._getRect(a.eq(0)).top,f=this._getRect(a.eq(a.length-1)).bottom;(a=b.find("td,th").filter(function(){var a=d._getRect(c(this));return!(a.bottom<=e||a.top>=f)})).filter(".xe_selected_cell").each(function(){var b=c(this),e=b.parent("tr"),f=d._getSpan(b,"row"),j=d._getRect(b),n= +[],m=b.clone().html("
    "),l=1,o=1;1=j.bottom?!1:!0}).each(function(){var a=c(this),b=d._getSpan(a,"row")+1;n.push(function(){a.attr("rowSpan",b)})}),c.browser.msie?e.after(e.clone().empty().get(0).outerHTML):e.after(e.clone().empty()));f=e.nextAll("tr");f.length?(e=f.eq(l-1).children("td,th").filter(function(){return d._getRect(c(this)).left> +j.left}),c.browser.msie?e.length?e.eq(0).before(m.get(0).outerHTML):f.eq(l-1).append(m.get(0).outerHTML):e.length?e.slice(0,1).before(m):f.slice(l-1,1).append(m)):e.after(e.clone().empty().append(m));c.each(n,function(){this()})})}},$ON_CELL_SPLIT_BY_COL:function(){var a=c(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),b=a.parents("table").slice(0,1),d=this;(new Date).getTime();if(a.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Column"]);var e=a.eq(0).parent("tr"), +f=this._getRect(e.find(".xe_selected_cell:first")).left,g=this._getRect(e.find(".xe_selected_cell:last")).right;(a=b.find("td,th").filter(function(){var a=d._getRect(c(this));return!(a.right<=f||a.left>=g)})).filter(".xe_selected_cell").each(function(){var b=c(this),e=d._getSpan(b,"col"),f=b.clone().html("
    ");if(1=m.right?!1:!0}).each(function(){var a=c(this);a.attr("colSpan",d._getSpan(a,"col")+1)});f.attr("colSpan",1)}c.browser.msie?b.after(f.get(0).outerHTML):b.after(f)})}},$ON_CHECK_STYLE_CHANGE:function(){var a=this.oApp,b=this._startSel&&this._startSel.is(".xe_selected_cell")?"ENABLE_UI":"DISABLE_UI";c.each(["merge_cells","split_col","split_row"],function(){a.exec(b,[this])})},_mousedown:function(a){var b=c(a.target).parents().andSelf().filter("td,th,table"),d=this.oApp,e=this;c("td.xe_selected_cell", this.oApp.getWYSIWYGDocument()).removeClass("xe_selected_cell");this._endSel=this._startSel=null;b.length&&this._isLeftClicked(a.button)&&setTimeout(function(){b=d.getSelection().cloneRange();b.collapseToStart();b=c(b.startContainer).parents().andSelf().filter("td,th").eq(0);if(!b.length)return e._removeAllListener()||!0;e._getRect(e._startSel=b);e._doc.bind("mousemove",e.$FnMouseMove);e._doc.bind("mouseup",e.$FnMouseUp)},0)},_mouseup:function(){this._removeAllListener();this._startSel=this._endSel= null},_mousemove:function(a){var b=c(a.target).parents().andSelf().filter("td,th").eq(0),d=this;if(!(!b.length||!this._isLeftClicked(a.button)||!this._endSel&&b.get(0)==this._startSel.get(0))&&!(this._endSel&&b.get(0)==this._endSel.get(0))){this._getRect(this._endSel=b);var e=Math.min(this._startSel.rect.top,this._endSel.rect.top),f=Math.min(this._startSel.rect.left,this._endSel.rect.left),g=Math.max(this._startSel.rect.bottom,this._endSel.rect.bottom),h=Math.max(this._startSel.rect.right,this._endSel.rect.right), a=b.parents("table").find("td,th").removeClass("xe_selected_cell"),b=c();do b.each(function(){var a=d._getRect(c(this));a.right>h&&(h=a.right);a.leftg&&(g=a.bottom)}),a=a.filter(":not(.xe_selected_cell)"),b=a.filter(function(){var a=d._getRect(c(this));return a.right<=f||a.left>=h||a.bottom<=e||a.top>=g?!1:!0}).addClass("xe_selected_cell");while(b.length);c.browser.mozilla||setTimeout(function(){var a=d.oApp.getSelection();d._startSel&&(d._startSel.get(0).firstChild|| d._startSel.text(" "),a.selectNode(d._startSel.get(0).firstChild),a.collapseToStart(),a.select())},0);return!1}},_removeAllListener:function(){this._doc.unbind("mousemove",this.$FnMouseMove);this._doc.unbind("mouseup",this.$FnMouseUp)},_isLeftClicked:function(a){return c.browser.msie?!!(a&1):0==a},_getRect:function(a){var b=a.get(0);a.rect={};a.rect.top=b.offsetTop;a.rect.left=b.offsetLeft;a.rect.bottom=a.rect.top+b.offsetHeight;a.rect.right=a.rect.left+b.offsetWidth;return a.rect},_getSpan:function(a, b){var d=parseInt(c(a).attr(b+"span"));return isNaN(d)?1:d}}).extend(xe.XE_Table)})(jQuery);window.xe||(xe={});xe.Editors=[]; -function editorStart_xe(c,m,l,p,a,b,d,e){function f(){try{var a=o.contentWindow.document;if("about:blank"==a.location)throw"blank";j.registerPlugin(new xe.XE_EditingArea_WYSIWYG(o));j.registerPlugin(new xe.XpressRangeManager(o));j.registerPlugin(new xe.XE_ExecCommand(o));d&&!a.body.style.fontFamily&&(a.body.style.fontFamily=d);e&&!a.body.style.fontSize&&(a.body.style.fontSize=e);j.run()}catch(b){setTimeout(f,0)}}"undefined"==typeof a&&(a="white");"undefined"==typeof b&&(b="xeStyle");"undefined"== +function editorStart_xe(c,o,l,p,a,b,d,e){function f(){try{var a=n.contentWindow.document;if("about:blank"==a.location)throw"blank";j.registerPlugin(new xe.XE_EditingArea_WYSIWYG(n));j.registerPlugin(new xe.XpressRangeManager(n));j.registerPlugin(new xe.XE_ExecCommand(n));d&&!a.body.style.fontFamily&&(a.body.style.fontFamily=d);e&&!a.body.style.fontSize&&(a.body.style.fontSize=e);j.run()}catch(b){setTimeout(f,0)}}"undefined"==typeof a&&(a="white");"undefined"==typeof b&&(b="xeStyle");"undefined"== typeof d&&(d="");"undefined"==typeof e&&(e="");var g=request_uri+"modules/editor/styles/"+b+"/editor.html",b=jQuery("#xpress-editor-"+c),g=jQuery('