/* Copyright (C) NAVER corp. Licensed under LGPL v2. @see https://github.com/naver/smarteditor2/blob/master/LICENSE.md */ function fontProperty(e,t,i,n,o){this.fontId=e,this.fontName=t,this.defaultSize=i,this.fontURL=n,this.fontCSSURL=o,this.displayName=t,this.isLoaded=!0,this.fontFamily=this.fontId,""!=this.fontCSSURL?(this.displayName+=""+i,this.fontFamily+="_"+i,this.isLoaded=!1,this.loadCSS=function(e){this.isLoaded||(this._importCSS(e),this.isLoaded=!0)},this.loadCSSToMenu=function(){this._importCSS(document)},this._importCSS=function(e){var t=e.styleSheets.length,i=e.styleSheets[t-1];(0===t||i.imports.length>30)&&(i=e.createElement("style"),e.documentElement.firstChild.appendChild(i),i=i.sheet||i.styleSheet),i.addImport(this.fontCSSURL)}):(this.loadCSS=function(){},this.loadCSSToMenu=function(){}),this.toStruct=function(){return{fontId:this.fontId,fontName:this.fontName,defaultSize:this.defaultSize,fontURL:this.fontURL,fontCSSURL:this.fontCSSURL}}}function Shortcut(e,t){var e=e.replace(/\s+/g,""),i=Shortcut.Store,n=Shortcut.Action;if("undefined"==typeof t&&e.constructor==String)return i.set("document",e,document),n.init(i.get("document"),e);if(t.constructor==String&&e.constructor==String)return i.set(t,e,jindo.$(t)),n.init(i.get(t),e);if(t.constructor!=String&&e.constructor==String){var o="nonID"+(new Date).getTime();return o=Shortcut.Store.searchId(o,t),i.set(o,e,t),n.init(i.get(o),e)}alert(t+"는 반드시 string이거나 없어야 됩니다.")}"undefined"==typeof window.nhn&&(window.nhn={}),nhn.husky||(nhn.husky={}),function(){var e=/^\$(LOCAL|BEFORE|ON|AFTER)_/,t=/^\$(BEFORE|ON|AFTER)_MSG_APP_READY$/,i=[],n={};nhn.husky.HuskyCore=jindo.$Class({name:"HuskyCore",aCallerStack:null,bMobile:jindo.$Agent().navigator().mobile||jindo.$Agent().navigator().msafari,$init:function(e){this.htOptions=e||{},i.push(this),this.htOptions.oDebugger&&(nhn.husky.HuskyCore.getCore=function(){return i},this.htOptions.oDebugger.setApp(this)),this.messageQueue=[],this.oMessageMap={},this.oDisabledMessage={},this.oLazyMessage={},this.aPlugins=[],this.appStatus=nhn.husky.APP_STATUS.NOT_READY,this.aCallerStack=[],this._fnWaitForPluginReady=jindo.$Fn(this._waitForPluginReady,this).bind(),this.registerPlugin(this)},setDebugger:function(e){this.htOptions.oDebugger=e,e.setApp(this)},exec:function(e,t,i){return this.appStatus==nhn.husky.APP_STATUS.NOT_READY?(this.messageQueue[this.messageQueue.length]={msg:e,args:t,event:i},!0):(this.exec=this._exec,void this.exec(e,t,i))},delayedExec:function(e,t,i,n){var o=jindo.$Fn(this.exec,this).bind(e,t,n);setTimeout(o,i)},_exec:function(e,t,i){return(this._exec=this.htOptions.oDebugger?this._execWithDebugger:this._execWithoutDebugger).call(this,e,t,i)},_execWithDebugger:function(e,t,i){this.htOptions.oDebugger.log_MessageStart(e,t);var n=this._doExec(e,t,i);return this.htOptions.oDebugger.log_MessageEnd(e,t),n},_execWithoutDebugger:function(e,t,i){return this._doExec(e,t,i)},_doExec:function(e,t,i){var n=!1;if(this.oLazyMessage[e]){var o=this.oLazyMessage[e];return this._loadLazyFiles(e,t,i,o.aFilenames,0),!1}if(!this.oDisabledMessage[e]){var s=[];if(t&&t.length)for(var r=t.length,a=0;r>a;a++)s[a]=t[a];i&&(s[s.length]=i),n=this._execMsgStep("BEFORE",e,s),n&&(n=this._execMsgStep("ON",e,s)),n&&(n=this._execMsgStep("AFTER",e,s))}return n},registerPlugin:function(t){if(!t)throw"An error occured in registerPlugin(): invalid plug-in";if(t.nIdx=this.aPlugins.length,t.oApp=this,this.aPlugins[t.nIdx]=t,t.status!=nhn.husky.PLUGIN_STATUS.NOT_READY&&(t.status=nhn.husky.PLUGIN_STATUS.READY),this.appStatus!=nhn.husky.APP_STATUS.NOT_READY)for(var i in t)e.test(i)&&this.addToMessageMap(i,t);return this.exec("MSG_PLUGIN_REGISTERED",[t]),t.nIdx},disableMessage:function(e,t){this.oDisabledMessage[e]=t},registerBrowserEvent:function(e,t,i,n,o){n=n||[];var s=o?jindo.$Fn(this.delayedExec,this).bind(i,n,o):jindo.$Fn(this.exec,this).bind(i,n);return jindo.$Fn(s,this).attach(e,t)},run:function(e){this.htRunOptions=e||{},this._changeAppStatus(nhn.husky.APP_STATUS.WAITING_FOR_PLUGINS_READY);for(var t=this.messageQueue.length,i=0;t>i;i++){var n=this.messageQueue[i];this.exec(n.msg,n.args,n.event)}this._fnWaitForPluginReady()},acceptLocalBeforeFirstAgain:function(e,t){e._husky_bRun=!t},createMessageMap:function(e){this.oMessageMap[e]=[];for(var t=this.aPlugins.length,i=0;t>i;i++)this._doAddToMessageMap(e,this.aPlugins[i])},addToMessageMap:function(e,t){this.oMessageMap[e]&&this._doAddToMessageMap(e,t)},_changeAppStatus:function(e){this.appStatus=e,this.appStatus==nhn.husky.APP_STATUS.READY&&this.exec("MSG_APP_READY")},_execMsgStep:function(e,t,i){return(this._execMsgStep=this.htOptions.oDebugger?this._execMsgStepWithDebugger:this._execMsgStepWithoutDebugger).call(this,e,t,i)},_execMsgStepWithDebugger:function(e,t,i){this.htOptions.oDebugger.log_MessageStepStart(e,t,i);var n=this._execMsgHandler("$"+e+"_"+t,i);return this.htOptions.oDebugger.log_MessageStepEnd(e,t,i),n},_execMsgStepWithoutDebugger:function(e,t,i){return this._execMsgHandler("$"+e+"_"+t,i)},_execMsgHandler:function(e,i){var n;this.oMessageMap[e]||this.createMessageMap(e);var o=this.oMessageMap[e],s=o.length;if(0===s)return!0;var r=!0;if(t.test(e)){for(n=0;s>n;n++)if(this._execHandler(o[n],e,i)===!1){r=!1;break}}else for(n=0;s>n;n++)if((o[n]._husky_bRun||(o[n]._husky_bRun=!0,"function"!=typeof o[n].$LOCAL_BEFORE_FIRST||this._execHandler(o[n],"$LOCAL_BEFORE_FIRST",[e,i])!==!1))&&("function"!=typeof o[n].$LOCAL_BEFORE_ALL||this._execHandler(o[n],"$LOCAL_BEFORE_ALL",[e,i])!==!1)&&this._execHandler(o[n],e,i)===!1){r=!1;break}return r},_execHandler:function(e,t,i){return(this._execHandler=this.htOptions.oDebugger?this._execHandlerWithDebugger:this._execHandlerWithoutDebugger).call(this,e,t,i)},_execHandlerWithDebugger:function(e,t,i){this.htOptions.oDebugger.log_CallHandlerStart(e,t,i);var n;try{this.aCallerStack.push(e),n=e[t].apply(e,i),this.aCallerStack.pop()}catch(o){this.htOptions.oDebugger.handleException(o),n=!1}return this.htOptions.oDebugger.log_CallHandlerEnd(e,t,i),n},_execHandlerWithoutDebugger:function(e,t,i){this.aCallerStack.push(e);var n=e[t].apply(e,i);return this.aCallerStack.pop(),n},_doAddToMessageMap:function(e,t){if("function"==typeof t[e]){for(var i=this.oMessageMap[e],n=0,o=i.length;o>n;n++)if(this.oMessageMap[e][n]==t)return;this.oMessageMap[e][n]=t}},_waitForPluginReady:function(){for(var e=!0,t=0;t=r)return this.oLazyMessage[e]=null,void this.oApp.exec(e,t,i);var a=o[s];n[a]?this._loadLazyFiles(e,t,i,o,s+1):jindo.LazyLoading.load(nhn.husky.SE2M_Configuration.LazyLoad.sJsBaseURI+"/"+a,jindo.$Fn(function(e,t,i,o,s){var r=o[s];n[r]=1,this._loadLazyFiles(e,t,i,o,s+1)},this).bind(e,t,i,o,s),"utf-8")},registerLazyMessage:function(e,t){e=e||[],t=t||[];for(var i,n,o=0;i=e[o];o++)n=this.oLazyMessage[i],n?n.aFilenames=n.aFilenames.concat(t):this.oLazyMessage[i]={sMsg:i,aFilenames:t}}}),nhn.husky.HuskyCore._htLoadedFile={},nhn.husky.HuskyCore.addLoadedFile=function(e){n[e]=1},nhn.husky.HuskyCore.mixin=function(t,n,o,s){for(var r,a=[],l=0;r=i[l];l++)for(var h,d=0;h=r.aPlugins[d];d++)if(h instanceof t)a.push(h),"function"!=typeof h.$LOCAL_BEFORE_FIRST&&h.oApp.acceptLocalBeforeFirstAgain(h,!0);else if(h._$superClass===t){"function"!=typeof h.$LOCAL_BEFORE_FIRST&&h.oApp.acceptLocalBeforeFirstAgain(h,!0);for(var c in n)(o||!h.hasOwnProperty(c))&&(h[c]=n[c],e.test(c)&&h.oApp.addToMessageMap(c,h))}for(var c in n)if((o||!t.prototype.hasOwnProperty(c))&&(t.prototype[c]=n[c],e.test(c)))for(var h,d=0;h=a[d];d++)h.oApp.addToMessageMap(c,h)},nhn.husky.APP_STATUS={NOT_READY:0,WAITING_FOR_PLUGINS_READY:1,READY:2},nhn.husky.PLUGIN_STATUS={NOT_READY:0,READY:1}}(),"undefined"==typeof window.nhn&&(window.nhn={}),nhn.CurrentSelection_IE=function(){this.getCommonAncestorContainer=function(){try{return this._oSelection=this._document.selection,"Control"==this._oSelection.type?this._oSelection.createRange().item(0):this._oSelection.createRangeCollection().item(0).parentElement()}catch(e){return this._document.body}},this.isCollapsed=function(){return this._oSelection=this._document.selection,"None"==this._oSelection.type}},nhn.CurrentSelection_FF=function(){this.getCommonAncestorContainer=function(){return this._getSelection().commonAncestorContainer},this.isCollapsed=function(){var e=this._window.getSelection();return e.rangeCount<1?!0:e.getRangeAt(0).collapsed},this._getSelection=function(){try{return this._window.getSelection().getRangeAt(0)}catch(e){return this._document.createRange()}}},nhn.CurrentSelection=new(jindo.$Class({$init:function(){var e=jindo.$Agent().navigator();e.ie&&document.selection?nhn.CurrentSelection_IE.apply(this):nhn.CurrentSelection_FF.apply(this)},setWindow:function(e){this._window=e,this._document=e.document}})),nhn.W3CDOMRange=jindo.$Class({$init:function(e){this.reset(e)},reset:function(e){this._window=e,this._document=this._window.document,this.collapsed=!0,this.commonAncestorContainer=this._document.body,this.endContainer=this._document.body,this.endOffset=0,this.startContainer=this._document.body,this.startOffset=0,this.oBrowserSelection=new nhn.BrowserSelection(this._window),this.selectionLoaded=this.oBrowserSelection.selectionLoaded},cloneContents:function(){var e=this._document.createDocumentFragment(),t=this._document.createDocumentFragment(),i=this._getNodesInRange();if(i.length<1)return e;var n=this._constructClonedTree(i,t),o=t.firstChild;if(o)for(var s,r=o.firstChild;r;)s=r.nextSibling,e.appendChild(r),r=s;return n=this._splitTextEndNodes({oStartContainer:n.oStartContainer,iStartOffset:this.startOffset,oEndContainer:n.oEndContainer,iEndOffset:this.endOffset}),n.oStartContainer&&n.oStartContainer.previousSibling&&nhn.DOMFix.parentNode(n.oStartContainer).removeChild(n.oStartContainer.previousSibling),n.oEndContainer&&n.oEndContainer.nextSibling&&nhn.DOMFix.parentNode(n.oEndContainer).removeChild(n.oEndContainer.nextSibling),e},_constructClonedTree:function(e,t){var i=null,n=null,o=this.startContainer,s=this.endContainer,r=function(e,t,r){if(0>t)return t;var a=t-1,l=e[t].cloneNode(!1);for(e[t]==o&&(i=l),e[t]==s&&(n=l);a>=0&&nhn.DOMFix.parentNode(e[a])==e[t];)a=this._recurConstructClonedTree(e,a,l);return r.insertBefore(l,r.firstChild),a};return this._recurConstructClonedTree=r,e[e.length]=nhn.DOMFix.parentNode(e[e.length-1]),this._recurConstructClonedTree(e,e.length-1,t),{oStartContainer:i,oEndContainer:n}},cloneRange:function(){return this._copyRange(new nhn.W3CDOMRange(this._window))},_copyRange:function(e){return e.collapsed=this.collapsed,e.commonAncestorContainer=this.commonAncestorContainer,e.endContainer=this.endContainer,e.endOffset=this.endOffset,e.startContainer=this.startContainer,e.startOffset=this.startOffset,e._document=this._document,e},collapse:function(e){e?(this.endContainer=this.startContainer,this.endOffset=this.startOffset):(this.startContainer=this.endContainer,this.startOffset=this.endOffset),this._updateRangeInfo()},compareBoundaryPoints:function(e,t){switch(e){case nhn.W3CDOMRange.START_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,t.startContainer,t.startOffset);case nhn.W3CDOMRange.START_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,t.startContainer,t.startOffset);case nhn.W3CDOMRange.END_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,t.endContainer,t.endOffset);case nhn.W3CDOMRange.END_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,t.endContainer,t.endOffset)}},_findBody:function(e){if(!e)return null;for(;e;){if("BODY"==e.tagName)return e;e=nhn.DOMFix.parentNode(e)}return null},_compareEndPoint:function(e,t,i,n){return this.oBrowserSelection.compareEndPoints(e,t,i,n)},_getCommonAncestorContainer:function(e,t){e=e||this.startContainer,t=t||this.endContainer;for(var i=t;e;){for(;i;){if(e==i)return e;i=nhn.DOMFix.parentNode(i)}i=t,e=nhn.DOMFix.parentNode(e)}return this._document.body},deleteContents:function(){if(!this.collapsed){this._splitTextEndNodesOfTheRange();var e=this._getNodesInRange();if(!(e.length<1)){for(var t=e[0].previousSibling;t&&this._isBlankTextNode(t);)t=t.previousSibling;var i,n=-1;t||(i=nhn.DOMFix.parentNode(e[0]),n=0);for(var o=0;oe.nodeValue.length&&(t=e.nodeValue.length):t>nhn.DOMFix.childNodes(e).length&&(t=nhn.DOMFix.childNodes(e).length),t},setEnd:function(e,t,i,n){i||(t=this._endsNodeValidation(e,t)),this.endContainer=e,this.endOffset=t,n||(this.startContainer&&-1==this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)?this._updateRangeInfo():this.collapse(!1))},setEndAfter:function(e,t){if(!e)throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter");return"BODY"==e.tagName?void this.setEnd(e,nhn.DOMFix.childNodes(e).length,!0,t):void this.setEnd(nhn.DOMFix.parentNode(e),this._getPosIdx(e)+1,!0,t)},setEndBefore:function(e,t){if(!e)throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore");return"BODY"==e.tagName?void this.setEnd(e,0,!0,t):void this.setEnd(nhn.DOMFix.parentNode(e),this._getPosIdx(e),!0,t)},setStart:function(e,t,i,n){i||(t=this._endsNodeValidation(e,t)),this.startContainer=e,this.startOffset=t,n||(this.endContainer&&-1==this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)?this._updateRangeInfo():this.collapse(!0))},setStartAfter:function(e,t){if(!e)throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter");return"BODY"==e.tagName?void this.setStart(e,nhn.DOMFix.childNodes(e).length,!0,t):void this.setStart(nhn.DOMFix.parentNode(e),this._getPosIdx(e)+1,!0,t)},setStartBefore:function(e,t){if(!e)throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore");return"BODY"==e.tagName?void this.setStart(e,0,!0,t):void this.setStart(nhn.DOMFix.parentNode(e),this._getPosIdx(e),!0,t)},surroundContents:function(e){e.appendChild(this.extractContents()),this.insertNode(e),this.selectNode(e)},toString:function(){var e=this._document.createElement("DIV");return e.appendChild(this.cloneContents()),e.textContent||e.innerText||""},fixCommonAncestorContainer:function(){jindo.$Agent().navigator().ie&&(this.commonAncestorContainer=this._getCommonAncestorContainer())},_isBlankTextNode:function(e){return 3==e.nodeType&&""==e.nodeValue?!0:!1},_isAllChildBlankText:function(e){for(var t=0,i=e.childNodes.length;i>t;t++)if(!this._isBlankTextNode(e.childNodes[t]))return!1;return!0},_getPosIdx:function(e){for(var t=0,i=e.previousSibling;i;i=i.previousSibling)t++;return t},_updateRangeInfo:function(){return this.startContainer?(this.collapsed=this.oBrowserSelection.isCollapsed(this)||this.startContainer===this.endContainer&&this.startOffset===this.endOffset,void(this.commonAncestorContainer=this.oBrowserSelection.getCommonAncestorContainer(this))):void this.reset(this._window)},_isCollapsed:function(e,t,i,n){var o=!1;if(e==i&&t==n)o=!0;else{var s=this._getActualStartNode(e,t),r=this._getActualEndNode(i,n);s=this._getNextNode(this._getPrevNode(s)),r=this._getPrevNode(this._getNextNode(r)),s&&r&&"BODY"!=r.tagName&&(this._getNextNode(r)==s||r==s&&this._isBlankTextNode(r))&&(o=!0)}return o},_splitTextEndNodesOfTheRange:function(){var e=this._splitTextEndNodes({oStartContainer:this.startContainer,iStartOffset:this.startOffset,oEndContainer:this.endContainer,iEndOffset:this.endOffset});this.startContainer=e.oStartContainer,this.startOffset=e.iStartOffset,this.endContainer=e.oEndContainer,this.endOffset=e.iEndOffset},_splitTextEndNodes:function(e){return e=this._splitStartTextNode(e),e=this._splitEndTextNode(e)},_splitStartTextNode:function(e){var t=e.oStartContainer,i=e.iStartOffset,n=e.oEndContainer,o=e.iEndOffset;if(!t)return e;if(3!=t.nodeType)return e;if(0===i)return e;if(t.nodeValue.length<=i)return e;var s=t.splitText(i);return t==n&&(o-=i,n=s),t=s,i=0,{oStartContainer:t,iStartOffset:i,oEndContainer:n,iEndOffset:o}},_splitEndTextNode:function(e){var t=e.oStartContainer,i=e.iStartOffset,n=e.oEndContainer,o=e.iEndOffset;return n?3!=n.nodeType?e:o>=n.nodeValue.length?e:0===o?e:(n.splitText(o),{oStartContainer:t,iStartOffset:i,oEndContainer:n,iEndOffset:o}):e},_getNodesInRange:function(){if(this.collapsed)return[];var e=this._getActualStartNode(this.startContainer,this.startOffset),t=this._getActualEndNode(this.endContainer,this.endOffset);return this._getNodesBetween(e,t)},_getActualStartNode:function(e,t){var i=e;return 3==e.nodeType?t>=e.nodeValue.length?(i=this._getNextNode(e),"BODY"==i.tagName&&(i=null)):i=e:t)$/i,_rxTextAlign:/text-align:[^"';]*;?/i,setWindow:function(e){this.reset(e||window)},$init:function(e){this.HUSKY_BOOMARK_START_ID_PREFIX="husky_bookmark_start_",this.HUSKY_BOOMARK_END_ID_PREFIX="husky_bookmark_end_",this.sBlockElement="P|DIV|LI|H[1-6]|PRE",this.sBlockContainer="BODY|TABLE|TH|TR|TD|UL|OL|BLOCKQUOTE|FORM",this.rxBlockElement=new RegExp("^("+this.sBlockElement+")$"),this.rxBlockContainer=new RegExp("^("+this.sBlockContainer+")$"),this.rxLineBreaker=new RegExp("^("+this.sBlockElement+"|"+this.sBlockContainer+")$"),this.rxHasBlock=new RegExp("(?:<(?:"+this.sBlockElement+"|"+this.sBlockContainer+").*?>|style=[\"']?[^>]*?(?:display\\s?:\\s?block)[^>]*?[\"']?)","i"),this.setWindow(e)},select:function(){try{this.oBrowserSelection.selectRange(this)}catch(e){}},setFromSelection:function(e){this.setRange(this.oBrowserSelection.getRangeAt(e),!0)},setRange:function(e,t){this.reset(this._window),this.setStart(e.startContainer,e.startOffset,t,!0),this.setEnd(e.endContainer,e.endOffset,t)},setEndNodes:function(e,t){this.reset(this._window),this.setEndAfter(t,!0),this.setStartBefore(e)},splitTextAtBothEnds:function(){this._splitTextEndNodesOfTheRange()},getStartNode:function(){return this.collapsed?3==this.startContainer.nodeType?0===this.startOffset?null: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>=nhn.DOMFix.childNodes(this.startContainer).length?this._getNextNode(this.startContainer):nhn.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):nhn.DOMFix.childNodes(this.endContainer)[this.endOffset-1]},getNodeAroundRange:function(e,t){if(!this.collapsed)return this.getStartNode();if(this.startContainer&&3==this.startContainer.nodeType)return this.startContainer;var i,n,o;return n=this.startOffset>=nhn.DOMFix.childNodes(this.startContainer).length?this._getNextNode(this.startContainer):nhn.DOMFix.childNodes(this.startContainer)[this.startOffset],i=0===this.endOffset?this._getPrevNode(this.endContainer):nhn.DOMFix.childNodes(this.endContainer)[this.endOffset-1],e?(o=i,o||t||(o=n)):(o=n,o||t||(o=i)),o},_getXPath:function(e){for(var t="";e&&1==e.nodeType;)t="/"+e.tagName+"["+this._getPosIdx4XPath(e)+"]"+t,e=nhn.DOMFix.parentNode(e);return t},_getPosIdx4XPath:function(e){for(var t=0,i=e.previousSibling;i;i=i.previousSibling)i.tagName==e.tagName&&t++;return t},_evaluateXPath:function(e,t){e=e.substring(1,e.length-1);for(var i=e.split(/\//),n=t.body,o=2;oc;c++)a[c].tagName==s&&(l[d++]=a[c]);n=l.length-1&&o){for(var s=nhn.DOMFix.childNodes(o),r=null,a=i,l=n;(r=s[a])&&3==r.nodeType&&r.nodeValue.length=i&&s>=0?!0:t?1==n?!1:-1==o?!1:!0:!1},isNodeInRange:function(e,t,i){var n=new nhn.HuskyRange(this._window);return i&&e.firstChild?(n.setStartBefore(e.firstChild),n.setEndAfter(e.lastChild)):n.selectNode(e),this.isRangeInRange(n,t)},pasteText:function(e){this.pasteHTML(e.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/"/g,"""))},pasteHTML:function(e,t){var i=this._document.createElement("DIV");if(i.innerHTML=e,!i.firstChild)return void this.deleteContents();var n=this.cloneRange(),o=n.placeStringBookmark(),s=n.getLineInfo(),r=s.oStart,a=s.oEnd;if(r.oLineBreaker&&"P"===r.oLineBreaker.nodeName&&(t||n.rxHasBlock.test(e))){var l=r.oLineBreaker.parentNode,h=r.oLineBreaker.nextSibling;if(n.deleteContents(),r.oLineBreaker===a.oLineBreaker){var d=n.getStringBookmark(o);n.setEndNodes(d,a.oLineBreaker);var c=n.extractContents(),_=c.firstChild;h?l.insertBefore(c,h):l.appendChild(c),h=_}i.style.cssText=r.oLineBreaker.style.cssText.replace(this._rxTextAlign,""),i.align=r.oLineBreaker.align,h?l.insertBefore(i,h):l.appendChild(i),n.removeStringBookmark(o),this._removeEmptyP(this._getPrevElement(i));var p=this._getNextElement(i);if(p){var E=this._getNextElement(p);E&&this._removeEmptyP(p)&&(p=E)}else p=this._document.createElement("P"),p.style.cssText=r.oLineBreaker.style.cssText,p.align=r.oLineBreaker.align,l.appendChild(p);""===p.innerHTML&&(p.innerHTML=jindo.$Agent().navigator().ie&&jindo.$Agent().navigator().version>8?"​":"\ufeff"),this.selectNodeContents(p),this.collapseToStart(),jindo.$Agent().navigator().ie&&jindo.$Agent().navigator().version<9&&(o=this.placeStringBookmark(),this.removeStringBookmark(o))}else{var u=i.firstChild,g=i.lastChild;for(this.collapseToStart();i.lastChild;)this.insertNode(i.lastChild);this.setEndNodes(u,g),n.moveToBookmark(o),n.deleteContents(),n.removeStringBookmark(o)}},_removeEmptyP:function(e){if(e&&"P"===e.nodeName){var t=e.innerHTML;if(""===t||this._rxCursorHolder.test(t))return e.parentNode.removeChild(e),!0}},_getSiblingElement:function(e,t){if(!e)return null;var i=e[t?"previousSibling":"nextSibling"];return i&&1===i.nodeType?i:arguments.callee(i,t)},_getPrevElement:function(e){return this._getSiblingElement(e,!0)},_getNextElement:function(e){return this._getSiblingElement(e,!1)},toString:function(){return this.toString=nhn.W3CDOMRange.prototype.toString,this.toString()},toHTMLString:function(){var e=this._document.createElement("DIV");return e.appendChild(this.cloneContents()),e.innerHTML},findAncestorByTagName:function(e){for(var t=this.commonAncestorContainer;t&&t.tagName!=e;)t=nhn.DOMFix.parentNode(t);return t},selectNodeContents:function(e){if(e){var t=e.firstChild?e.firstChild:e,i=e.lastChild?e.lastChild:e;this.reset(this._window),3==t.nodeType?this.setStart(t,0,!0):this.setStartBefore(t),3==i.nodeType?this.setEnd(i,i.nodeValue.length,!0):this.setEndAfter(i)}},_hasTextDecoration:function(e,t){return e&&e.style?e.style.textDecoration.indexOf(t)>-1?!0:"underline"===t&&"U"===e.tagName?!0:"line-through"!==t||"S"!==e.tagName&&"STRIKE"!==e.tagName?!1:!0:!1},_setTextDecoration:function(e,t){jindo.$Agent().navigator().firefox?e.style.textDecoration=e.style.textDecoration?e.style.textDecoration+" "+t:t:"underline"===t?e.innerHTML=""+e.innerHTML+"":"line-through"===t&&(e.innerHTML=""+e.innerHTML+"")},_checkTextDecoration:function(e){if("SPAN"===e.tagName){var t=!1,i=!1,n=null;for(oChildNode=e.firstChild;oChildNode;){if(1===oChildNode.nodeType&&(t=t||"U"===oChildNode.tagName,i=i||"S"===oChildNode.tagName||"STRIKE"===oChildNode.tagName),t&&i)return;oChildNode=oChildNode.nextSibling}for(n=nhn.DOMFix.parentNode(e);n&&"BODY"!==n.tagName;)if(1===n.nodeType){if(!t&&this._hasTextDecoration(n,"underline")&&(t=!0,this._setTextDecoration(e,"underline")),!i&&this._hasTextDecoration(n,"line-through")&&(i=!0,this._setTextDecoration(e,"line-through")),t&&i)return;n=nhn.DOMFix.parentNode(n)}else n=nhn.DOMFix.parentNode(n)}},styleRange:function(e,t,i,n,o){var s=this.aStyleParents=this._getStyleParentNodes(i,n);if(!(s.length<1)){for(var r,a,l=0;l_;_++)if(i=r[_])if(t&&"LI"==i.tagName&&this._isFullyContained(i,d))a[l++]=i;else if(3==i.nodeType&&""!=i.nodeValue&&!i.nodeValue.match(/^(\r|\n)+$/)){var p=nhn.DOMFix.parentNode(i);if("SPAN"==p.tagName){if(this._isFullyContained(p,d,i)){a[l++]=p;continue}}else{var E=this._findParentSingleSpan(p);if(E){a[l++]=E;continue}}n=this._document.createElement("SPAN"),p.insertBefore(n,i),n.appendChild(i),a[l++]=n,e&&n.setAttribute(e,"true")}return this.setStartBefore(o),this.setEndAfter(s),a},_findParentSingleSpan:function(e){if(!e)return null;for(var t,i,n=0,o=0,s=e.childNodes;i=s[n];n++)if(t=i.nodeValue,!this._rxCursorHolder.test(t)&&(o++,o>1))return null;return"SPAN"===e.nodeName?e:this._findParentSingleSpan(e.parentNode)},_isFullyContained:function(e,t,i){var n,o,s=this._getVeryFirstRealChild(e);return n=i&&s==i?1:t.indexOf(s),-1!=n&&(s=this._getVeryLastRealChild(e),o=i&&s==i?1:t.indexOf(s)),-1!=n&&-1!=o},_getVeryFirstChild:function(e){return e.firstChild?this._getVeryFirstChild(e.firstChild):e},_getVeryLastChild:function(e){return e.lastChild?this._getVeryLastChild(e.lastChild):e},_getFirstRealChild:function(e){for(var t=e.firstChild;t&&3==t.nodeType&&""==t.nodeValue;)t=t.nextSibling;return t},_getLastRealChild:function(e){for(var t=e.lastChild;t&&3==t.nodeType&&""==t.nodeValue;)t=t.previousSibling;return t},_getVeryFirstRealChild:function(e){var t=this._getFirstRealChild(e);return t?this._getVeryFirstRealChild(t):e},_getVeryLastRealChild:function(e){var t=this._getLastRealChild(e);return t?this._getVeryLastChild(t):e},_getLineStartInfo:function(e){function t(e){if(e&&!n){if(a.test(e.tagName))return s=e,n=o,void(r=!0);o=e,i(e.previousSibling),n||t(nhn.DOMFix.parentNode(e))}}function i(e){if(e&&!n){if(a.test(e.tagName))return s=e,n=o,void(r=!1);o=e,n||i(e.previousSibling)}}var n=null,o=e,s=e,r=!1,a=this.rxLineBreaker;return a.test(e.tagName)?n=e:t(e),{oNode:n,oLineBreaker:s,bParentBreak:r}},_getLineEndInfo:function(e){function t(e){if(e&&!n){if(a.test(e.tagName))return s=e,n=o,void(r=!0);o=e,i(e.nextSibling),n||t(nhn.DOMFix.parentNode(e))}}function i(e){if(e&&!n){if(a.test(e.tagName))return s=e,n=o,void(r=!1);o=e,n||i(e.nextSibling)}}var n=null,o=e,s=e,r=!1,a=this.rxLineBreaker;return a.test(e.tagName)?n=e:t(e),{oNode:n,oLineBreaker:s,bParentBreak:r}},getLineInfo:function(e){var e=e||!1,t=this.getStartNode(),i=this.getEndNode();t||(t=this.getNodeAroundRange(!e,!0)),i||(i=this.getNodeAroundRange(!e,!0));var n=this._getLineStartInfo(t),o=n.oNode,s=this._getLineEndInfo(i),r=s.oNode;if(t!=o||i!=r){var a=this._compareEndPoint(nhn.DOMFix.parentNode(o),this._getPosIdx(o),this.endContainer,this.endOffset),l=this._compareEndPoint(nhn.DOMFix.parentNode(r),this._getPosIdx(r)+1,this.startContainer,this.startOffset);0>=a&&l>=0||(t=this.getNodeAroundRange(!1,!0),i=this.getNodeAroundRange(!1,!0),n=this._getLineStartInfo(t),s=this._getLineEndInfo(i))}return{oStart:n,oEnd:s}},_findSingleChild:function(e){if(!e)return null;for(var t,i,n=null,o=0,s=0,r=e.childNodes;i=r[o];o++)if(t=i.nodeValue,!this._rxCursorHolder.test(t)&&(n=i,s++,s>1))return null;return n},_hasCursorHolderOnly:function(e){return e&&1===e.nodeType?this._rxCursorHolder.test(e.innerHTML)?!0:this._hasCursorHolderOnly(this._findSingleChild(e)):!1}}).extend(nhn.W3CDOMRange),nhn.BrowserSelection=function(e){this.init=function(e){this._window=e||window,this._document=this._window.document},this.init(e),this._document.createRange?nhn.BrowserSelectionImpl_FF.apply(this):nhn.BrowserSelectionImpl_IE.apply(this),this.selectRange=function(e){this.selectNone(),this.addRange(e)},this.selectionLoaded=!0,this._oSelection||(this.selectionLoaded=!1)},nhn.BrowserSelectionImpl_FF=function(){this._oSelection=this._window.getSelection(),this.getRangeAt=function(e){e=e||0;try{var t=this._oSelection.getRangeAt(e)}catch(i){return new nhn.W3CDOMRange(this._window)}return this._FFRange2W3CRange(t)},this.addRange=function(e){var t=this._W3CRange2FFRange(e);this._oSelection.addRange(t)},this.selectNone=function(){this._oSelection.removeAllRanges()},this.getCommonAncestorContainer=function(e){var t=this._W3CRange2FFRange(e);return t.commonAncestorContainer},this.isCollapsed=function(e){var t=this._W3CRange2FFRange(e);return t.collapsed},this.compareEndPoints=function(e,t,i,n){var o=this._document.createRange(),s=this._document.createRange();o.setStart(e,t),s.setStart(i,n),o.collapse(!0),s.collapse(!0);try{return o.compareBoundaryPoints(1,s)}catch(r){return 1}},this._FFRange2W3CRange=function(e){var t=new nhn.W3CDOMRange(this._window);return t.setStart(e.startContainer,e.startOffset,!0),t.setEnd(e.endContainer,e.endOffset,!0),t},this._W3CRange2FFRange=function(e){var t=this._document.createRange();return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t}},nhn.BrowserSelectionImpl_IE=function(){this._oSelection=this._document.selection,this.oLastRange={oBrowserRange:null,elStartContainer:null,nStartOffset:-1,elEndContainer:null,nEndOffset:-1},this._updateLastRange=function(e,t){this.oLastRange.oBrowserRange=e,this.oLastRange.elStartContainer=t.startContainer,this.oLastRange.nStartOffset=t.startOffset,this.oLastRange.elEndContainer=t.endContainer,this.oLastRange.nEndOffset=t.endOffset},this.getRangeAt=function(e){e=e||0;var t,i;if("Control"==this._oSelection.type){t=new nhn.W3CDOMRange(this._window);var n=this._oSelection.createRange().item(e);return n&&n.ownerDocument==this._document?(t.selectNode(n),t):t}i=this._oSelection.createRange();var n=i.parentElement();return t=n&&n.ownerDocument==this._document?this._IERange2W3CRange(i):new nhn.W3CDOMRange(this._window)},this.addRange=function(e){var t=this._W3CRange2IERange(e);t.select()},this.selectNone=function(){this._oSelection.empty()},this.getCommonAncestorContainer=function(e){return this._W3CRange2IERange(e).parentElement()},this.isCollapsed=function(e){var t=this._W3CRange2IERange(e),i=t.duplicate();return i.collapse(),t.isEqual(i)},this.compareEndPoints=function(e,t,i,n){var o,s;return e===this.oLastRange.elStartContainer&&t===this.oLastRange.nStartOffset?(o=this.oLastRange.oBrowserRange.duplicate(),o.collapse(!0)):e===this.oLastRange.elEndContainer&&t===this.oLastRange.nEndOffset?(o=this.oLastRange.oBrowserRange.duplicate(),o.collapse(!1)):o=this._getIERangeAt(e,t),i===this.oLastRange.elStartContainer&&n===this.oLastRange.nStartOffset?(s=this.oLastRange.oBrowserRange.duplicate(),s.collapse(!0)):i===this.oLastRange.elEndContainer&&n===this.oLastRange.nEndOffset?(s=this.oLastRange.oBrowserRange.duplicate(),s.collapse(!1)):s=this._getIERangeAt(i,n),o.compareEndPoints("StartToStart",s)},this._W3CRange2IERange=function(e){if(this.oLastRange.elStartContainer===e.startContainer&&this.oLastRange.nStartOffset===e.startOffset&&this.oLastRange.elEndContainer===e.endContainer&&this.oLastRange.nEndOffset===e.endOffset)return this.oLastRange.oBrowserRange;var t=this._getIERangeAt(e.startContainer,e.startOffset),i=this._getIERangeAt(e.endContainer,e.endOffset);return t.setEndPoint("EndToEnd",i),this._updateLastRange(t,e),t},this._getIERangeAt=function(e,t){var i=this._document.body.createTextRange(),n=this._getSelectableNodeAndOffsetForIE(e,t),o=n.oSelectableNodeForIE,s=n.iOffsetForIE;return i.moveToElementText(o),i.collapse(n.bCollapseToStart),i.moveStart("character",s),i},this._getSelectableNodeAndOffsetForIE=function(e,t){var i=null,n=null,o=0;3==e.nodeType?(i=nhn.DOMFix.parentNode(e),n=nhn.DOMFix.childNodes(i),o=n.length):(i=e,n=nhn.DOMFix.childNodes(i),o=tl;l++)if(s=n[l],3==s.nodeType){if(s==e)break;r+=s.nodeValue.length}else i=s,r=0,a=!1;return 3==e.nodeType&&(r+=t),{oSelectableNodeForIE:i,iOffsetForIE:r,bCollapseToStart:a}},this._IERange2W3CRange=function(e){var t=new nhn.W3CDOMRange(this._window),i=null,n=null;i=e.duplicate(),i.collapse(!0),n=this._getW3CContainerAndOffset(i,!0),t.setStart(n.oContainer,n.iOffset,!0,!0);var o=e.duplicate();return o.collapse(!0),o.isEqual(e)?t.collapse(!0):(i=e.duplicate(),i.collapse(!1),n=this._getW3CContainerAndOffset(i),t.setEnd(n.oContainer,n.iOffset,!0)),this._updateLastRange(e,t),t},this._getW3CContainerAndOffset=function(e,t){for(var i=e,n=i.parentElement(),o=-1,s=this._document.body.createTextRange(),r=nhn.DOMFix.childNodes(n),a=null,l=0,h=0;h=0)break;a=r[h]}var l=h;if(0!==l&&3==r[l-1].nodeType){var d=this._document.body.createTextRange(),c=null;a?(d.moveToElementText(a),d.collapse(!1),c=a.nextSibling):(d.moveToElementText(n),d.collapse(!0),c=n.firstChild);var _=i.duplicate();_.setEndPoint("StartToStart",d);for(var p=_.text.replace(/[\r\n]/g,"").length;p>c.nodeValue.length&&c.nextSibling;)p-=c.nodeValue.length,c=c.nextSibling;c.nodeValue;t&&c.nextSibling&&3==c.nextSibling.nodeType&&p==c.nodeValue.length&&(p-=c.nodeValue.length,c=c.nextSibling),n=c,o=p}else n=i.parentElement(),o=l;return{oContainer:n,iOffset:o}}},nhn.DOMFix=new(jindo.$Class({$init:function(){jindo.$Agent().navigator().ie||jindo.$Agent().navigator().opera?(this.childNodes=this._childNodes_Fix,this.parentNode=this._parentNode_Fix):(this.childNodes=this._childNodes_Native,this.parentNode=this._parentNode_Native)},_parentNode_Native:function(e){return e.parentNode},_parentNode_Fix:function(e){if(!e)return e;for(;e.previousSibling;)e=e.previousSibling;return e.parentNode},_childNodes_Native:function(e){return e.childNodes},_childNodes_Fix:function(e){var t=null,i=0;if(e){var t=[];for(e=e.firstChild;e;)t[i++]=e,e=e.nextSibling}return t}})),nhn.husky.CorePlugin=jindo.$Class({name:"CorePlugin",htLazyLoadRequest_plugins:{},htLazyLoadRequest_allFiles:{},htHTMLLoaded:{},$AFTER_MSG_APP_READY:function(){this.oApp.exec("EXEC_ON_READY_FUNCTION",[])},$ON_ADD_APP_PROPERTY:function(e,t){this.oApp[e]=t},$ON_REGISTER_BROWSER_EVENT:function(e,t,i,n,o){this.oApp.registerBrowserEvent(e,t,i,n,o)},$ON_DISABLE_MESSAGE:function(e){this.oApp.disableMessage(e,!0)},$ON_ENABLE_MESSAGE:function(e){this.oApp.disableMessage(e,!1)},$ON_LOAD_FULL_PLUGIN:function(e,t,i,n,o){var s=(n.$this||n,e[0]);this.htLazyLoadRequest_plugins[s]||(this.htLazyLoadRequest_plugins[s]={nStatus:1,sContents:""}),2===this.htLazyLoadRequest_plugins[s].nStatus?this.oApp.exec("MSG_FULL_PLUGIN_LOADED",[s,t,i,n,o,!1]):this._loadFullPlugin(e,t,i,n,o,0)},_loadFullPlugin:function(e,t,i,n,o,s){jindo.LazyLoading.load(nhn.husky.SE2M_Configuration.LazyLoad.sJsBaseURI+"/"+e[s],jindo.$Fn(function(e,t,i,n,o,s){var r=(e[s],e[0]);return s==e.length-1?(this.htLazyLoadRequest_plugins[r].nStatus=2,void this.oApp.exec("MSG_FULL_PLUGIN_LOADED",[e,t,i,n,o])):void this._loadFullPlugin(e,t,i,n,o,s+1)},this).bind(e,t,i,n,o,s),"utf-8")},$ON_MSG_FULL_PLUGIN_LOADED:function(aFilenames,sClassName,sMsgName,oThisRef,oArguments,oRes){for(var oPluginRef=oThisRef.$this||oThisRef,sFilename=aFilenames,i=0,nLen=oThisRef._huskyFLT.length;nLen>i;i++){var sLoaderHandlerName="$BEFORE_"+oThisRef._huskyFLT[i],oRemoveFrom=oThisRef.$this&&oThisRef[sLoaderHandlerName]?oThisRef:oPluginRef;oRemoveFrom[sLoaderHandlerName]=null,this.oApp.createMessageMap(sLoaderHandlerName)}var oPlugin=eval(sClassName+".prototype"),bAcceptLocalBeforeFirstAgain=!1;"function"!=typeof oPluginRef.$LOCAL_BEFORE_FIRST&&this.oApp.acceptLocalBeforeFirstAgain(oPluginRef,!0);for(var x in oPlugin)oThisRef.$this&&(!oThisRef[x]||"function"==typeof oPlugin[x]&&"constructor"!=x)&&(oThisRef[x]=jindo.$Fn(oPlugin[x],oPluginRef).bind()),oPlugin[x]&&(!oPluginRef[x]||"function"==typeof oPlugin[x]&&"constructor"!=x)&&(oPluginRef[x]=oPlugin[x],x.match(/^\$(LOCAL|BEFORE|ON|AFTER)_/)&&this.oApp.addToMessageMap(x,oPluginRef));bAcceptLocalBeforeFirstAgain&&this.oApp.acceptLocalBeforeFirstAgain(oPluginRef,!0),oThisRef.$this||this.oApp.exec(sMsgName,oArguments)},$ON_LOAD_HTML:function(e){if(!this.htHTMLLoaded[e]){var t=jindo.$("_llh_"+e);if(t){this.htHTMLLoaded[e]=!0;var i=document.createElement("DIV");for(i.innerHTML=t.value;i.firstChild;)t.parentNode.insertBefore(i.firstChild,t)}}},$ON_EXEC_ON_READY_FUNCTION:function(){"function"==typeof this.oApp.htRunOptions.fnOnAppReady&&this.oApp.htRunOptions.fnOnAppReady()}}),nhn.husky.HuskyRangeManager=jindo.$Class({name:"HuskyRangeManager",oWindow:null,$init:function(e){this.oWindow=e||window},$BEFORE_MSG_APP_READY:function(){this.oWindow&&"IFRAME"==this.oWindow.tagName&&(this.oWindow=this.oWindow.contentWindow,nhn.CurrentSelection.setWindow(this.oWindow)),this.oApp.exec("ADD_APP_PROPERTY",["getSelection",jindo.$Fn(this.getSelection,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getEmptySelection",jindo.$Fn(this.getEmptySelection,this).bind()])},$ON_SET_EDITING_WINDOW:function(e){this.oWindow=e},getEmptySelection:function(e){var t=new nhn.HuskyRange(e||this.oWindow);return t},getSelection:function(e){this.oApp.exec("RESTORE_IE_SELECTION",[]);var t=this.getEmptySelection(e);try{t.setFromSelection()}catch(i){}return t}}),nhn.husky.SE2M_Toolbar=jindo.$Class({name:"SE2M_Toolbar",toolbarArea:null,toolbarButton:null,uiNameTag:"uiName",nUIStatus:1,sUIClassPrefix:"husky_seditor_ui_",aUICmdMap:null,elFirstToolbarItem:null,_hideAlert:function(e){return"function"==typeof e&&e(),this._elAlertLayer.style.display="none",this.oApp.exec("HIDE_EDITING_AREA_COVER"),!1},$ON_ALERT:function(e,t){this._elAlertLayer&&(t=t||{},this._elAlertTxts.innerHTML=e||"",this._elAlertOk.onclick=jindo.$Fn(this._hideAlert,this).bind(t.fOkCallback),this._elAlertClose.onclick=jindo.$Fn(this._hideAlert,this).bind(t.fCloseCallback),t.fCancelCallback?(this._elAlertCancel.onclick=jindo.$Fn(this._hideAlert,this).bind(t.fCancelCallback),this._elAlertCancel.style.display=""):this._elAlertCancel.style.display="none",this.oApp.exec("SHOW_EDITING_AREA_COVER",[!0]),this._elAlertLayer.style.zIndex=100,this._elAlertLayer.style.display="block",this._elAlertOk.focus())},_assignHTMLElements:function(e){e=jindo.$(e)||document,this.rxUI=new RegExp(this.sUIClassPrefix+"([^ ]+)"),this.toolbarArea=jindo.$$.getSingle(".se2_tool",e),this.aAllUI=jindo.$$("[class*="+this.sUIClassPrefix+"]",this.toolbarArea),this.elTextTool=jindo.$$.getSingle("div.husky_seditor_text_tool",this.toolbarArea),this._elAlertLayer=jindo.$$.getSingle(".se2_alert_wrap",e),this._elAlertLayer&&(this._elAlertTxts=jindo.$$.getSingle(".se2_alert_txts",this._elAlertLayer),this._elAlertOk=jindo.$$.getSingle(".se2_confirm",this._elAlertLayer),this._elAlertCancel=jindo.$$.getSingle(".se2_cancel",this._elAlertLayer),this._elAlertClose=jindo.$$.getSingle(".btn_close",this._elAlertLayer)),this.welToolbarArea=jindo.$Element(this.toolbarArea);for(var t=0,i=this.aAllUI.length;i>t;t++)if(this.rxUI.test(this.aAllUI[t].className)){var n=RegExp.$1;if(void 0!==this.htUIList[n])continue;this.htUIList[n]=this.aAllUI[t],this.htWrappedUIList[n]=jindo.$Element(this.htUIList[n])}null!=jindo.$$.getSingle("DIV.se2_icon_tool")&&(this.elFirstToolbarItem=jindo.$$.getSingle("DIV.se2_icon_tool UL.se2_itool1>li>button"))},$LOCAL_BEFORE_FIRST:function(e){var t=jindo.$$(">ul>li[class*="+this.sUIClassPrefix+"]>button",this.elTextTool),i=t.length;this.elFirstToolbarItem=this.elFirstToolbarItem||t[0],this.elLastToolbarItem=t[i-1],this.oApp.registerBrowserEvent(this.toolbarArea,"keydown","NAVIGATE_TOOLBAR",[])},$init:function(e,t){this._htOptions=t||{},this.htUIList={},this.htWrappedUIList={},this.aUICmdMap={},this._assignHTMLElements(e)},$ON_MSG_APP_READY:function(){this.oApp.bMobile?this.oApp.registerBrowserEvent(this.toolbarArea,"touchstart","EVENT_TOOLBAR_TOUCHSTART"):(this.oApp.registerBrowserEvent(this.toolbarArea,"mouseover","EVENT_TOOLBAR_MOUSEOVER"),this.oApp.registerBrowserEvent(this.toolbarArea,"mouseout","EVENT_TOOLBAR_MOUSEOUT")),this.oApp.registerBrowserEvent(this.toolbarArea,"mousedown","EVENT_TOOLBAR_MOUSEDOWN"),this.oApp.exec("ADD_APP_PROPERTY",["getToolbarButtonByUIName",jindo.$Fn(this.getToolbarButtonByUIName,this).bind()]),this._htOptions.aDisabled&&(this._htOptions._sDisabled=","+this._htOptions.aDisabled.toString()+",",this.oApp.exec("DISABLE_UI",[this._htOptions.aDisabled]))},$ON_NAVIGATE_TOOLBAR:function(e){var t=9;e.element==this.elLastToolbarItem&&e.key().keyCode==t&&(e.key().shift||(this.elFirstToolbarItem.focus(),e.stopDefault())),e.element==this.elFirstToolbarItem&&e.key().keyCode==t&&e.key().shift&&(e.stopDefault(),this.elLastToolbarItem.focus())},$ON_TOGGLE_TOOLBAR_ACTIVE_LAYER:function(e,t,i,n,o,s){this.oApp.exec("TOGGLE_ACTIVE_LAYER",[e,"MSG_TOOLBAR_LAYER_SHOWN",[e,t,i,n],o,s])},$ON_MSG_TOOLBAR_LAYER_SHOWN:function(e,t,i,n){this.oApp.exec("POSITION_TOOLBAR_LAYER",[e,t]),i&&this.oApp.exec(i,n)},$ON_SHOW_TOOLBAR_ACTIVE_LAYER:function(e,t,i,n){this.oApp.exec("SHOW_ACTIVE_LAYER",[e,t,i]),this.oApp.exec("POSITION_TOOLBAR_LAYER",[e,n])},$ON_ENABLE_UI:function(e){this._enableUI(e)},$ON_DISABLE_UI:function(e){if(e instanceof Array)for(var t,i=0;t=e[i];i++)this._disableUI(t);else this._disableUI(e)},$ON_SELECT_UI:function(e){var t=this.htWrappedUIList[e];t&&(t.removeClass("hover"),t.addClass("active"))},$ON_DESELECT_UI:function(e){var t=this.htWrappedUIList[e];t&&t.removeClass("active")},$ON_TOGGLE_UI_SELECTED:function(e){var t=this.htWrappedUIList[e];t&&(t.hasClass("active")?t.removeClass("active"):(t.removeClass("hover"),t.addClass("active")))},$ON_ENABLE_ALL_UI:function(e){if(1!==this.nUIStatus){var t;e=e||{};var i=jindo.$A(e.aExceptions||[]);for(t in this.htUIList)t&&!i.has(t)&&this._enableUI(t);this.nUIStatus=1}},$ON_DISABLE_ALL_UI:function(e){if(2!==this.nUIStatus){var t;e=e||{};var i=jindo.$A(e.aExceptions||[]),n=e.bLeaveActiveLayer||!1;n||this.oApp.exec("HIDE_ACTIVE_LAYER");for(t in this.htUIList)t&&!i.has(t)&&this._disableUI(t);this.nUIStatus=2}},$ON_MSG_STYLE_CHANGED:function(e,t){"@^"===t?this.oApp.exec("SELECT_UI",[e]):this.oApp.exec("DESELECT_UI",[e])},$ON_POSITION_TOOLBAR_LAYER:function(e,t){var i,n,o,s;e=jindo.$(e),t=t||{};var r=jindo.$(t.elBtn),a=t.sAlign,l=-1;if(e){r&&r.tagName&&"BUTTON"==r.tagName&&r.parentNode.appendChild(e);var h=jindo.$Element(e);"right"!=a?(e.style.left="0",i=h.offset().left,n=i+e.offsetWidth,o=this.welToolbarArea.offset().left,s=o+this.toolbarArea.offsetWidth,n>s&&h.css("left",s-n-l+"px"),o>i&&h.css("left",o-i+l+"px")):(e.style.right="0",i=h.offset().left,n=i+e.offsetWidth,o=this.welToolbarArea.offset().left,s=o+this.toolbarArea.offsetWidth,n>s&&h.css("right",-1*(s-n-l)+"px"),o>i&&h.css("right",-1*(o-i+l)+"px"))}},$ON_EVENT_TOOLBAR_MOUSEOVER:function(e){if(2!==this.nUIStatus)for(var t=this._getAffectedElements(e.element),i=0;i2||t.parentNode.className.match(/se2_pair/)))return;t=t.parentNode}this.oApp.exec("HIDE_ACTIVE_LAYER_IF_NOT_CHILD",[e.element])},_enableUI:function(e){if(!(this._htOptions._sDisabled&&this._htOptions._sDisabled.indexOf(","+e+",")>-1)){var t,i;this.nUIStatus=0;var n=this.htWrappedUIList[e],o=this.htUIList[e];if(n){n.removeClass("off");var s=o.getElementsByTagName("BUTTON");for(t=0,i=s.length;i>t;t++)s[t].disabled=!1;var r="";if(this.aUICmdMap[e])for(t=0;tt;t++)s[t].disabled=!0;var r="";if(this.aUICmdMap[e])for(t=0;to;o++)n[o].onmousedown=function(){return!1}}if(!e||!e.tagName)return[];if("BUTTON"==(t=e).tagName)return(t=t.parentNode)&&"LI"==t.tagName&&this.rxUI.test(t.className)?[jindo.$Element(t)]:(t=e,(t=t.parentNode.parentNode)&&"LI"==t.tagName&&(i=jindo.$Element(t)).hasClass("se2_pair")?[i,jindo.$Element(e.parentNode)]:[]);if("SPAN"==(t=e).tagName){if((t=t.parentNode.parentNode)&&"LI"==t.tagName&&this.rxUI.test(t.className))return[jindo.$Element(t)];if((t=t.parentNode)&&"LI"==t.tagName&&this.rxUI.test(t.className))return[jindo.$Element(t)]}return[]},$ON_REGISTER_UI_EVENT:function(e,t,i,n){if(this.htUIList[e]){var o;this.aUICmdMap[e]||(this.aUICmdMap[e]=[]),this.aUICmdMap[e][this.aUICmdMap[e].length]=i,o=jindo.$$.getSingle("button",this.htUIList[e]),o&&this.oApp.registerBrowserEvent(o,t,i,n)}},getToolbarButtonByUIName:function(e){return jindo.$$.getSingle("BUTTON",this.htUIList[e])}}),nhn.husky.SE_EditingAreaManager=jindo.$Class({name:"SE_EditingAreaManager",oActivePlugin:null,elContentsField:null,bIsDirty:!1,bAutoResize:!1,$init:function(e,t,i,n,o){this.sDefaultEditingMode=e,this.elContentsField=jindo.$(t),this._assignHTMLElements(o),this.fOnBeforeUnload=n,this.oEditingMode={},this.elContentsField.style.display="none",this.nMinWidth=parseInt(i.nMinWidth||60,10),this.nMinHeight=parseInt(i.nMinHeight||60,10);var s=this._getSize([i.nWidth,i.width,this.elEditingAreaContainer.offsetWidth],this.nMinWidth),r=this._getSize([i.nHeight,i.height,this.elEditingAreaContainer.offsetHeight],this.nMinHeight);this.elEditingAreaContainer.style.width=s.nSize+s.sUnit,this.elEditingAreaContainer.style.height=r.nSize+r.sUnit,"px"===s.sUnit?o.style.width=s.nSize+2+"px":"%"===s.sUnit&&(o.style.minWidth=this.nMinWidth+"px")},_getSize:function(e,t){var i,n,o,s,r,a="px";for(t=parseInt(t,10),i=0,n=e.length;n>i;i++)if(e[i]){if(!isNaN(e[i])){s=parseInt(e[i],10),r=a;break}if(o=/([0-9]+)(.*)/i.exec(e[i]),!(!o||o.length<2||o[1]<=0)){s=parseInt(o[1],10),r=o[2],r||(r=a),t>s&&r===a&&(s=t);break}}return r||(r=a),(isNaN(s)||t>s&&r===a)&&(s=t),{nSize:s,sUnit:r}},_assignHTMLElements:function(e){this.elEditingAreaContainer=jindo.$$.getSingle("DIV.husky_seditor_editing_area_container",e);var t=function(){};this.elLoadingLayer=jindo.$$.getSingle(".se2_content_loading",e),this.elLoadingLayer||(this.$ON_SHOW_LOADING_LAYER=t,this.$ON_HIDE_LOADING_LAYER=t)},$BEFORE_MSG_APP_READY:function(e){this.oApp.exec("ADD_APP_PROPERTY",["version",nhn.husky.SE_EditingAreaManager.version]),this.oApp.exec("ADD_APP_PROPERTY",["elEditingAreaContainer",this.elEditingAreaContainer]),this.oApp.exec("ADD_APP_PROPERTY",["welEditingAreaContainer",jindo.$Element(this.elEditingAreaContainer)]),this.oApp.exec("ADD_APP_PROPERTY",["getEditingAreaHeight",jindo.$Fn(this.getEditingAreaHeight,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getEditingAreaWidth",jindo.$Fn(this.getEditingAreaWidth,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getRawContents",jindo.$Fn(this.getRawContents,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getContents",jindo.$Fn(this.getContents,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getIR",jindo.$Fn(this.getIR,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["setContents",this.setContents]),this.oApp.exec("ADD_APP_PROPERTY",["setIR",this.setIR]),this.oApp.exec("ADD_APP_PROPERTY",["getEditingMode",jindo.$Fn(this.getEditingMode,this).bind()])},$ON_MSG_APP_READY:function(){this.htOptions=this.oApp.htOptions[this.name]||{},this.sDefaultEditingMode=this.htOptions.sDefaultEditingMode||this.sDefaultEditingMode,this.iframeWindow=this.oApp.getWYSIWYGWindow(),this.oApp.exec("REGISTER_CONVERTERS",[]),this.oApp.exec("CHANGE_EDITING_MODE",[this.sDefaultEditingMode,!0]),this.oApp.exec("LOAD_CONTENTS_FIELD",[!1]),this.fOnBeforeUnload!==!1&&(this.fOnBeforeUnload?window.onbeforeunload=this.fOnBeforeUnload:window.onbeforeunload=jindo.$Fn(function(){return this.getRawContents()!=this.sCurrentRawContents||this.bIsDirty?this.oApp.$MSG("SE_EditingAreaManager.onExit"):void 0},this).bind())},$AFTER_MSG_APP_READY:function(){this.oApp.exec("UPDATE_RAW_CONTENTS"),this.oApp.htOptions[this.name]&&this.oApp.htOptions[this.name].bAutoResize&&(this.bAutoResize=this.oApp.htOptions[this.name].bAutoResize),this.oApp.oNavigator.msafari&&(this.bAutoResize=!0),this.startAutoResize()},$ON_LOAD_CONTENTS_FIELD:function(e){var t=this.elContentsField.value;t=t.replace(/^\s+/,""),this.oApp.exec("SET_CONTENTS",[t,e])},$ON_UPDATE_CONTENTS_FIELD:function(){this.elContentsField.value=this.oApp.getContents(),this.oApp.exec("UPDATE_RAW_CONTENTS")},$ON_UPDATE_RAW_CONTENTS:function(){this.sCurrentRawContents=this.oApp.getRawContents()},$BEFORE_CHANGE_EDITING_MODE:function(e){return this.oEditingMode[e]?(this.stopAutoResize(),this._oPrevActivePlugin=this.oActivePlugin,void(this.oActivePlugin=this.oEditingMode[e])):!1},$AFTER_CHANGE_EDITING_MODE:function(e,t){if(this._oPrevActivePlugin){var i=this._oPrevActivePlugin.getIR();this.oApp.exec("SET_IR",[i]),this._setEditingAreaDimension()}this.startAutoResize(),t||this.oApp.delayedExec("FOCUS",[],0)},$ON_SET_IS_DIRTY:function(e){this.bIsDirty=e},$ON_FOCUS:function(e){this.oActivePlugin&&"function"==typeof this.oActivePlugin.setIR&&(this.iframeWindow&&this.iframeWindow.document.hasFocus&&!this.iframeWindow.document.hasFocus()&&"WYSIWYG"==this.oActivePlugin.sMode?this.iframeWindow.focus():this.oActivePlugin.focus(),e&&this.oApp.bMobile||this.oActivePlugin.focus())},$ON_IE_FOCUS:function(){var e=this.oApp.oNavigator;(e.ie||e.edge)&&this.oApp.exec("FOCUS")},$ON_SET_CONTENTS:function(e,t){this.setContents(e,t)},$BEFORE_SET_IR:function(e,t){t=t||!1,t||this.oApp.exec("RECORD_UNDO_ACTION",["BEFORE SET CONTENTS",{sSaveTarget:"BODY"}])},$ON_SET_IR:function(e){this.oActivePlugin&&"function"==typeof this.oActivePlugin.setIR&&this.oActivePlugin.setIR(e)},$AFTER_SET_IR:function(e,t){t=t||!1,t||this.oApp.exec("RECORD_UNDO_ACTION",["AFTER SET CONTENTS",{sSaveTarget:"BODY"}])},$ON_REGISTER_EDITING_AREA:function(e){this.oEditingMode[e.sMode]=e,"WYSIWYG"==e.sMode&&this.attachDocumentEvents(e.oEditingArea),this._setEditingAreaDimension(e)},$ON_MSG_EDITING_AREA_RESIZE_STARTED:function(){this._fitElementInEditingArea(this.elEditingAreaContainer),this.oApp.exec("STOP_AUTORESIZE_EDITING_AREA"),this.oApp.exec("SHOW_EDITING_AREA_COVER"),this.elEditingAreaContainer.style.overflow="hidden",this.iStartingHeight=parseInt(this.elEditingAreaContainer.style.height,10)},$ON_STOP_AUTORESIZE_EDITING_AREA:function(){this.bAutoResize&&(this.stopAutoResize(),this.bAutoResize=!1)},startAutoResize:function(){this.bAutoResize&&this.oActivePlugin&&"function"==typeof this.oActivePlugin.startAutoResize&&this.oActivePlugin.startAutoResize()},stopAutoResize:function(){this.bAutoResize&&this.oActivePlugin&&"function"==typeof this.oActivePlugin.stopAutoResize&&this.oActivePlugin.stopAutoResize()},$ON_RESIZE_EDITING_AREA:function(e,t){null!==e&&"undefined"!=typeof e&&this._resizeWidth(e,"px"),null!==t&&"undefined"!=typeof t&&this._resizeHeight(t,"px"),this._setEditingAreaDimension()},_resizeWidth:function(e,t){var i=parseInt(e,10);ithis.oApp.elEditingAreaContainer.offsetHeight&&("number"==typeof t?e.style.top=i-e.offsetHeight-t+"px":e.style.top=this.oApp.elEditingAreaContainer.offsetHeight-e.offsetHeight+"px");var n=parseInt(e.style.left,10);n+e.offsetWidth>this.oApp.elEditingAreaContainer.offsetWidth&&(e.style.left=this.oApp.elEditingAreaContainer.offsetWidth-e.offsetWidth+"px")},$ON_EVENT_EDITING_AREA_KEYDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_EVENT_EDITING_AREA_MOUSEDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_EVENT_EDITING_AREA_SCROLL:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},_setEditingAreaDimension:function(e){e=e||this.oActivePlugin,this._fitElementInEditingArea(e.elEditingArea)},_fitElementInEditingArea:function(e){e.style.height=this.elEditingAreaContainer.offsetHeight+"px"},attachDocumentEvents:function(e){this.oApp.registerBrowserEvent(e,"click","EVENT_EDITING_AREA_CLICK"),this.oApp.registerBrowserEvent(e,"dblclick","EVENT_EDITING_AREA_DBLCLICK"),this.oApp.registerBrowserEvent(e,"mousedown","EVENT_EDITING_AREA_MOUSEDOWN"),this.oApp.registerBrowserEvent(e,"mousemove","EVENT_EDITING_AREA_MOUSEMOVE"),this.oApp.registerBrowserEvent(e,"mouseup","EVENT_EDITING_AREA_MOUSEUP"),this.oApp.registerBrowserEvent(e,"mouseout","EVENT_EDITING_AREA_MOUSEOUT"),this.oApp.registerBrowserEvent(e,"mousewheel","EVENT_EDITING_AREA_MOUSEWHEEL"),this.oApp.registerBrowserEvent(e,"keydown","EVENT_EDITING_AREA_KEYDOWN"),this.oApp.registerBrowserEvent(e,"keypress","EVENT_EDITING_AREA_KEYPRESS"),this.oApp.registerBrowserEvent(e,"keyup","EVENT_EDITING_AREA_KEYUP"),this.oApp.registerBrowserEvent(e,"scroll","EVENT_EDITING_AREA_SCROLL")},$ON_GET_COVER_DIV:function(e,t){this.elEditingAreaCover&&(t[e]=this.elEditingAreaCover)},$ON_SHOW_LOADING_LAYER:function(){this.elLoadingLayer.style.display="block"},$ON_HIDE_LOADING_LAYER:function(){this.elLoadingLayer.style.display="none"},getIR:function(){return this.oActivePlugin?this.oActivePlugin.getIR():""},setIR:function(e,t){this.oApp.exec("SET_IR",[e,t])},getRawContents:function(){return this.oActivePlugin?this.oActivePlugin.getRawContents():""},getContents:function(){this._convertLastBrToNbsp();var e,t=this.oApp.getIR();return e=this.oApp.applyConverter?this.oApp.applyConverter("IR_TO_DB",t,this.oApp.getWYSIWYGDocument()):t,e=this._cleanContents(e)},_convertLastBrToNbsp:function(){var e,t,i,n,o,s,r,a,l,h,d,c,_,p,E=this.oApp.getWYSIWYGDocument().body,u=document.createTextNode(" ");e=jindo.$$("br:last-child",E,{oneTimeOffCache:!0});for(var g=0,f=e.length;f>g;g++)if(a=null,p=null,t=e[g],n=this._findNextSiblingRecursive(t,{isReverse:!0}),n&&1===n.nodeType&&(i=n.nextSibling,s=this._findNextSiblingRecursive(i),!s)){if("IMG"===n.tagName.toUpperCase()?a=n:(r=jindo.$$("img:last-child",n,{oneTimeOffCache:!0}),r.length>0&&(a=r[r.length-1])),a)if(o=this._findNextSiblingRecursive(a),o==i){if(h=a.parentNode,!h)continue;l=jindo.$Element(a).width(),h=a.parentNode,d=jindo.$Element(h).width(),c=!(l===d)}else c=!0;else c=!0;p=t.parentNode,c?(_=u.cloneNode(!1), p.replaceChild(_,t)):this._recursiveRemoveChild(t)}},_findNextSiblingRecursive:function(e,t){for(var i,n=e,o=t&&t.isReverse?!0:!1,s=(new RegExp("^(P|DIV)$","i"),new RegExp("^(TD|BODY)$","i"));!i;)if(i=o?n.previousSibling:n.nextSibling,n=n.parentNode,s.test(n.tagName)){i=null;break}return i},_recursiveRemoveChild:function(e){var t,i=e.parentNode,n=e;do i.removeChild(n);while((t=i.childNodes)&&0==t.length&&(n=i)&&(i=i.parentNode))},_cleanContents:function(e){return e.replace(new RegExp("(]*>)"+unescape("%uFEFF"),"ig"),"$1")},setContents:function(e,t){var i;i=this.oApp.applyConverter?this.oApp.applyConverter("DB_TO_IR",e,this.oApp.getWYSIWYGDocument()):e,this.oApp.exec("SET_IR",[i,t])},getEditingMode:function(){return this.oActivePlugin.sMode},getEditingAreaWidth:function(){return this.elEditingAreaContainer.offsetWidth},getEditingAreaHeight:function(){return this.elEditingAreaContainer.offsetHeight}});var nSE2Version="5caeebb";nhn.husky.SE_EditingAreaManager.version={revision:"5caeebb",type:"open",number:"2.9.1"},nhn.husky.SE_EditingArea_WYSIWYG=jindo.$Class({name:"SE_EditingArea_WYSIWYG",status:nhn.husky.PLUGIN_STATUS.NOT_READY,sMode:"WYSIWYG",iframe:null,doc:null,bStopCheckingBodyHeight:!1,bAutoResize:!1,nBodyMinHeight:0,nScrollbarWidth:0,iLastUndoRecorded:0,_nIFrameReadyCount:50,bWYSIWYGEnabled:!1,$init:function(e){this.iframe=jindo.$(e);var t=jindo.$Agent().navigator();t.ie&&(this.iframe.style.display="none"),this.sBlankPageURL="smart_editor2_inputarea.html",this.sBlankPageURL_EmulateIE7="smart_editor2_inputarea_ie8.html",this.aAddtionalEmulateIE7=[],this.htOptions=nhn.husky.SE2M_Configuration.SE_EditingAreaManager,this.htOptions&&(this.sBlankPageURL=this.htOptions.sBlankPageURL||this.sBlankPageURL,this.sBlankPageURL_EmulateIE7=this.htOptions.sBlankPageURL_EmulateIE7||this.sBlankPageURL_EmulateIE7,this.aAddtionalEmulateIE7=this.htOptions.aAddtionalEmulateIE7||this.aAddtionalEmulateIE7),this.aAddtionalEmulateIE7.push(8),this.sIFrameSrc=this.sBlankPageURL,t.ie&&jindo.$A(this.aAddtionalEmulateIE7).has(t.nativeVersion)&&(this.sIFrameSrc=this.sBlankPageURL_EmulateIE7);var i=this.sIFrameSrc,e=this.iframe,n=jindo.$Fn(this.initIframe,this).bind(),o=jindo.$Fn(function(){this.iframe.src=i},this).bind();!t.ie||t.version>=9&&document.addEventListener?(e.addEventListener("load",n,!1),e.addEventListener("error",o,!1)):(e.attachEvent("onload",n),e.attachEvent("onerror",o)),e.src=i,this.elEditingArea=e},$BEFORE_MSG_APP_READY:function(){this.oEditingArea=this.iframe.contentWindow.document,this.oApp.exec("REGISTER_EDITING_AREA",[this]),this.oApp.exec("ADD_APP_PROPERTY",["getWYSIWYGWindow",jindo.$Fn(this.getWindow,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getWYSIWYGDocument",jindo.$Fn(this.getDocument,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["isWYSIWYGEnabled",jindo.$Fn(this.isWYSIWYGEnabled,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getRawHTMLContents",jindo.$Fn(this.getRawHTMLContents,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["setRawHTMLContents",jindo.$Fn(this.setRawHTMLContents,this).bind()]),this.isWYSIWYGEnabled()&&this.oApp.exec("ENABLE_WYSIWYG_RULER"),this.oApp.registerBrowserEvent(this.getDocument().body,"paste","EVENT_EDITING_AREA_PASTE"),this.oApp.registerBrowserEvent(this.getDocument().body,"drop","EVENT_EDITING_AREA_DROP")},$ON_MSG_APP_READY:function(){this.oApp.hasOwnProperty("saveSnapShot")||(this.$ON_EVENT_EDITING_AREA_MOUSEUP=function(){},this._recordUndo=function(){}),this._bIERangeReset=!0,this.oApp.oNavigator.ie||navigator.userAgent.indexOf("Edge")>-1?(this._bIECursorHide=!0,jindo.$Fn(function(e){var t=this.iframe.contentWindow.document.selection;t&&"control"===t.type.toLowerCase()&&8===e.key().keyCode&&(this.oApp.exec("EXECCOMMAND",["delete",!1,!1]),e.stop()),this._bIERangeReset=!1},this).attach(this.iframe.contentWindow.document,"keydown"),jindo.$Fn(function(e){this._oIERange=null,this._bIERangeReset=!0},this).attach(this.iframe.contentWindow.document.body,"mousedown"),this.getDocument().createRange||jindo.$Fn(this._onIEBeforeDeactivate,this).attach(this.iframe.contentWindow.document.body,"beforedeactivate"),jindo.$Fn(function(e){this._bIERangeReset=!1},this).attach(this.iframe.contentWindow.document.body,"mouseup")):this.oApp.oNavigator.bGPadBrowser&&(this.$ON_EVENT_TOOLBAR_TOUCHSTART=function(){this._oIERange=this.oApp.getSelection().cloneRange()}),this.fnSetBodyHeight=jindo.$Fn(this._setBodyHeight,this).bind(),this.fnCheckBodyChange=jindo.$Fn(this._checkBodyChange,this).bind(),this.fnSetBodyHeight(),this._nContainerHeight=this.oApp.getEditingAreaHeight(),this._setScrollbarWidth()},$ON_REGISTER_CONVERTERS:function(){this.oApp.exec("ADD_CONVERTER_DOM",["DB_TO_IR",jindo.$Fn(this._dbToIrDOM,this).bind()])},_dbToIrDOM:function(e){nhn.husky.SE2M_Utils.removeInvalidFont(e),nhn.husky.SE2M_Utils.convertFontToSpan(e)},_setScrollbarWidth:function(){var e=this.getDocument(),t=e.createElement("div");t.style.width="100px",t.style.height="100px",t.style.overflow="scroll",t.style.position="absolute",t.style.top="-9999px",e.body.appendChild(t),this.nScrollbarWidth=t.offsetWidth-t.clientWidth,e.body.removeChild(t)},$AFTER_EVENT_EDITING_AREA_KEYUP:function(e){if(this.bAutoResize){var t=e.key();t.keyCode>=33&&t.keyCode<=40||t.alt||t.ctrl||16===t.keyCode||this._setAutoResize()}},$AFTER_PASTE_HTML:function(){this.bAutoResize&&this._setAutoResize()},startAutoResize:function(){this.oApp.exec("STOP_CHECKING_BODY_HEIGHT"),this.bAutoResize=!0;var e=this.oApp.oNavigator;e.ie&&e.version<9?jindo.$Element(this.getDocument().body).css({overflow:"visible"}):jindo.$Element(this.getDocument().body).css({overflowX:"visible",overflowY:"hidden"}),this._setAutoResize(),this.nCheckBodyInterval=setInterval(this.fnCheckBodyChange,500),this.oApp.exec("START_FLOAT_TOOLBAR")},stopAutoResize:function(){this.bAutoResize=!1,clearInterval(this.nCheckBodyInterval),this.oApp.exec("STOP_FLOAT_TOOLBAR"),jindo.$Element(this.getDocument().body).css({overflow:"visible",overflowY:"visible"}),this.oApp.exec("START_CHECKING_BODY_HEIGHT")},_checkBodyChange:function(){if(this.bAutoResize){var e=this.getDocument().body.innerHTML.length;e!==this.nBodyLength&&(this.nBodyLength=e,this._setAutoResize())}},_setAutoResize:function(){var e,t,i,n,o=this.getDocument().body,s=jindo.$Element(o),r=!1,a=this.oApp.oNavigator;this.nTopBottomMargin=this.nTopBottomMargin||parseInt(s.css("marginTop"),10)+parseInt(s.css("marginBottom"),10),this.nBodyMinHeight=this.nBodyMinHeight||this.oApp.getEditingAreaHeight()-this.nTopBottomMargin,s.css("height","0px"),this.iframe.style.height="0px",e=parseInt(o.scrollHeight,10),ethis.nBodyMinHeight?(i=this.oApp.getCurrentStyle(),n=this._getStyleSize(i),nthis.nBodyMinHeight?(i=this.oApp.getCurrentStyle(),n=this._getStyleSize(i),ns?e-o:r,this._isHorizontalScrollbarVisible()&&(t-=this.nScrollbarWidth),h&&d||n.css("height",t+"px"),this.nBodyHeight_last=t,setTimeout(this.fnSetBodyHeight,500)}},_isHorizontalScrollbarVisible:function(){var e=this.getDocument();return e.documentElement.clientWidth8){var n=jindo.$$.getSingle("DIV.husky_seditor_editing_area_container").childNodes[0];"DIV"==n.tagName&&1e3==n.style.zIndex&&n.parentNode.removeChild(n)}this.iframe.style.visibility="visible","block"!=this.iframe.style.display&&(this.iframe.style.display="block"),this.oApp.exec("SET_EDITING_WINDOW",[this.getWindow()]),this.oApp.exec("START_CHECKING_BODY_HEIGHT")}else this.iframe.style.visibility="hidden",this.oApp.exec("STOP_CHECKING_BODY_HEIGHT")},$AFTER_CHANGE_EDITING_MODE:function(e,t){this._oIERange=null},$ON_ENABLE_WYSIWYG:function(){this._enableWYSIWYG()},$ON_DISABLE_WYSIWYG:function(){this._disableWYSIWYG()},$ON_IE_HIDE_CURSOR:function(){if(this._bIECursorHide){this._onIEBeforeDeactivate();var e=this.oApp.getWYSIWYGDocument().selection;if(e&&e.createRange)try{e.empty()}catch(t){e=this.oApp.getSelection(),e.select(),e.oBrowserSelection.selectNone()}else this.oApp.getEmptySelection().oBrowserSelection.selectNone(),this.getDocument().body.blur()}},$AFTER_SHOW_ACTIVE_LAYER:function(){this.oApp.exec("IE_HIDE_CURSOR"),this.bActiveLayerShown=!0},$BEFORE_EVENT_EDITING_AREA_KEYDOWN:function(e){this._bKeyDown=!0},$ON_EVENT_EDITING_AREA_KEYDOWN:function(e){if(this.oApp.getEditingMode()===this.sMode){var t=e.key();if(this.oApp.oNavigator.ie)switch(t.keyCode){case 33:this._pageUp(e);break;case 34:this._pageDown(e);break;case 8:this._backspace(e);break;case 46:this._delete(e)}else this.oApp.oNavigator.firefox&&8===t.keyCode&&this._backspace(e);this._recordUndo(t)}},_backspace:function(e){var t=this._prepareBackspaceDelete(!0);t&&this._removeUnremovable(t,!0)&&e.stop()},_delete:function(e){var t=this._prepareBackspaceDelete(!1);if(t)if(this._removeUnremovable(t,!1))e.stop();else if(3===t.nodeType){var i=this.oApp.getSelection().getLineInfo(),n=i.oEnd.oLineBreaker,o=n&&n.nextSibling;this._removeWrongSpan(o)}else this._removeWrongSpan(t)},_prepareBackspaceDelete:function(e){var t=this.oApp.getSelection();if(t.collapsed){var i=t.getNodeAroundRange(e,!1);return this._isLineFeed(i)&&(i=e?t._getPrevNode(i):t._getNextNode(i)),this._clearCursorHolderValue(i),i}},_isLineFeed:function(e){return e&&3===e.nodeType&&/^[\n]*$/.test(e.nodeValue)},_clearCursorHolderValue:function(e){!e||3!==e.nodeType||"​"!==e.nodeValue&&"\ufeff"!==e.nodeValue||(e.nodeValue="")},_removeUnremovable:function(e,t){var i=!1;if(!e)return!1;if("TABLE"===e.nodeName)e.parentNode.removeChild(e),i=!0;else if("DIV"===e.nodeName){var n=t?e.lastChild:e.firstChild;n?"TABLE"===n.nodeName?(e.removeChild(n),i=!0):1===n.nodeType&&""==jindo.$S(n.innerHTML).trim()&&(e.removeChild(n),i=!0):(e.parentNode.removeChild(e),i=!0)}return i},_removeWrongSpan:function(e){if(e&&"SPAN"===e.nodeName&&e.firstChild&&"P"===e.firstChild.nodeName){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}},$BEFORE_EVENT_EDITING_AREA_KEYUP:function(e){return this._bKeyDown?void(this._bKeyDown=!1):!1},$ON_EVENT_EDITING_AREA_MOUSEUP:function(e){this.oApp.saveSnapShot()},$BEFORE_PASTE_HTML:function(){this.oApp.getEditingMode()!==this.sMode&&this.oApp.exec("CHANGE_EDITING_MODE",[this.sMode])},$ON_PASTE_HTML:function(e,t,i){i=i||{};var n,o,s,r,a,l,h,d;if(this.oApp.getEditingMode()===this.sMode){if(this.focus(),i.bNoUndo||this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["PASTE HTML"]),o=jindo.$Agent().navigator(),n=t||this.oApp.getSelection(),n.pasteHTML(e,i.bBlock),o.ie?(n.collapseToEnd(),n.select(),this._oIERange=null,this._bIERangeReset=!1):(s=n.placeStringBookmark(),this.oApp.getWYSIWYGDocument().body.innerHTML=this.oApp.getWYSIWYGDocument().body.innerHTML,n.moveToBookmark(s),n.collapseToEnd(),n.select(),n.removeStringBookmark(s),n=this.oApp.getSelection(),t&&t.setRange(n)),e.indexOf("-1&&(r=n.startContainer,1===r.nodeType&&"P"===r.tagName&&(a=jindo.$Element(r).child(function(e){return 1===e.$value().nodeType&&"IMG"===e.$value().tagName},1),a.length>0)))for(l=a[a.length-1].$value(),h=l.nextSibling;h;)d=h.nextSibling,3!==h.nodeType||" "!==h.nodeValue&&h.nodeValue!==unescape("%u00A0")||r.removeChild(h),h=d;i.bNoUndo||this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["PASTE HTML"])}},$ON_FOCUS_N_CURSOR:function(e,t){var i,n;return t&&(i=jindo.$(t,this.getDocument()))?(clearTimeout(this._nTimerFocus),void(this._nTimerFocus=setTimeout(jindo.$Fn(function(e){this._scrollIntoView(e),this.oApp.exec("FOCUS")},this).bind(i),300))):(n=this.oApp.getSelection(),void(n.collapsed?e?(this.oApp.exec("FOCUS"),i=this.getDocument().body,n.selectNode(i),n.collapseToEnd(),n.select(),this._scrollIntoView(i)):this.oApp.exec("FOCUS"):(e?n.collapseToEnd():n.collapseToStart(),n.select())))},_getElementVerticalPosition:function(e){var t=0,i=e,n={nTop:0,nBottom:0};if(!e)return n;try{for(;i;)t+=i.offsetTop,i=i.offsetParent}catch(o){}return n.nTop=t,n.nBottom=t+jindo.$Element(e).height(),n},_getVisibleVerticalPosition:function(){var e,t,i,n={nTop:0,nBottom:0};return e=this.getWindow(),t=this.getDocument(),i=e.innerHeight?e.innerHeight:t.documentElement.clientHeight||t.body.clientHeight,n.nTop=e.pageYOffset||t.documentElement.scrollTop,n.nBottom=n.nTop+i,n},_isElementVisible:function(e,t){return e.nTop>=t.nTop&&e.nBottom<=t.nBottom},_scrollIntoView:function(e){var t=this._getElementVerticalPosition(e),i=this._getVisibleVerticalPosition(),n=0;if(!this._isElementVisible(t,i))return(n=t.nBottom-i.nBottom)>0?void this.getWindow().scrollTo(0,i.nTop+n):void this.getWindow().scrollTo(0,t.nTop)},$BEFORE_MSG_EDITING_AREA_RESIZE_STARTED:function(){if(!jindo.$Agent().navigator().ie){var e=null;e=this.oApp.getSelection(),this.sBM=e.placeStringBookmark()}},$AFTER_MSG_EDITING_AREA_RESIZE_ENDED:function(e,t,i){if(this.oApp.getEditingMode()===this.sMode&&!jindo.$Agent().navigator().ie){var n=this.oApp.getEmptySelection();n.moveToBookmark(this.sBM),n.select(),n.removeStringBookmark(this.sBM)}},$ON_CLEAR_IE_BACKUP_SELECTION:function(){this._oIERange=null},$ON_RESTORE_IE_SELECTION:function(){if(this._oIERange)try{this._oIERange.select(),this._oPrevIERange=this._oIERange,this._oIERange=null}catch(e){}},$ON_EVENT_EDITING_AREA_PASTE:function(e){this.oApp.delayedExec("EVENT_EDITING_AREA_PASTE_DELAY",[e],0)},$ON_EVENT_EDITING_AREA_PASTE_DELAY:function(e){this._replaceBlankToNbsp(e.element)},_replaceBlankToNbsp:function(e){var t=this.oApp.oNavigator;if(t.ie&&9===t.nativeVersion&&7===document.documentMode&&1===e.nodeType&&"BR"!==e.tagName){var i=jindo.$$("p:empty()",this.oApp.getWYSIWYGDocument().body,{oneTimeOffCache:!0});jindo.$A(i).forEach(function(e,t,i){e.innerHTML=" "})}},_pageUp:function(e){var t,i=this._getEditorHeight(),n=jindo.$Document(this.oApp.getWYSIWYGDocument()).scrollPosition();t=n.top<=i?0:n.top-i,this.oApp.getWYSIWYGWindow().scrollTo(0,t),e.stop()},_pageDown:function(e){var t,i=this._getEditorHeight(),n=jindo.$Document(this.oApp.getWYSIWYGDocument()).scrollPosition(),o=this._getBodyHeight();t=n.top+i>=o?o-i:n.top+i,this.oApp.getWYSIWYGWindow().scrollTo(0,t),e.stop()},_getEditorHeight:function(){return this.oApp.elEditingAreaContainer.offsetHeight-this.nTopBottomMargin},_getBodyHeight:function(){return parseInt(this.getDocument().body.scrollHeight,10)},initIframe:function(){try{if(!this.iframe.contentWindow.document||!this.iframe.contentWindow.document.body||"about:blank"===this.iframe.contentWindow.document.location.href)throw new Error("Access denied");var e=nhn.husky.SE2M_Configuration.SE2M_CSSLoader&&nhn.husky.SE2M_Configuration.SE2M_CSSLoader.sCSSBaseURI?nhn.husky.SE2M_Configuration.SE2M_CSSLoader.sCSSBaseURI:"";if(nhn.husky.SE2M_Configuration.SE_EditingAreaManager.sCSSBaseURI&&(e=nhn.husky.SE2M_Configuration.SE_EditingAreaManager.sCSSBaseURI),e){var t=e,i=this.oApp&&this.oApp.htOptions.I18N_LOCALE;i&&(t+="/"+i),t+="/smart_editor2_in.css";var n=this.getDocument(),o=n.getElementsByTagName("head")[0],s=n.createElement("link");s.type="text/css",s.rel="stylesheet",s.href=t,s.onload=jindo.$Fn(function(){this.oApp&&this.oApp.getEditingMode&&this.oApp.getEditingMode()===this.sMode&&this.oApp.exec("RESET_STYLE_STATUS"),s.onload=null},this).bind(),o.appendChild(s)}this._enableWYSIWYG(),this.status=nhn.husky.PLUGIN_STATUS.READY}catch(r){if(!(this._nIFrameReadyCount-- >0))throw"iframe for WYSIWYG editing mode can't be initialized. Please check if the iframe document exists and is also accessable(cross-domain issues). ";setTimeout(jindo.$Fn(this.initIframe,this).bind(),100)}},getIR:function(){var e,t=this.iframe.contentWindow.document.body.innerHTML;return e=this.oApp.applyConverter?this.oApp.applyConverter(this.sMode+"_TO_IR",t,this.oApp.getWYSIWYGDocument()):t},setIR:function(e){var t,i=this.oApp.oNavigator,n=i.ie&&document.documentMode<11,o=n?"":"
";if(t=this.oApp.applyConverter?this.oApp.applyConverter("IR_TO_"+this.sMode,e,this.oApp.getWYSIWYGDocument()):e,""===t.replace(/[\r\n\t\s]*/,"")&&("BR"!==this.oApp.sLineBreaker&&(o="

"+o+"

"),t=o),this.iframe.contentWindow.document.body.innerHTML=t,n&&this.oApp.getEditingMode()===this.sMode)for(var s=this.oApp.getWYSIWYGDocument().body.getElementsByTagName("P"),r=0,a=s.length;a>r;r++)1===s[r].childNodes.length&&" "===s[r].innerHTML&&(s[r].innerHTML="")},getRawContents:function(){return this.iframe.contentWindow.document.body.innerHTML},getRawHTMLContents:function(){return this.getRawContents()},setRawHTMLContents:function(e){this.iframe.contentWindow.document.body.innerHTML=e},getWindow:function(){return this.iframe.contentWindow},getDocument:function(){return this.iframe.contentWindow.document},focus:function(){this.getDocument().body.focus(),this.oApp.exec("RESTORE_IE_SELECTION")},_recordUndo:function(e){return e.keyCode>=33&&e.keyCode<=40?void this.oApp.saveSnapShot():void(e.alt||e.ctrl||16===e.keyCode||this.oApp.getLastKey()!==e.keyCode&&(this.oApp.setLastKey(e.keyCode),(e.enter||46===e.keyCode||8===e.keyCode)&&this.oApp.exec("RECORD_UNDO_ACTION",["KEYPRESS("+e.keyCode+")",{bMustBlockContainer:!0}])))},_enableWYSIWYG:function(){null!==this.iframe.contentWindow.document.body.contentEditable?this.iframe.contentWindow.document.body.contentEditable=!0:this.iframe.contentWindow.document.designMode="on",this.bWYSIWYGEnabled=!0,jindo.$Agent().navigator().firefox&&setTimeout(jindo.$Fn(function(){this.iframe.contentWindow.document.execCommand("enableInlineTableEditing",!1,!1)},this).bind(),0)},_disableWYSIWYG:function(){null!==this.iframe.contentWindow.document.body.contentEditable?this.iframe.contentWindow.document.body.contentEditable=!1:this.iframe.contentWindow.document.designMode="off",this.bWYSIWYGEnabled=!1},isWYSIWYGEnabled:function(){return this.bWYSIWYGEnabled}}),nhn.husky.SE_EditingArea_HTMLSrc=jindo.$Class({name:"SE_EditingArea_HTMLSrc",sMode:"HTMLSrc",bAutoResize:!1,nMinHeight:null,$init:function(e){this.elEditingArea=jindo.$(e)},$BEFORE_MSG_APP_READY:function(){this.oNavigator=jindo.$Agent().navigator(),this.oApp.exec("REGISTER_EDITING_AREA",[this])},$ON_MSG_APP_READY:function(){this.oApp.getEditingAreaHeight&&(this.nMinHeight=this.oApp.getEditingAreaHeight())},$ON_CHANGE_EDITING_MODE:function(e){e==this.sMode?(this.elEditingArea.style.display="block",this.elEditingArea.style.position="absolute",this.elEditingArea.style.top="0px"):(this.elEditingArea.style.display="none",this.elEditingArea.style.position="",this.elEditingArea.style.top="")},$AFTER_CHANGE_EDITING_MODE:function(e,t){if(e==this.sMode&&!t){var i=new TextRange(this.elEditingArea);i.setSelection(0,0)}},startAutoResize:function(){var e={nMinHeight:this.nMinHeight,wfnCallback:jindo.$Fn(this.oApp.checkResizeGripPosition,this).bind()};this.oNavigator.msafari&&(e.wfnCallback=function(){}),this.bAutoResize=!0,this.AutoResizer=new nhn.husky.AutoResizer(this.elEditingArea,e),this.AutoResizer.bind()},stopAutoResize:function(){this.AutoResizer.unbind()},getIR:function(){var e=this.getRawContents();return this.oApp.applyConverter&&(e=this.oApp.applyConverter(this.sMode+"_TO_IR",e,this.oApp.getWYSIWYGDocument())),e},setIR:function(e){("
"===e.toLowerCase()||"

 

"===e.toLowerCase()||"


"===e.toLowerCase()||"

"===e.toLowerCase())&&(e="");var t=jindo.$Agent().navigator();t.ie&&11==t.nativeVersion&&11==document.documentMode&&(e=e.replace(/(

$)/,""));var i=e;this.oApp.applyConverter&&(i=this.oApp.applyConverter("IR_TO_"+this.sMode,i,this.oApp.getWYSIWYGDocument())),this.setRawContents(i)},setRawContents:function(e){"undefined"!=typeof e&&(this.elEditingArea.value=e)},getRawContents:function(){return this.elEditingArea.value},focus:function(){this.elEditingArea.focus()}}),"undefined"==typeof window.TextRange&&(window.TextRange={}),TextRange=function(e,t){this._o=e,this._oDoc=t||document},TextRange.prototype.getSelection=function(){var e=this._o,t=[-1,-1];if(isNaN(this._o.selectionStart)){e.focus();var i=this._oDoc.body.createTextRange(),n=null;n=this._oDoc.selection.createRange().duplicate(),i.moveToElementText(e),n.collapse(!0),i.setEndPoint("EndToEnd",n),t[0]=i.text.length,n=this._oDoc.selection.createRange().duplicate(),i.moveToElementText(e),n.collapse(!1),i.setEndPoint("EndToEnd",n),t[1]=i.text.length,e.blur()}else t[0]=e.selectionStart,t[1]=e.selectionEnd;return t},TextRange.prototype.setSelection=function(e,t){var i=this._o;if("undefined"==typeof t&&(t=e),i.setSelectionRange)i.setSelectionRange(e,t);else if(i.createTextRange){var n=i.createTextRange();n.collapse(!0),n.moveStart("character",e),n.moveEnd("character",t-e),n.select(),i.blur()}},TextRange.prototype.copy=function(){var e=this.getSelection();return this._o.value.substring(e[0],e[1])},TextRange.prototype.paste=function(e){var t=this._o,i=this.getSelection(),n=t.value,o=n.substr(0,i[0]),s=n.substr(i[1]);n=o+e+s,t.value=n;var r=0;if("undefined"==typeof this._oDoc.body.style.maxHeight){var a=o.match(/\n/gi);r=null!==a?a.length:0}this.setSelection(i[0]+e.length-r)},TextRange.prototype.cut=function(){var e=this.copy();return this.paste(""),e},nhn.husky.SE_EditingArea_TEXT=jindo.$Class({name:"SE_EditingArea_TEXT",sMode:"TEXT",sRxConverter:"@[0-9]+@",bAutoResize:!1,nMinHeight:null,$init:function(e){this.elEditingArea=jindo.$(e)},$BEFORE_MSG_APP_READY:function(){this.oNavigator=jindo.$Agent().navigator(),this.oApp.exec("REGISTER_EDITING_AREA",[this]),this.oApp.exec("ADD_APP_PROPERTY",["getTextAreaContents",jindo.$Fn(this.getRawContents,this).bind()])},$ON_MSG_APP_READY:function(){this.oApp.getEditingAreaHeight&&(this.nMinHeight=this.oApp.getEditingAreaHeight())},$ON_REGISTER_CONVERTERS:function(){this.oApp.exec("ADD_CONVERTER",["IR_TO_TEXT",jindo.$Fn(this.irToText,this).bind()]),this.oApp.exec("ADD_CONVERTER",["TEXT_TO_IR",jindo.$Fn(this.textToIr,this).bind()])},$ON_CHANGE_EDITING_MODE:function(e){e==this.sMode?(this.elEditingArea.style.display="block",this.elEditingArea.style.position="absolute",this.elEditingArea.style.top="0px"):(this.elEditingArea.style.display="none",this.elEditingArea.style.position="",this.elEditingArea.style.top="")},$AFTER_CHANGE_EDITING_MODE:function(e,t){if(e==this.sMode&&!t){var i=new TextRange(this.elEditingArea);i.setSelection(0,0)}},irToText:function(e){var t=e,i=0,n=t.match(new RegExp(this.sRxConverter));return null!==n&&(t=t.replace(new RegExp(this.sRxConverter),"")),t=t.replace(/\r/g,""),t=t.replace(/[\n|\t]/g,""),t=t.replace(/[\v|\f]/g,""),t=t.replace(/


<\/p>/gi,"\n"),t=t.replace(/

 <\/P>/gi,"\n"),t=t.replace(//gi,"\n"),t=t.replace(//gi,"\n"),t=t.replace(/<\/p(\s[^\/]*)?>/gi,"\n"),t=t.replace(/<\/li(\s[^\/]*)?>/gi,"\n"),t=t.replace(/<\/tr(\s[^\/]*)?>/gi,"\n"),i=t.lastIndexOf("\n"),i>-1&&"\n"==t.substring(i)&&(t=t.substring(0,i)),t=jindo.$S(t).stripTags().toString(),t=this.unhtmlSpecialChars(t),null!==n&&(t=n[0]+t),t},textToIr:function(e){if(e){var t=e,i=null;return i=t.match(new RegExp(this.sRxConverter)),null!==i&&(t=t.replace(i[0],"")),t=this.htmlSpecialChars(t),t=this._addLineBreaker(t),null!==i&&(t=i[0]+t),t}},_addLineBreaker:function(e){if("BR"===this.oApp.sLineBreaker)return e.replace(/\r?\n/g,"
");for(var t=new StringBuffer,i=e.split("\n"),n=i.length,o="",s=0;n>s&&(o=jindo.$S(i[s]).trim().$value(),s!==n-1||""!==o);s++)null!==o&&""!==o?(t.append("

"),t.append(i[s]),t.append("

")):jindo.$Agent().navigator().ie?t.append("

 

"):t.append("


");return t.toString()},startAutoResize:function(){var e={nMinHeight:this.nMinHeight,wfnCallback:jindo.$Fn(this.oApp.checkResizeGripPosition,this).bind()};this.oNavigator.msafari&&(e.wfnCallback=function(){}),this.bAutoResize=!0,this.AutoResizer=new nhn.husky.AutoResizer(this.elEditingArea,e),this.AutoResizer.bind()},stopAutoResize:function(){this.AutoResizer.unbind()},getIR:function(){var e=this.getRawContents();return this.oApp.applyConverter&&(e=this.oApp.applyConverter(this.sMode+"_TO_IR",e,this.oApp.getWYSIWYGDocument())),e},setIR:function(e){var t=e;this.oApp.applyConverter&&(t=this.oApp.applyConverter("IR_TO_"+this.sMode,t,this.oApp.getWYSIWYGDocument())),this.setRawContents(t)},setRawContents:function(e){"undefined"!=typeof e&&(this.elEditingArea.value=e)},getRawContents:function(){return this.elEditingArea.value},focus:function(){this.elEditingArea.focus()},htmlSpecialChars:function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/ /g," ")},unhtmlSpecialChars:function(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/ /g," ").replace(/&/g,"&")}}),nhn.husky.SE_EditingAreaVerticalResizer=jindo.$Class({name:"SE_EditingAreaVerticalResizer",oResizeGrip:null,sCookieNotice:"bHideResizeNotice",nEditingAreaMinHeight:null,htConversionMode:null,$init:function(e,t){this.htConversionMode=t,this._assignHTMLElements(e)},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["isUseVerticalResizer",jindo.$Fn(this.isUseVerticalResizer,this).bind()])},$ON_MSG_APP_READY:function(){this.oApp.bMobile?(this.oResizeGrip.disabled=!0,this.oResizeGrip.style.height="0"):(this.oApp.exec("REGISTER_HOTKEY",["shift+esc","FOCUS_RESIZER"]),this.isUseVerticalResizer()?(this.oResizeGrip.style.display="block",this.welNoticeLayer&&!Number(jindo.$Cookie().get(this.sCookieNotice))&&(this.welNoticeLayer.delegate("click","BUTTON.bt_clse",jindo.$Fn(this._closeNotice,this).bind()),this.welNoticeLayer.show()),this.$FnMouseDown=jindo.$Fn(this._mousedown,this),this.$FnMouseMove=jindo.$Fn(this._mousemove,this),this.$FnMouseUp=jindo.$Fn(this._mouseup,this),this.$FnMouseOver=jindo.$Fn(this._mouseover,this),this.$FnMouseOut=jindo.$Fn(this._mouseout,this),this.$FnMouseDown.attach(this.oResizeGrip,"mousedown"),this.$FnMouseOver.attach(this.oResizeGrip,"mouseover"),this.$FnMouseOut.attach(this.oResizeGrip,"mouseout")):(this.oResizeGrip.style.display="none",this.oApp.isUseModeChanger()||(this.elModeToolbar.style.display="none"))),this.oApp.exec("ADD_APP_PROPERTY",["checkResizeGripPosition",jindo.$Fn(this.checkResizeGripPosition,this).bind()]),this.oApp.getEditingAreaHeight&&(this.nEditingAreaMinHeight=this.oApp.getEditingAreaHeight())},$ON_DISABLE_ALL_UI:function(){this.oResizeGrip.style.cursor="default",this.welConversionMode.addClass("off"),this.oResizeGrip.disabled=!0},$ON_ENABLE_ALL_UI:function(){this.oResizeGrip.style.cursor="n-resize",this.welConversionMode.removeClass("off"),this.oResizeGrip.disabled=!1},isUseVerticalResizer:function(){return"undefined"==typeof this.htConversionMode||"undefined"==typeof this.htConversionMode.bUseVerticalResizer||this.htConversionMode.bUseVerticalResizer===!0?!0:!1},checkResizeGripPosition:function(e){var t=jindo.$Document(),i=jindo.$Element(this.oResizeGrip).offset().top-t.scrollPosition().top+25-t.clientSize().height;0>=i||(e&&(this.nEditingAreaMinHeight>this.oApp.getEditingAreaHeight()-i&&(i=-1*(this.nEditingAreaMinHeight-this.oApp.getEditingAreaHeight())),this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED"),this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,-1*i]),this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED")),this.oApp.exec("STOP_AUTORESIZE_EDITING_AREA"))},$ON_FOCUS_RESIZER:function(){this.oApp.exec("IE_HIDE_CURSOR"),this.oResizeGrip.focus()},_assignHTMLElements:function(e,t){this.oResizeGrip=jindo.$$.getSingle("BUTTON.husky_seditor_editingArea_verticalResizer",e),this.elModeToolbar=jindo.$$.getSingle("DIV.se2_conversion_mode",e),this.welNoticeLayer=jindo.$Element(jindo.$$.getSingle("DIV.husky_seditor_resize_notice",e)),this.welConversionMode=jindo.$Element(this.oResizeGrip.parentNode)},_mouseover:function(e){e.stopBubble(),this.welConversionMode.addClass("controller_on")},_mouseout:function(e){e.stopBubble(),this.welConversionMode.removeClass("controller_on")},_mousedown:function(e){this.iStartHeight=e.pos().clientY,this.iStartHeightOffset=e.pos().layerY,this.$FnMouseMove.attach(document,"mousemove"),this.$FnMouseUp.attach(document,"mouseup"),this.iStartHeight=e.pos().clientY,this.oApp.exec("HIDE_ACTIVE_LAYER"),this.oApp.exec("HIDE_ALL_DIALOG_LAYER"),this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])},_mousemove:function(e){var t=e.pos().clientY-this.iStartHeight;this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,t])},_mouseup:function(e){this.$FnMouseMove.detach(document,"mousemove"),this.$FnMouseUp.detach(document,"mouseup"),this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])},_closeNotice:function(){this.welNoticeLayer.hide(),jindo.$Cookie().set(this.sCookieNotice,1,3650)}}),nhn.husky.SE_WYSIWYGEnterKey=jindo.$Class({name:"SE_WYSIWYGEnterKey",$init:function(e){"BR"==e?this.sLineBreaker="BR":this.sLineBreaker="P",this.htBrowser=jindo.$Agent().navigator(),this.htBrowser.opera&&"P"==this.sLineBreaker&&(this.$ON_MSG_APP_READY=function(){}),this.htBrowser.ie?this._addCursorHolder=this._addCursorHolderSpace:(this._addExtraCursorHolder=function(){},this._addBlankText=function(){})},$ON_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["sLineBreaker",this.sLineBreaker]),this.oSelection=this.oApp.getEmptySelection(),this.tmpTextNode=this.oSelection._document.createTextNode(unescape("%u00A0")),jindo.$Fn(this._onKeyDown,this).attach(this.oApp.getWYSIWYGDocument(),"keydown")},_onKeyDown:function(e){var t=e.key();t.shift||t.enter&&("BR"==this.sLineBreaker?this._insertBR(e):this._wrapBlock(e))},$ON_REGISTER_CONVERTERS:function(){this.oApp.exec("ADD_CONVERTER",["IR_TO_DB",jindo.$Fn(this.onIrToDB,this).bind()])},onIrToDB:function(e){var t=e,i=/(]*>)(?:\s*)(<\/p>)/gi;return t=this.htBrowser.ie&&this.htBrowser.version<11?t.replace(i,"$1 $2"):t.replace(i,"")},_addBlankText:function(e){var t,i,n,o,s,r=e.getNodes();for(t=0,i=r.length;i>t;t++)n=r[t],1===n.nodeType&&"SPAN"===n.tagName&&(n.id.indexOf(e.HUSKY_BOOMARK_START_ID_PREFIX)>-1||n.id.indexOf(e.HUSKY_BOOMARK_END_ID_PREFIX)>-1||(o=n.firstChild, (!o||3==o.nodeType&&nhn.husky.SE2M_Utils.isBlankTextNode(o)||1==o.nodeType&&1==n.childNodes.length&&(o.id.indexOf(e.HUSKY_BOOMARK_START_ID_PREFIX)>-1||o.id.indexOf(e.HUSKY_BOOMARK_END_ID_PREFIX)>-1))&&(s=e._document.createTextNode(unescape("%uFEFF")),n.appendChild(s))))},_addCursorHolder:function(e){var t=e;return(""==e.innerHTML||(t=this._getStyleOnlyNode(e)))&&(t.innerHTML="
"),t||(t=this._getStyleNode(e)),t},_addCursorHolderSpace:function(e){var t;if(this._addSpace(e),t=this._getStyleNode(e),""==t.innerHTML&&"param"!=t.nodeName.toLowerCase())try{t.innerHTML=unescape("%uFEFF")}catch(i){}return t},_getBlockEndNode:function(e,t){return e?"BR"===e.nodeName?e:e===t?t:this._getBlockEndNode(e.nextSibling,t):t},_convertHeadSpace:function(e){if(e&&3===e.nodeType){for(var t,i=e.nodeValue,n="",o=0;(t=i[o])&&" "===t;o++)n+=" ";o>0&&(e.nodeValue=n+i.substring(o))}},_getValidNextSibling:function(e){var t=e.nextSibling;return t?3==t.nodeType&&""==t.nodeValue?arguments.callee(t):t:null},_wrapBlock:function(e){var t,i,n,o=this.oApp.getSelection(),s=o.placeStringBookmark(),r=o.getLineInfo(),a=r.oStart,l=r.oEnd;if((!a.bParentBreak||o.rxBlockContainer.test(a.oLineBreaker.tagName))&&(e.stop(),o.deleteContents(),a.oNode.parentNode&&11!==a.oNode.parentNode.nodeType)){t=this.oApp.getWYSIWYGDocument().createElement(this.sLineBreaker),o.moveToBookmark(s),o.setStartBefore(a.oNode),o.surroundContents(t),o.collapseToEnd(),i=this.oApp.getWYSIWYGDocument().createElement(this.sLineBreaker);var h=this._getBlockEndNode(a.oNode,l.oNode);return h===a.oNode&&(h=l.oNode),o.setEndAfter(h),this._addBlankText(o),o.surroundContents(i),o.moveToStringBookmark(s,!0),o.collapseToEnd(),o.removeStringBookmark(s),o.select(),this._addCursorHolder(t),null!==i.lastChild&&"BR"==i.lastChild.tagName&&i.removeChild(i.lastChild),n=this._addCursorHolder(i),i.nextSibling&&"BR"==i.nextSibling.tagName&&i.parentNode.removeChild(i.nextSibling),o.selectNodeContents(n),o.collapseToStart(),o.select(),this.oApp.exec("CHECK_STYLE_CHANGE"),s=o.placeStringBookmark(),void setTimeout(jindo.$Fn(function(e){var t=o.getStringBookmark(e);t&&(o.moveToStringBookmark(e),o.select(),o.removeStringBookmark(e))},this).bind(s),0)}var d=o.getStringBookmark(s,!0);if(this.htBrowser.firefox)d&&d.nextSibling&&"IFRAME"==d.nextSibling.tagName?setTimeout(jindo.$Fn(function(e){var t=o.getStringBookmark(e);t&&(o.moveToStringBookmark(e),o.select(),o.removeStringBookmark(e))},this).bind(s),0):(setTimeout(jindo.$Fn(function(e){this._convertHeadSpace(e)},this).bind(d.nextSibling),0),o.removeStringBookmark(s));else if(this.htBrowser.ie){var c=d.parentNode,_=!1,p=!1;if(this._firstBR2Line(c,o,l.oLineBreaker),!d||!c)return void o.removeStringBookmark(s);if(setTimeout(jindo.$Fn(function(){this.oApp.getSelection().removeStringBookmark(s)},this).bind(s),0),_="U"===c.tagName||null!==nhn.husky.SE2M_Utils.findAncestorByTagName("U",c),p="S"===c.tagName||"STRIKE"===c.tagName||null!==nhn.husky.SE2M_Utils.findAncestorByTagName("S",c)&&null!==nhn.husky.SE2M_Utils.findAncestorByTagName("STRIKE",c),_||p)return void setTimeout(jindo.$Fn(this._addTextDecorationTag,this).bind(_,p),0);setTimeout(jindo.$Fn(this._addExtraCursorHolder,this).bind(c),0)}else{var c=d.parentNode,E=this._getValidNextSibling(d);if("SPAN"==c.tagName&&E&&"BR"==E.nodeName&&E.nextSibling){o.deleteContents(),o.setEndNodes(d,l.oLineBreaker);var u=o.extractContents(),g=u.firstChild;c=a.oLineBreaker.parentNode,E=a.oLineBreaker.nextSibling,E?c.insertBefore(u,E):c.appendChild(u),o.selectNodeContents(g),o.collapseToStart(),o.select(),o.removeStringBookmark(s),e.stop()}else this._convertHeadSpace(d.nextSibling),o.removeStringBookmark(s)}},_firstBR2Line:function(e,t,i){for(;e.firstChild&&"BR"===e.firstChild.nodeName;){var n=t._document.createTextNode("​");e.replaceChild(n,e.firstChild),t.setStartBefore(i),t.setEndAfter(n),i.parentNode.insertBefore(t.extractContents(),i)}},_addExtraCursorHolder:function(e){var t,i,n;if(e=this._getStyleOnlyNode(e),e&&"SPAN"===e.tagName){for(t=e.lastChild;t;)i=t.previousSibling,3===t.nodeType?(nhn.husky.SE2M_Utils.isBlankTextNode(t)&&t.parentNode.removeChild(t),t=i):t=i;n=e.innerHTML,""===n.replace("​","").replace("\ufeff","")&&(e.innerHTML="​")}var o,s=this.oApp.getSelection();s.collapsed&&(s.fixCommonAncestorContainer(),o=s.commonAncestorContainer,o&&(o=s._getVeryFirstRealChild(o),3===o.nodeType&&(o=o.parentNode),o&&"SPAN"===o.tagName&&(n=o.innerHTML,""===n.replace("​","").replace("\ufeff","")&&(o.innerHTML="​"),s.selectNodeContents(o),s.collapseToStart(),s.select())))},_addSpace:function(e){var t,i,n,o,s,r;if(e){if(3===e.nodeType)return e.parentNode;if("P"!==e.tagName)return e;if(s=jindo.$Element(e).child(function(e){return 1===e.$value().nodeType&&"IMG"===e.$value().tagName},1),s.length>0){for(r=s[s.length-1].$value(),i=r.nextSibling;i;)n=i.nextSibling,3!==i.nodeType||" "!==i.nodeValue&&i.nodeValue!==unescape("%u00A0")&&"​"!==i.nodeValue||e.removeChild(i),i=n;return e}for(i=e.firstChild,n=i,o=!1;i;)n=i.nextSibling,3===i.nodeType&&(i.nodeValue===unescape("%uFEFF")&&e.removeChild(i),o||" "!==i.nodeValue&&i.nodeValue!==unescape("%u00A0")&&"​"!==i.nodeValue||(o=!0)),i=n;return o||(t=this.tmpTextNode.cloneNode(),e.appendChild(t)),e}},_addTextDecorationTag:function(e,t){var i,n,o=this.oApp.getSelection();if(o.collapsed){for(i=o.startContainer;i;){if(3===i.nodeType){i=nhn.DOMFix.parentNode(i);break}if(!i.childNodes||0===i.childNodes.length)break;i=i.firstChild}i&&"U"!==i.tagName&&"S"!==i.tagName&&"STRIKE"!==i.tagName&&(e&&(n=o._document.createElement("U"),i.appendChild(n),i=n),t&&(n=o._document.createElement("STRIKE"),i.appendChild(n)),n.innerHTML="​",o.selectNodeContents(n),o.collapseToEnd(),o.select())}},_getStyleNode:function(e){for(;e.firstChild&&this.oSelection._isBlankTextNode(e.firstChild);)e.removeChild(e.firstChild);var t=e.firstChild;return t?3===t.nodeType||1===t.nodeType&&("IMG"==t.tagName||"BR"==t.tagName||"HR"==t.tagName||"IFRAME"==t.tagName)?e:this._getStyleNode(e.firstChild):e},_getStyleOnlyNode:function(e){if(!e)return null;if(!e.insertBefore)return null;if("IMG"==e.tagName||"BR"==e.tagName||"HR"==e.tagName||"IFRAME"==e.tagName)return null;for(;e.firstChild&&this.oSelection._isBlankTextNode(e.firstChild);)e.removeChild(e.firstChild);return e.childNodes.length>1?null:e.firstChild?3===e.firstChild.nodeType?nhn.husky.SE2M_Utils.isBlankTextNode(e.firstChild)?e:null:this._getStyleOnlyNode(e.firstChild):e},_insertBR:function(e){e.stop();var t=this.oApp.getSelection(),i=this.oApp.getWYSIWYGDocument().createElement("BR");if(t.insertNode(i),t.selectNode(i),t.collapseToEnd(),!this.htBrowser.ie){var n=t.getLineInfo(),o=n.oEnd;if(o.bParentBreak){for(;o.oNode&&3==o.oNode.nodeType&&""==o.oNode.nodeValue;)o.oNode=o.oNode.previousSibling;var s=1;(o.oNode==i||o.oNode.nextSibling==i)&&(s=0),0===s&&(t.pasteHTML("
"),t.collapseToEnd())}}t.insertNode(this.oApp.getWYSIWYGDocument().createTextNode("")),t.select()}}),nhn.husky.SE2M_EditingModeChanger=jindo.$Class({name:"SE2M_EditingModeChanger",htConversionMode:null,$init:function(e,t){this.htConversionMode=t,this._assignHTMLElements(e)},_assignHTMLElements:function(e){e=jindo.$(e)||document,this.elWYSIWYGButton=jindo.$$.getSingle("BUTTON.se2_to_editor",e),this.elHTMLSrcButton=jindo.$$.getSingle("BUTTON.se2_to_html",e),this.elTEXTButton=jindo.$$.getSingle("BUTTON.se2_to_text",e),this.elModeToolbar=jindo.$$.getSingle("DIV.se2_conversion_mode",e),this.welWYSIWYGButtonLi=jindo.$Element(this.elWYSIWYGButton.parentNode),this.welHTMLSrcButtonLi=jindo.$Element(this.elHTMLSrcButton.parentNode),this.welTEXTButtonLi=jindo.$Element(this.elTEXTButton.parentNode)},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["isUseModeChanger",jindo.$Fn(this.isUseModeChanger,this).bind()])},$ON_MSG_APP_READY:function(){this.oApp.htOptions.bOnlyTextMode?(this.elWYSIWYGButton.style.display="none",this.elHTMLSrcButton.style.display="none",this.elTEXTButton.style.display="block",this.oApp.exec("CHANGE_EDITING_MODE",["TEXT"])):(this.oApp.registerBrowserEvent(this.elWYSIWYGButton,"click","EVENT_CHANGE_EDITING_MODE_CLICKED",["WYSIWYG"]),this.oApp.registerBrowserEvent(this.elHTMLSrcButton,"click","EVENT_CHANGE_EDITING_MODE_CLICKED",["HTMLSrc"]),this.oApp.registerBrowserEvent(this.elTEXTButton,"click","EVENT_CHANGE_EDITING_MODE_CLICKED",["TEXT",!1]),this.showModeChanger(),this.isUseModeChanger()===!1&&this.oApp.isUseVerticalResizer()===!1&&(this.elModeToolbar.style.display="none"))},showModeChanger:function(){this.isUseModeChanger()?(this.elWYSIWYGButton.style.display="block",this.elHTMLSrcButton.style.display="block",this.elTEXTButton.style.display="block"):(this.elWYSIWYGButton.style.display="none",this.elHTMLSrcButton.style.display="none",this.elTEXTButton.style.display="none")},isUseModeChanger:function(){return"undefined"==typeof this.htConversionMode||"undefined"==typeof this.htConversionMode.bUseModeChanger||this.htConversionMode.bUseModeChanger===!0?!0:!1},$ON_EVENT_CHANGE_EDITING_MODE_CLICKED:function(e,t){if("TEXT"==e){var i=this.oApp.getIR();if(i.length>0&&!t&&!confirm(this.oApp.$MSG("SE2M_EditingModeChanger.confirmTextMode")))return!1;this.oApp.exec("CHANGE_EDITING_MODE",[e])}else this.oApp.exec("CHANGE_EDITING_MODE",[e]);"HTMLSrc"==e?this.oApp.exec("MSG_NOTIFY_CLICKCR",["htmlmode"]):"TEXT"==e?this.oApp.exec("MSG_NOTIFY_CLICKCR",["textmode"]):this.oApp.exec("MSG_NOTIFY_CLICKCR",["editormode"])},$ON_DISABLE_ALL_UI:function(e){e=e||{};var t=jindo.$A(e.aExceptions||[]);t.has("mode_switcher")||("WYSIWYG"==this.oApp.getEditingMode()?(this.welWYSIWYGButtonLi.removeClass("active"),this.elHTMLSrcButton.disabled=!0,this.elTEXTButton.disabled=!0):"TEXT"==this.oApp.getEditingMode()?(this.welTEXTButtonLi.removeClass("active"),this.elWYSIWYGButton.disabled=!0,this.elHTMLSrcButton.disabled=!0):(this.welHTMLSrcButtonLi.removeClass("active"),this.elWYSIWYGButton.disabled=!0,this.elTEXTButton.disabled=!0))},$ON_ENABLE_ALL_UI:function(){"WYSIWYG"==this.oApp.getEditingMode()?(this.welWYSIWYGButtonLi.addClass("active"),this.elHTMLSrcButton.disabled=!1,this.elTEXTButton.disabled=!1):"TEXT"==this.oApp.getEditingMode()?(this.welTEXTButtonLi.addClass("active"),this.elWYSIWYGButton.disabled=!1,this.elHTMLSrcButton.disabled=!1):(this.welHTMLSrcButtonLi.addClass("active"),this.elWYSIWYGButton.disabled=!1,this.elTEXTButton.disabled=!1)},$ON_CHANGE_EDITING_MODE:function(e){"HTMLSrc"==e?(this.welWYSIWYGButtonLi.removeClass("active"),this.welHTMLSrcButtonLi.addClass("active"),this.welTEXTButtonLi.removeClass("active"),this.elWYSIWYGButton.disabled=!1,this.elHTMLSrcButton.disabled=!0,this.elTEXTButton.disabled=!1,this.oApp.exec("HIDE_ALL_DIALOG_LAYER"),this.oApp.exec("DISABLE_ALL_UI",[{aExceptions:["mode_switcher"]}])):"TEXT"==e?(this.welWYSIWYGButtonLi.removeClass("active"),this.welHTMLSrcButtonLi.removeClass("active"),this.welTEXTButtonLi.addClass("active"),this.elWYSIWYGButton.disabled=!1,this.elHTMLSrcButton.disabled=!1,this.elTEXTButton.disabled=!0,this.oApp.exec("HIDE_ALL_DIALOG_LAYER"),this.oApp.exec("DISABLE_ALL_UI",[{aExceptions:["mode_switcher"]}])):(this.welWYSIWYGButtonLi.addClass("active"),this.welHTMLSrcButtonLi.removeClass("active"),this.welTEXTButtonLi.removeClass("active"),this.elWYSIWYGButton.disabled=!0,this.elHTMLSrcButton.disabled=!1,this.elTEXTButton.disabled=!1,this.oApp.exec("RESET_STYLE_STATUS"),this.oApp.exec("ENABLE_ALL_UI",[]))}}),nhn.husky.SE_PasteHandler=jindo.$Class({name:"SE_PasteHandler",_rxStyleTag:/]*)?>(?:.|\r|\n)*?<\/style>/gi,_rxStyleTagStrip:/<\/?style(?:\s+[^>]*)?>/gi,_rxClassSelector:/\w*\.\w+/g,_rxClassSelectorStart:/\w*\./g,$init:function(){},_getTmpDocument:function(){if(!this._oTmpDoc){var e=document.createElement("IFRAME");e.style.display="none",document.body.appendChild(e);var t=e.contentWindow.document;t.open(),t.write(""),t.close(),this._oTmpDoc=t}return this._oTmpDoc},_getCSSStyleRule:function(e){for(var t,i={},n=0;t=e[n];n++)t.type===CSSRule.STYLE_RULE&&(i[t.selectorText]=t.style);return i},_extractStyle:function(e){if(e){var t=e.match(this._rxStyleTag)||[],i=t.join("\n");i=i.replace(this._rxStyleTagStrip,"");var n=this._getTmpDocument(),o=n.getElementsByTagName("HEAD")[0],s=n.createElement("STYLE");s.innerHTML=i,o.appendChild(s),this._htStyleRule=this._getCSSStyleRule(s.sheet.cssRules),s.parentNode.removeChild(s)}},_applyInlineStyle:function(e,t,i){for(var n,o=0,s=t.length;s>o;o++)n=t[o],(i||!e.style[n])&&(e.style[n]=t[n])},_applyStyleRuleToInline:function(e,t,i){var n=e.match(this._rxClassSelector)||[];if(!(n.length<1))for(var o,s=n.join(" ").replace(this._rxClassSelectorStart,""),r=jindo.$$(e,i),a=0;o=r[a];a++)this._applyInlineStyle(o,t),s&&jindo.$Element(o).removeClass(s)},_applyStyle:function(e){var t=this._htStyleRule||{};for(var i in t)this._applyStyleRuleToInline(i,t[i],e);this._htStyleRule=null},_revertFontAfterPaste:function(e){nhn.husky.SE2M_Utils.removeInvalidFont(e),document.documentMode<11?nhn.husky.SE2M_Utils.stripTags(e,"FONT"):nhn.husky.SE2M_Utils.convertFontToSpan(e)},_removeLineHeightInSpan:function(e){for(var t,i=jindo.$$('span[style*="line-height:"]',e),n=0;t=i[n];n++)t.style.lineHeight=null},$ON_EVENT_EDITING_AREA_PASTE:function(e){var t=e.$value().clipboardData;if(t){var i=t.getData("text/html");i&&this._extractStyle(i)}},$ON_EVENT_EDITING_AREA_PASTE_DELAY:function(){var e=this.oApp.getWYSIWYGDocument().body;this._revertFontAfterPaste(e),this._applyStyle(e),this._removeLineHeightInSpan(e)}}),nhn.husky.SE2M_ExecCommand=jindo.$Class({name:"SE2M_ExecCommand",oEditingArea:null,oUndoOption:null,_rxCmdInline:/^(?:bold|underline|italic|strikethrough|superscript|subscript)$/i,$init:function(e){this.oEditingArea=e,this.nIndentSpacing=40,this.rxClickCr=new RegExp("^bold|underline|italic|strikethrough|justifyleft|justifycenter|justifyright|justifyfull|insertorderedlist|insertunorderedlist|outdent|indent$","i")},$BEFORE_MSG_APP_READY:function(){this.oEditingArea&&"IFRAME"==this.oEditingArea.tagName&&(this.oEditingArea=this.oEditingArea.contentWindow.document)},$ON_MSG_APP_READY:function(){jindo.$Agent().os().mac?(this.oApp.exec("REGISTER_HOTKEY",["meta+b","EXECCOMMAND",["bold",!1,!1]]),this.oApp.exec("REGISTER_HOTKEY",["meta+u","EXECCOMMAND",["underline",!1,!1]]),this.oApp.exec("REGISTER_HOTKEY",["meta+i","EXECCOMMAND",["italic",!1,!1]]),this.oApp.exec("REGISTER_HOTKEY",["meta+d","EXECCOMMAND",["strikethrough",!1,!1]])):(this.oApp.exec("REGISTER_HOTKEY",["ctrl+b","EXECCOMMAND",["bold",!1,!1]]),this.oApp.exec("REGISTER_HOTKEY",["ctrl+u","EXECCOMMAND",["underline",!1,!1]]),this.oApp.exec("REGISTER_HOTKEY",["ctrl+i","EXECCOMMAND",["italic",!1,!1]]),this.oApp.exec("REGISTER_HOTKEY",["ctrl+d","EXECCOMMAND",["strikethrough",!1,!1]])),this.oApp.exec("REGISTER_HOTKEY",["tab","INDENT"]),this.oApp.exec("REGISTER_HOTKEY",["shift+tab","OUTDENT"]),this.oApp.exec("REGISTER_UI_EVENT",["bold","click","EXECCOMMAND",["bold",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["underline","click","EXECCOMMAND",["underline",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["italic","click","EXECCOMMAND",["italic",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["lineThrough","click","EXECCOMMAND",["strikethrough",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["superscript","click","EXECCOMMAND",["superscript",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["subscript","click","EXECCOMMAND",["subscript",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["justifyleft","click","EXECCOMMAND",["justifyleft",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["justifycenter","click","EXECCOMMAND",["justifycenter",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["justifyright","click","EXECCOMMAND",["justifyright",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["justifyfull","click","EXECCOMMAND",["justifyfull",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["orderedlist","click","EXECCOMMAND",["insertorderedlist",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["unorderedlist","click","EXECCOMMAND",["insertunorderedlist",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["outdent","click","EXECCOMMAND",["outdent",!1,!1]]),this.oApp.exec("REGISTER_UI_EVENT",["indent","click","EXECCOMMAND",["indent",!1,!1]]),this.oNavigator=jindo.$Agent().navigator(),this.oNavigator.safari||this.oNavigator.chrome||(this._getDocumentBR=function(){},this._fixDocumentBR=function(){}),this.oNavigator.ie||(this._fixCorruptedBlockQuote=function(){},this.oNavigator.safari||this.oNavigator.chrome||(this._insertBlankLine=function(){})),this.oNavigator.firefox||(this._extendBlock=function(){})},$ON_INDENT:function(){this.oApp.delayedExec("EXECCOMMAND",["indent",!1,!1],0)},$ON_OUTDENT:function(){this.oApp.delayedExec("EXECCOMMAND",["outdent",!1,!1],0)},$BEFORE_EXECCOMMAND:function(e,t,i,n){var o;this.oApp.exec("FOCUS"),this._bOnlyCursorChanged=!1,o=this.oApp.getSelection();for(var s,r=0,a=o.getNodes();s=a[r];r++)nhn.husky.SE2M_Utils.removeInvalidNodeInTable(s);/^insertorderedlist|insertunorderedlist$/i.test(e)&&(this._getDocumentBR(),this._checkBlockQuoteCondition_IE()),/^justify*/i.test(e)&&this._removeElementAlign("span"),this._rxCmdInline.test(e)&&(this.oUndoOption={bMustBlockElement:!0},nhn.CurrentSelection.isCollapsed()&&(this._bOnlyCursorChanged=!0)),("indent"==e||"outdent"==e)&&(n||(n={}),n.bDontAddUndoHistory=!0),n&&n.bDontAddUndoHistory||this._bOnlyCursorChanged||(/^justify*/i.test(e)?this.oUndoOption={sSaveTarget:"BODY"}:("insertorderedlist"===e||"insertunorderedlist"===e)&&(this.oUndoOption={bMustBlockContainer:!0}),this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",[e,this.oUndoOption])),this.oNavigator.ie&&this.oApp.getWYSIWYGDocument().selection&&"Control"===this.oApp.getWYSIWYGDocument().selection.type&&(o=this.oApp.getSelection(),o.select()),("insertorderedlist"==e||"insertunorderedlist"==e)&&this._insertBlankLine()},_checkBlockQuoteCondition_IE:function(){var e,t=jindo.$Agent().navigator(),i=!1;if(t.ie&&t.nativeVersion>=9&&t.nativeVersion<=11&&t.version>=9&&t.version<=11||this.oApp.oAgent.os().winxp&&t.ie&&t.nativeVersion<=8||t.edge){var n=this.oApp.getSelection(),o=n.commonAncestorContainer,s=nhn.husky.SE2M_Utils.findAncestorByTagNameWithCount("BLOCKQUOTE",o);if(e=s.elNode){var r=nhn.husky.SE2M_Utils.findClosestAncestorAmongTagNamesWithCount(["td","th"],o);r.elNode?r.nRecursiveCount>s.nRecursiveCount&&(i=!0):i=!0}}i&&this._insertDummyParagraph_IE(e)},_insertDummyParagraph_IE:function(e){this._elDummyParagraph=document.createElement("P"),e.appendChild(this._elDummyParagraph)},_removeDummyParagraph_IE:function(){this._elDummyParagraph&&this._elDummyParagraph.parentNode&&this._elDummyParagraph.parentNode.removeChild(this._elDummyParagraph)},$ON_EXECCOMMAND:function(e,t,i){var n=!1,o={},s=this.oApp.getSelection();if(t=""==t||t?t:!1,i=""==i||i?i:!1,this.oApp.exec("IS_SELECTED_TD_BLOCK",["bIsSelectedTd",o]),n=o.bIsSelectedTd)"indent"==e?this.oApp.exec("SET_LINE_BLOCK_STYLE",[null,jindo.$Fn(this._indentMargin,this).bind()]):"outdent"==e?this.oApp.exec("SET_LINE_BLOCK_STYLE",[null,jindo.$Fn(this._outdentMargin,this).bind()]):this._setBlockExecCommand(e,t,i);else switch(e){case"indent":case"outdent":this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",[e]);var r=s.placeStringBookmark();"indent"===e?this.oApp.exec("SET_LINE_STYLE",[null,jindo.$Fn(this._indentMargin,this).bind(),{bDoNotSelect:!0,bDontAddUndoHistory:!0}]):this.oApp.exec("SET_LINE_STYLE",[null,jindo.$Fn(this._outdentMargin,this).bind(),{bDoNotSelect:!0,bDontAddUndoHistory:!0}]),s.moveToStringBookmark(r),s.select(),s.removeStringBookmark(r),setTimeout(jindo.$Fn(function(e){this.oApp.exec("RECORD_UNDO_AFTER_ACTION",[e])},this).bind(e),25);break;case"justifyleft":case"justifycenter":case"justifyright":case"justifyfull":var a=this._extendBlock();this.oEditingArea.execCommand(e,t,i),a&&a.select(),this.oNavigator.ie&&this._removeElementAlign("table");break;default:if(s.collapsed&&this._rxCmdInline.test(e)){var l=s.placeStringBookmark(),h=s.getStringBookmark(l),d=h.previousSibling;d&&"​"===d.nodeValue||(d=this.oApp.getWYSIWYGDocument().createTextNode("​"),s.insertNode(d)),s.removeStringBookmark(l),s.selectNodeContents(d),s.select(),this.oEditingArea.execCommand(e,t,i),s.collapseToEnd(),s.select();var c=this._findSingleNode(d);c&&s._hasCursorHolderOnly(c.nextSibling)&&c.parentNode.removeChild(c.nextSibling)}else this.oEditingArea.execCommand(e,t,i)}this._countClickCr(e)},_findSingleNode:function(e){return e?1===e.parentNode.childNodes.length?this._findSingleNode(e.parentNode):e:null},$AFTER_EXECCOMMAND:function(e,t,i,n){this.elP1&&this.elP1.parentNode&&this.elP1.parentNode.removeChild(this.elP1),this.elP2&&this.elP2.parentNode&&this.elP2.parentNode.removeChild(this.elP2),/^insertorderedlist|insertunorderedlist$/i.test(e)&&(this._removeDummyParagraph_IE(),this._fixCorruptedBlockQuote("insertorderedlist"===e?"OL":"UL"),this.oNavigator.bGalaxyBrowser&&this._removeBlockQuote()),/^justify*/i.test(e)&&this._fixAlign("justifyfull"===e?"justify":e.substring(7)),("indent"==e||"outdent"==e)&&(n||(n={}),n.bDontAddUndoHistory=!0),n&&n.bDontAddUndoHistory||this._bOnlyCursorChanged||this.oApp.exec("RECORD_UNDO_AFTER_ACTION",[e,this.oUndoOption]),this.oApp.exec("CHECK_STYLE_CHANGE",[])},_removeElementAlign:function(e){for(var t=this.oApp.getSelection(),i=t.getNodes(),n=null,o=new RegExp("^"+e+"$","i"),s=0,r=i.length;r>s;s++)n=i[s],n.tagName&&o.test(n.tagName)&&(n.style.textAlign="",n.removeAttribute("align"))},_getAlignNode:function(e){if(e.tagName&&("P"===e.tagName||"DIV"===e.tagName))return e;for(e=e.parentNode;e&&e.tagName;){if("P"===e.tagName||"DIV"===e.tagName)return e;e=e.parentNode}},_fixAlign:function(e){var t=this.oApp.getSelection(),i=[],n=null,o=null;this.oNavigator.ie?function(e){return e.tagName&&"TABLE"===e.tagName?(e.removeAttribute("align"),!0):!1}:function(){};t.collapsed?i[0]=t.startContainer:i=t.getNodes();for(var s=0,r=i.length;r>s;s++)n=i[s],3===n.nodeType&&(n=n.parentNode),(!o||n!==o&&!jindo.$Element(n).isChildOf(o))&&(o=this._getAlignNode(n),o&&o.align!==o.style.textAlign&&(o.style.textAlign=e,o.setAttribute("align",e)))},_getDocumentBR:function(){var e,t;for(this.aBRs=this.oApp.getWYSIWYGDocument().getElementsByTagName("BR"),this.aBeforeBRs=[],e=0,t=this.aBRs.length;t>e;e++)this.aBeforeBRs[e]=this.aBRs[e]},_fixDocumentBR:function(){if(this.aBeforeBRs.length!==this.aBRs.length){var e,t=jindo.$A(this.aBeforeBRs),i=this.aBRs.length;for(e=i-1;e>=0;e--)t.indexOf(this.aBRs[e])<0&&this.aBRs[e].parentNode.removeChild(this.aBRs[e])}},_setBlockExecCommand:function(e,t,i){var n,o,s={};this.oSelection=this.oApp.getSelection(),this.oApp.exec("GET_SELECTED_TD_BLOCK",["aTdCells",s]),n=s.aTdCells;for(var r=0;ri;i++)t.push(e.nextSibling.childNodes[i]);for(o=e.previousSibling,s=e.nextSibling,i=0,n=t.length;n>i;i++)o.insertBefore(t[i],null);s.parentNode.removeChild(s)}else e.previousSibling.insertBefore(e,null);return}return e.nextSibling&&e.nextSibling.tagName&&e.nextSibling.tagName===e.parentNode.tagName?void e.nextSibling.insertBefore(e,e.nextSibling.firstChild):(a=e.parentNode.cloneNode(!1),e.parentNode.insertBefore(a,e),void a.appendChild(e))}r=parseInt(e.style.marginLeft,10),r||(r=0),r+=this.nIndentSpacing,e.style.marginLeft=r+"px"},_outdentMargin:function(e){for(var t,i,n,o,s,r,a=e;a;){if(a.tagName&&"LI"===a.tagName){e=a;break}a=a.parentNode}if("LI"!==e.tagName)r=parseInt(e.style.marginLeft,10),r||(r=0),r-=this.nIndentSpacing,0>r&&(r=0),e.style.marginLeft=r+"px";else{if(t=e.parentNode,i=e.parentNode,e.previousSibling&&e.previousSibling.tagName&&e.previousSibling.tagName.match(/LI|UL|OL/))if(e.nextSibling&&e.nextSibling.tagName&&e.nextSibling.tagName.match(/LI|UL|OL/)){for(n=t.cloneNode(!1);e.nextSibling;)n.insertBefore(e.nextSibling,null);t.parentNode.insertBefore(n,t.nextSibling),i=n}else i=t.nextSibling;if(t.parentNode.insertBefore(e,i),t.innerHTML.match(/LI/i)||t.parentNode.removeChild(t),!e.parentNode.tagName.match(/OL|UL/)){for(o=e.parentNode,i=e,s=this.oApp.getWYSIWYGDocument(),o=s.createElement("P"),i=null,e.parentNode.insertBefore(o,e);e.firstChild;)o.insertBefore(e.firstChild,i);e.parentNode.removeChild(e)}}},_insertBlankLine:function(){var e=this.oApp.getSelection(),t=e.commonAncestorContainer;for(this.elP1=null,this.elP2=null;t;){if("BLOCKQUOTE"==t.tagName){this.elP1=jindo.$("

 

",this.oApp.getWYSIWYGDocument()),t.parentNode.insertBefore(this.elP1,t),this.elP2=jindo.$("

 

",this.oApp.getWYSIWYGDocument()),t.parentNode.insertBefore(this.elP2,t.nextSibling);break}t=t.parentNode}if(!this.elP1&&!this.elP2){t=e.commonAncestorContainer,t=1!==t.nodeType?t.parentNode:t;var i=t.previousSibling,n=t.nextSibling;i&&"BLOCKQUOTE"===i.tagName&&(this.elP1=jindo.$("

 

",this.oApp.getWYSIWYGDocument()),i.parentNode.insertBefore(this.elP1,i.nextSibling)),n&&"BLOCKQUOTE"===n.tagName&&(this.elP1=jindo.$("

 

",this.oApp.getWYSIWYGDocument()),n.parentNode.insertBefore(this.elP1,n))}},_fixCorruptedBlockQuote:function(e){var t,i,n,o,s,r,a,l,h,d=this.oApp.getWYSIWYGDocument().getElementsByTagName(e);for(s=0,r=d.length;r>s;s++)if(d[s].firstChild&&d[s].firstChild.tagName==e){t=d[s];break}if(t){for(i=t.parentNode,a=this._getPosIdx(t),l=this.oApp.getWYSIWYGDocument().createElement("DIV"),l.innerHTML=t.outerHTML.replace("<"+e,"s;s++)o[s].childNodes.length<1&&o[s].parentNode.removeChild(o[s]);h=this.oApp.getEmptySelection(),h.selectNodeContents(n),h.collapseToEnd(),h.select()}},_removeBlockQuote:function(){for(var e,t,i,n="Apple-style-span",o=this.oApp.getSelection(),s=o.commonAncestorContainer,r=s;s;)"LI"===s.tagName?(i=s,s="display: inline !important; "===s.style.cssText?s.parentNode:null):"SPAN"===s.tagName&&s.className===n?(e=s,s=i?null:s.parentNode):s=s.parentNode;for(i&&e&&(s=e.parentNode,s.replaceChild(r,e),o.selectNodeContents(s),o.collapseToEnd(),o.select());s;)if("BLOCKQUOTE"===s.tagName){t=s.getElementsByClassName(n);for(var a=0;e=t[a];a++)e.parentNode.removeChild(e);s=null}else s=s.parentNode},_getPosIdx:function(e){for(var t=0,i=e.previousSibling;i;i=i.previousSibling)t++;return t},_countClickCr:function(e){e.match(this.rxClickCr)&&this.oApp.exec("MSG_NOTIFY_CLICKCR",[e.replace(/^insert/i,"")])},_extendBlock:function(){var e=this.oApp.getSelection(),t=e.startContainer,i=e.endContainer,n=[],o=[],s=e.cloneRange();if(t===i&&1===t.nodeType&&"P"===t.tagName&&(n=jindo.$A(t.childNodes).filter(function(e,t,i){return 1===e.nodeType&&"IMG"===e.tagName}).$value(),o=jindo.$A(e.getNodes()).filter(function(e,t,i){return 1===e.nodeType&&"IMG"===e.tagName}).$value(),!(n.length<=o.length)))return e.selectNode(t),e.select(),s}}),nhn.husky.SE_WYSIWYGStyler=jindo.$Class({name:"SE_WYSIWYGStyler",_sCursorHolder:"\ufeff",$init:function(){var e=jindo.$Agent().navigator();e.ie&&e.version>8&&(this._sCursorHolder="⁠",this.$ON_REGISTER_CONVERTERS=function(){var e=/\u2060/g;this.oApp.exec("ADD_CONVERTER",["WYSIWYG_TO_IR",jindo.$Fn(function(t){return t.replace(e,"\ufeff")},this).bind()])})},$PRECONDITION:function(e,t){return"WYSIWYG"==this.oApp.getEditingMode()},$ON_SET_WYSIWYG_STYLE:function(e){var t=this.oApp.getSelection(),i={};this.oApp.exec("IS_SELECTED_TD_BLOCK",["bIsSelectedTd",i]);var n=i.bIsSelectedTd;if(t.collapsed&&!n){this.oApp.exec("RECORD_UNDO_ACTION",["FONT STYLE",{bMustBlockElement:!0}]);var o,s=!1,r=t.commonAncestorContainer;3==r.nodeType&&(r=r.parentNode),r&&t._rxCursorHolder.test(r.innerHTML)&&(o=t._findParentSingleSpan(r)),o?""==o.innerHTML&&(o.innerHTML=this._sCursorHolder):(o=this.oApp.getWYSIWYGDocument().createElement("SPAN"),o.innerHTML=this._sCursorHolder,s=!0);var a;for(var l in e)a=e[l],"string"==typeof a&&(o.style[l]=a);if(s)if("BODY"==t.startContainer.tagName&&0===t.startOffset){var h=t._getVeryFirstRealChild(this.oApp.getWYSIWYGDocument().body),d=!0,c=h.cloneNode(!1);try{c.innerHTML="test","test"!=c.innerHTML&&(d=!1)}catch(_){d=!1}d&&1==c.nodeType&&"BR"==c.tagName?(t.selectNode(h),t.collapseToStart(),t.insertNode(o)):d&&"IFRAME"!=h.tagName&&h.appendChild&&"string"==typeof h.innerHTML?h.appendChild(o):(t.selectNode(h),t.collapseToStart(),t.insertNode(o))}else t.collapseToStart(),t.insertNode(o);else t=this.oApp.getEmptySelection();return e.color&&t._checkTextDecoration(o),t.selectNodeContents(s?o:r),t.collapseToEnd(),t._window.focus(),t._window.document.body.focus(),void t.select()}if(this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["FONT STYLE",{bMustBlockElement:!0}]),n){var p;this.oApp.exec("GET_SELECTED_TD_BLOCK",["aTdCells",i]),p=i.aTdCells;for(var E=0;EA;A++){var C=S[A];C.nextSibling&&"BR"==C.nextSibling.tagName&&!C.nextSibling.nextSibling&&C.parentNode.removeChild(C.nextSibling)}t._window.focus(),t.select()}this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["FONT STYLE",{bMustBlockElement:!0}])}}),nhn.husky.SE_WYSIWYGStyleGetter=jindo.$Class({name:"SE_WYSIWYGStyleGetter",hKeyUp:null,getStyleInterval:200,oStyleMap:{fontFamily:{type:"Value",css:"fontFamily"},fontSize:{type:"Value",css:"fontSize"},lineHeight:{type:"Value",css:"lineHeight",converter:function(e,t){return e.match(/px$/)?Math.ceil(parseInt(e,10)/parseInt(t.fontSize,10)*10)/10:e}},bold:{command:"bold"},underline:{command:"underline"},italic:{command:"italic"},lineThrough:{command:"strikethrough"},superscript:{command:"superscript"},subscript:{command:"subscript"},justifyleft:{command:"justifyleft"},justifycenter:{command:"justifycenter"},justifyright:{command:"justifyright"},justifyfull:{command:"justifyfull"},orderedlist:{command:"insertorderedlist"},unorderedlist:{command:"insertunorderedlist"}},$init:function(){this.oStyle=this._getBlankStyle()},$LOCAL_BEFORE_ALL:function(){return"WYSIWYG"==this.oApp.getEditingMode()},$ON_MSG_APP_READY:function(){this.oDocument=this.oApp.getWYSIWYGDocument(),this.oApp.exec("ADD_APP_PROPERTY",["getCurrentStyle",jindo.$Fn(this.getCurrentStyle,this).bind()]),(jindo.$Agent().navigator().safari||jindo.$Agent().navigator().chrome||jindo.$Agent().navigator().ie)&&(this.oStyleMap.textAlign={type:"Value",css:"textAlign"})},$ON_EVENT_EDITING_AREA_MOUSEUP:function(e){this.oApp.exec("CHECK_STYLE_CHANGE")},$ON_EVENT_EDITING_AREA_KEYPRESS:function(e){var t;if(!this.oApp.oNavigator.firefox||(t=e.key(),!t.ctrl||97!=t.keyCode))return this.bAllSelected?void(this.bAllSelected=!1):void this.oApp.exec("CHECK_STYLE_CHANGE")},$ON_EVENT_EDITING_AREA_KEYDOWN:function(e){var t=e.key();if((this.oApp.oNavigator.ie||this.oApp.oNavigator.firefox)&&t.ctrl&&65==t.keyCode)return this.oApp.exec("RESET_STYLE_STATUS"),void(this.bAllSelected=!0);if(8==t.keyCode||t.keyCode>=33&&t.keyCode<=40||45==t.keyCode||46==t.keyCode){if(t.shift&&35===t.keyCode)return this.oApp.exec("RESET_STYLE_STATUS"),void(this.bAllSelected=!0);if(this.bAllSelected){if(this.oApp.oNavigator.firefox)return;return void(this.bAllSelected=!1)}this.oApp.exec("CHECK_STYLE_CHANGE")}},$ON_CHECK_STYLE_CHANGE:function(){this._getStyle()},$ON_RESET_STYLE_STATUS:function(){this.oStyle=this._getBlankStyle();var e=this._getStyleOf(this.oApp.getWYSIWYGDocument().body); this.oStyle.fontFamily=e.fontFamily,this.oStyle.fontSize=e.fontSize,this.oStyle.justifyleft="@^";for(var t in this.oStyle)this.oApp.exec("MSG_STYLE_CHANGED",[t,this.oStyle[t]])},getCurrentStyle:function(){return this.oStyle},_check_style_change:function(){this.oApp.exec("CHECK_STYLE_CHANGE",[])},_getBlankStyle:function(){var e={};for(var t in this.oStyleMap)"Value"==this.oStyleMap[t].type?e[t]="":e[t]=0;return e},_getStyle:function(){var e;if(nhn.CurrentSelection.isCollapsed())e=this._getStyleOf(nhn.CurrentSelection.getCommonAncestorContainer());else{var t=this.oApp.getSelection(),i=function(e){return e.childNodes&&0!=e.childNodes.length?!1:!0},n=t.getNodes(!1,i);e=0==n.length?this._getStyleOf(t.commonAncestorContainer):this._getStyleOf(n[0])}for(attributeName in e)if(this.oStyleMap[attributeName].converter&&(e[attributeName]=this.oStyleMap[attributeName].converter(e[attributeName],e)),this.oStyle[attributeName]!=e[attributeName]){if("object"!=typeof document.body.currentStyle&&"function"==typeof getComputedStyle&&"fontSize"==attributeName&&this.oStyle.fontFamily!=e.fontFamily)continue;this.oApp.exec("MSG_STYLE_CHANGED",[attributeName,e[attributeName]])}this.oStyle=e},_getStyleOf:function(e){var t=this._getBlankStyle();if(!e)return t;3==e.nodeType?e=e.parentNode:9==e.nodeType&&(e=e.body);var i,n=jindo.$Element(e);for(var o in this.oStyle)if(i=this.oStyleMap[o],i.type&&"Value"==i.type)try{if(i.css){var s=n.css(i.css);"fontFamily"==o&&(s=s.split(/,/)[0]),t[o]=s}else i.command&&(t[o]=this.oDocument.queryCommandState(i.command))}catch(r){}else if(i.command)try{this.oDocument.queryCommandState(i.command)?t[o]="@^":t[o]="@-"}catch(r){}switch(t.textAlign){case"left":t.justifyleft="@^";break;case"center":t.justifycenter="@^";break;case"right":t.justifyright="@^";break;case"justify":t.justifyfull="@^"}return"@-"==t.justifyleft&&"@-"==t.justifycenter&&"@-"==t.justifyright&&"@-"==t.justifyfull&&(t.justifyleft="@^"),t}}),nhn.husky.SE2M_FontSizeWithLayerUI=jindo.$Class({name:"SE2M_FontSizeWithLayerUI",$init:function(e){this._assignHTMLElements(e)},_assignHTMLElements:function(e){this.oDropdownLayer=jindo.$$.getSingle("DIV.husky_se_fontSize_layer",e),this.elFontSizeLabel=jindo.$$.getSingle("SPAN.husky_se2m_current_fontSize",e),this.aLIFontSizes=jindo.$A(jindo.$$("LI",this.oDropdownLayer)).filter(function(e,t,i){return null!=e.firstChild})._array,this.sDefaultText=this.elFontSizeLabel.innerHTML},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["fontSize","click","SE2M_TOGGLE_FONTSIZE_LAYER"]),this.oApp.exec("SE2_ATTACH_HOVER_EVENTS",[this.aLIFontSizes]);for(var e=0;e0?72*i/96+"pt":this.sDefaultText}if(this._rxPT.test(t)){var i=parseFloat(t.replace(this._rxPT,"")),n=Math.floor(i),o=i-n;i=o>=0&&.25>o?n+0:o>=.25&&.75>o?n+.5:n+1,t=i+"pt"}t||(t=this.sDefaultText);var s=this._getMatchingLI(t);this._clearFontSizeSelection(),s?(this.elFontSizeLabel.innerHTML=t,jindo.$Element(s).addClass("active")):this.elFontSizeLabel.innerHTML=t}},$ON_SET_FONTSIZE:function(e){e&&(this.oApp.exec("SET_WYSIWYG_STYLE",[{fontSize:e}]),this.oApp.exec("HIDE_ACTIVE_LAYER",[]),this.oApp.exec("CHECK_STYLE_CHANGE",[]))},_getMatchingLI:function(e){var t;e=e.toLowerCase();for(var i=0;il;l++)if(!this._isChildOf(s[l],t)&&s[l]&&(t=this._getLineWrapper(s[l]),t!=i)){if(n=this._getWrapperLineStyle(e,t),n!=o){o=null;break}i=t}t=this._getLineWrapper(s[r-1]);var h=this.oSelection.getEndNode();return setTimeout(jindo.$Fn(function(e,t){var i=this._getSelectedTDs();if(i.length>0){var n=nhn.husky.SE2M_Utils.findAncestorByTagName("TD",e),o=nhn.husky.SE2M_Utils.findAncestorByTagName("TD",t);e=n||!e?i[0].firstChild:e,t=o||!t?i[i.length-1].lastChild:t}this.oSelection.setEndNodes(e,t),this.oSelection.select(),this.oApp.exec("CHECK_STYLE_CHANGE",[])},this).bind(a,h),0),o},setLineStyle:function(e,t,i,n){function o(e,t,i){if(!e){r=!0;try{e=thisRef.oSelection.surroundContentsWithNewNode("P")}catch(n){e=thisRef.oSelection.surroundContentsWithNewNode("DIV")}}return"function"==typeof i?i(e):e.style[t]=i,0===e.childNodes.length&&(e.innerHTML=" "),e}function s(e){for(;e&&"BODY"!=e.tagName;)e=nhn.DOMFix.parentNode(e);return e?!0:!1}thisRef=this;var r=!1;if(0!==n.length){var a,l,h=n.length;i&&i.bDontAddUndoHistory||this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["LINE STYLE"]),l=this._getLineWrapper(n[0]),l=o(l,e,t);for(var d=l,c=l,_=1;h>_;_++){try{if(!s(nhn.DOMFix.parentNode(n[_])))continue}catch(p){continue}this._isChildOf(n[_],a)||(a=this._getLineWrapper(n[_]),a!=l&&(a=o(a,e,t),l=a))}c=a||d,!r||i&&i.bDoNotSelect||setTimeout(jindo.$Fn(function(e,t,i){e==t?(this.oSelection.selectNodeContents(e),1==e.childNodes.length&&"BR"==e.firstChild.tagName&&this.oSelection.collapseToStart()):this.oSelection.setEndNodes(e,t),this.oSelection.select(),i&&i.bDontAddUndoHistory||this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["LINE STYLE"])},this).bind(d,c,i),0)}},setLineBlockStyle:function(e,t,i){for(var n=[],o=[],s=this._getSelectedTDs(),r=0;r0)return[t[0].firstChild,t[t.length-1].lastChild];this.oSelection.selectNode(this.oSelection.commonAncestorContainer)}var i=this.getTextNodes(!1,this.oSelection);if(0===i.length){var n=this.oSelection.getStartNode();if(n)i[0]=n;else{var o=this.oSelection._document.createTextNode(" ");this.oSelection.insertNode(o),i=[o]}}return i},_getWrapperLineStyle:function(e,t){var i=null;if(t&&t.style[e])i=t.style[e];else for(t=this.oSelection.commonAncesterContainer;t&&!this.oSelection.rxLineBreaker.test(t.tagName);){if(t&&t.style[e]){i=t.style[e];break}t=nhn.DOMFix.parentNode(t)}return i},_isChildOf:function(e,t){for(;e&&"BODY"!=e.tagName;){if(e==t)return!0;e=nhn.DOMFix.parentNode(e)}return!1},_getLineWrapper:function(e){var t=this.oApp.getEmptySelection();t.selectNode(e);var i,n,o,s,r=t.getLineInfo(),a=r.oStart,l=r.oEnd,h=null;return i=a.oNode,o=a.oLineBreaker,n=l.oNode,s=l.oLineBreaker,this.oSelection.setEndNodes(i,n),o==s&&("P"==o.tagName||"DIV"==o.tagName||"LI"==o.tagName?h=o:this.oSelection.setEndNodes(o.firstChild,o.lastChild)),h}}),nhn.husky.SE2M_LineHeightWithLayerUI=jindo.$Class({name:"SE2M_LineHeightWithLayerUI",MIN_LINE_HEIGHT:50,$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["lineHeight","click","SE2M_TOGGLE_LINEHEIGHT_LAYER"]),this.oApp.registerLazyMessage(["SE2M_TOGGLE_LINEHEIGHT_LAYER"],["hp_SE2M_LineHeightWithLayerUI$Lazy.js"])}}),nhn.husky.SE2M_ColorPalette=jindo.$Class({name:"SE2M_ColorPalette",elAppContainer:null,bUseRecentColor:!1,nLimitRecentColor:17,rxRGBColorPattern:/rgb\((\d+), ?(\d+), ?(\d+)\)/i,rxColorPattern:/^#?[0-9a-fA-F]{6}$|^rgb\(\d+, ?\d+, ?\d+\)$/i,aRecentColor:[],URL_COLOR_LIST:"",URL_COLOR_ADD:"",URL_COLOR_UPDATE:"",sRecentColorTemp:'
  • ',$init:function(e){this.elAppContainer=e},$ON_MSG_APP_READY:function(){},_assignHTMLElements:function(e){var t=nhn.husky.SE2M_Configuration.SE2M_ColorPalette;t&&(this.bUseRecentColor=t.bUseRecentColor||!1,this.URL_COLOR_ADD=t.addColorURL||"http://api.se2.naver.com/1/colortable/TextAdd.nhn",this.URL_COLOR_UPDATE=t.updateColorURL||"http://api.se2.naver.com/1/colortable/TextUpdate.nhn",this.URL_COLOR_LIST=t.colorListURL||"http://api.se2.naver.com/1/colortable/TextList.nhn"),this.elColorPaletteLayer=jindo.$$.getSingle("DIV.husky_se2m_color_palette",e),this.elColorPaletteLayerColorPicker=jindo.$$.getSingle("DIV.husky_se2m_color_palette_colorpicker",this.elColorPaletteLayer),this.elRecentColorForm=jindo.$$.getSingle("form",this.elColorPaletteLayerColorPicker),this.elBackgroundColor=jindo.$$.getSingle("ul.husky_se2m_bgcolor_list",e),this.elInputColorCode=jindo.$$.getSingle("INPUT.husky_se2m_cp_colorcode",this.elColorPaletteLayerColorPicker),this.elPreview=jindo.$$.getSingle("SPAN.husky_se2m_cp_preview",this.elColorPaletteLayerColorPicker),this.elCP_ColPanel=jindo.$$.getSingle("DIV.husky_se2m_cp_colpanel",this.elColorPaletteLayerColorPicker),this.elCP_HuePanel=jindo.$$.getSingle("DIV.husky_se2m_cp_huepanel",this.elColorPaletteLayerColorPicker),this.elCP_ColPanel.style.position="relative",this.elCP_HuePanel.style.position="relative",this.elColorPaletteLayerColorPicker.style.display="none",this.elMoreBtn=jindo.$$.getSingle("BUTTON.husky_se2m_color_palette_more_btn",this.elColorPaletteLayer),this.welMoreBtn=jindo.$Element(this.elMoreBtn),this.elOkBtn=jindo.$$.getSingle("BUTTON.husky_se2m_color_palette_ok_btn",this.elColorPaletteLayer),this.bUseRecentColor&&(this.elColorPaletteLayerRecent=jindo.$$.getSingle("DIV.husky_se2m_color_palette_recent",this.elColorPaletteLayer),this.elRecentColor=jindo.$$.getSingle("ul.se2_pick_color",this.elColorPaletteLayerRecent),this.elDummyNode=jindo.$$.getSingle("ul.se2_pick_color > li",this.elColorPaletteLayerRecent)||null,this.elColorPaletteLayerRecent.style.display="none")},$LOCAL_BEFORE_FIRST:function(){this._assignHTMLElements(this.elAppContainer),this.elDummyNode&&jindo.$Element(jindo.$$.getSingle("ul.se2_pick_color > li",this.elColorPaletteLayerRecent)).leave(),this.bUseRecentColor&&this._ajaxRecentColor(this._ajaxRecentColorCallback),this.oApp.registerBrowserEvent(this.elColorPaletteLayer,"click","EVENT_CLICK_COLOR_PALETTE"),this.oApp.bMobile||(this.oApp.registerBrowserEvent(this.elBackgroundColor,"mouseover","EVENT_MOUSEOVER_COLOR_PALETTE"),this.oApp.registerBrowserEvent(this.elColorPaletteLayer,"mouseover","EVENT_MOUSEOVER_COLOR_PALETTE"),this.oApp.registerBrowserEvent(this.elBackgroundColor,"mouseout","EVENT_MOUSEOUT_COLOR_PALETTE"),this.oApp.registerBrowserEvent(this.elColorPaletteLayer,"mouseout","EVENT_MOUSEOUT_COLOR_PALETTE"))},$ON_EVENT_MOUSEOVER_COLOR_PALETTE:function(e){for(var t=e.element;t&&t.tagName&&"li"!=t.tagName.toLowerCase();)t=t.parentNode;t&&t.nodeType&&9!=t.nodeType&&(""!=t.className&&t.className&&"undefined"!=typeof t.className||jindo.$Element(t).addClass("hover"))},$ON_EVENT_MOUSEOUT_COLOR_PALETTE:function(e){for(var t=e.element;t&&t.tagName&&"li"!=t.tagName.toLowerCase();)t=t.parentNode;t&&"hover"==t.className&&jindo.$Element(t).removeClass("hover")},$ON_EVENT_CLICK_COLOR_PALETTE:function(e){for(var t=e.element;"SPAN"==t.tagName;)t=t.parentNode;if(t.tagName&&"BUTTON"==t.tagName){if(t==this.elMoreBtn)return void this.oApp.exec("TOGGLE_COLOR_PICKER");this.oApp.exec("APPLY_COLOR",[t])}},$ON_APPLY_COLOR:function(e){var t=this.elInputColorCode.value,i=null;return-1==t.indexOf("#")&&(t="#"+t,this.elInputColorCode.value=t),e==this.elOkBtn?this._verifyColorCode(t)?void this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[t,!0]):(this.elInputColorCode.value="",alert(this.oApp.$MSG("SE_Color.invalidColorCode")),void this.elInputColorCode.focus()):(i=jindo.$Element(e.parentNode.parentNode.parentNode),t=e.title,void(i.hasClass("husky_se2m_color_palette")?this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[t,!1]):i.hasClass("husky_se2m_color_palette_recent")&&this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[t,!0])))},$ON_RESET_COLOR_PALETTE:function(){this._initColor()},$ON_TOGGLE_COLOR_PICKER:function(){"none"==this.elColorPaletteLayerColorPicker.style.display?this.oApp.exec("SHOW_COLOR_PICKER"):this.oApp.exec("HIDE_COLOR_PICKER")},$ON_SHOW_COLOR_PICKER:function(){this.elColorPaletteLayerColorPicker.style.display="",this.cpp=new nhn.ColorPicker(this.elCP_ColPanel,{huePanel:this.elCP_HuePanel});var e=jindo.$Fn(function(e){this.elPreview.style.backgroundColor=e.hexColor,this.elInputColorCode.value=e.hexColor},this).bind();this.cpp.attach("colorchange",e),this.$ON_SHOW_COLOR_PICKER=this._showColorPickerMain,this.$ON_SHOW_COLOR_PICKER()},$ON_HIDE_COLOR_PICKER:function(){this.elColorPaletteLayerColorPicker.style.display="none",this.welMoreBtn.addClass("se2_view_more"),this.welMoreBtn.removeClass("se2_view_more2")},$ON_SHOW_COLOR_PALETTE:function(e,t){this.sCallbackCmd=e,this.oLayerContainer=t,this.oLayerContainer.insertBefore(this.elColorPaletteLayer,null),this.elColorPaletteLayer.style.display="block",this.oApp.delayedExec("POSITION_TOOLBAR_LAYER",[this.elColorPaletteLayer.parentNode.parentNode],0)},$ON_HIDE_COLOR_PALETTE:function(){this.elColorPaletteLayer.style.display="none"},$ON_COLOR_PALETTE_APPLY_COLOR:function(e,t){t=t?t:!1,e=this._getHexColorCode(e),this.bUseRecentColor&&t&&this.oApp.exec("ADD_RECENT_COLOR",[e]),this.oApp.exec(this.sCallbackCmd,[e])},$ON_EVENT_MOUSEUP_COLOR_PALETTE:function(e){var t=e.element;t.style.backgroundColor&&this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[t.style.backgroundColor,!1])},$ON_ADD_RECENT_COLOR:function(e){var t=0===this.aRecentColor.length;this._addRecentColor(e),t?this._ajaxAddColor():this._ajaxUpdateColor(),this._redrawRecentColorElement()},_verifyColorCode:function(e){return this.rxColorPattern.test(e)},_getHexColorCode:function(e){if(this.rxRGBColorPattern.test(e)){var t=function(e){var t=parseInt(e,10).toString(16);return t.length<2&&(t="0"+t),t.toUpperCase()},i=t(RegExp.$1),n=t(RegExp.$2),o=t(RegExp.$3);e="#"+i+n+o}return e},_addRecentColor:function(e){var t=jindo.$A(this.aRecentColor);t=t.refuse(e),t.unshift(e),t.length()>this.nLimitRecentColor&&t.length(this.nLimitRecentColor),this.aRecentColor=t.$value()},_redrawRecentColorElement:function(){var e,t=[],i=this.aRecentColor.length;if(0!==i){for(e=0;i>e;e++)t.push(this.sRecentColorTemp.replace(/\{RGB_CODE\}/gi,this.aRecentColor[e]));this.elRecentColor.innerHTML=t.join(""),this.elColorPaletteLayerRecent.style.display="block"}},_ajaxAddColor:function(){jindo.$Ajax(this.URL_COLOR_ADD,{type:"jsonp",onload:function(){}}).request({text_key:"colortable",text_data:this.aRecentColor.join(",")})},_ajaxUpdateColor:function(){jindo.$Ajax(this.URL_COLOR_UPDATE,{type:"jsonp",onload:function(){}}).request({text_key:"colortable",text_data:this.aRecentColor.join(",")})},_showColorPickerMain:function(){this._initColor(),this.elColorPaletteLayerColorPicker.style.display="",this.welMoreBtn.removeClass("se2_view_more"),this.welMoreBtn.addClass("se2_view_more2")},_initColor:function(){this.cpp&&this.cpp.rgb({r:0,g:0,b:0}),this.elPreview.style.backgroundColor="#000000",this.elInputColorCode.value="#000000",this.oApp.exec("HIDE_COLOR_PICKER")},_ajaxRecentColor:function(e){jindo.$Ajax(this.URL_COLOR_LIST,{type:"jsonp",onload:jindo.$Fn(e,this).bind()}).request()},_ajaxRecentColorCallback:function(e){var t,i,n,o=e.json().result;if(o&&!o.error){for(t=jindo.$A(o).filter(this._verifyColorCode,this),t.length()>this.nLimitRecentColor&&t.length(this.nLimitRecentColor),o=t.reverse().$value(),i=0,n=o.length;n>i;i++)this._addRecentColor(this._getHexColorCode(o[i]));this._redrawRecentColorElement()}}}).extend(jindo.Component),nhn.husky.SE2M_FontColor=jindo.$Class({name:"SE2M_FontColor",rxColorPattern:/^#?[0-9a-fA-F]{6}$|^rgb\(\d+, ?\d+, ?\d+\)$/i,$init:function(e){this._assignHTMLElements(e)},_assignHTMLElements:function(e){this.elLastUsed=jindo.$$.getSingle("SPAN.husky_se2m_fontColor_lastUsed",e),this.elDropdownLayer=jindo.$$.getSingle("DIV.husky_se2m_fontcolor_layer",e),this.elPaletteHolder=jindo.$$.getSingle("DIV.husky_se2m_fontcolor_paletteHolder",this.elDropdownLayer),this._setLastUsedFontColor("#000000")},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["getLastUsedFontColor",jindo.$Fn(this.getLastUsedFontColor,this).bind()])},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["fontColorA","click","APPLY_LAST_USED_FONTCOLOR"]),this.oApp.exec("REGISTER_UI_EVENT",["fontColorB","click","TOGGLE_FONTCOLOR_LAYER"]),this.oApp.registerLazyMessage(["APPLY_LAST_USED_FONTCOLOR","TOGGLE_FONTCOLOR_LAYER"],["hp_SE2M_FontColor$Lazy.js"])},_setLastUsedFontColor:function(e){this.sLastUsedColor=e,this.elLastUsed.style.backgroundColor=this.sLastUsedColor},getLastUsedFontColor:function(){return this.sLastUsedColor?this.sLastUsedColor:"#000000"}}),nhn.husky.SE2M_BGColor=jindo.$Class({name:"SE2M_BGColor",rxColorPattern:/^#?[0-9a-fA-F]{6}$|^rgb\(\d+, ?\d+, ?\d+\)$/i,$init:function(e){this._assignHTMLElements(e)},_assignHTMLElements:function(e){this.elLastUsed=jindo.$$.getSingle("SPAN.husky_se2m_BGColor_lastUsed",e),this.elDropdownLayer=jindo.$$.getSingle("DIV.husky_se2m_BGColor_layer",e),this.elBGColorList=jindo.$$.getSingle("UL.husky_se2m_bgcolor_list",e),this.elPaletteHolder=jindo.$$.getSingle("DIV.husky_se2m_BGColor_paletteHolder",this.elDropdownLayer),this._setLastUsedBGColor("#777777")},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["getLastUsedBackgroundColor",jindo.$Fn(this.getLastUsedBGColor,this).bind()])},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["BGColorA","click","APPLY_LAST_USED_BGCOLOR"]),this.oApp.exec("REGISTER_UI_EVENT",["BGColorB","click","TOGGLE_BGCOLOR_LAYER"]),this.oApp.registerBrowserEvent(this.elBGColorList,"click","EVENT_APPLY_BGCOLOR",[]),this.oApp.registerLazyMessage(["APPLY_LAST_USED_BGCOLOR","TOGGLE_BGCOLOR_LAYER"],["hp_SE2M_BGColor$Lazy.js"])},_setLastUsedBGColor:function(e){this.sLastUsedColor=e,this.elLastUsed.style.backgroundColor=this.sLastUsedColor},getLastUsedBGColor:function(){return this.sLastUsedColor?this.sLastUsedColor:"#777777"}}),nhn.husky.SE2M_Hyperlink=jindo.$Class({name:"SE2M_Hyperlink",sATagMarker:"HTTP://HUSKY_TMP.MARKER/",_assignHTMLElements:function(e){this.oHyperlinkButton=jindo.$$.getSingle("li.husky_seditor_ui_hyperlink",e),this.oHyperlinkLayer=jindo.$$.getSingle("div.se2_layer",this.oHyperlinkButton),this.oLinkInput=jindo.$$.getSingle("INPUT[type=text]",this.oHyperlinkLayer),this.oBtnConfirm=jindo.$$.getSingle("button.se2_apply",this.oHyperlinkLayer),this.oBtnCancel=jindo.$$.getSingle("button.se2_cancel",this.oHyperlinkLayer)},_generateAutoLink:function(e,t,i,n,o){t=t||"";var s;return s=n?''+i+"":''+i+"",t+s},$BEFORE_MSG_APP_READY:function(){var e=nhn.husky.SE2M_Configuration.SE2M_Hyperlink;if(e&&e.bAutolink===!1){this.$ON_REGISTER_CONVERTERS=null,this.$ON_DISABLE_MESSAGE=null,this.$ON_ENABLE_MESSAGE=null;try{this.oApp.getWYSIWYGDocument().execCommand("AutoUrlDetect",!1,!1)}catch(t){}}},$ON_MSG_APP_READY:function(){this.bLayerShown=!1,jindo.$Agent().os().mac?this.oApp.exec("REGISTER_HOTKEY",["meta+k","TOGGLE_HYPERLINK_LAYER",[]]):this.oApp.exec("REGISTER_HOTKEY",["ctrl+k","TOGGLE_HYPERLINK_LAYER",[]]),this.oApp.exec("REGISTER_UI_EVENT",["hyperlink","click","TOGGLE_HYPERLINK_LAYER"]),this.oApp.registerLazyMessage(["TOGGLE_HYPERLINK_LAYER","APPLY_HYPERLINK"],["hp_SE2M_Hyperlink$Lazy.js"])},$ON_REGISTER_CONVERTERS:function(){this.oApp.exec("ADD_CONVERTER_DOM",["IR_TO_DB",jindo.$Fn(this.irToDb,this).bind()])},$LOCAL_BEFORE_FIRST:function(e){return e.match(/(REGISTER_CONVERTERS)/)?(this.oApp.acceptLocalBeforeFirstAgain(this,!0),!0):(this._assignHTMLElements(this.oApp.htOptions.elAppContainer),this.sRXATagMarker=this.sATagMarker.replace(/\//g,"\\/").replace(/\./g,"\\."),this.oApp.registerBrowserEvent(this.oBtnConfirm,"click","APPLY_HYPERLINK"),this.oApp.registerBrowserEvent(this.oBtnCancel,"click","HIDE_ACTIVE_LAYER"),void this.oApp.registerBrowserEvent(this.oLinkInput,"keydown","EVENT_HYPERLINK_KEYDOWN"))},$ON_EVENT_HYPERLINK_KEYDOWN:function(e){e.key().enter&&(this.oApp.exec("APPLY_HYPERLINK"),e.stop())},$ON_DISABLE_MESSAGE:function(e){if("TOGGLE_HYPERLINK_LAYER"===e){try{this.oApp.getWYSIWYGDocument().execCommand("AutoUrlDetect",!1,!1)}catch(t){}this._bDisabled=!0}},$ON_ENABLE_MESSAGE:function(e){if("TOGGLE_HYPERLINK_LAYER"===e){try{this.oApp.getWYSIWYGDocument().execCommand("AutoUrlDetect",!1,!0)}catch(t){}this._bDisabled=!1}},irToDb:function(e){if(!this._bDisabled){var t=e.cloneNode(!0);try{t.innerHTML}catch(i){t=jindo.$(e.outerHTML)}for(var n,o,s=this.oApp.getEmptySelection(),r=s._getFirstRealChild(t),a=s._getLastRealChild(t),l=jindo.$A(s._getNodesBetween(r,a)),h=l.filter(function(e){return e&&3===e.nodeType}).$value(),d=h,c=h,_=this.oApp.getWYSIWYGDocument().createElement("DIV"),p="@"+(new Date).getTime()+"@",E=new RegExp(p,"g"),u=0,g=h.length;g>u;u++){for(n=d[u].parentNode,o=!1;n;){if("A"===n.tagName||"PRE"===n.tagName){o=!0;break}n=n.parentNode}if(!o){_.innerHTML="";try{_.appendChild(d[u].cloneNode(!0)),_.innerHTML=(p+_.innerHTML).replace(/( |\s)?(((?!http[s]?:\/\/)www\.(?:(?!\ |\s|"|').)+)|(http[s]?:\/\/(?:(?! |\s|"|').)+))/gi,this._generateAutoLink),d[u].parentNode.insertBefore(_,d[u]),d[u].parentNode.removeChild(d[u])}catch(f){}for(;_.firstChild;)_.parentNode.insertBefore(_.firstChild,_);_.parentNode.removeChild(_)}}_=s=r=a=l=h=d=c=n=null,t.innerHTML=t.innerHTML.replace(E,""),e.innerHTML=t.innerHTML,t=null}}}),nhn.husky.SE2M_FontNameWithLayerUI=jindo.$Class({name:"SE2M_FontNameWithLayerUI",FONT_SEPARATOR:"husky_seditor_font_separator",_rxQuote:/['"]/g,_rxComma:/\s*,\s*/g,$init:function(e,t){this.elLastHover=null,this._assignHTMLElements(e),this.htBrowser=jindo.$Agent().navigator(),this.aAdditionalFontList=t||[]},addAllFonts:function(){var e,t,i,n,o;if(this.htFamilyName2DisplayName={},this.htAllFonts={},this.aBaseFontList=[],this.aDefaultFontList=[],this.aTempSavedFontList=[],this.htOptions=this.oApp.htOptions.SE2M_FontName,this.htOptions){if(e=this.htOptions.aDefaultFontList||[],t=this.htOptions.aFontList,i=this.htOptions.htMainFont,n=this.htOptions.aFontInUse,this.htBrowser.ie&&t)for(o=0;o0)for(o=0,nLen=this.aAdditionalFontList.length;o-1?(i&&(i.style.display=n?"block":"none"),i=e,n=!1):e.style.display="none";i&&(i.style.display=n?"block":"none")},_attachIEEvent:function(){if(this.htBrowser.ie){if(this.htBrowser.nativeVersion<9)return this._wfOnPasteWYSIWYGBody=jindo.$Fn(this._onPasteWYSIWYGBody,this),void this._wfOnPasteWYSIWYGBody.attach(this.oApp.getWYSIWYGDocument().body,"paste");if(document.documentMode<9)return this._wfOnFocusWYSIWYGBody=jindo.$Fn(this._onFocusWYSIWYGBody,this),void this._wfOnFocusWYSIWYGBody.attach(this.oApp.getWYSIWYGDocument().body,"focus");this.welEditingAreaCover=jindo.$Element('
    '),this.oApp.welEditingAreaContainer.prepend(this.welEditingAreaCover),jindo.$Fn(this._onMouseupCover,this).attach(this.welEditingAreaCover.$value(),"mouseup")}},_onFocusWYSIWYGBody:function(e){this._wfOnFocusWYSIWYGBody.detach(this.oApp.getWYSIWYGDocument().body,"focus"),this._loadAllBaseFont()},_onPasteWYSIWYGBody:function(e){this._wfOnPasteWYSIWYGBody.detach(this.oApp.getWYSIWYGDocument().body,"paste"),this._loadAllBaseFont()},_onMouseupCover:function(e){e.stop(),this.welEditingAreaCover&&this.welEditingAreaCover.leave();var t=e.mouse(),i=this.oApp.getWYSIWYGDocument().body,n=jindo.$Element(i),o=this.oApp.getEmptySelection();if(o.selectNode(i),o.collapseToStart(),o.select(),n.fireEvent("mousedown",{left:t.left,middle:t.middle,right:t.right}),n.fireEvent("mouseup",{left:t.left,middle:t.middle,right:t.right}),this.oApp.oNavigator.ie&&document.documentMode<11&&"WYSIWYG"===this.oApp.getEditingMode()){if("

    "==this.oApp.getWYSIWYGDocument().body.innerHTML){this.oApp.getWYSIWYGDocument().body.innerHTML='

    ';var o=this.oApp.getSelection();o.moveToStringBookmark("INIT"),o.select(),o.removeStringBookmark("INIT")}}else if(this.oApp.oNavigator.ie&&11==this.oApp.oNavigator.nativeVersion&&11==document.documentMode&&"WYSIWYG"===this.oApp.getEditingMode()&&"


    "==this.oApp.getWYSIWYGDocument().body.innerHTML){var s=jindo.$$.getSingle("br",i);o.setStartBefore(s),o.setEndBefore(s),o.select()}},$ON_EVENT_TOOLBAR_MOUSEDOWN:function(){this.htBrowser.nativeVersion<9||document.documentMode<9||this.welEditingAreaCover&&this.welEditingAreaCover.leave()},_loadAllBaseFont:function(){var e,t;if(this.htBrowser.ie){if(this.htBrowser.nativeVersion<9)for(e=0,t=this.aBaseFontList.length;t>e;e++)this.aBaseFontList[e].loadCSS(this.oApp.getWYSIWYGDocument());else if(document.documentMode<9)for(e=0,t=this.aBaseFontList.length;t>e;e++)this.aBaseFontList[e].loadCSSToMenu();this._loadAllBaseFont=function(){}}},_addFontToMenu:function(e,t,i){var n=document.createElement("LI");n.innerHTML=this.elFontItemTemplate.innerHTML.replace("@DisplayName@",e).replace("FontFamily",t).replace("@SampleText@",i),this.elFontNameList.insertBefore(n,this.elFontItemTemplate),this.aLIFontNames[this.aLIFontNames.length]=n,this.aLIFontNames.length>20&&(this.oDropdownLayer.style.overflowX="hidden",this.oDropdownLayer.style.overflowY="auto",this.oDropdownLayer.style.height="400px",this.oDropdownLayer.style.width="204px")},$ON_EVENT_FONTNAME_LAYER_MOUSEOVER:function(e){var t=this._findLI(e.element);t&&(this._clearLastHover(),t.className="hover",this.elLastHover=t)},$ON_EVENT_FONTNAME_LAYER_CLICKED:function(e){var t=this._findLI(e.element);if(t){var i,n=this._getFontFamilyFromLI(t),o=this.htAllFonts[n.replace(/\"/g,nhn.husky.SE2M_FontNameWithLayerUI.CUSTOM_FONT_MARKS)];i=o?o.defaultSize+"pt":0,this.oApp.exec("SET_FONTFAMILY",[n,i])}},_findLI:function(e){for(;"LI"!=e.tagName;){if(!e||e===this.oDropdownLayer)return null;e=e.parentNode}return e.className.indexOf(this.FONT_SEPARATOR)>-1?null:e},_clearLastHover:function(){this.elLastHover&&(this.elLastHover.className="")},$ON_SE2M_TOGGLE_FONTNAME_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.oDropdownLayer,null,"MSG_FONTNAME_LAYER_OPENED",[],"MSG_FONTNAME_LAYER_CLOSED",[]]),this.oApp.exec("MSG_NOTIFY_CLICKCR",["font"])},$ON_MSG_FONTNAME_LAYER_OPENED:function(){this.oApp.exec("SELECT_UI",["fontName"])},$ON_MSG_FONTNAME_LAYER_CLOSED:function(){this._clearLastHover(),this.oApp.exec("DESELECT_UI",["fontName"])},$ON_MSG_STYLE_CHANGED:function(e,t){if("fontFamily"==e){t=t.replace(/["']/g,"");var i=this._getMatchingLI(t);if(this._clearFontNameSelection(),i)this.elFontNameLabel.innerHTML=this._getFontNameLabelFromLI(i),jindo.$Element(i).addClass("active");else{var n=this.sDefaultText;this.elFontNameLabel.innerHTML=n}}},$BEFORE_RECORD_UNDO_BEFORE_ACTION:function(){return!this.bDoNotRecordUndo},$BEFORE_RECORD_UNDO_AFTER_ACTION:function(){return!this.bDoNotRecordUndo},$BEFORE_RECORD_UNDO_ACTION:function(){return!this.bDoNotRecordUndo},$ON_SET_FONTFAMILY:function(e,t){if(e){var i=this.htAllFonts[e.replace(/\"/g,nhn.husky.SE2M_FontNameWithLayerUI.CUSTOM_FONT_MARKS)];i&&i.loadCSS(this.oApp.getWYSIWYGDocument()),this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["SET FONTFAMILY",{bMustBlockElement:!0}]),this.bDoNotRecordUndo=!0,parseInt(t,10)>0&&this.oApp.exec("SET_WYSIWYG_STYLE",[{fontSize:t}]),this.oApp.exec("SET_WYSIWYG_STYLE",[{fontFamily:e}]),this.bDoNotRecordUndo=!1, this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["SET FONTFAMILY",{bMustBlockElement:!0}]),this.oApp.exec("HIDE_ACTIVE_LAYER",[]),this.oApp.exec("CHECK_STYLE_CHANGE",[])}},_getMatchingLI:function(e){e=e.toLowerCase();for(var t,i,n=0;n0?(l=e+"_"+i,h=t+"_"+i):(l=e,h=t),s||(l=nhn.husky.SE2M_FontNameWithLayerUI.CUSTOM_FONT_MARKS+l+nhn.husky.SE2M_FontNameWithLayerUI.CUSTOM_FONT_MARKS),this.htAllFonts[l]?this.htAllFonts[l]:(this.htAllFonts[l]=d,this.htBrowser.ie&&this.htBrowser.nativeVersion>=9&&document.documentMode>=9&&d.loadCSSToMenu(),this.htFamilyName2DisplayName[l]=t,r=r||this.oApp.$MSG("SE2M_FontNameWithLayerUI.sSampleText"),this._addFontToMenu(h,l,r),s?1==s?this.aDefaultFontList[this.aDefaultFontList.length]=d:this.aTempSavedFontList[this.aTempSavedFontList.length]=d:this.aBaseFontList[this.aBaseFontList.length]=d,d)},addFontInUse:function(e,t,i,n,o,s){var r=this.addFont(e,t,i,n,o,s);return r?(r.loadCSS(this.oApp.getWYSIWYGDocument()),r):null},setMainFont:function(e,t,i,n,o,s){var r=this.addFontInUse(e,t,i,n,o,s);return r?(this.setDefaultFont(r.fontFamily,i),r):null},setDefaultFont:function(e,t){var i=this.oApp.getWYSIWYGDocument().body;i.style.fontFamily=e,t>0&&(i.style.fontSize=t+"pt")}}),nhn.husky.SE2M_FontNameWithLayerUI.CUSTOM_FONT_MARKS="'",nhn.ColorPicker=jindo.$Class({elem:null,huePanel:null,canvasType:"Canvas",_hsvColor:null,$init:function(e,t){if(this.elem=jindo.$Element(e).empty(),this.huePanel=null,this.cursor=jindo.$Element("
    ").css("overflow","hidden"),this.canvasType=jindo.$(e).filters?"Filter":jindo.$("").getContext?"Canvas":null,!this.canvasType)return!1;this.option({huePanel:null,huePanelType:"horizontal"}),this.option(t),this.option("huePanel")&&(this.huePanel=jindo.$Element(this.option("huePanel")).empty()),this._hsvColor=this._hsv(0,100,100);for(var i in this)/^_on[A-Z][a-z]+[A-Z][a-z]+$/.test(i)&&(this[i+"Fn"]=jindo.$Fn(this[i],this));this._onDownColorFn.attach(this.elem,"mousedown"),this.huePanel&&this._onDownHueFn.attach(this.huePanel,"mousedown"),this.paint()},rgb:function(e){this.hsv(this._rgb2hsv(e.r,e.g,e.b))},hsv:function(e){if("undefined"==typeof e)return this._hsvColor;var t=null,i=this.elem.width(),n=this.elem.height(),o=this.cursor.width(),s=this.cursor.height(),r=0,a=0;if(this.huePanel)t=this._hsv2rgb(e.h,100,100),this.elem.css("background","#"+this._rgb2hex(t.r,t.g,t.b)),r=e.s/100*i,a=(100-e.v)/100*n;else{var l=i/2;e.v>e.s?(e.v=100,r=e.s/100*l):(e.s=100,r=(100-e.v)/100*l+l),a=e.h/360*n}r=Math.max(Math.min(r-1,i-o),1),a=Math.max(Math.min(a-1,n-s),1),this.cursor.css({left:r+"px",top:a+"px"}),this._hsvColor=e,t=this._hsv2rgb(e.h,e.s,e.v),this.fireEvent("colorchange",{type:"colorchange",element:this,currentElement:this,rgbColor:t,hexColor:"#"+this._rgb2hex(t.r,t.g,t.b),hsvColor:e})},paint:function(){this.huePanel?(this["_paintColWith"+this.canvasType](),this["_paintHueWith"+this.canvasType]()):this["_paintOneWith"+this.canvasType](),this.cursor.appendTo(this.elem),this.cursor.css({position:"absolute",top:"1px",left:"1px",background:"white",border:"1px solid black"}).width(3).height(3),this.hsv(this._hsvColor)},_paintColWithFilter:function(){jindo.$Element("
    ").css({position:"absolute",top:0,left:0,width:"100%",height:"100%",filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=1,StartColorStr='#FFFFFFFF',EndColorStr='#00FFFFFF')"}).appendTo(this.elem),jindo.$Element("
    ").css({position:"absolute",top:0,left:0,width:"100%",height:"100%",filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#00000000',EndColorStr='#FF000000')"}).appendTo(this.elem)},_paintColWithCanvas:function(){var e=jindo.$Element("").css({width:"100%",height:"100%"});e.appendTo(this.elem.empty());var t=e.attr("width",e.width()).attr("height",e.height()).$value().getContext("2d"),i=null,n=e.width(),o=e.height();i=t.createLinearGradient(0,0,n,0),i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=i,t.fillRect(0,0,n,o),i=t.createLinearGradient(0,0,0,o),i.addColorStop(0,"rgba(0,0,0,0)"),i.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=i,t.fillRect(0,0,n,o)},_paintOneWithFilter:function(){for(var e,t,i,n,o,s,r=this.elem.height(),a=1;7>a;a++)e=Math.floor((a-1)/6*r),t=Math.floor(a/6*r),i=this._hsv2rgb((a-1)/6*360,100,100),n=this._hsv2rgb(a/6*360,100,100),o="#FF"+this._rgb2hex(i.r,i.g,i.b),s="#FF"+this._rgb2hex(n.r,n.g,n.b),jindo.$Element("
    ").css({position:"absolute",left:0,width:"100%",top:e+"px",height:t-e+"px",filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='"+o+"',EndColorStr='"+s+"')"}).appendTo(this.elem);jindo.$Element("
    ").css({position:"absolute",top:0,left:0,width:"50%",height:"100%",filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=1,StartColorStr='#FFFFFFFF',EndColorStr='#00FFFFFF')"}).appendTo(this.elem),jindo.$Element("
    ").css({position:"absolute",top:0,right:0,width:"50%",height:"100%",filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=1,StartColorStr='#00000000',EndColorStr='#FF000000')"}).appendTo(this.elem)},_paintOneWithCanvas:function(){var e={r:0,g:0,b:0},t=jindo.$Element("").css({width:"100%",height:"100%"});t.appendTo(this.elem.empty());for(var i=t.attr("width",t.width()).attr("height",t.height()).$value().getContext("2d"),n=t.width(),o=t.height(),s=i.createLinearGradient(0,0,0,o),r=0;7>r;r++)e=this._hsv2rgb(r/6*360,100,100),s.addColorStop(r/6,"rgb("+e.join(",")+")");i.fillStyle=s,i.fillRect(0,0,n,o),s=i.createLinearGradient(0,0,n,0),s.addColorStop(0,"rgba(255,255,255,1)"),s.addColorStop(.5,"rgba(255,255,255,0)"),s.addColorStop(.5,"rgba(0,0,0,0)"),s.addColorStop(1,"rgba(0,0,0,1)"),i.fillStyle=s,i.fillRect(0,0,n,o)},_paintHueWithFilter:function(){var e,t,i,n,o,s,r="vertical"==this.option().huePanelType,a=this.huePanel.width(),l=this.huePanel.height(),h=null,d=parseInt(this.huePanel.css("borderWidth"),10);isNaN(d)&&(d=0),a-=2*d;for(var c=1;7>c;c++){e=Math.floor((c-1)/6*(r?l:a)),t=Math.floor(c/6*(r?l:a)),i=this._hsv2rgb((c-1)/6*360,100,100),n=this._hsv2rgb(c/6*360,100,100),o="#FF"+this._rgb2hex(i.r,i.g,i.b),s="#FF"+this._rgb2hex(n.r,n.g,n.b),h=jindo.$Element("
    ").css({position:"absolute",filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType="+(r?0:1)+",StartColorStr='"+o+"',EndColorStr='"+s+"')"});var _=t-e+1;h.appendTo(this.huePanel),h.css(r?"left":"top",0).css(r?"width":"height","100%"),h.css(r?"top":"left",e+"px").css(r?"height":"width",_+"px")}},_paintHueWithCanvas:function(){var e,t=this.option(),i="vertical"==t.huePanelType,n=jindo.$Element("").css({width:"100%",height:"100%"});n.appendTo(this.huePanel.empty());for(var o=n.attr("width",n.width()).attr("height",n.height()).$value().getContext("2d"),s=o.createLinearGradient(0,0,i?0:n.width(),i?n.height():0),r=0;7>r;r++)e=this._hsv2rgb(r/6*360,100,100),s.addColorStop(r/6,"rgb("+e.join(",")+")");o.fillStyle=s,o.fillRect(0,0,n.width(),n.height())},_rgb2hsv:function(e,t,i){var n=0,o=0,s=Math.max(e,t,i),r=Math.min(e,t,i),a=s-r;return o=s?a/s:0,o&&(e==s?n=60*(t-i)/a:t==s?n=120+60*(i-e)/a:i==s&&(n=240+60*(e-t)/a),0>n&&(n+=360)),n=Math.floor(n),o=Math.floor(100*o),s=Math.floor(s/255*100),this._hsv(n,o,s)},_hsv2rgb:function(e,t,i){e=e%360/60,t/=100,i/=100;var n=0,o=0,s=0,r=Math.floor(e),a=e-r,l=i*(1-t),h=i*(1-t*a),d=i*(1-t*(1-a));switch(r){case 0:n=i,o=d,s=l;break;case 1:n=h,o=i,s=l;break;case 2:n=l,o=i,s=d;break;case 3:n=l,o=h,s=i;break;case 4:n=d,o=l,s=i;break;case 5:n=i,o=l,s=h;break;case 6:}return n=Math.floor(255*n),o=Math.floor(255*o),s=Math.floor(255*s),this._rgb(n,o,s)},_rgb2hex:function(e,t,i){return e=e.toString(16),1==e.length&&(e="0"+e),t=t.toString(16),1==t.length&&(t="0"+t),i=i.toString(16),1==i.length&&(i="0"+i),e+t+i},_hex2rgb:function(e){var t=e.match(/#?([0-9a-f]{6}|[0-9a-f]{3})/i);return t=3==t[1].length?t[1].match(/./g).filter(function(e){return e+e}):t[1].match(/../g),{r:Number("0x"+t[0]),g:Number("0x"+t[1]),b:Number("0x"+t[2])}},_rgb:function(e,t,i){var n=[e,t,i];return n.r=e,n.g=t,n.b=i,n},_hsv:function(e,t,i){var n=[e,t,i];return n.h=e,n.s=t,n.v=i,n},_onDownColor:function(e){if(!e.mouse().left)return!1;var t=e.pos();this._colPagePos=[t.pageX,t.pageY],this._colLayerPos=[t.layerX,t.layerY],this._onUpColorFn.attach(document,"mouseup"),this._onMoveColorFn.attach(document,"mousemove"),this._onMoveColor(e)},_onUpColor:function(e){this._onUpColorFn.detach(document,"mouseup"),this._onMoveColorFn.detach(document,"mousemove")},_onMoveColor:function(e){var t=this._hsvColor,i=e.pos(),n=this._colLayerPos[0]+(i.pageX-this._colPagePos[0]),o=this._colLayerPos[1]+(i.pageY-this._colPagePos[1]),s=this.elem.width(),r=this.elem.height();if(n=Math.max(Math.min(n,s),0),o=Math.max(Math.min(o,r),0),this.huePanel)t.s=t[1]=n/s*100,t.v=t[2]=(r-o)/r*100;else{t.h=o/r*360;var a=s/2;a>n?(t.s=n/a*100,t.v=100):(t.s=100,t.v=(s-n)/a*100)}this.hsv(t),e.stop()},_onDownHue:function(e){if(!e.mouse().left)return!1;var t=e.pos();this._huePagePos=[t.pageX,t.pageY],this._hueLayerPos=[t.layerX,t.layerY],this._onUpHueFn.attach(document,"mouseup"),this._onMoveHueFn.attach(document,"mousemove"),this._onMoveHue(e)},_onUpHue:function(e){this._onUpHueFn.detach(document,"mouseup"),this._onMoveHueFn.detach(document,"mousemove")},_onMoveHue:function(e){var t=this._hsvColor,i=e.pos(),n=0,o=0,s=this._hueLayerPos[0]+(i.pageX-this._huePagePos[0]),r=this._hueLayerPos[1]+(i.pageY-this._huePagePos[1]);"vertical"==this.option().huePanelType?(n=r,o=this.huePanel.height()):(n=s,o=this.huePanel.width()),t.h=t[0]=Math.min(Math.max(n,0),o)/o*360%360,this.hsv(t),e.stop()}}).extend(jindo.Component),nhn.husky.SE2M_Accessibility=jindo.$Class({name:"SE2M_Accessibility",$init:function(e,t,i){this._assignHTMLElements(e),t&&(this.sLang=t),i&&(this.sType=i)},_assignHTMLElements:function(e){this.elHelpPopupLayer=jindo.$$.getSingle("DIV.se2_accessibility",e),this.welHelpPopupLayer=jindo.$Element(this.elHelpPopupLayer),this.oCloseButton=jindo.$$.getSingle("BUTTON.se2_close",this.elHelpPopupLayer),this.oCloseButton2=jindo.$$.getSingle("BUTTON.se2_close2",this.elHelpPopupLayer),this.nDefaultTop=150,this.elAppContainer=e},$ON_MSG_APP_READY:function(){this.htAccessOption=nhn.husky.SE2M_Configuration.SE2M_Accessibility||{},this.oApp.exec("REGISTER_HOTKEY",["alt+F10","FOCUS_TOOLBAR_AREA",[]]),this.oApp.exec("REGISTER_HOTKEY",["alt+COMMA","FOCUS_BEFORE_ELEMENT",[]]),this.oApp.exec("REGISTER_HOTKEY",["alt+PERIOD","FOCUS_NEXT_ELEMENT",[]]),this.sLang&&"ko_KR"!==this.sLang||(this.oApp.exec("REGISTER_HOTKEY",["alt+0","OPEN_HELP_POPUP",[]]),this.oApp.exec("REGISTER_HOTKEY",["esc","CLOSE_HELP_POPUP",[],document]),this.htAccessOption.sTitleElementId&&this.oApp.registerBrowserEvent(document.getElementById(this.htAccessOption.sTitleElementId),"keydown","MOVE_TO_EDITAREA",[]))},$ON_MOVE_TO_EDITAREA:function(e){var t=9;if(e.key().keyCode==t){if(e.key().shift)return;this.oApp.delayedExec("FOCUS",[],0)}},$LOCAL_BEFORE_FIRST:function(e){jindo.$Fn(jindo.$Fn(this.oApp.exec,this.oApp).bind("CLOSE_HELP_POPUP",[this.oCloseButton]),this).attach(this.oCloseButton,"click"),jindo.$Fn(jindo.$Fn(this.oApp.exec,this.oApp).bind("CLOSE_HELP_POPUP",[this.oCloseButton2]),this).attach(this.oCloseButton2,"click");var t=this.oApp.getWYSIWYGWindow().frameElement;this.htOffsetPos=jindo.$Element(t).offset(),this.nEditorWidth=t.offsetWidth,this.htInitialPos=this.welHelpPopupLayer.offset();this.oApp.oUtils.getScrollXY();this.nLayerWidth=590,this.nLayerHeight=480,this.htTopLeftCorner={x:parseInt(this.htOffsetPos.left,10),y:parseInt(this.htOffsetPos.top,10)}},$ON_FOCUS_NEXT_ELEMENT:function(){this._currentNextFocusElement=null,this.htAccessOption.sNextElementId?this._currentNextFocusElement=document.getElementById(this.htAccessOption.sNextElementId):this._currentNextFocusElement=this._findNextFocusElement(this.elAppContainer),this._currentNextFocusElement?(window.focus(),this._currentNextFocusElement.focus()):parent&&parent.nhn&&parent.nhn.husky&&parent.nhn.husky.EZCreator&&parent.nhn.husky.EZCreator.elIFrame&&(parent.focus(),(this._currentNextFocusElement=this._findNextFocusElement(parent.nhn.husky.EZCreator.elIFrame))&&this._currentNextFocusElement.focus())},_findNextFocusElement:function(e){for(var t=null,i=e.nextSibling;i;){if(1!==i.nodeType){if(i=this._switchToSiblingOrNothing(i))continue;break}if(this._recursivePreorderTraversalFilter(i,this._isFocusTag),this._nextFocusElement){t=this._nextFocusElement,this._bStopFindingNextElement=!1,this._nextFocusElement=null;break}if(i=this._switchToSiblingOrNothing(i),!i)break}return t},_switchToSiblingOrNothing:function(e,t){var i=e;if(t)if(i.previousSibling)i=i.previousSibling;else{for(;"BODY"!=i.nodeName.toUpperCase()&&!i.previousSibling;)i=i.parentNode;i="BODY"==i.nodeName.toUpperCase()?null:i.previousSibling}else if(i.nextSibling)i=i.nextSibling;else{for(;"BODY"!=i.nodeName.toUpperCase()&&!i.nextSibling;)i=i.parentNode;i="BODY"==i.nodeName.toUpperCase()?null:i.nextSibling}return i},_recursivePreorderTraversalFilter:function(e,t,i){var n=this,o=t.apply(e);if(o)return n._bStopFindingNextElement=!0,void(i?n._previousFocusElement=e:n._nextFocusElement=e);if(i)for(var s=e.childNodes.length,r=s-1;r>=0&&(n._recursivePreorderTraversalFilter(e.childNodes[r],t,!0),!this._bStopFindingNextElement);r--);else for(var r=0,s=e.childNodes.length;s>r&&(n._recursivePreorderTraversalFilter(e.childNodes[r],t),!this._bStopFindingNextElement);r++);},_isFocusTag:function(){for(var e=this,t=["A","BUTTON","INPUT","TEXTAREA"],i=!1,n=0,o=t.length;o>n;n++)if(1===e.nodeType&&e.nodeName&&e.nodeName.toUpperCase()==t[n]&&!e.disabled&&jindo.$Element(e).visible()){i=!0;break}return i},$ON_FOCUS_BEFORE_ELEMENT:function(){this._currentPreviousFocusElement=null,this.htAccessOption.sBeforeElementId?this._currentPreviousFocusElement=document.getElementById(this.htAccessOption.sBeforeElementId):this._currentPreviousFocusElement=this._findPreviousFocusElement(this.elAppContainer),this._currentPreviousFocusElement?(window.focus(),this._currentPreviousFocusElement.focus()):parent&&parent.nhn&&parent.nhn.husky&&parent.nhn.husky.EZCreator&&parent.nhn.husky.EZCreator.elIFrame&&(parent.focus(),(this._currentPreviousFocusElement=this._findPreviousFocusElement(parent.nhn.husky.EZCreator.elIFrame))&&this._currentPreviousFocusElement.focus())},_findPreviousFocusElement:function(e){for(var t=null,i=e.previousSibling;i;){if(1!==i.nodeType){if(i=this._switchToSiblingOrNothing(i,!0))continue;break}if(this._recursivePreorderTraversalFilter(i,this._isFocusTag,!0),this._previousFocusElement){t=this._previousFocusElement,this._bStopFindingNextElement=!1,this._previousFocusElement=null;break}if(i=this._switchToSiblingOrNothing(i,!0),!i)break}return t},$ON_FOCUS_TOOLBAR_AREA:function(){this.oButton=jindo.$$.getSingle("BUTTON.se2_font_family",this.elAppContainer),this.oButton&&!this.oButton.disabled&&(window.focus(),this.oButton.focus())},$ON_OPEN_HELP_POPUP:function(){this.oApp.exec("DISABLE_ALL_UI",[{aExceptions:["se2_accessibility"]}]),this.oApp.exec("SHOW_EDITING_AREA_COVER"),this.oApp.exec("SELECT_UI",["se2_accessibility"]),this.nCalcX=this.htTopLeftCorner.x+this.oApp.getEditingAreaWidth()-this.nLayerWidth,this.nCalcY=this.htTopLeftCorner.y-30,this.oApp.exec("SHOW_DIALOG_LAYER",[this.elHelpPopupLayer,{elHandle:this.elTitle,nMinX:this.htTopLeftCorner.x+0,nMinY:this.nDefaultTop+77,nMaxX:this.nCalcX,nMaxY:this.nCalcY}]),this.welHelpPopupLayer.offset(this.nCalcY,this.nCalcX/2),jindo.$Agent().navigator().ie&&window.focus();var e=this;setTimeout(function(){try{e.oCloseButton2.focus()}catch(t){}},200)},$ON_CLOSE_HELP_POPUP:function(){this.oApp.exec("ENABLE_ALL_UI"),this.oApp.exec("DESELECT_UI",["helpPopup"]),this.oApp.exec("HIDE_ALL_DIALOG_LAYER",[]),this.oApp.exec("HIDE_EDITING_AREA_COVER"),this.oApp.exec("FOCUS")}}),nhn.husky.SE2M_SCharacter=jindo.$Class({name:"SE2M_SCharacter",$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["sCharacter","click","TOGGLE_SCHARACTER_LAYER"]),this.oApp.registerLazyMessage(["TOGGLE_SCHARACTER_LAYER"],["hp_SE2M_SCharacter$Lazy.js"])}}),nhn.husky.SE2M_FindReplacePlugin=jindo.$Class({name:"SE2M_FindReplacePlugin",oEditingWindow:null,oFindReplace:null,bFindMode:!0,bLayerShown:!1,$init:function(){this.nDefaultTop=20},$ON_MSG_APP_READY:function(){this.oEditingWindow=this.oApp.getWYSIWYGWindow(),jindo.$Agent().os().mac?(this.oApp.exec("REGISTER_HOTKEY",["meta+f","SHOW_FIND_LAYER",[]]),this.oApp.exec("REGISTER_HOTKEY",["meta+h","SHOW_REPLACE_LAYER",[]])):(this.oApp.exec("REGISTER_HOTKEY",["ctrl+f","SHOW_FIND_LAYER",[]]),this.oApp.exec("REGISTER_HOTKEY",["ctrl+h","SHOW_REPLACE_LAYER",[]])),this.oApp.exec("REGISTER_UI_EVENT",["findAndReplace","click","TOGGLE_FIND_REPLACE_LAYER"]),this.oApp.registerLazyMessage(["TOGGLE_FIND_REPLACE_LAYER","SHOW_FIND_LAYER","SHOW_REPLACE_LAYER","SHOW_FIND_REPLACE_LAYER"],["hp_SE2M_FindReplacePlugin$Lazy.js","N_FindReplace.js"])},$ON_SHOW_ACTIVE_LAYER:function(){this.oApp.exec("HIDE_DIALOG_LAYER",[this.elDropdownLayer])}}),nhn.husky.SE2M_Quote=jindo.$Class({name:"SE2M_Quote",htQuoteStyles_view:null,$init:function(){var e=nhn.husky.SE2M_Configuration.Quote||{},t=e.sImageBaseURL;this.nMaxLevel=e.nMaxLevel||14,this.htQuoteStyles_view={},this.htQuoteStyles_view.se2_quote1="_zoom:1;padding:0 8px; margin:0 0 30px 20px; margin-right:15px; border-left:2px solid #cccccc;color:#888888;",this.htQuoteStyles_view.se2_quote2="_zoom:1;margin:0 0 30px 13px;padding:0 8px 0 16px;background:url("+t+"/bg_quote2.gif) 0 3px no-repeat;color:#888888;",this.htQuoteStyles_view.se2_quote3="_zoom:1;margin:0 0 30px 0;padding:10px;border:1px dashed #cccccc;color:#888888;",this.htQuoteStyles_view.se2_quote4="_zoom:1;margin:0 0 30px 0;padding:10px;border:1px dashed #66b246;color:#888888;",this.htQuoteStyles_view.se2_quote5="_zoom:1;margin:0 0 30px 0;padding:10px;border:1px dashed #cccccc;background:url("+t+"/bg_b1.png) repeat;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+t+"/bg_b1.png',sizingMethod='scale');color:#888888;",this.htQuoteStyles_view.se2_quote6="_zoom:1;margin:0 0 30px 0;padding:10px;border:1px solid #e5e5e5;color:#888888;",this.htQuoteStyles_view.se2_quote7="_zoom:1;margin:0 0 30px 0;padding:10px;border:1px solid #66b246;color:#888888;",this.htQuoteStyles_view.se2_quote8="_zoom:1;margin:0 0 30px 0;padding:10px;border:1px solid #e5e5e5;background:url("+t+"/bg_b1.png) repeat;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+t+"/bg_b1.png',sizingMethod='scale');color:#888888;",this.htQuoteStyles_view.se2_quote9="_zoom:1;margin:0 0 30px 0;padding:10px;border:2px solid #e5e5e5;color:#888888;",this.htQuoteStyles_view.se2_quote10="_zoom:1;margin:0 0 30px 0;padding:10px;border:2px solid #e5e5e5;background:url("+t+"/bg_b1.png) repeat;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+t+"/bg_b1.png',sizingMethod='scale');color:#888888;"},_assignHTMLElements:function(){this.elDropdownLayer=jindo.$$.getSingle("DIV.husky_seditor_blockquote_layer",this.oApp.htOptions.elAppContainer),this.aLI=jindo.$$("LI",this.elDropdownLayer)},$ON_REGISTER_CONVERTERS:function(){this.oApp.exec("ADD_CONVERTER",["DB_TO_IR",jindo.$Fn(function(e){return e=e.replace(/<(blockquote)[^>]*class=['"]?(se2_quote[0-9]+)['"]?[^>]*>/gi,"<$1 class=$2>")},this).bind()]),this.oApp.exec("ADD_CONVERTER",["IR_TO_DB",jindo.$Fn(function(e){var t=this.htQuoteStyles_view;return e=e.replace(/<(blockquote)[^>]*class=['"]?(se2_quote[0-9]+)['"]?[^>]*>/gi,function(e,i,n){return"<"+i+" class="+n+' style="'+t[n]+'">'})},this).bind()]),this.htSE1toSE2Map={"01":"1","02":"2","03":"6","04":"8","05":"9","07":"3","08":"5"}},$LOCAL_BEFORE_FIRST:function(){this._assignHTMLElements(),this.oApp.registerBrowserEvent(this.elDropdownLayer,"click","EVENT_SE2_BLOCKQUOTE_LAYER_CLICK",[]),this.oApp.delayedExec("SE2_ATTACH_HOVER_EVENTS",[this.aLI],0)},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["quote","click","TOGGLE_BLOCKQUOTE_LAYER"]),this.oApp.registerLazyMessage(["TOGGLE_BLOCKQUOTE_LAYER"],["hp_SE2M_Quote$Lazy.js"])},$ON_EVENT_EDITING_AREA_KEYDOWN:function(e){var t,i;"WYSIWYG"===this.oApp.getEditingMode()&&8===e.key().keyCode&&(t=this.oApp.getSelection(),t.fixCommonAncestorContainer(),i=this._findParentQuote(t.commonAncestorContainer),i&&this._isBlankQuote(i)&&(e.stop(jindo.$Event.CANCEL_DEFAULT),t.selectNode(i),t.collapseToStart(),jindo.$Element(i).leave(),t.select()))},$ON_EVENT_EDITING_AREA_KEYUP:function(e){var t,i,n;if("WYSIWYG"===this.oApp.getEditingMode()&&46===e.key().keyCode)return t=this.oApp.getSelection(),t.fixCommonAncestorContainer(),(i=this._findParentQuote(t.commonAncestorContainer))?void(i.nextSibling||(e.stop(jindo.$Event.CANCEL_DEFAULT),n=t._document.createElement("P"),n.innerHTML=" ",jindo.$Element(i).after(n),setTimeout(jindo.$Fn(function(e){var t=e.placeStringBookmark();e.select(),e.removeStringBookmark(t)},this).bind(t),0))):!1},_isBlankQuote:function(e){var t,i,n,o,s=this.oApp.oNavigator.chrome,r=this.oApp.oNavigator.safari,a=function(e){return e=e.replace(/[\r\n]/gi,"").replace(unescape("%uFEFF"),""),""===e?!0:" "===e||" "===e?!0:!1},l=function(e){return 3===e.nodeType&&a(e.nodeValue)?!0:"P"!==e.tagName&&"SPAN"!==e.tagName||!a(e.innerHTML)&&"
    "!==e.innerHTML?!1:!0},h=function(e){return 0===jindo.$$("tr",e).length?!0:!1};if(a(e.innerHTML)||"
    "===e.innerHTML)return!0;if(s||r){var d,c=jindo.$$("TABLE",e),_=c.length;for(n=0;_>n;n++)d=c[n],h(d)&&jindo.$Element(d).leave()}for(i=e.childNodes,n=0,o=i.length;o>n;n++)if(t=i[n],!l(t))return!1;return!0},_findParentQuote:function(e){return this._findAncestor(jindo.$Fn(function(e){if(!e)return!1;if("BLOCKQUOTE"!==e.tagName)return!1;if(!e.className)return!1;var t=e.className;return this.htQuoteStyles_view[t]?!0:!1},this).bind(),e)},_findAncestor:function(e,t){for(;t&&!e(t);)t=t.parentNode;return t}}),nhn.husky.SE2M_TableCreator=jindo.$Class({name:"SE2M_TableCreator",_sSETblClass:"__se_tbl",nRows:3,nColumns:4,nBorderSize:1,sBorderColor:"#000000",sBGColor:"#000000",nBorderStyleIdx:3,nTableStyleIdx:1,nMinRows:1,nMaxRows:20,nMinColumns:1,nMaxColumns:20,nMinBorderWidth:1,nMaxBorderWidth:10,rxLastDigits:null,sReEditGuideMsg_table:null,oSelection:null,$ON_MSG_APP_READY:function(){this.sReEditGuideMsg_table=this.oApp.$MSG("SE2M_ReEditAction.reEditGuideMsg.table"),this.oApp.exec("REGISTER_UI_EVENT",["table","click","TOGGLE_TABLE_LAYER"]),this.oApp.registerLazyMessage(["TOGGLE_TABLE_LAYER"],["hp_SE2M_TableCreator$Lazy.js"])},$ON_REGISTER_CONVERTERS:function(){this.oApp.exec("ADD_CONVERTER_DOM",["IR_TO_DB",jindo.$Fn(this.irToDbDOM,this).bind()]),this.oApp.exec("ADD_CONVERTER_DOM",["DB_TO_IR",jindo.$Fn(this.dbToIrDOM,this).bind()])},irToDbDOM:function(e){var t=[],i=jindo.$$("table[class=__se_tbl]",e,{oneTimeOffCache:!0});if(jindo.$A(i).forEach(function(e,i,n){jindo.$Element(e).attr("attr_no_border_tbl")&&t.push(e)},this),!(t.length<1))for(var n,o=[],s=0,r=t.length;r>s;s++)n=t[s],jindo.$Element(n).css({border:"",borderLeft:"",borderBottom:""}),jindo.$Element(n).attr({border:0,cellpadding:1}),o=jindo.$$("tbody>tr>td",n),jindo.$A(o).forEach(function(e,t,i){jindo.$Element(e).css({border:"",borderTop:"",borderRight:""})})},dbToIrDOM:function(e){var t=[],i=jindo.$$("table[class=__se_tbl]",e,{oneTimeOffCache:!0});if(jindo.$A(i).forEach(function(e,i,n){jindo.$Element(e).attr("attr_no_border_tbl")&&t.push(e)},this),!(t.length<1))for(var n,o=[],s=0,r=t.length;r>s;s++)n=t[s],jindo.$Element(n).css({border:"1px dashed #c7c7c7",borderLeft:0,borderBottom:0}),jindo.$Element(n).attr({border:1,cellpadding:0}),o=jindo.$$("tbody>tr>td",n),jindo.$A(o).forEach(function(e,t,i){jindo.$Element(e).css({border:"1px dashed #c7c7c7",borderTop:0,borderRight:0})})}}),nhn.husky.SE2M_TableBlockStyler=jindo.$Class({name:"SE2M_TableBlockStyler",nSelectedTD:0,htSelectedTD:{},aTdRange:[],$init:function(){},$LOCAL_BEFORE_ALL:function(){return"WYSIWYG"==this.oApp.getEditingMode()},$ON_MSG_APP_READY:function(){this.oDocument=this.oApp.getWYSIWYGDocument()},$ON_EVENT_EDITING_AREA_MOUSEUP:function(e){"WYSIWYG"==this.oApp.getEditingMode()&&this.setTdBlock()},$ON_IS_SELECTED_TD_BLOCK:function(e,t){return this.nSelectedTD>0?(t[e]=!0,t[e]):(t[e]=!1,t[e])},$ON_GET_SELECTED_TD_BLOCK:function(e,t){t[e]=this.htSelectedTD.aTdCells},setTdBlock:function(){this.oApp.exec("GET_SELECTED_CELLS",["aTdCells",this.htSelectedTD]);var e=this.htSelectedTD.aTdCells;e&&(this.nSelectedTD=e.length)},$ON_DELETE_BLOCK_CONTENTS:function(){var e,t,i,n=this;this.setTdBlock();for(var o=0;o 

    ":i.firefox&&(e+="

    \ufeff

    "),r.selectNode(n),r.pasteHTML(e),s=r.getNodes()||[];for(var a=0;ao;o++)t[o].className&&(t[o].className=t[o].className.replace(this.CELL_SELECTION_CLASS,""),t[o].getAttribute(this.TMP_BGC_ATTR)?(t[o].style.backgroundColor=t[o].getAttribute(this.TMP_BGC_ATTR),t[o].removeAttribute(this.TMP_BGC_ATTR)):t[o].getAttribute(this.TMP_BGIMG_ATTR)&&(jindo.$Element(this.aCells[o]).css("backgroundImage",t[o].getAttribute(this.TMP_BGIMG_ATTR)),t[o].removeAttribute(this.TMP_BGIMG_ATTR)))}},this).bind()])},$ON_MSG_APP_READY:function(){this.oApp.registerLazyMessage(["EVENT_EDITING_AREA_MOUSEMOVE","STYLE_TABLE"],["hp_SE2M_TableEditor$Lazy.js","SE2M_TableTemplate.js"])}}),nhn.husky.SE2M_QuickEditor_Common=jindo.$Class({ name:"SE2M_QuickEditor_Common",_environmentData:"",_currentType:"",_in_event:!1,_bUseConfig:!1,_sBaseAjaxUrl:"",_sAddTextAjaxUrl:"",$init:function(){this.waHotkeys=new jindo.$A([]),this.waHotkeyLayers=new jindo.$A([])},$ON_MSG_APP_READY:function(){var e=nhn.husky.SE2M_Configuration.QuickEditor;e&&(this._bUseConfig=e.common&&"undefined"!=typeof e.common.bUseConfig?e.common.bUseConfig:!0),this._bUseConfig?(this._sBaseAjaxUrl=e.common.sBaseAjaxUrl,this._sAddTextAjaxUrl=e.common.sAddTextAjaxUrl,this.getData()):this.setData("{table:'full',img:'full',review:'full'}"),this.oApp.registerLazyMessage(["OPEN_QE_LAYER"],["hp_SE2M_QuickEditor_Common$Lazy.js"])},$ON_EVENT_EDITING_AREA_KEYDOWN:function(e){var t=e.key();if(8==t.keyCode||46==t.keyCode){var i=jindo.$Agent().navigator();if(i.ie&&i.nativeVersion>8){var n=jindo.$$.getSingle("DIV.husky_seditor_editing_area_container").childNodes[0];"DIV"==n.tagName&&1e3==n.style.zIndex&&n.parentNode.removeChild(n)}this.oApp.exec("CLOSE_QE_LAYER",[e])}},getData:function(){var e=this;jindo.$Ajax(e._sBaseAjaxUrl,{type:"jsonp",timeout:1,onload:function(t){var i=t.json().result;i&&i.text_data?e.setData(i.text_data):e.setData("{table:'full',img:'full',review:'full'}")},onerror:function(){e.setData("{table:'full',img:'full',review:'full'}")},ontimeout:function(){e.setData("{table:'full',img:'full',review:'full'}")}}).request({text_key:"qeditor_fold"})},setData:function(sResult){var oResult={table:"full",img:"full",review:"full"};sResult&&(oResult=eval("("+sResult+")")),this._environmentData={table:{isOpen:!1,type:oResult.table,isFixed:!1,position:[]},img:{isOpen:!1,type:oResult.img,isFixed:!1},review:{isOpen:!1,type:oResult.review,isFixed:!1,position:[]}},this.waTableTagNames=jindo.$A(["table","tbody","td","tfoot","th","thead","tr"])},$ON_REGISTER_HOTKEY:function(e,t,i){"tab"!=e&&"shift+tab"!=e&&this.waHotkeys.push([e,t,i])}}),Shortcut.Store={anthorKeyHash:{},datas:{},currentId:"",currentKey:"",searchId:function(e,t){var i=!1;if(jindo.$H(this.datas).forEach(function(n,o){t==n.element&&(e=o,i=!0,jindo.$H.Break())}),!i&&e in this.datas){for(var n=e;n in this.datas;)n="nonID"+(new Date).getTime();return n}return e},set:function(e,t,i){this.currentId=e,this.currentKey=t;var n=this.get(e);this.datas[e]=n?n.createKey(t):new Shortcut.Data(e,t,i)},get:function(e,t){return t?this.datas[e].keys[t]:this.datas[e]},reset:function(e){var t=this.datas[e];Shortcut.Helper.bind(t.func,t.element,"detach"),delete this.datas[e]},allReset:function(){jindo.$H(this.datas).forEach(jindo.$Fn(function(e,t){this.reset(t)},this).bind())}},Shortcut.Data=jindo.$Class({$init:function(e,t,i){this.id=e,this.element=i,this.func=jindo.$Fn(this.fire,this).bind(),Shortcut.Helper.bind(this.func,i,"attach"),this.keys={},this.keyStemp={},this.createKey(t)},createKey:function(e){this.keyStemp[Shortcut.Helper.keyInterpretor(e)]=e,this.keys[e]={};var t=this.keys[e];return t.key=e,t.events=[],t.commonExceptions=[],t.stopDefalutBehavior=!0,this},getKeyStamp:function(e){var t=e.keyCode||e.charCode,i="";return i+=e.altKey?"1":"0",i+=e.ctrlKey?"1":"0",i+=e.metaKey?"1":"0",i+=e.shiftKey?"1":"0",i+=t},fire:function(e){e=e||window.eEvent;var t=this.keyStemp[this.getKeyStamp(e)];t&&this.excute(new jindo.$Event(e),t)},excute:function(e,t){var i=!0,n=Shortcut.Helper,o=this.keys[t];n.notCommonException(e,o.commonExceptions)&&jindo.$A(o.events).forEach(function(t){if(o.stopDefalutBehavior){var n=t.exceptions.length;if(n){for(var s=0;n>s;s++)if(!t.exception[s](e)){i=!1;break}if(i){if(t.event(e),jindo.$Agent().navigator().ie){var r=e._event;r.keyCode="",r.charCode=""}e.stop()}else jindo.$A.Break()}else{if(t.event(e),jindo.$Agent().navigator().ie){var r=e._event;r.keyCode="",r.charCode=""}e.stop()}}})},addEvent:function(e,t){var i=this.keys[t].events;Shortcut.Helper.hasEvent(e,i)||i.push({event:e,exceptions:[]})},addException:function(e,t){var i=this.keys[t].commonExceptions;Shortcut.Helper.hasException(e,i)||i.push(e)},removeException:function(e,t){var i=this.keys[t].commonExceptions;i=jindo.$A(i).filter(function(t){return t!=e}).$value()},removeEvent:function(e,t){var i=this.keys[t].events;i=jindo.$A(i).filter(function(t){return t!=e}).$value(),this.unRegister(t)},unRegister:function(e){var t=this.keys[e].events;t.length&&delete this.keys[e];var i=!0;for(var n in this.keys){i=!1;break}i&&(Shortcut.Helper.bind(this.func,this.element,"detach"),delete Shortcut.Store.datas[this.id])},startDefalutBehavior:function(e){this._setDefalutBehavior(e,!1)},stopDefalutBehavior:function(e){this._setDefalutBehavior(e,!0)},_setDefalutBehavior:function(e,t){this.keys[e].stopDefalutBehavior=t}}),Shortcut.Helper={keyInterpretor:function(e){var t=e.split("+"),i=jindo.$A(t),n="";n+=i.has("alt")?"1":"0",n+=i.has("ctrl")?"1":"0",n+=i.has("meta")?"1":"0",n+=i.has("shift")?"1":"0";var i=i.filter(function(e){return!("alt"==e||"ctrl"==e||"meta"==e||"shift"==e)}),o=i.$value()[0];if(o){var e=Shortcut.Store.anthorKeyHash[o.toUpperCase()]||o.toUpperCase().charCodeAt(0);n+=e}return n},notCommonException:function(e,t){for(var i=t.length,n=0;i>n;n++)if(!t[n](e))return!1;return!0},hasEvent:function(e,t){for(var i=t.length,n=0;i>n;++n)if(t.event==e)return!0;return!1},hasException:function(e,t){for(var i=t.length,n=0;i>n;++n)if(t[n]==e)return!0;return!1},bind:function(e,t,i){"attach"==i?domAttach(t,"keydown",e):domDetach(t,"keydown",e)}},function(){document.addEventListener?window.domAttach=function(e,t,i){e.addEventListener(t,i,!1)}:window.domAttach=function(e,t,i){e.attachEvent("on"+t,i)}}(),function(){document.removeEventListener?window.domDetach=function(e,t,i){e.removeEventListener(t,i,!1)}:window.domDetach=function(e,t,i){e.detachEvent("on"+t,i)}}(),Shortcut.Action={init:function(e,t){return this.dataInstance=e,this.rawKey=t,this},addEvent:function(e){return this.dataInstance.addEvent(e,this.rawKey),this},removeEvent:function(e){return this.dataInstance.removeEvent(e,this.rawKey),this},addException:function(e){return this.dataInstance.addException(e,this.rawKey),this},removeException:function(e){return this.dataInstance.removeException(e,this.rawKey),this},startDefalutBehavior:function(){return this.dataInstance.startDefalutBehavior(this.rawKey),this},stopDefalutBehavior:function(){return this.dataInstance.stopDefalutBehavior(this.rawKey),this},resetElement:function(){return Shortcut.Store.reset(this.dataInstance.id),this},resetAll:function(){return Shortcut.Store.allReset(),this}},function(){Shortcut.Store.anthorKeyHash={BACKSPACE:8,TAB:9,ENTER:13,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DEL:46,COMMA:188,PERIOD:190,SLASH:191};for(var e=Shortcut.Store.anthorKeyHash,t=1;13>t;t++)Shortcut.Store.anthorKeyHash["F"+t]=t+111;var i=jindo.$Agent().navigator();i.ie||i.safari||i.chrome?(e.HYPHEN=189,e.EQUAL=187):(e.HYPHEN=109,e.EQUAL=61)}();var shortcut=Shortcut;nhn.husky.Hotkey=jindo.$Class({name:"Hotkey",$init:function(){this.oShortcut=shortcut},$ON_ADD_HOTKEY:function(e,t,i,n){i||(i=[]);var o=jindo.$Fn(this.oApp.exec,this.oApp).bind(t,i);this.oShortcut(e,n).addEvent(o)}}),nhn.husky.SE_UndoRedo=jindo.$Class({name:"SE_UndoRedo",oCurStateIdx:null,iMinimumSizeChange:1,nMaxUndoCount:20,nAfterMaxDeleteBuffer:100,sBlankContentsForFF:"
    ",sDefaultXPath:"/HTML[0]/BODY[0]",$init:function(){this.aUndoHistory=[],this.oCurStateIdx={nIdx:0,nStep:0},this.nHardLimit=this.nMaxUndoCount+this.nAfterMaxDeleteBuffer},$LOCAL_BEFORE_ALL:function(e){if(e.match(/_DO_RECORD_UNDO_HISTORY_AT$/))return!0;try{if("WYSIWYG"!=this.oApp.getEditingMode())return!1}catch(t){return!1}return!0},$BEFORE_MSG_APP_READY:function(){this._historyLength=0,this.oApp.exec("ADD_APP_PROPERTY",["getUndoHistory",jindo.$Fn(this._getUndoHistory,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getUndoStateIdx",jindo.$Fn(this._getUndoStateIdx,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["saveSnapShot",jindo.$Fn(this._saveSnapShot,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getLastKey",jindo.$Fn(this._getLastKey,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["setLastKey",jindo.$Fn(this._setLastKey,this).bind()]),this._saveSnapShot(),this.oApp.exec("DO_RECORD_UNDO_HISTORY_AT",[this.oCurStateIdx,"","","",null,this.sDefaultXPath])},_getLastKey:function(){return this.sLastKey},_setLastKey:function(e){this.sLastKey=e},$ON_MSG_APP_READY:function(){var e=jindo.$Agent().navigator();this.bIE=e.ie,this.bFF=e.firefox,this.oApp.exec("REGISTER_UI_EVENT",["undo","click","UNDO"]),this.oApp.exec("REGISTER_UI_EVENT",["redo","click","REDO"]),jindo.$Agent().os().mac?(this.oApp.exec("REGISTER_HOTKEY",["meta+z","UNDO"]),this.oApp.exec("REGISTER_HOTKEY",["meta+y","REDO"])):(this.oApp.exec("REGISTER_HOTKEY",["ctrl+z","UNDO"]),this.oApp.exec("REGISTER_HOTKEY",["ctrl+y","REDO"]))},$ON_UNDO:function(){if(this._doRecordUndoHistory("UNDO",{nStep:0,bSkipIfEqual:!0,bMustBlockContainer:!0}),!(this.oCurStateIdx.nIdx<=0)){var e=this.aUndoHistory[this.oCurStateIdx.nIdx].oUndoCallback[this.oCurStateIdx.nStep],t=this.aUndoHistory[this.oCurStateIdx.nIdx].sParentXPath[this.oCurStateIdx.nStep];if(e&&this.oApp.exec(e.sMsg,e.aParams),this.oCurStateIdx.nStep>0)this.oCurStateIdx.nStep--;else{var i=this.aUndoHistory[this.oCurStateIdx.nIdx];this.oCurStateIdx.nIdx--,i.nTotalSteps>1?this.oCurStateIdx.nStep=0:(i=this.aUndoHistory[this.oCurStateIdx.nIdx],this.oCurStateIdx.nStep=i.nTotalSteps-1)}var n=this.aUndoHistory[this.oCurStateIdx.nIdx].sParentXPath[this.oCurStateIdx.nStep],o=!1;n!==t&&0===n.indexOf(t)&&(o=!0),this.oApp.exec("RESTORE_UNDO_HISTORY",[this.oCurStateIdx.nIdx,this.oCurStateIdx.nStep,o]),this.oApp.exec("CHECK_STYLE_CHANGE",[]),this.sLastKey=null}},$ON_REDO:function(){if(!(this.oCurStateIdx.nIdx>=this.aUndoHistory.length)){var e=this.aUndoHistory[this.oCurStateIdx.nIdx];if(!(this.oCurStateIdx.nIdx==this.aUndoHistory.length-1&&this.oCurStateIdx.nStep>=e.nTotalSteps-1)){this.oCurStateIdx.nStepthis.nHardLimit&&(this.aUndoHistory.splice(0,this.nAfterMaxDeleteBuffer),e.nIdx-=this.nAfterMaxDeleteBuffer),this.oCurStateIdx.nIdx=e.nIdx,this.oCurStateIdx.nStep=e.nStep},_saveSnapShot:function(){this.oSnapShot={oBookmark:this.oApp.getSelection().getXPathBookmark()}},_getTargetXPath:function(e,t){var i=this.sDefaultXPath,n=e[0].sXPath.split("/"),o=e[1].sXPath.split("/"),s=[],r=n.lengtha&&n[a]===o[a];a++)s.push(n[a]),""!==n[a]&&"HTML"!==n[a]&&"BODY"!==n[a]&&n[a].indexOf(t)>-1&&(l=a);return l>-1&&(s.length=l),i=s.join("/"),i.lengthl?l:a,3>l)return c;for(t=t||!1,i=i||!1,p=3;l>p&&(h=n[p],h===o[p]&&h===s[p]&&h===r[p]&&o[p]===s[p]&&o[p]===r[p]&&s[p]===r[p]);p++)_.push(h),d=h.substring(0,h.indexOf("[")),!t||"P"!==d&&"LI"!==d&&"DIV"!==d?("UL"===d||"OL"===d||"TD"===d||"TR"===d||"TABLE"===d||"BLOCKQUOTE"===d)&&(E=p):E=p;if(E>-1)_.length=E+1;else if(t||i)return c;return _.join("/")},_getUndoHistory:function(){return this.aUndoHistory},_getUndoStateIdx:function(){return this.oCurStateIdx}}),nhn.husky.Utils=jindo.$Class({name:"Utils",$init:function(){var e=jindo.$Agent(),t=e.navigator();if(t.ie&&6==t.version)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(i){}},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["htBrowser",jindo.$Agent().navigator()])},$ON_ATTACH_HOVER_EVENTS:function(e,t){t=t||[];var i=t.sHoverClass||"hover",n=t.fnElmToSrc||function(e){return e},o=t.fnElmToTarget||function(e){return e};if(e)for(var s=jindo.$Fn(function(e){jindo.$Element(o(e.currentElement)).addClass(i)},this),r=jindo.$Fn(function(e){jindo.$Element(o(e.currentElement)).removeClass(i)},this),a=0,l=e.length;l>a;a++){var h=n(e[a]);s.attach(h,"mouseover"),r.attach(h,"mouseout"),s.attach(h,"focus"),r.attach(h,"blur")}}}),nhn.husky.DialogLayerManager=jindo.$Class({name:"DialogLayerManager",aMadeDraggable:null,aOpenedLayers:null,$init:function(){this.aMadeDraggable=[],this.aDraggableLayer=[],this.aOpenedLayers=[]},$ON_MSG_APP_READY:function(){this.oApp.registerLazyMessage(["SHOW_DIALOG_LAYER","TOGGLE_DIALOG_LAYER"],["hp_DialogLayerManager$Lazy.js","N_DraggableLayer.js"])}}),nhn.husky.ActiveLayerManager=jindo.$Class({name:"ActiveLayerManager",oCurrentLayer:null,$BEFORE_MSG_APP_READY:function(){this.oNavigator=jindo.$Agent().navigator()},$ON_TOGGLE_ACTIVE_LAYER:function(e,t,i,n,o){e==this.oCurrentLayer?this.oApp.exec("HIDE_ACTIVE_LAYER",[]):(this.oApp.exec("SHOW_ACTIVE_LAYER",[e,n,o]),t&&this.oApp.exec(t,i))},$ON_SHOW_ACTIVE_LAYER:function(e,t,i){e=jindo.$(e);var n=this.oCurrentLayer;e!=n&&(this.oApp.exec("HIDE_ACTIVE_LAYER",[]),this.sOnCloseCmd=t,this.aOnCloseParam=i,e.style.display="block",this.oCurrentLayer=e,this.oApp.exec("ADD_APP_PROPERTY",["oToolBarLayer",this.oCurrentLayer]))},$ON_HIDE_ACTIVE_LAYER:function(){var e=this.oCurrentLayer;e&&(e.style.display="none",this.oCurrentLayer=null,this.sOnCloseCmd&&this.oApp.exec(this.sOnCloseCmd,this.aOnCloseParam))},$ON_HIDE_ACTIVE_LAYER_IF_NOT_CHILD:function(e){for(var t=e;t;){if(t==this.oCurrentLayer)return;t=t.parentNode}this.oApp.exec("HIDE_ACTIVE_LAYER")},$ON_HIDE_CURRENT_ACTIVE_LAYER:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])}}),nhn.husky.StringConverterManager=jindo.$Class({name:"StringConverterManager",oConverters:null,$init:function(){this.oConverters={},this.oConverters_DOM={},this.oAgent=jindo.$Agent().navigator()},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["applyConverter",jindo.$Fn(this.applyConverter,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["addConverter",jindo.$Fn(this.addConverter,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["addConverter_DOM",jindo.$Fn(this.addConverter_DOM,this).bind()])},applyConverter:function(e,t,i){var n="@"+(new Date).getTime()+"@",o=new RegExp(n,"g"),s={sContents:n+t};i=i||document,this.oApp.exec("MSG_STRING_CONVERTER_STARTED",[e,s]);var r;if(t=s.sContents,r=this.oConverters_DOM[e]){var a=i.createElement("DIV");a.innerHTML=t;for(var l=0;l-1&&e.indexOf("Version/4.0")>-1&&(i.bGPadBrowser=!0),"undefined"==typeof n.ios&&(n.ios=e.indexOf("iPad")>-1||e.indexOf("iPhone")>-1,n.ios&&(o=e.match(/(iPhone )?OS ([\d|_]+)/),null!=o&&void 0!=o[2]&&(n.version=String(o[2]).split("_").join("."))))}(),nhn.husky.SE2M_UtilPlugin=jindo.$Class({name:"SE2M_UtilPlugin",$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["oAgent",jindo.$Agent()]),this.oApp.exec("ADD_APP_PROPERTY",["oNavigator",jindo.$Agent().navigator()]),this.oApp.exec("ADD_APP_PROPERTY",["oUtils",this])},$ON_REGISTER_HOTKEY:function(e,t,i,n){this.oApp.exec("ADD_HOTKEY",[e,t,i,n||this.oApp.getWYSIWYGDocument()])},$ON_SE2_ATTACH_HOVER_EVENTS:function(e){this.oApp.exec("ATTACH_HOVER_EVENTS",[e,{fnElmToSrc:this._elm2Src,fnElmToTarget:this._elm2Target}])},_elm2Src:function(e){return"LI"==e.tagName&&e.firstChild&&"BUTTON"==e.firstChild.tagName?e.firstChild:e},_elm2Target:function(e){return"BUTTON"==e.tagName&&"LI"==e.parentNode.tagName?e.parentNode:e},getScrollXY:function(){var e,t,i=this.oApp.getWYSIWYGWindow();return"undefined"==typeof i.scrollX?(e=i.document.documentElement.scrollLeft,t=i.document.documentElement.scrollTop):(e=i.scrollX,t=i.scrollY),{x:e,y:t}}}),nhn.husky.SE2M_Utils={sURLPattern:"(http|https|ftp|mailto):(?:\\/\\/)?((:?\\w|-)+(:?\\.(:?\\w|-)+)+)([^ <>]+)?",rxDateFormat:/^(?:\d{4}\.)?\d{1,2}\.\d{1,2}$/,_rxTable:/^(?:CAPTION|TBODY|THEAD|TFOOT|TR|TD|TH|COLGROUP|COL)$/i,_rxSpaceOnly:/^\s+$/,_rxFontStart:/]*)?>/i,_rxFontStrip:/<\/?font(?:\s+[^>]*)?>/gi,_bUnderIE8:jindo.$Agent().navigator().ie&&jindo.$Agent().navigator().version<9,_htFontSize:{1:"7pt",2:"10pt",3:"12pt",4:"13.5pt",5:"18pt",6:"24pt",7:"36pt"},isInvalidNodeInTable:function(e){if(e&&!this._rxTable.test(e.nodeName)){var t;if((t=e.previousSibling)&&this._rxTable.test(t.nodeName))return!0;if((t=e.nextSibling)&&this._rxTable.test(t.nodeName))return!0}return!1},removeInvalidNodeInTable:function(e){this.isInvalidNodeInTable(e)&&e.parentNode&&e.parentNode.removeChild(e)},removeInvalidFont:function(e){e&&(this._removeInvalidFontInTable(e),this._removeEmptyFont(e))},_removeInvalidFontInTable:function(e){for(var t,i=jindo.$$("table font",e),n=0;t=i[n];n++)this.removeInvalidNodeInTable(t)},_removeEmptyFont:function(e){for(var t,i,n=jindo.$$("font",e),o=0;t=n[o];o++)i=t.innerHTML||"",i=i.replace(this._rxSpaceOnly,""),i||t.parentNode.removeChild(t)},convertFontToSpan:function(e){if(e){for(var t,i,n,o=e.ownerDocument||document,s=jindo.$$("font",e),r=0;t=s[r];r++)i=t.parentNode,("SPAN"!==i.tagName||i.childNodes.length>1)&&(i=o.createElement("SPAN"),t.parentNode.insertBefore(i,t)),n=t.getAttribute("face"),n&&(i.style.fontFamily=n),n=this._htFontSize[t.getAttribute("size")],n&&(i.style.fontSize=n),n=t.getAttribute("color"),n&&(i.style.color=n),this._switchFontInnerToSpan(t,i),t.parentNode&&t.parentNode.removeChild(t);r>0&&this._bUnderIE8&&(e.innerHTML=e.innerHTML.replace(this._rxFontStrip,""))}},_switchFontInnerToSpan:function(e,t){var i=e.innerHTML;if(this._rxFontStart.test(i)||this._bUnderIE8)for(var n;n=e.firstChild;)t.appendChild(n);else t.innerHTML=i},stripTag:function(e){for(var t;t=e.firstChild;)e.parentNode.insertBefore(t,e);e.parentNode.removeChild(e)},stripTags:function(e,t){for(var i,n=jindo.$$(t,e),o=0;i=n[o];o++)this.stripTag(i)},reviseDateFormat:function(e){return e&&e.replace&&(e=e.replace(this.rxDateFormat,"$&.")),e},getCustomCSS:function(e,t,i){var n=[];if("undefined"==typeof e||"undefined"==typeof t||!e||!t)return n;var o=e.match(t);return o&&o[0]&&o[1]&&(i?n=o[1].split(i):n[0]=o[1]),n},toStringSamePropertiesOfArray:function(e,t,i){if(!e)return"";if(e instanceof Array){for(var n=[],o=0;ol)return o.html(r);for(l=d;d*(n+.5)>l;)h+=Math.max(Math.ceil((a-h)/2),1),o.html(r.substring(0,h)+i),l=s.height();for(;l>d*(n+.5);)h--,o.html(r.substring(0,h)+i),l=s.height()},ellipsisByPixel:function(e,t,i,n){t=t||"...";var o=jindo.$Element(e),s=o.width();if(!(i>s)){var r=o.html(),a=r.length,l=0;if("undefined"==typeof n){var h=o.html("A").width();for(s=h;i>s;)l+=Math.max(Math.ceil((a-l)/2),1),o.html(r.substring(0,l)+t),s=o.width();n=function(){return!0}}for(l=o.html().length-t.length;s>i&&n();)l--,o.html(r.substring(0,l)+t),s=o.width()}},ellipsisElementsToDesinatedWidth:function(e,t,i,n){jindo.$A(e).forEach(function(e,o){e||jindo.$A.Continue(),nhn.husky.SE2M_Utils.ellipsisByPixel(e,t,i[o],n)})},paddingZero:function(e,t){for(var i=e.toString();i.lengthr;r++){if(o+=this.getCharByte(e.charAt(r)),o==n)return r==s-1?e:e.substring(0,r)+i;if(o>n)return e.substring(0,r)+i}return e},getCharByte:function(e){if(null===e||e.length<1)return 0;var t=0,i=escape(e);return 1==i.length?t++:-1!=i.indexOf("%u")?t+=2:-1!=i.indexOf("%")&&(t+=i.length/3),t},getFilteredHashTable:function(e,t){if(!(t instanceof Array))return arguments.callee.call(this,e,[t]);var i=jindo.$A(t);return jindo.$H(e).filter(function(e,t){return i.has(t)&&e?!0:!1}).$value()},isBlankNode:function(e){var t=this.isBlankTextNode,i=function(e){return e?t(e)?!0:"BR"==e.tagName?!0:" "==e.innerHTML||""==e.innerHTML?!0:!1:!0},n=function(e){if("IMG"==e.tagName||"IFRAME"==e.tagName)return!1;if(i(e))return!0;if("P"==e.tagName){for(var n=e.childNodes.length-1;n>=0;n--){var o=e.childNodes[n];t(o)&&o.parentNode.removeChild(o)}if(1==e.childNodes.length){if("IMG"==e.firstChild.tagName||"IFRAME"==e.firstChild.tagName)return!1;if(i(e.firstChild))return!0}}return!1};if(n(e))return!0;for(var o=0,s=e.childNodes.length;s>o;o++){var r=e.childNodes[o];if(!n(r))return!1}return!0},isBlankTextNode:function(e){var t;return 3==e.nodeType&&(t=e.nodeValue,t=t.replace(unescape("%uFEFF"),""),""==t)?!0:!1},isFirstChildOfNode:function(e,t,i){return i&&i.tagName==t&&i.firstChild.tagName==e?!0:!1},findAncestorByTagName:function(e,t){for(;t&&t.tagName!=e;)t=t.parentNode;return t},findAncestorByTagNameWithCount:function(e,t){for(var i=0,n={};t&&t.tagName!=e;)t=t.parentNode,i+=1;return n={elNode:t,nRecursiveCount:i}},findClosestAncestorAmongTagNames:function(e,t){for(var i=new RegExp("^("+e.join("|")+")$","i");t&&!i.test(t.tagName);)t=t.parentNode;return t},findClosestAncestorAmongTagNamesWithCount:function(e,t){for(var i=0,n={},o=new RegExp("^("+e.join("|")+")$","i");t&&!o.test(t.tagName);)t=t.parentNode,i+=1;return n={elNode:t,nRecursiveCount:i}},isNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},deleteProperty:function(e,t){if("object"==typeof e&&"string"==typeof t&&"undefined"!=typeof e[t]){e[t]=void 0;try{delete e[t]}catch(i){}}},loadCSS:function(e,t){var i=document,n=i.getElementsByTagName("HEAD")[0],o=i.createElement("LINK");o.setAttribute("type","text/css"),o.setAttribute("rel","stylesheet"),o.setAttribute("href",e),t&&("onload"in o?o.onload=function(){t(),this.onload=null}:o.onreadystatechange=function(){"complete"==o.readyState&&(o.getAttribute("_complete")||(o.setAttribute("_complete",!0),t()))}),n.appendChild(o)},getUniqueId:function(e){return(e||"")+jindo.$Date().time()+(1e5*Math.random()).toFixed()},clone:function(e,t){if("undefined"!=typeof e&&e&&(e.constructor==Array||e.constructor==Object)){var i=e.constructor==Array?[]:{};for(var n in e)"undefined"!=typeof t&&t[n]?i[n]=arguments.callee(t[n]):i[n]=arguments.callee(e[n]); return i}return e},getHtmlTagAttr:function(e,t){var i=new RegExp("\\s"+t+"=('([^']*)'|\"([^\"]*)\"|([^\"' >]*))","i"),n=i.exec(e);if(!n)return"";var o=n[1]||n[2]||n[3];return o&&(o=o.replace(/[\"]/g,"")),o},iframeAlignConverter:function(e,t){var i=e.tagName.toUpperCase();if("DIV"==i||"P"==i){if(null===e.parentNode)return;var n=t,o=jindo.$Element(e),s=o.html(),r=jindo.$Element(e).attr("align")||jindo.$Element(e).css("text-align"),a=jindo.$Element(jindo.$("
    ",n));a.html(s).attr("align",r),o.replace(a)}},getJsonDatafromXML:function(e){var t={},i=/\s*<(\/?[\w:\-]+)((?:\s+[\w:\-]+\s*=\s*(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'))*)\s*((?:\/>)|(?:><\/\1>|\s*))|\s*\s*|\s*>?([^<]*)/gi,n=/^[0-9]+(?:\.[0-9]+)?$/,o=/^\s+$/g,s={"&":"&"," ":" ",""":'"',"<":"<",">":">"},r={tags:["/"],stack:[t]},a=function(e){return"undefined"==typeof e?"":e.replace(/&[a-z]+;/g,function(e){return"string"==typeof s[e]?s[e]:e})},l=function(e,t){e.replace(/([\w\:\-]+)\s*=\s*(?:"((?:\\"|[^"])*)"|'((?:\\'|[^'])*)')/g,function(e,i,n,o){t[i]=a((n?n.replace(/\\"/g,'"'):void 0)||(o?o.replace(/\\'/g,"'"):void 0))})},h=function(e){for(var t in e)if(e.hasOwnProperty(t)){if(Object.prototype[t])continue;return!1}return!0},d=function(e,t,i,s,d,c){var _,p="",E=r.stack.length-1;if("string"==typeof t&&t)if("/"!=t.substr(0,1)){var u="string"==typeof i&&i,g="string"==typeof s&&s,f=!u&&g?"":{};if(_=r.stack[E],"undefined"==typeof _[t])_[t]=f,_=r.stack[E+1]=_[t];else if(_[t]instanceof Array){var A=_[t].length;_[t][A]=f,_=r.stack[E+1]=_[t][A]}else _[t]=[_[t],f],_=r.stack[E+1]=_[t][1];u&&l(i,_),r.tags[E+1]=t,g&&(r.tags.length--,r.stack.length--)}else r.tags.length--,r.stack.length--;else"string"==typeof d&&d?p=d:"string"==typeof c&&c.replace(o,"")&&(p=a(c));if(p.length>0){var S=r.stack[E-1],T=r.tags[E];if(n.test(p)||("true"==p||"false"==p)&&(p=new Boolean(p)),"undefined"==typeof S)return;if(S[T]instanceof Array){var C=S[T];"object"!=typeof C[C.length-1]||h(C[C.length-1])?C[C.length-1]=p:(C[C.length-1].$cdata=p,C[C.length-1].toString=function(){return p})}else"object"!=typeof S[T]||h(S[T])?S[T]=p:(S[T].$cdata=p,S[T].toString=function(){return p})}};return e=e.replace(/<(\?|\!-)[^>]*>/g,""),e.replace(i,d),jindo.$Json(t)},replaceSpecialChar:function(e){return"string"==typeof e?e.replace(/\&/g,"&").replace(/\"/g,""").replace(/\'/g,"'").replace(//g,">"):""},restoreSpecialChar:function(e){return"string"==typeof e?e.replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"):""}},nhn.husky.AutoResizer=jindo.$Class({welHiddenDiv:null,welCloneDiv:null,elContainer:null,$init:function(e,t){var i=["lineHeight","textDecoration","letterSpacing","fontSize","fontFamily","fontStyle","fontWeight","textTransform","textAlign","direction","wordSpacing","fontSizeAdjust","paddingTop","paddingLeft","paddingBottom","paddingRight","width"],n=i.length,o={position:"absolute",top:-9999,left:-9999,opacity:0,overflow:"hidden",wordWrap:"break-word"};for(this.nMinHeight=t.nMinHeight,this.wfnCallback=t.wfnCallback,this.elContainer=e.parentNode,this.welTextArea=jindo.$Element(e),this.welHiddenDiv=jindo.$Element("
    "),this.wfnResize=jindo.$Fn(this._resize,this),this.sOverflow=this.welTextArea.css("overflow"),this.welTextArea.css("overflow","hidden");n--;)o[i[n]]=this.welTextArea.css(i[n]);this.welHiddenDiv.css(o),this.nLastHeight=this.welTextArea.height()},bind:function(){this.welCloneDiv=jindo.$Element(this.welHiddenDiv.$value().cloneNode(!1)),this.wfnResize.attach(this.welTextArea,"keyup"),this.welCloneDiv.appendTo(this.elContainer),this._resize()},unbind:function(){this.wfnResize.detach(this.welTextArea,"keyup"),this.welTextArea.css("overflow",this.sOverflow),this.welCloneDiv&&this.welCloneDiv.leave()},_resize:function(){var e,t=this.welTextArea.$value().value,i=!1;t!==this.sContents&&(this.sContents=t.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/\n/g,"
    "),this.sContents+="
    ",this.welCloneDiv.html(this.sContents),e=this.welCloneDiv.height(),e=e?this._aString.length=0:this._aString.length=e},function(){var e=null,t=/,/gi;IsInstalledFont=function(i){var n="Comic Sans MS"==i?"Courier New":"Comic Sans MS";e||(e=document.createElement("div"));var o="position:absolute !important; font-size:200px !important; left:-9999px !important; top:-9999px !important;";e.innerHTML="mmmmiiiii"+unescape("%uD55C%uAE00"),e.style.cssText=o+'font-family:"'+n+'" !important';var s=document.body||document.documentElement;s.firstChild?s.insertBefore(e,s.firstChild):document.body.appendChild(e);var r=e.offsetWidth+"-"+e.offsetHeight;e.style.cssText=o+'font-family:"'+i.replace(t,'","')+'", "'+n+'" !important';var a=r!=e.offsetWidth+"-"+e.offsetHeight;return document.body.removeChild(e),a}}(),nhn.husky.SE2B_CSSLoader=jindo.$Class({name:"SE2B_CSSLoader",bCssLoaded:!1,aInstantLoadTrigger:["OPEN_QE_LAYER","SHOW_ACTIVE_LAYER","SHOW_DIALOG_LAYER","START_SPELLCHECK"],aDelayedLoadTrigger:["MSG_SE_OBJECT_EDIT_REQUESTED","OBJECT_MODIFY","MSG_SE_DUMMY_OBJECT_EDIT_REQUESTED","TOGGLE_TOOLBAR_ACTIVE_LAYER","SHOW_TOOLBAR_ACTIVE_LAYER"],$init:function(){if(this.htOptions=nhn.husky.SE2M_Configuration.SE2B_CSSLoader,jindo.$Agent().navigator().ie){for(var e=0,t=this.aInstantLoadTrigger.length;t>e;e++)this["$BEFORE_"+this.aInstantLoadTrigger[e]]=jindo.$Fn(function(){this.loadSE2CSS()},this).bind();for(var e=0,t=this.aDelayedLoadTrigger.length;t>e;e++){var i=this.aDelayedLoadTrigger[e];this["$BEFORE_"+this.aDelayedLoadTrigger[e]]=jindo.$Fn(function(e){var t=jindo.$A(arguments).$value();return t=t.splice(1,t.length-1),this.loadSE2CSS(e,t)},this).bind(i)}}else this.$ON_MSG_APP_READY=jindo.$Fn(function(){this.loadSE2CSS()},this).bind()},loadSE2CSS:function(e,t){if(this.bCssLoaded)return!0;this.bCssLoaded=!0;var i=null;e&&(i=jindo.$Fn(this.oApp.exec,this.oApp).bind(e,t));var n=this.htOptions.sCSSBaseURI,o=this.oApp&&this.oApp.htOptions.I18N_LOCALE;return o&&(n+="/"+o),n+="/smart_editor2_items.css",nhn.husky.SE2M_Utils.loadCSS(n,i),!1}}),"undefined"==typeof window.nhn&&(window.nhn={});var oMessageMap={"SE_EditingAreaManager.onExit":"내용이 변경되었습니다.","SE_Color.invalidColorCode":"색상 코드를 올바르게 입력해 주세요. \n\n 예) #000000, #FF0000, #FFFFFF, #ffffff, ffffff","SE_Hyperlink.invalidURL":"입력하신 URL이 올바르지 않습니다.","SE_FindReplace.keywordMissing":"찾으실 단어를 입력해 주세요.","SE_FindReplace.keywordNotFound":"찾으실 단어가 없습니다.","SE_FindReplace.replaceAllResultP1":"일치하는 내용이 총 ","SE_FindReplace.replaceAllResultP2":"건 바뀌었습니다.","SE_FindReplace.notSupportedBrowser":"현재 사용하고 계신 브라우저에서는 사용하실수 없는 기능입니다.\n\n이용에 불편을 드려 죄송합니다.","SE_FindReplace.replaceKeywordNotFound":"바뀔 단어가 없습니다","SE_LineHeight.invalidLineHeight":"잘못된 값입니다.","SE_Footnote.defaultText":"각주내용을 입력해 주세요","SE.failedToLoadFlash":"플래시가 차단되어 있어 해당 기능을 사용할 수 없습니다.","SE2M_EditingModeChanger.confirmTextMode":"텍스트 모드로 전환하면 작성된 내용은 유지되나, \n\n글꼴 등의 편집효과와 이미지 등의 첨부내용이 모두 사라지게 됩니다.\n\n전환하시겠습니까?","SE2M_FontNameWithLayerUI.sSampleText":"가나다라"};"undefined"==typeof window.nhn&&(window.nhn={});var oMessageMap_en_US={"SE_EditingAreaManager.onExit":"Contents have been changed.","SE_Color.invalidColorCode":"Enter the correct color code. \n\n ex) #000000, #FF0000, #FFFFFF, #ffffff, ffffff","SE_Hyperlink.invalidURL":"You have entered an incorrect URL.","SE_FindReplace.keywordMissing":"Enter the word you wish to find.","SE_FindReplace.keywordNotFound":"The word does not exist.","SE_FindReplace.replaceAllResultP1":"A total of ","SE_FindReplace.replaceAllResultP2":" matching contents have been changed.","SE_FindReplace.notSupportedBrowser":"Function cannot be used in the browser you are currently using. \n\nSorry for the inconvenience.","SE_FindReplace.replaceKeywordNotFound":"No word to change.","SE_LineHeight.invalidLineHeight":"Incorrect value.","SE_Footnote.defaultText":"Enter footnote details.","SE.failedToLoadFlash":"The function cannot be used because flash has been blocked.","SE2M_EditingModeChanger.confirmTextMode":"The contents remain, but editing effects, including fonts, and attachments, \n\nsuch as images, will disappear when changed to text mode. \n\n Make changes?","SE2M_FontNameWithLayerUI.sSampleText":"ABCD"};"undefined"==typeof window.nhn&&(window.nhn={});var oMessageMap_ja_JP={"SE_EditingAreaManager.onExit":"内容が変更されました。","SE_Color.invalidColorCode":"カラーコードを正しく入力してください。 \n\n 例) #000000, #FF0000, #FFFFFF, #ffffff, ffffff","SE_Hyperlink.invalidURL":"入力したURLが正しくありません。","SE_FindReplace.keywordMissing":"お探しの単語を入力してください。","SE_FindReplace.keywordNotFound":"お探しの単語がありません。","SE_FindReplace.replaceAllResultP1":"一致する内容が計","SE_FindReplace.replaceAllResultP2":"件変わりました。","SE_FindReplace.notSupportedBrowser":"現在ご使用中のブラウザーではご利用いただけない機能です。\n\nご不便をおかけしまして申し訳ございません。","SE_FindReplace.replaceKeywordNotFound":"変更される単語がありません。","SE_LineHeight.invalidLineHeight":"誤った値です。","SE_Footnote.defaultText":"脚注内容を入力してください。","SE.failedToLoadFlash":"フラッシュが遮断されているため、この機能は使用できません。","SE2M_EditingModeChanger.confirmTextMode":"テキストモードに切り換えると、作成された内容は維持されますが、\n\nフォント等の編集効果と画像等の添付内容が消えることになります。\n\n切り換えますか?","SE2M_FontNameWithLayerUI.sSampleText":"あいうえお"};"undefined"==typeof window.nhn&&(window.nhn={});var oMessageMap_zh_CN={"SE_EditingAreaManager.onExit":"内容有了变化。","SE_Color.invalidColorCode":"请你输入正确的色相代码。 \n\n 例) #000000, #FF0000, #FFFFFF, #ffffff, ffffff","SE_Hyperlink.invalidURL":"你输入的URL不符条件。","SE_FindReplace.keywordMissing":"请你输入要找的词汇。","SE_FindReplace.keywordNotFound":"没有词汇符合条件。","SE_FindReplace.replaceAllResultP1":"符合条件的内容改编为","SE_FindReplace.replaceAllResultP2":"件","SE_FindReplace.notSupportedBrowser":"这是你现在使用的浏览器不可支持的功能。\n\n麻烦你很道歉。","SE_FindReplace.replaceKeywordNotFound":"没有词汇要改变。","SE_LineHeight.invalidLineHeight":"这是有问题的值。","SE_Footnote.defaultText":"请你输入脚注内容。","SE.failedToLoadFlash":"flash被隔绝,不能使用该功能。","SE2M_EditingModeChanger.confirmTextMode":"转换为text模式就能维持制作内容,\n\n但字体等编辑效果和图像等附件内容都会消失。\n\n你还要继续吗?","SE2M_FontNameWithLayerUI.sSampleText":"ABCD"};"undefined"==typeof window.nhn&&(window.nhn={});var oMessageMap_zh_TW={"SE_EditingAreaManager.onExit":"內容已被更改。","SE_Color.invalidColorCode":"請輸入正確的顔色代碼。\n\n例子)#000000, #FF0000, #FFFFFF, #ffffff, ffffff","SE_Hyperlink.invalidURL":"輸錯URL","SE_FindReplace.keywordMissing":"請輸入要查詢的單詞。","SE_FindReplace.keywordNotFound":"要查詢的單詞不存在。","SE_FindReplace.replaceAllResultP1":"一致的內容總有","SE_FindReplace.replaceAllResultP2":"件已被更改。","SE_FindReplace.notSupportedBrowser":"當前的浏覽器上無法使用此功能。\n\n很抱歉給你添麻煩了。","SE_FindReplace.replaceKeywordNotFound":"要更改的詞彙不存在。","SE_LineHeight.invalidLineHeight":"爲有錯誤的值。","SE_Footnote.defaultText":"請輸入注腳內容。","SE.failedToLoadFlash":"Flash被屏蔽,導致無法使用此功能。","SE2M_EditingModeChanger.confirmTextMode":"如轉換爲文本模式,雖然維持已寫成的內容,\n\n但字號等編輯效果和圖像等附加內容都會被消失。\n\n是否轉換?","SE2M_FontNameWithLayerUI.sSampleText":"ABCD"};nhn.husky.SE_OuterIFrameControl=$Class({name:"SE_OuterIFrameControl",oResizeGrip:null,$init:function(e){this.aHeightChangeKeyMap=[-100,100,500,-500,-1,-10,1,10],this._assignHTMLObjects(e),this.$FnKeyDown=$Fn(this._keydown,this),this.oResizeGrip&&this.$FnKeyDown.attach(this.oResizeGrip,"keydown"),jindo.$Agent().navigator().ie&&(this.$FnMouseDown=$Fn(this._mousedown,this),this.$FnMouseMove=$Fn(this._mousemove,this),this.$FnMouseMove_Parent=$Fn(this._mousemove_parent,this),this.$FnMouseUp=$Fn(this._mouseup,this),this.oResizeGrip&&this.$FnMouseDown.attach(this.oResizeGrip,"mousedown"))},_assignHTMLObjects:function(e){e=jindo.$(e)||document,this.oResizeGrip=cssquery.getSingle(".husky_seditor_editingArea_verticalResizer",e),this.elIFrame=window.frameElement,this.welIFrame=$Element(this.elIFrame)},$ON_MSG_APP_READY:function(){this.oApp.exec("SE_FIT_IFRAME",[])},$ON_MSG_EDITING_AREA_SIZE_CHANGED:function(){this.oApp.exec("SE_FIT_IFRAME",[])},$ON_SE_FIT_IFRAME:function(){this.elIFrame.style.height=document.body.offsetHeight+"px"},$AFTER_RESIZE_EDITING_AREA_BY:function(e,t){this.oApp.exec("SE_FIT_IFRAME",[])},_keydown:function(e){var t=e.key();t.keyCode>=33&&t.keyCode<=40&&(this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED",[]),this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,this.aHeightChangeKeyMap[t.keyCode-33]]),this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED",[]),e.stop())},_mousedown:function(e){this.iStartHeight=e.pos().clientY,this.iStartHeightOffset=e.pos().layerY,this.$FnMouseMove.attach(document,"mousemove"),this.$FnMouseMove_Parent.attach(parent.document,"mousemove"),this.$FnMouseUp.attach(document,"mouseup"),this.$FnMouseUp.attach(parent.document,"mouseup"),this.iStartHeight=e.pos().clientY,this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])},_mousemove:function(e){var t=e.pos().clientY-this.iStartHeight;this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,t])},_mousemove_parent:function(e){var t=e.pos().pageY-(this.welIFrame.offset().top+this.iStartHeight);this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,t])},_mouseup:function(e){this.$FnMouseMove.detach(document,"mousemove"),this.$FnMouseMove_Parent.detach(parent.document,"mousemove"),this.$FnMouseUp.detach(document,"mouseup"),this.$FnMouseUp.detach(parent.document,"mouseup"),this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])}}),nhn.husky.SE_ToolbarToggler=$Class({name:"SE_ToolbarToggler",bUseToolbar:!0,$init:function(e,t){this._assignHTMLObjects(e,t)},_assignHTMLObjects:function(e,t){e=jindo.$(e)||document,this.toolbarArea=cssquery.getSingle(".se2_tool",e),"undefined"==typeof t||t===!0?this.toolbarArea.style.display="block":this.toolbarArea.style.display="none"},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_HOTKEY",["ctrl+t","SE_TOGGLE_TOOLBAR",[]])},$ON_SE_TOGGLE_TOOLBAR:function(){this.toolbarArea.style.display="none"==this.toolbarArea.style.display?"block":"none",this.oApp.exec("MSG_EDITING_AREA_SIZE_CHANGED",[])}}),nhn.husky.HuskyCore.addLoadedFile("hp_SE2M_FindReplacePlugin$Lazy.js"),nhn.husky.HuskyCore.mixin(nhn.husky.SE2M_FindReplacePlugin,{_assignHTMLElements:function(){var e=this.oApp.htOptions.elAppContainer;this.oApp.exec("LOAD_HTML",["find_and_replace"]),this.elDropdownLayer=jindo.$$.getSingle("DIV.husky_se2m_findAndReplace_layer",e),this.welDropdownLayer=jindo.$Element(this.elDropdownLayer);var t=jindo.$$("LI",this.elDropdownLayer);this.oFindTab=t[0],this.oReplaceTab=t[1],t=jindo.$$(".container > .bx",this.elDropdownLayer),this.oFindInputSet=jindo.$$.getSingle(".husky_se2m_find_ui",this.elDropdownLayer),this.oReplaceInputSet=jindo.$$.getSingle(".husky_se2m_replace_ui",this.elDropdownLayer),this.elTitle=jindo.$$.getSingle("H3",this.elDropdownLayer),this.oFindInput_Keyword=jindo.$$.getSingle("INPUT",this.oFindInputSet),t=jindo.$$("INPUT",this.oReplaceInputSet),this.oReplaceInput_Original=t[0],this.oReplaceInput_Replacement=t[1],this.oFindNextButton=jindo.$$.getSingle("BUTTON.husky_se2m_find_next",this.elDropdownLayer),this.oReplaceFindNextButton=jindo.$$.getSingle("BUTTON.husky_se2m_replace_find_next",this.elDropdownLayer),this.oReplaceButton=jindo.$$.getSingle("BUTTON.husky_se2m_replace",this.elDropdownLayer),this.oReplaceAllButton=jindo.$$.getSingle("BUTTON.husky_se2m_replace_all",this.elDropdownLayer),this.aCloseButtons=jindo.$$("BUTTON.husky_se2m_cancel",this.elDropdownLayer)},$LOCAL_BEFORE_FIRST:function(e){this._assignHTMLElements(),this.oFindReplace=new nhn.FindReplace(this.oEditingWindow);for(var t=0;tn?(alert(this.oApp.$MSG("SE_FindReplace.keywordMissing")),i.select()):(alert(this.oApp.$MSG("SE_FindReplace.replaceAllResultP1")+n+this.oApp.$MSG("SE_FindReplace.replaceAllResultP2")),i=this.oApp.getEmptySelection(),i.select(),this.oApp.exec("FOCUS"))}}),nhn.husky.HuskyCore.addLoadedFile("hp_SE2M_Quote$Lazy.js"),nhn.husky.HuskyCore.mixin(nhn.husky.SE2M_Quote,{$ON_TOGGLE_BLOCKQUOTE_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer,null,"SELECT_UI",["quote"],"DESELECT_UI",["quote"]]),this.oApp.exec("MSG_NOTIFY_CLICKCR",["quote"])},$ON_EVENT_SE2_BLOCKQUOTE_LAYER_CLICK:function(e){var t=nhn.husky.SE2M_Utils.findAncestorByTagName("BUTTON",e.element);if(t&&"BUTTON"==t.tagName){var i=t.className;this.oApp.exec("APPLY_BLOCKQUOTE",[i])}},$ON_APPLY_BLOCKQUOTE:function(e){e.match(/(se2_quote[0-9]+)/)?this._wrapBlock("BLOCKQUOTE",RegExp.$1):this._unwrapBlock("BLOCKQUOTE"),this.oApp.exec("HIDE_ACTIVE_LAYER",[])},_isExceedMaxDepth:function(e){var t=function(e){var i=e.firstChild,n=0,o=0;if(!i)return e.tagName&&"BLOCKQUOTE"===e.tagName?1:0;for(;i;){if(1===i.nodeType&&(n=t(i),"BLOCKQUOTE"===i.tagName&&(n+=1),n>o&&(o=n),o>=this.nMaxLevel))return o;i=i.nextSibling}return o};return t(e)>=this.nMaxLevel},_unwrapBlock:function(e){for(var t=this.oApp.getSelection(),i=t.commonAncestorContainer;i&&i.tagName!=e;)i=i.parentNode;if(i){this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["CANCEL BLOCK QUOTE",{sSaveTarget:"BODY"}]);var n=t.commonAncestorContainer;if(3!==n.nodeType){var o=t.getTextNodes()||"",s=o.length-1;n=s>-1?o[s]:null}for(;i.firstChild;)i.parentNode.insertBefore(i.firstChild,i);i.parentNode.removeChild(i),n&&(t.selectNodeContents(n),t.collapseToEnd(),t.select()),this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["CANCEL BLOCK QUOTE",{sSaveTarget:"BODY"}])}},_wrapBlock:function(e,t){var i,n,o,s,r,a,l,h,d,c,_,p,E,u,g,f,A,S,T,C,m=/BODY|TD|LI/i;if(this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["BLOCK QUOTE",{sSaveTarget:"BODY"}]),i=this.oApp.getSelection(),n=i.startContainer===i.endContainer&&1===i.startContainer.nodeType&&"P"===i.startContainer.tagName&&(nhn.husky.SE2M_Utils.isBlankNode(i.startContainer)||nhn.husky.SE2M_Utils.isFirstChildOfNode("IMG",i.startContainer.tagName,i.startContainer)||nhn.husky.SE2M_Utils.isFirstChildOfNode("IFRAME",i.startContainer.tagName,i.startContainer))?i.getLineInfo(!0):i.getLineInfo(!1),o=n.oStart,s=n.oEnd,r=o.bParentBreak&&!m.test(o.oLineBreaker.tagName)?o.oNode.parentNode:o.oNode,a=s.bParentBreak&&!m.test(s.oLineBreaker.tagName)?s.oNode.parentNode:s.oNode,i.setStartBefore(r),i.setEndAfter(a),l=this._expandToTableStart(i,a),l&&(a=l,i.setEndAfter(l)),l=this._expandToTableStart(i,r),l&&(r=l,i.setStartBefore(l)),l=r,i.fixCommonAncestorContainer(),h=i.commonAncestorContainer,d=i.startContainer==i.endContainer&&i.endOffset-i.startOffset==1?i.startContainer.childNodes[i.startOffset]:i.commonAncestorContainer,c=this._findParentQuote(d))return c.className=t,void this._setStyle(c,this.htQuoteStyles_view[t]);for(;!h.tagName||h.tagName&&h.tagName.match(/UL|OL|LI|IMG|IFRAME/);)h=h.parentNode;for(;l&&l!=h&&l.parentNode!=h;)l=l.parentNode;if(_=l==h?h.firstChild:l,p=i._document.createElement(e),t&&(p.className=t,this._setStyle(p,this.htQuoteStyles_view[t])),h.insertBefore(p,_),i.setStartAfter(p),i.setEndAfter(a),i.surroundContents(p),!this._isExceedMaxDepth(p))return i.selectNodeContents(p),p&&p.parentNode&&"BODY"==p.parentNode.tagName&&!p.nextSibling&&(T=i._document.createElement("P"),T.innerHTML=" ",p.parentNode.insertBefore(T,p.nextSibling)),nhn.husky.SE2M_Utils.isBlankNode(p)&&(p.innerHTML=" ",i.selectNodeContents(p.firstChild),i.collapseToStart(),i.select()),setTimeout(jindo.$Fn(function(e){C=e.placeStringBookmark(),e.select(),e.removeStringBookmark(C),this.oApp.exec("FOCUS")},this).bind(i),0),this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["BLOCK QUOTE",{sSaveTarget:"BODY"}]),p;for(alert(this.oApp.$MSG("SE2M_Quote.exceedMaxCount").replace("#MaxCount#",this.nMaxLevel+1)),this.oApp.exec("HIDE_ACTIVE_LAYER",[]),E=p.nextSibling,u=p.parentNode,g=p.childNodes,f=[],jindo.$Element(p).leave(),A=0,S=g.length;S>A;A++)f[A]=g[A];for(A=0,S=f.length;S>A;A++)E?jindo.$Element(E).before(f[A]):jindo.$Element(u).append(f[A])},_expandToTableStart:function(e,t){for(var i=e.commonAncestorContainer,n=null,o=!1;t&&!o;){if(t==i&&(o=!0),/TBODY|TFOOT|THEAD|TR/i.test(t.tagName)){n=this._getTableRoot(t);break}t=t.parentNode}return n},_getTableRoot:function(e){for(;e&&"TABLE"!=e.tagName;)e=e.parentNode;return e},_setStyle:function(e,t){e.setAttribute("style",t),e.style.cssText=t}}),nhn.husky.HuskyCore.addLoadedFile("hp_SE2M_SCharacter$Lazy.js"),nhn.husky.HuskyCore.mixin(nhn.husky.SE2M_SCharacter,{_assignHTMLObjects:function(e){e=jindo.$(e)||document,this.elDropdownLayer=jindo.$$.getSingle("DIV.husky_seditor_sCharacter_layer",e),this.oTextField=jindo.$$.getSingle("INPUT",this.elDropdownLayer),this.oInsertButton=jindo.$$.getSingle("BUTTON.se2_confirm",this.elDropdownLayer),this.aCloseButton=jindo.$$("BUTTON.husky_se2m_sCharacter_close",this.elDropdownLayer),this.aSCharList=jindo.$$("UL.husky_se2m_sCharacter_list",this.elDropdownLayer);var t=jindo.$$.getSingle("UL.se2_char_tab",this.elDropdownLayer);this.aLabel=jindo.$$(">LI",t)},$LOCAL_BEFORE_FIRST:function(e){this.bIE=jindo.$Agent().navigator().ie,this._assignHTMLObjects(this.oApp.htOptions.elAppContainer),this.charSet=[],this.charSet[0]=unescape("FF5B FF5D 3014 3015 3008 3009 300A 300B 300C 300D 300E 300F 3010 3011 2018 2019 201C 201D 3001 3002 %B7 2025 2026 %A7 203B 2606 2605 25CB 25CF 25CE 25C7 25C6 25A1 25A0 25B3 25B2 25BD 25BC 25C1 25C0 25B7 25B6 2664 2660 2661 2665 2667 2663 2299 25C8 25A3 25D0 25D1 2592 25A4 25A5 25A8 25A7 25A6 25A9 %B1 %D7 %F7 2260 2264 2265 221E 2234 %B0 2032 2033 2220 22A5 2312 2202 2261 2252 226A 226B 221A 223D 221D 2235 222B 222C 2208 220B 2286 2287 2282 2283 222A 2229 2227 2228 FFE2 21D2 21D4 2200 2203 %B4 FF5E 02C7 02D8 02DD 02DA 02D9 %B8 02DB %A1 %BF 02D0 222E 2211 220F 266D 2669 266A 266C 327F 2192 2190 2191 2193 2194 2195 2197 2199 2196 2198 321C 2116 33C7 2122 33C2 33D8 2121 2668 260F 260E 261C 261E %B6 2020 2021 %AE %AA %BA 2642 2640").replace(/(\S{4})/g,function(e){return"%u"+e}).split(" "),this.charSet[1]=unescape("%BD 2153 2154 %BC %BE 215B 215C 215D 215E %B9 %B2 %B3 2074 207F 2081 2082 2083 2084 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 FFE6 %24 FFE5 FFE1 20AC 2103 212B 2109 FFE0 %A4 2030 3395 3396 3397 2113 3398 33C4 33A3 33A4 33A5 33A6 3399 339A 339B 339C 339D 339E 339F 33A0 33A1 33A2 33CA 338D 338E 338F 33CF 3388 3389 33C8 33A7 33A8 33B0 33B1 33B2 33B3 33B4 33B5 33B6 33B7 33B8 33B9 3380 3381 3382 3383 3384 33BA 33BB 33BC 33BD 33BE 33BF 3390 3391 3392 3393 3394 2126 33C0 33C1 338A 338B 338C 33D6 33C5 33AD 33AE 33AF 33DB 33A9 33AA 33AB 33AC 33DD 33D0 33D3 33C3 33C9 33DC 33C6").replace(/(\S{4})/g,function(e){return"%u"+e}).split(" "),this.charSet[2]=unescape("3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 326A 326B 326C 326D 326E 326F 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 327A 327B 24D0 24D1 24D2 24D3 24D4 24D5 24D6 24D7 24D8 24D9 24DA 24DB 24DC 24DD 24DE 24DF 24E0 24E1 24E2 24E3 24E4 24E5 24E6 24E7 24E8 24E9 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 246A 246B 246C 246D 246E 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 320A 320B 320C 320D 320E 320F 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 321A 321B 249C 249D 249E 249F 24A0 24A1 24A2 24A3 24A4 24A5 24A6 24A7 24A8 24A9 24AA 24AB 24AC 24AD 24AE 24AF 24B0 24B1 24B2 24B3 24B4 24B5 2474 2475 2476 2477 2478 2479 247A 247B 247C 247D 247E 247F 2480 2481 2482").replace(/(\S{4})/g,function(e){return"%u"+e}).split(" "),this.charSet[3]=unescape("3131 3132 3133 3134 3135 3136 3137 3138 3139 313A 313B 313C 313D 313E 313F 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 314A 314B 314C 314D 314E 314F 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 315A 315B 315C 315D 315E 315F 3160 3161 3162 3163 3165 3166 3167 3168 3169 316A 316B 316C 316D 316E 316F 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 317A 317B 317C 317D 317E 317F 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 318A 318B 318C 318D 318E").replace(/(\S{4})/g,function(e){return"%u"+e}).split(" "),this.charSet[4]=unescape("0391 0392 0393 0394 0395 0396 0397 0398 0399 039A 039B 039C 039D 039E 039F 03A0 03A1 03A3 03A4 03A5 03A6 03A7 03A8 03A9 03B1 03B2 03B3 03B4 03B5 03B6 03B7 03B8 03B9 03BA 03BB 03BC 03BD 03BE 03BF 03C0 03C1 03C3 03C4 03C5 03C6 03C7 03C8 03C9 %C6 %D0 0126 0132 013F 0141 %D8 0152 %DE 0166 014A %E6 0111 %F0 0127 I 0133 0138 0140 0142 0142 0153 %DF %FE 0167 014B 0149 0411 0413 0414 0401 0416 0417 0418 0419 041B 041F 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F 0431 0432 0433 0434 0451 0436 0437 0438 0439 043B 043F 0444 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F").replace(/(\S{4})/g,function(e){return"%u"+e}).split(" "),this.charSet[5]=unescape("3041 3042 3043 3044 3045 3046 3047 3048 3049 304A 304B 304C 304D 304E 304F 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 305A 305B 305C 305D 305E 305F 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 306A 306B 306C 306D 306E 306F 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 307A 307B 307C 307D 307E 307F 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 308A 308B 308C 308D 308E 308F 3090 3091 3092 3093 30A1 30A2 30A3 30A4 30A5 30A6 30A7 30A8 30A9 30AA 30AB 30AC 30AD 30AE 30AF 30B0 30B1 30B2 30B3 30B4 30B5 30B6 30B7 30B8 30B9 30BA 30BB 30BC 30BD 30BE 30BF 30C0 30C1 30C2 30C3 30C4 30C5 30C6 30C7 30C8 30C9 30CA 30CB 30CC 30CD 30CE 30CF 30D0 30D1 30D2 30D3 30D4 30D5 30D6 30D7 30D8 30D9 30DA 30DB 30DC 30DD 30DE 30DF 30E0 30E1 30E2 30E3 30E4 30E5 30E6 30E7 30E8 30E9 30EA 30EB 30EC 30ED 30EE 30EF 30F0 30F1 30F2 30F3 30F4 30F5 30F6").replace(/(\S{4})/g,function(e){return"%u"+e}).split(" ");var t=jindo.$Fn(this.oApp.exec,this.oApp).bind("INSERT_SCHARACTERS",[this.oTextField.value]);jindo.$Fn(t,this).attach(this.oInsertButton,"click"),this.oApp.exec("SET_SCHARACTER_LIST",[this.charSet]);for(var i=0;i1||(this.oApp.exec("SELECT_SCHARACTER",[i]),e.stop())}},$ON_SELECT_SCHARACTER:function(e){if(this.oTextField.value+=e,this.oTextField.createTextRange){var t=this.oTextField.createTextRange();t.collapse(!1),t.select()}else this.oTextField.selectionEnd&&(this.oTextField.selectionEnd=this.oTextField.value.length,this.oTextField.focus())},$ON_INSERT_SCHARACTERS:function(){this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["INSERT SCHARACTER"]),this.oApp.exec("PASTE_HTML",[this.oTextField.value]),this.oApp.exec("FOCUS"),this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["INSERT SCHARACTER"]),this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_CHANGE_SCHARACTER_SET:function(e){for(var t=0;ts;s++)i[s]=jindo.$("
  • "),this.bIE?(n=jindo.$("