/* Copyright (C) NAVER corp. Licensed under LGPL v2. @see https://github.com/naver/smarteditor2/blob/master/LICENSE.md */ if(typeof window.nhn=="undefined"){window.nhn={}}if(!nhn.husky){nhn.husky={}}(function(){var b=/^\$(LOCAL|BEFORE|ON|AFTER)_/,c=/^\$(BEFORE|ON|AFTER)_MSG_APP_READY$/,a=[],d={};nhn.husky.HuskyCore=jindo.$Class({name:"HuskyCore",aCallerStack:null,bMobile:jindo.$Agent().navigator().mobile||jindo.$Agent().navigator().msafari,$init:function(e){this.htOptions=e||{};a.push(this);if(this.htOptions.oDebugger){nhn.husky.HuskyCore.getCore=function(){return a};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(g,f,e){if(this.appStatus==nhn.husky.APP_STATUS.NOT_READY){this.messageQueue[this.messageQueue.length]={msg:g,args:f,event:e};return true}this.exec=this._exec;this.exec(g,f,e)},delayedExec:function(j,g,e,f){var h=jindo.$Fn(this.exec,this).bind(j,g,f);setTimeout(h,e)},_exec:function(g,f,e){return(this._exec=this.htOptions.oDebugger?this._execWithDebugger:this._execWithoutDebugger).call(this,g,f,e)},_execWithDebugger:function(h,g,f){this.htOptions.oDebugger.log_MessageStart(h,g);var e=this._doExec(h,g,f);this.htOptions.oDebugger.log_MessageEnd(h,g);return e},_execWithoutDebugger:function(g,f,e){return this._doExec(g,f,e)},_doExec:function(m,j,h){var f=false;if(this.oLazyMessage[m]){var l=this.oLazyMessage[m];this._loadLazyFiles(m,j,h,l.aFilenames,0);return false}if(!this.oDisabledMessage[m]){var g=[];if(j&&j.length){var e=j.length;for(var k=0;k=0&&nhn.DOMFix.parentNode(l[m])==l[k]){m=this._recurConstructClonedTree(l,m,h)}j.insertBefore(h,j.firstChild);return m};this._recurConstructClonedTree=g;b[b.length]=nhn.DOMFix.parentNode(b[b.length-1]);this._recurConstructClonedTree(b,b.length-1,d);return{oStartContainer:a,oEndContainer:c}},cloneRange:function(){return this._copyRange(new nhn.W3CDOMRange(this._window))},_copyRange:function(a){a.collapsed=this.collapsed;a.commonAncestorContainer=this.commonAncestorContainer;a.endContainer=this.endContainer;a.endOffset=this.endOffset;a.startContainer=this.startContainer;a.startOffset=this.startOffset;a._document=this._document;return a},collapse:function(a){if(a){this.endContainer=this.startContainer;this.endOffset=this.startOffset}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset}this._updateRangeInfo()},compareBoundaryPoints:function(a,b){switch(a){case nhn.W3CDOMRange.START_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,b.startContainer,b.startOffset);case nhn.W3CDOMRange.START_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,b.startContainer,b.startOffset);case nhn.W3CDOMRange.END_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,b.endContainer,b.endOffset);case nhn.W3CDOMRange.END_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,b.endContainer,b.endOffset)}},_findBody:function(a){if(!a){return null}while(a){if(a.tagName=="BODY"){return a}a=nhn.DOMFix.parentNode(a)}return null},_compareEndPoint:function(d,g,c,e){return this.oBrowserSelection.compareEndPoints(d,g,c,e);var l,j;if(!d||this._findBody(d)!=this._document.body){d=this._document.body;g=0}if(!c||this._findBody(c)!=this._document.body){c=this._document.body;e=0}var f=function(n,m){if(m==-1){m=n+1}if(nb.nodeValue.length){a=b.nodeValue.length}}else{if(a>nhn.DOMFix.childNodes(b).length){a=nhn.DOMFix.childNodes(b).length}}return a},setEnd:function(a,d,c,b){if(!c){d=this._endsNodeValidation(a,d)}this.endContainer=a;this.endOffset=d;if(!b){if(!this.startContainer||this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)!=-1){this.collapse(false)}else{this._updateRangeInfo()}}},setEndAfter:function(a,b){if(!a){throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter")}if(a.tagName=="BODY"){this.setEnd(a,nhn.DOMFix.childNodes(a).length,true,b);return}this.setEnd(nhn.DOMFix.parentNode(a),this._getPosIdx(a)+1,true,b)},setEndBefore:function(a,b){if(!a){throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore")}if(a.tagName=="BODY"){this.setEnd(a,0,true,b);return}this.setEnd(nhn.DOMFix.parentNode(a),this._getPosIdx(a),true,b)},setStart:function(a,d,c,b){if(!c){d=this._endsNodeValidation(a,d)}this.startContainer=a;this.startOffset=d;if(!b){if(!this.endContainer||this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)!=-1){this.collapse(true)}else{this._updateRangeInfo()}}},setStartAfter:function(a,b){if(!a){throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter")}if(a.tagName=="BODY"){this.setStart(a,nhn.DOMFix.childNodes(a).length,true,b);return}this.setStart(nhn.DOMFix.parentNode(a),this._getPosIdx(a)+1,true,b)},setStartBefore:function(a,b){if(!a){throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore")}if(a.tagName=="BODY"){this.setStart(a,0,true,b);return}this.setStart(nhn.DOMFix.parentNode(a),this._getPosIdx(a),true,b)},surroundContents:function(a){a.appendChild(this.extractContents());this.insertNode(a);this.selectNode(a)},toString:function(){var a=this._document.createElement("DIV");a.appendChild(this.cloneContents());return a.textContent||a.innerText||""},fixCommonAncestorContainer:function(){if(!jindo.$Agent().navigator().ie){return}this.commonAncestorContainer=this._getCommonAncestorContainer()},_isBlankTextNode:function(a){if(a.nodeType==3&&a.nodeValue==""){return true}return false},_isAllChildBlankText:function(a){for(var b=0,c=a.childNodes.length;b=c.nodeValue.length){return b}if(a===0){return b}c.splitText(a);return{oStartContainer:e,iStartOffset:d,oEndContainer:c,iEndOffset:a}},_getNodesInRange:function(){if(this.collapsed){return[]}var b=this._getActualStartNode(this.startContainer,this.startOffset);var a=this._getActualEndNode(this.endContainer,this.endOffset);return this._getNodesBetween(b,a)},_getActualStartNode:function(c,b){var a=c;if(c.nodeType==3){if(b>=c.nodeValue.length){a=this._getNextNode(c);if(a.tagName=="BODY"){a=null}}else{a=c}}else{if(b)$/i,_rxTextAlign:/text-align:[^"';]*;?/i,setWindow:function(a){this.reset(a||window)},$init:function(a){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(a)},select:function(){try{this.oBrowserSelection.selectRange(this)}catch(a){}},setFromSelection:function(a){this.setRange(this.oBrowserSelection.getRangeAt(a),true)},setRange:function(a,b){this.reset(this._window);this.setStart(a.startContainer,a.startOffset,b,true);this.setEnd(a.endContainer,a.endOffset,b)},setEndNodes:function(b,a){this.reset(this._window);this.setEndAfter(a,true);this.setStartBefore(b)},splitTextAtBothEnds:function(){this._splitTextEndNodesOfTheRange()},getStartNode:function(){if(this.collapsed){if(this.startContainer.nodeType==3){if(this.startOffset===0){return null}if(this.startContainer.nodeValue.length<=this.startOffset){return null}return this.startContainer}return null}if(this.startContainer.nodeType==3){if(this.startOffset>=this.startContainer.nodeValue.length){return this._getNextNode(this.startContainer)}return this.startContainer}else{if(this.startOffset>=nhn.DOMFix.childNodes(this.startContainer).length){return this._getNextNode(this.startContainer)}return nhn.DOMFix.childNodes(this.startContainer)[this.startOffset]}},getEndNode:function(){if(this.collapsed){return this.getStartNode()}if(this.endContainer.nodeType==3){if(this.endOffset===0){return this._getPrevNode(this.endContainer)}return this.endContainer}else{if(this.endOffset===0){return this._getPrevNode(this.endContainer)}return nhn.DOMFix.childNodes(this.endContainer)[this.endOffset-1]}},getNodeAroundRange:function(d,a){if(!this.collapsed){return this.getStartNode()}if(this.startContainer&&this.startContainer.nodeType==3){return this.startContainer}var e,c,b;if(this.startOffset>=nhn.DOMFix.childNodes(this.startContainer).length){c=this._getNextNode(this.startContainer)}else{c=nhn.DOMFix.childNodes(this.startContainer)[this.startOffset]}if(this.endOffset===0){e=this._getPrevNode(this.endContainer)}else{e=nhn.DOMFix.childNodes(this.endContainer)[this.endOffset-1]}if(d){b=e;if(!b&&!a){b=c}}else{b=c;if(!b&&!a){b=e}}return b},_getXPath:function(b){var a="";while(b&&b.nodeType==1){a="/"+b.tagName+"["+this._getPosIdx4XPath(b)+"]"+a;b=nhn.DOMFix.parentNode(b)}return a},_getPosIdx4XPath:function(b){var a=0;for(var c=b.previousSibling;c;c=c.previousSibling){if(c.tagName==b.tagName){a++}}return a},_evaluateXPath:function(l,j){l=l.substring(1,l.length-1);var f=l.split(/\//);var d=j.body;for(var e=2;e-1&&e){var g=nhn.DOMFix.childNodes(e);var d=null;var b=a;var f=c;while((d=g[b])&&d.nodeType==3&&d.nodeValue.length=0){return true}if(f){if(c==1){return false}if(d==-1){return false}return true}return false},isNodeInRange:function(d,c,b){var a=new nhn.HuskyRange(this._window);if(b&&d.firstChild){a.setStartBefore(d.firstChild);a.setEndAfter(d.lastChild)}else{a.selectNode(d)}return this.isRangeInRange(a,c)},pasteText:function(a){this.pasteHTML(a.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/"/g,"""))},pasteHTML:function(g,d){var j=this._document.createElement("DIV");j.innerHTML=g;if(!j.firstChild){this.deleteContents();return}var n=this.cloneRange();var o=n.placeStringBookmark();var r=n.getLineInfo(),q=r.oStart,h=r.oEnd;if(q.oLineBreaker&&q.oLineBreaker.nodeName==="P"&&(d||n.rxHasBlock.test(g))){var e=q.oLineBreaker.parentNode,b=q.oLineBreaker.nextSibling;n.deleteContents();if(q.oLineBreaker===h.oLineBreaker){var p=n.getStringBookmark(o);n.setEndNodes(p,h.oLineBreaker);var f=n.extractContents(),c=f.firstChild;if(b){e.insertBefore(f,b)}else{e.appendChild(f)}b=c}j.style.cssText=q.oLineBreaker.style.cssText.replace(this._rxTextAlign,"");j.align=q.oLineBreaker.align;if(b){e.insertBefore(j,b)}else{e.appendChild(j)}n.removeStringBookmark(o);this._removeEmptyP(this._getPrevElement(j));var a=this._getNextElement(j);if(a){var m=this._getNextElement(a);if(m&&this._removeEmptyP(a)){a=m}}else{a=this._document.createElement("P");a.style.cssText=q.oLineBreaker.style.cssText;a.align=q.oLineBreaker.align;e.appendChild(a)}if(a.innerHTML===""){a.innerHTML=(jindo.$Agent().navigator().ie&&jindo.$Agent().navigator().version>8)?"\u200B":"\uFEFF"}this.selectNodeContents(a);this.collapseToStart();if(jindo.$Agent().navigator().ie&&jindo.$Agent().navigator().version<9){o=this.placeStringBookmark();this.removeStringBookmark(o)}}else{var k=j.firstChild;var l=j.lastChild;this.collapseToStart();while(j.lastChild){this.insertNode(j.lastChild)}this.setEndNodes(k,l);n.moveToBookmark(o);n.deleteContents();n.removeStringBookmark(o)}},_removeEmptyP:function(b){if(b&&b.nodeName==="P"){var a=b.innerHTML;if(a===""||this._rxCursorHolder.test(a)){b.parentNode.removeChild(b);return true}}},_getSiblingElement:function(c,b){if(!c){return null}var a=c[b?"previousSibling":"nextSibling"];if(a&&a.nodeType===1){return a}else{return arguments.callee(a,b)}},_getPrevElement:function(a){return this._getSiblingElement(a,true)},_getNextElement:function(a){return this._getSiblingElement(a,false)},toString:function(){this.toString=nhn.W3CDOMRange.prototype.toString;return this.toString()},toHTMLString:function(){var a=this._document.createElement("DIV");a.appendChild(this.cloneContents());return a.innerHTML},findAncestorByTagName:function(a){var b=this.commonAncestorContainer;while(b&&b.tagName!=a){b=nhn.DOMFix.parentNode(b)}return b},selectNodeContents:function(c){if(!c){return}var b=c.firstChild?c.firstChild:c;var a=c.lastChild?c.lastChild:c;this.reset(this._window);if(b.nodeType==3){this.setStart(b,0,true)}else{this.setStartBefore(b)}if(a.nodeType==3){this.setEnd(a,a.nodeValue.length,true)}else{this.setEndAfter(a)}},_hasTextDecoration:function(a,b){if(!a||!a.style){return false}if(a.style.textDecoration.indexOf(b)>-1){return true}if(b==="underline"&&a.tagName==="U"){return true}if(b==="line-through"&&(a.tagName==="S"||a.tagName==="STRIKE")){return true}return false},_setTextDecoration:function(a,b){if(jindo.$Agent().navigator().firefox){a.style.textDecoration=(a.style.textDecoration)?a.style.textDecoration+" "+b:b}else{if(b==="underline"){a.innerHTML=""+a.innerHTML+""}else{if(b==="line-through"){a.innerHTML=""+a.innerHTML+""}}}},_checkTextDecoration:function(e){if(e.tagName!=="SPAN"){return}var c=false,a=false,d="",b=null;oChildNode=e.firstChild;while(oChildNode){if(oChildNode.nodeType===1){c=(c||oChildNode.tagName==="U");a=(a||oChildNode.tagName==="S"||oChildNode.tagName==="STRIKE")}if(c&&a){return}oChildNode=oChildNode.nextSibling}b=nhn.DOMFix.parentNode(e);while(b&&b.tagName!=="BODY"){if(b.nodeType!==1){b=nhn.DOMFix.parentNode(b);continue}if(!c&&this._hasTextDecoration(b,"underline")){c=true;this._setTextDecoration(e,"underline")}if(!a&&this._hasTextDecoration(b,"line-through")){a=true;this._setTextDecoration(e,"line-through")}if(c&&a){return}b=nhn.DOMFix.parentNode(b)}},styleRange:function(k,f,b,a,e){var j=this.aStyleParents=this._getStyleParentNodes(b,a);if(j.length<1){return}var d,h;for(var c=0;c1){return null}}if(e.nodeName==="SPAN"){return e}else{return this._findParentSingleSpan(e.parentNode)}},_isFullyContained:function(d,c,f){var a,e;var b=this._getVeryFirstRealChild(d);if(f&&b==f){a=1}else{a=c.indexOf(b)}if(a!=-1){b=this._getVeryLastRealChild(d);if(f&&b==f){e=1}else{e=c.indexOf(b)}}return(a!=-1&&e!=-1)},_getVeryFirstChild:function(a){if(a.firstChild){return this._getVeryFirstChild(a.firstChild)}return a},_getVeryLastChild:function(a){if(a.lastChild){return this._getVeryLastChild(a.lastChild)}return a},_getFirstRealChild:function(b){var a=b.firstChild;while(a&&a.nodeType==3&&a.nodeValue==""){a=a.nextSibling}return a},_getLastRealChild:function(b){var a=b.lastChild;while(a&&a.nodeType==3&&a.nodeValue==""){a=a.previousSibling}return a},_getVeryFirstRealChild:function(b){var a=this._getFirstRealChild(b);if(a){return this._getVeryFirstRealChild(a)}return b},_getVeryLastRealChild:function(b){var a=this._getLastRealChild(b);if(a){return this._getVeryLastChild(a)}return b},_getLineStartInfo:function(f){var h=null;var a=f;var g=f;var e=false;var d=this.rxLineBreaker;function b(j){if(!j){return}if(h){return}if(d.test(j.tagName)){g=j;h=a;e=true;return}else{a=j}c(j.previousSibling);if(h){return}b(nhn.DOMFix.parentNode(j))}function c(k){if(!k){return}if(h){return}if(d.test(k.tagName)){g=k;h=a;e=false;return}if(k.firstChild&&k.tagName!="TABLE"){var j=k.lastChild;while(j&&!h){c(j);j=j.previousSibling}}else{a=k}if(!h){c(k.previousSibling)}}if(d.test(f.tagName)){h=f}else{b(f)}return{oNode:h,oLineBreaker:g,bParentBreak:e}},_getLineEndInfo:function(f){var b=null;var a=f;var g=f;var e=false;var d=this.rxLineBreaker;function h(j){if(!j){return}if(b){return}if(d.test(j.tagName)){g=j;b=a;e=true;return}else{a=j}c(j.nextSibling);if(b){return}h(nhn.DOMFix.parentNode(j))}function c(k){if(!k){return}if(b){return}if(d.test(k.tagName)){g=k;b=a;e=false;return}if(k.firstChild&&k.tagName!="TABLE"){var j=k.firstChild;while(j&&!b){c(j);j=j.nextSibling}}else{a=k}if(!b){c(k.nextSibling)}}if(d.test(f.tagName)){b=f}else{h(f)}return{oNode:b,oLineBreaker:g,bParentBreak:e}},getLineInfo:function(h){var h=h||false;var b=this.getStartNode();var e=this.getEndNode();if(!b){b=this.getNodeAroundRange(!h,true)}if(!e){e=this.getNodeAroundRange(!h,true)}var j=this._getLineStartInfo(b);var f=j.oNode;var c=this._getLineEndInfo(e);var a=c.oNode;if(b!=f||e!=a){var g=this._compareEndPoint(nhn.DOMFix.parentNode(f),this._getPosIdx(f),this.endContainer,this.endOffset);var d=this._compareEndPoint(nhn.DOMFix.parentNode(a),this._getPosIdx(a)+1,this.startContainer,this.startOffset);if(!(g<=0&&d>=0)){b=this.getNodeAroundRange(false,true);e=this.getNodeAroundRange(false,true);j=this._getLineStartInfo(b);c=this._getLineEndInfo(e)}}return{oStart:j,oEnd:c}},_findSingleChild:function(f){if(!f){return null}var b=null;for(var c=0,a=0,g,d,e=f.childNodes;(d=e[c]);c++){g=d.nodeValue;if(this._rxCursorHolder.test(g)){continue}else{b=d;a++}if(a>1){return null}}return b},_hasCursorHolderOnly:function(a){if(!a||a.nodeType!==1){return false}if(this._rxCursorHolder.test(a.innerHTML)){return true}else{return this._hasCursorHolderOnly(this._findSingleChild(a))}}}).extend(nhn.W3CDOMRange);nhn.BrowserSelection=function(a){this.init=function(b){this._window=b||window;this._document=this._window.document};this.init(a);if(!!this._document.createRange){nhn.BrowserSelectionImpl_FF.apply(this)}else{nhn.BrowserSelectionImpl_IE.apply(this)}this.selectRange=function(b){this.selectNone();this.addRange(b)};this.selectionLoaded=true;if(!this._oSelection){this.selectionLoaded=false}};nhn.BrowserSelectionImpl_FF=function(){this._oSelection=this._window.getSelection();this.getRangeAt=function(a){a=a||0;try{var b=this._oSelection.getRangeAt(a)}catch(c){return new nhn.W3CDOMRange(this._window)}return this._FFRange2W3CRange(b)};this.addRange=function(a){var b=this._W3CRange2FFRange(a);this._oSelection.addRange(b)};this.selectNone=function(){this._oSelection.removeAllRanges()};this.getCommonAncestorContainer=function(a){var b=this._W3CRange2FFRange(a);return b.commonAncestorContainer};this.isCollapsed=function(a){var b=this._W3CRange2FFRange(a);return b.collapsed};this.compareEndPoints=function(g,d,c,a){var f=this._document.createRange();var b=this._document.createRange();f.setStart(g,d);b.setStart(c,a);f.collapse(true);b.collapse(true);try{return f.compareBoundaryPoints(1,b)}catch(h){return 1}};this._FFRange2W3CRange=function(b){var a=new nhn.W3CDOMRange(this._window);a.setStart(b.startContainer,b.startOffset,true);a.setEnd(b.endContainer,b.endOffset,true);return a};this._W3CRange2FFRange=function(a){var b=this._document.createRange();b.setStart(a.startContainer,a.startOffset);b.setEnd(a.endContainer,a.endOffset);return b}};nhn.BrowserSelectionImpl_IE=function(){this._oSelection=this._document.selection;this.oLastRange={oBrowserRange:null,elStartContainer:null,nStartOffset:-1,elEndContainer:null,nEndOffset:-1};this._updateLastRange=function(b,a){this.oLastRange.oBrowserRange=b;this.oLastRange.elStartContainer=a.startContainer;this.oLastRange.nStartOffset=a.startOffset;this.oLastRange.elEndContainer=a.endContainer;this.oLastRange.nEndOffset=a.endOffset};this.getRangeAt=function(b){b=b||0;var a,c;if(this._oSelection.type=="Control"){a=new nhn.W3CDOMRange(this._window);var d=this._oSelection.createRange().item(b);if(!d||d.ownerDocument!=this._document){return a}a.selectNode(d);return a}else{c=this._oSelection.createRange();var d=c.parentElement();if(!d||d.ownerDocument!=this._document){a=new nhn.W3CDOMRange(this._window);return a}a=this._IERange2W3CRange(c);return a}};this.addRange=function(a){var b=this._W3CRange2IERange(a);b.select()};this.selectNone=function(){this._oSelection.empty()};this.getCommonAncestorContainer=function(a){return this._W3CRange2IERange(a).parentElement()};this.isCollapsed=function(a){var c=this._W3CRange2IERange(a);var b=c.duplicate();b.collapse();return c.isEqual(b)};this.compareEndPoints=function(d,c,b,a){var f,e;if(d===this.oLastRange.elStartContainer&&c===this.oLastRange.nStartOffset){f=this.oLastRange.oBrowserRange.duplicate();f.collapse(true)}else{if(d===this.oLastRange.elEndContainer&&c===this.oLastRange.nEndOffset){f=this.oLastRange.oBrowserRange.duplicate();f.collapse(false)}else{f=this._getIERangeAt(d,c)}}if(b===this.oLastRange.elStartContainer&&a===this.oLastRange.nStartOffset){e=this.oLastRange.oBrowserRange.duplicate();e.collapse(true)}else{if(b===this.oLastRange.elEndContainer&&a===this.oLastRange.nEndOffset){e=this.oLastRange.oBrowserRange.duplicate();e.collapse(false)}else{e=this._getIERangeAt(b,a)}}return f.compareEndPoints("StartToStart",e)};this._W3CRange2IERange=function(a){if(this.oLastRange.elStartContainer===a.startContainer&&this.oLastRange.nStartOffset===a.startOffset&&this.oLastRange.elEndContainer===a.endContainer&&this.oLastRange.nEndOffset===a.endOffset){return this.oLastRange.oBrowserRange}var b=this._getIERangeAt(a.startContainer,a.startOffset);var c=this._getIERangeAt(a.endContainer,a.endOffset);b.setEndPoint("EndToEnd",c);this._updateLastRange(b,a);return b};this._getIERangeAt=function(f,d){var c=this._document.body.createTextRange();var b=this._getSelectableNodeAndOffsetForIE(f,d);var e=b.oSelectableNodeForIE;var a=b.iOffsetForIE;c.moveToElementText(e);c.collapse(b.bCollapseToStart);c.moveStart("character",a);return c};this._getSelectableNodeAndOffsetForIE=function(e,g){var a=null;var d=null;var b=0;if(e.nodeType==3){a=nhn.DOMFix.parentNode(e);d=nhn.DOMFix.childNodes(a);b=d.length}else{a=e;d=nhn.DOMFix.childNodes(a);b=(g=0){break}g=k[j]}var n=j;if(n!==0&&k[n-1].nodeType==3){var a=this._document.body.createTextRange();var d=null;if(g){a.moveToElementText(g);a.collapse(false);d=g.nextSibling}else{a.moveToElementText(o);a.collapse(true);d=o.firstChild}var m=p.duplicate();m.setEndPoint("StartToStart",a);var b=m.text.replace(/[\r\n]/g,"").length;while(b>d.nodeValue.length&&d.nextSibling){b-=d.nodeValue.length;d=d.nextSibling}var l=d.nodeValue;if(f&&d.nextSibling&&d.nextSibling.nodeType==3&&b==d.nodeValue.length){b-=d.nodeValue.length;d=d.nextSibling}o=d;h=b}else{o=p.parentElement();h=n}return{oContainer:o,iOffset:h}}};nhn.DOMFix=new (jindo.$Class({$init:function(){if(jindo.$Agent().navigator().ie||jindo.$Agent().navigator().opera){this.childNodes=this._childNodes_Fix;this.parentNode=this._parentNode_Fix}else{this.childNodes=this._childNodes_Native;this.parentNode=this._parentNode_Native}},_parentNode_Native:function(a){return a.parentNode},_parentNode_Fix:function(a){if(!a){return a}while(a.previousSibling){a=a.previousSibling}return a.parentNode},_childNodes_Native:function(a){return a.childNodes},_childNodes_Fix:function(a){var c=null;var b=0;if(a){var c=[];a=a.firstChild;while(a){c[b++]=a;a=a.nextSibling}}return c}}))();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(a,b){this.oApp[a]=b},$ON_REGISTER_BROWSER_EVENT:function(d,e,b,c,a){this.oApp.registerBrowserEvent(d,e,b,c,a)},$ON_DISABLE_MESSAGE:function(a){this.oApp.disableMessage(a,true)},$ON_ENABLE_MESSAGE:function(a){this.oApp.disableMessage(a,false)},$ON_LOAD_FULL_PLUGIN:function(f,b,e,c,d){var g=c.$this||c;var a=f[0];if(!this.htLazyLoadRequest_plugins[a]){this.htLazyLoadRequest_plugins[a]={nStatus:1,sContents:""}}if(this.htLazyLoadRequest_plugins[a].nStatus===2){this.oApp.exec("MSG_FULL_PLUGIN_LOADED",[a,b,e,c,d,false])}else{this._loadFullPlugin(f,b,e,c,d,0)}},_loadFullPlugin:function(f,a,e,c,d,b){jindo.LazyLoading.load(nhn.husky.SE2M_Configuration.LazyLoad.sJsBaseURI+"/"+f[b],jindo.$Fn(function(o,h,n,l,m,k){var j=o[k];var g=o[0];if(k==o.length-1){this.htLazyLoadRequest_plugins[g].nStatus=2;this.oApp.exec("MSG_FULL_PLUGIN_LOADED",[o,h,n,l,m]);return}this._loadFullPlugin(o,h,n,l,m,k+1)},this).bind(f,a,e,c,d,b),"utf-8")},$ON_MSG_FULL_PLUGIN_LOADED:function(aFilenames,sClassName,sMsgName,oThisRef,oArguments,oRes){var oPluginRef=oThisRef.$this||oThisRef;var sFilename=aFilenames;for(var i=0,nLen=oThisRef._huskyFLT.length;ili>button")}},$LOCAL_BEFORE_FIRST:function(a){var c=jindo.$$(">ul>li[class*="+this.sUIClassPrefix+"]>button",this.elTextTool);var b=c.length;this.elFirstToolbarItem=this.elFirstToolbarItem||c[0];this.elLastToolbarItem=c[b-1];this.oApp.registerBrowserEvent(this.toolbarArea,"keydown","NAVIGATE_TOOLBAR",[])},$init:function(b,a){this._htOptions=a||{};this.htUIList={};this.htWrappedUIList={};this.aUICmdMap={};this._assignHTMLElements(b)},$ON_MSG_APP_READY:function(){if(this.oApp.bMobile){this.oApp.registerBrowserEvent(this.toolbarArea,"touchstart","EVENT_TOOLBAR_TOUCHSTART")}else{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()]);if(this._htOptions.aDisabled){this._htOptions._sDisabled=","+this._htOptions.aDisabled.toString()+",";this.oApp.exec("DISABLE_UI",[this._htOptions.aDisabled])}},$ON_NAVIGATE_TOOLBAR:function(b){var a=9;if((b.element==this.elLastToolbarItem)&&(b.key().keyCode==a)){if(b.key().shift){}else{this.elFirstToolbarItem.focus();b.stopDefault()}}if(b.element==this.elFirstToolbarItem&&(b.key().keyCode==a)){if(b.key().shift){b.stopDefault();this.elLastToolbarItem.focus()}}},$ON_TOGGLE_TOOLBAR_ACTIVE_LAYER:function(b,d,e,a,f,c){this.oApp.exec("TOGGLE_ACTIVE_LAYER",[b,"MSG_TOOLBAR_LAYER_SHOWN",[b,d,e,a],f,c])},$ON_MSG_TOOLBAR_LAYER_SHOWN:function(c,d,b,a){this.oApp.exec("POSITION_TOOLBAR_LAYER",[c,d]);if(b){this.oApp.exec(b,a)}},$ON_SHOW_TOOLBAR_ACTIVE_LAYER:function(a,d,c,b){this.oApp.exec("SHOW_ACTIVE_LAYER",[a,d,c]);this.oApp.exec("POSITION_TOOLBAR_LAYER",[a,b])},$ON_ENABLE_UI:function(a){this._enableUI(a)},$ON_DISABLE_UI:function(c){if(c instanceof Array){for(var a=0,b;(b=c[a]);a++){this._disableUI(b)}}else{this._disableUI(c)}},$ON_SELECT_UI:function(a){var b=this.htWrappedUIList[a];if(!b){return}b.removeClass("hover");b.addClass("active")},$ON_DESELECT_UI:function(a){var b=this.htWrappedUIList[a];if(!b){return}b.removeClass("active")},$ON_TOGGLE_UI_SELECTED:function(a){var b=this.htWrappedUIList[a];if(!b){return}if(b.hasClass("active")){b.removeClass("active")}else{b.removeClass("hover");b.addClass("active")}},$ON_ENABLE_ALL_UI:function(b){if(this.nUIStatus===1){return}var c,a;b=b||{};var d=jindo.$A(b.aExceptions||[]);for(c in this.htUIList){if(c&&!d.has(c)){this._enableUI(c)}}this.nUIStatus=1},$ON_DISABLE_ALL_UI:function(b){if(this.nUIStatus===2){return}var c;b=b||{};var d=jindo.$A(b.aExceptions||[]);var a=b.bLeaveActiveLayer||false;if(!a){this.oApp.exec("HIDE_ACTIVE_LAYER")}for(c in this.htUIList){if(c&&!d.has(c)){this._disableUI(c)}}this.nUIStatus=2},$ON_MSG_STYLE_CHANGED:function(b,a){if(a==="@^"){this.oApp.exec("SELECT_UI",[b])}else{this.oApp.exec("DESELECT_UI",[b])}},$ON_POSITION_TOOLBAR_LAYER:function(f,j){var b,k,e,a;f=jindo.$(f);j=j||{};var d=jindo.$(j.elBtn);var g=j.sAlign;var c=-1;if(!f){return}if(d&&d.tagName&&d.tagName=="BUTTON"){d.parentNode.appendChild(f)}var h=jindo.$Element(f);if(g!="right"){f.style.left="0";b=h.offset().left;k=b+f.offsetWidth;e=this.welToolbarArea.offset().left;a=e+this.toolbarArea.offsetWidth;if(k>a){h.css("left",(a-k-c)+"px")}if(ba){h.css("right",-1*(a-k-c)+"px")}if(b2||a.parentNode.className.match(/se2_pair/))){return}a=a.parentNode}this.oApp.exec("HIDE_ACTIVE_LAYER_IF_NOT_CHILD",[b.element])},_enableUI:function(d){if(this._htOptions._sDisabled&&this._htOptions._sDisabled.indexOf(","+d+",")>-1){return}var b,c;this.nUIStatus=0;var e=this.htWrappedUIList[d];var g=this.htUIList[d];if(!e){return}e.removeClass("off");var a=g.getElementsByTagName("BUTTON");for(b=0,c=a.length;bthis.oApp.elEditingAreaContainer.offsetHeight){if(typeof a=="number"){b.style.top=c-b.offsetHeight-a+"px"}else{b.style.top=this.oApp.elEditingAreaContainer.offsetHeight-b.offsetHeight+"px"}}var d=parseInt(b.style.left,10);if(d+b.offsetWidth>this.oApp.elEditingAreaContainer.offsetWidth){b.style.left=this.oApp.elEditingAreaContainer.offsetWidth-b.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(a){a=a||this.oActivePlugin;this._fitElementInEditingArea(a.elEditingArea)},_fitElementInEditingArea:function(a){a.style.height=this.elEditingAreaContainer.offsetHeight+"px"},attachDocumentEvents:function(a){this.oApp.registerBrowserEvent(a,"click","EVENT_EDITING_AREA_CLICK");this.oApp.registerBrowserEvent(a,"dblclick","EVENT_EDITING_AREA_DBLCLICK");this.oApp.registerBrowserEvent(a,"mousedown","EVENT_EDITING_AREA_MOUSEDOWN");this.oApp.registerBrowserEvent(a,"mousemove","EVENT_EDITING_AREA_MOUSEMOVE");this.oApp.registerBrowserEvent(a,"mouseup","EVENT_EDITING_AREA_MOUSEUP");this.oApp.registerBrowserEvent(a,"mouseout","EVENT_EDITING_AREA_MOUSEOUT");this.oApp.registerBrowserEvent(a,"mousewheel","EVENT_EDITING_AREA_MOUSEWHEEL");this.oApp.registerBrowserEvent(a,"keydown","EVENT_EDITING_AREA_KEYDOWN");this.oApp.registerBrowserEvent(a,"keypress","EVENT_EDITING_AREA_KEYPRESS");this.oApp.registerBrowserEvent(a,"keyup","EVENT_EDITING_AREA_KEYUP");this.oApp.registerBrowserEvent(a,"scroll","EVENT_EDITING_AREA_SCROLL")},$ON_GET_COVER_DIV:function(a,b){if(!!this.elEditingAreaCover){b[a]=this.elEditingAreaCover}},$ON_SHOW_LOADING_LAYER:function(){this.elLoadingLayer.style.display="block"},$ON_HIDE_LOADING_LAYER:function(){this.elLoadingLayer.style.display="none"},getIR:function(){if(!this.oActivePlugin){return""}return this.oActivePlugin.getIR()},setIR:function(b,a){this.oApp.exec("SET_IR",[b,a])},getRawContents:function(){if(!this.oActivePlugin){return""}return this.oActivePlugin.getRawContents()},getContents:function(){this._convertLastBrToNbsp();var b=this.oApp.getIR();var a;if(this.oApp.applyConverter){a=this.oApp.applyConverter("IR_TO_DB",b,this.oApp.getWYSIWYGDocument())}else{a=b}a=this._cleanContents(a);return a},_convertLastBrToNbsp:function(){var h=this.oApp.getWYSIWYGDocument().body,k,r,p,l,e,g,m,j,c,s,d,f,a=document.createTextNode("\u00A0"),q,b;k=jindo.$$("br:last-child",h,{oneTimeOffCache:true});for(var n=0,o=k.length;n0){j=m[m.length-1]}}if(j){e=this._findNextSiblingRecursive(j);if(e==p){s=j.parentNode;if(!s){continue}c=jindo.$Element(j).width(),s=j.parentNode,d=jindo.$Element(s).width();f=!(c===d)}else{f=true}}else{f=true}b=r.parentNode;if(f){q=a.cloneNode(false);b.replaceChild(q,r)}else{this._recursiveRemoveChild(r)}}},_findNextSiblingRecursive:function(c,f){var h=c,b,e,g=(f&&f.isReverse)?true:false,a=new RegExp("^(P|DIV)$","i"),d=new RegExp("^(TD|BODY)$","i");while(!b){if(g){b=h.previousSibling}else{b=h.nextSibling}h=h.parentNode;if(d.test(h.tagName)){b=null;break}}return b},_recursiveRemoveChild:function(a){var b=a.parentNode,d=a,c;do{b.removeChild(d)}while((c=b.childNodes)&&(c.length==0)&&(d=b)&&(b=b.parentNode))},_cleanContents:function(a){return a.replace(new RegExp("(]*>)"+unescape("%uFEFF")+"","ig"),"$1")},setContents:function(a,b){var c;if(this.oApp.applyConverter){c=this.oApp.applyConverter("DB_TO_IR",a,this.oApp.getWYSIWYGDocument())}else{c=a}this.oApp.exec("SET_IR",[c,b])},getEditingMode:function(){return this.oActivePlugin.sMode},getEditingAreaWidth:function(){return this.elEditingAreaContainer.offsetWidth},getEditingAreaHeight:function(){return this.elEditingAreaContainer.offsetHeight}});var nSE2Version="4a256db";nhn.husky.SE_EditingAreaManager.version={revision:"4a256db",type:"open",number:"2.9.0"};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:false,bAutoResize:false,nBodyMinHeight:0,nScrollbarWidth:0,iLastUndoRecorded:0,_nIFrameReadyCount:50,bWYSIWYGEnabled:false,$init:function(b){this.iframe=jindo.$(b);var a=jindo.$Agent().navigator();if(a.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;if(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;if(a.ie&&jindo.$A(this.aAddtionalEmulateIE7).has(a.nativeVersion)){this.sIFrameSrc=this.sBlankPageURL_EmulateIE7}var e=this.sIFrameSrc,b=this.iframe,d=jindo.$Fn(this.initIframe,this).bind(),c=jindo.$Fn(function(){this.iframe.src=e},this).bind();if(!a.ie||(a.version>=9&&!!document.addEventListener)){b.addEventListener("load",d,false);b.addEventListener("error",c,false)}else{b.attachEvent("onload",d);b.attachEvent("onerror",c)}b.src=e;this.elEditingArea=b},$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()]);if(!!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(){if(!this.oApp.hasOwnProperty("saveSnapShot")){this.$ON_EVENT_EDITING_AREA_MOUSEUP=function(){};this._recordUndo=function(){}}this._bIERangeReset=true;if(this.oApp.oNavigator.ie||navigator.userAgent.indexOf("Edge")>-1){this._bIECursorHide=true;jindo.$Fn(function(b){var a=this.iframe.contentWindow.document.selection;if(a&&a.type.toLowerCase()==="control"&&b.key().keyCode===8){this.oApp.exec("EXECCOMMAND",["delete",false,false]);b.stop()}this._bIERangeReset=false},this).attach(this.iframe.contentWindow.document,"keydown");jindo.$Fn(function(a){this._oIERange=null;this._bIERangeReset=true},this).attach(this.iframe.contentWindow.document.body,"mousedown");if(!this.getDocument().createRange){jindo.$Fn(this._onIEBeforeDeactivate,this).attach(this.iframe.contentWindow.document.body,"beforedeactivate")}jindo.$Fn(function(a){this._bIERangeReset=false},this).attach(this.iframe.contentWindow.document.body,"mouseup")}else{if(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(a){nhn.husky.SE2M_Utils.removeInvalidFont(a);nhn.husky.SE2M_Utils.convertFontToSpan(a)},_setScrollbarWidth:function(){var a=this.getDocument(),b=a.createElement("div");b.style.width="100px";b.style.height="100px";b.style.overflow="scroll";b.style.position="absolute";b.style.top="-9999px";a.body.appendChild(b);this.nScrollbarWidth=b.offsetWidth-b.clientWidth;a.body.removeChild(b)},$AFTER_EVENT_EDITING_AREA_KEYUP:function(a){if(!this.bAutoResize){return}var b=a.key();if((b.keyCode>=33&&b.keyCode<=40)||b.alt||b.ctrl||b.keyCode===16){return}this._setAutoResize()},$AFTER_PASTE_HTML:function(){if(!this.bAutoResize){return}this._setAutoResize()},startAutoResize:function(){this.oApp.exec("STOP_CHECKING_BODY_HEIGHT");this.bAutoResize=true;var a=this.oApp.oNavigator;if(a.ie&&a.version<9){jindo.$Element(this.getDocument().body).css({overflow:"visible"})}else{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=false;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){return}var a=this.getDocument().body.innerHTML.length;if(a!==this.nBodyLength){this.nBodyLength=a;this._setAutoResize()}},_setAutoResize:function(){var g=this.getDocument().body,c=jindo.$Element(g),h,d,b,f,e=false,a=this.oApp.oNavigator;this.nTopBottomMargin=this.nTopBottomMargin||(parseInt(c.css("marginTop"),10)+parseInt(c.css("marginBottom"),10));this.nBodyMinHeight=this.nBodyMinHeight||(this.oApp.getEditingAreaHeight()-this.nTopBottomMargin);c.css("height","0px");this.iframe.style.height="0px";h=parseInt(g.scrollHeight,10);if(hthis.nBodyMinHeight){b=this.oApp.getCurrentStyle();f=this._getStyleSize(b);if(fthis.nBodyMinHeight){b=this.oApp.getCurrentStyle();f=this._getStyleSize(b);if(ff?c-g:d);if(this._isHorizontalScrollbarVisible()){j-=this.nScrollbarWidth}if(!(k&&h)){l.css("height",j+"px")}this.nBodyHeight_last=j;setTimeout(this.fnSetBodyHeight,500)},_isHorizontalScrollbarVisible:function(){var a=this.getDocument();if(a.documentElement.clientWidth8){var d=jindo.$$.getSingle("DIV.husky_seditor_editing_area_container").childNodes[0];if((d.tagName=="DIV")&&(d.style.zIndex==1000)){d.parentNode.removeChild(d)}}this.iframe.style.visibility="visible";if(this.iframe.style.display!="block"){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(a,b){this._oIERange=null},$ON_ENABLE_WYSIWYG:function(){this._enableWYSIWYG()},$ON_DISABLE_WYSIWYG:function(){this._disableWYSIWYG()},$ON_IE_HIDE_CURSOR:function(){if(!this._bIECursorHide){return}this._onIEBeforeDeactivate();var a=this.oApp.getWYSIWYGDocument().selection;if(a&&a.createRange){try{a.empty()}catch(b){a=this.oApp.getSelection();a.select();a.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=true},$BEFORE_EVENT_EDITING_AREA_KEYDOWN:function(a){this._bKeyDown=true},$ON_EVENT_EDITING_AREA_KEYDOWN:function(a){if(this.oApp.getEditingMode()!==this.sMode){return}var b=a.key();if(this.oApp.oNavigator.ie){switch(b.keyCode){case 33:this._pageUp(a);break;case 34:this._pageDown(a);break;case 8:this._backspace(a);break;case 46:this._delete(a);break;default:}}else{if(this.oApp.oNavigator.firefox){if(b.keyCode===8){this._backspace(a)}}}this._recordUndo(b)},_backspace:function(b){var a=this._prepareBackspaceDelete(true);if(!a){return}if(this._removeUnremovable(a,true)){b.stop()}},_delete:function(d){var b=this._prepareBackspaceDelete(false);if(!b){return}if(this._removeUnremovable(b,false)){d.stop()}else{if(b.nodeType===3){var a=this.oApp.getSelection().getLineInfo(),c=a.oEnd.oLineBreaker,e=c&&c.nextSibling;this._removeWrongSpan(e)}else{this._removeWrongSpan(b)}}},_prepareBackspaceDelete:function(a){var b=this.oApp.getSelection();if(!b.collapsed){return}var c=b.getNodeAroundRange(a,false);if(this._isLineFeed(c)){c=a?b._getPrevNode(c):b._getNextNode(c)}this._clearCursorHolderValue(c);return c},_isLineFeed:function(a){return(a&&a.nodeType===3&&/^[\n]*$/.test(a.nodeValue))},_clearCursorHolderValue:function(a){if(a&&a.nodeType===3&&(a.nodeValue==="\u200B"||a.nodeValue==="\uFEFF")){a.nodeValue=""}},_removeUnremovable:function(d,b){var a=false;if(!d){return false}if(d.nodeName==="TABLE"){d.parentNode.removeChild(d);a=true}else{if(d.nodeName==="DIV"){var c=b?d.lastChild:d.firstChild;if(!c){d.parentNode.removeChild(d);a=true}else{if(c.nodeName==="TABLE"){d.removeChild(c);a=true}else{if(c.nodeType===1&&jindo.$S(c.innerHTML).trim()==""){d.removeChild(c);a=true}}}}}return a},_removeWrongSpan:function(b){if(b&&b.nodeName==="SPAN"&&b.firstChild&&b.firstChild.nodeName==="P"){var a=b.parentNode;while(b.firstChild){a.insertBefore(b.firstChild,b)}a.removeChild(b)}},$BEFORE_EVENT_EDITING_AREA_KEYUP:function(a){if(!this._bKeyDown){return false}this._bKeyDown=false},$ON_EVENT_EDITING_AREA_MOUSEUP:function(a){this.oApp.saveSnapShot()},$BEFORE_PASTE_HTML:function(){if(this.oApp.getEditingMode()!==this.sMode){this.oApp.exec("CHANGE_EDITING_MODE",[this.sMode])}},$ON_PASTE_HTML:function(b,f,j){j=j||{};var c,h,e,l,g,d,k,a;if(this.oApp.getEditingMode()!==this.sMode){return}this.focus();if(!j.bNoUndo){this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["PASTE HTML"])}h=jindo.$Agent().navigator();c=f||this.oApp.getSelection();c.pasteHTML(b,j.bBlock);if(!h.ie){e=c.placeStringBookmark();this.oApp.getWYSIWYGDocument().body.innerHTML=this.oApp.getWYSIWYGDocument().body.innerHTML;c.moveToBookmark(e);c.collapseToEnd();c.select();c.removeStringBookmark(e);c=this.oApp.getSelection();if(!!f){f.setRange(c)}}else{c.collapseToEnd();c.select();this._oIERange=null;this._bIERangeReset=false}if(b.indexOf("-1){l=c.startContainer;if(l.nodeType===1&&l.tagName==="P"){g=jindo.$Element(l).child(function(m){return(m.$value().nodeType===1&&m.$value().tagName==="IMG")},1);if(g.length>0){d=g[g.length-1].$value();k=d.nextSibling;while(k){a=k.nextSibling;if(k.nodeType===3&&(k.nodeValue===" "||k.nodeValue===unescape("%u00A0"))){l.removeChild(k)}k=a}}}}if(!j.bNoUndo){this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["PASTE HTML"])}},$ON_FOCUS_N_CURSOR:function(d,a){var b,c;if(a&&(b=jindo.$(a,this.getDocument()))){clearTimeout(this._nTimerFocus);this._nTimerFocus=setTimeout(jindo.$Fn(function(e){this._scrollIntoView(e);this.oApp.exec("FOCUS")},this).bind(b),300);return}c=this.oApp.getSelection();if(!c.collapsed){if(d){c.collapseToEnd()}else{c.collapseToStart()}c.select()}else{if(d){this.oApp.exec("FOCUS");b=this.getDocument().body;c.selectNode(b);c.collapseToEnd();c.select();this._scrollIntoView(b)}else{this.oApp.exec("FOCUS")}}},_getElementVerticalPosition:function(b){var a=0,c=b,d={nTop:0,nBottom:0};if(!b){return d}try{while(c){a+=c.offsetTop;c=c.offsetParent}}catch(f){}d.nTop=a;d.nBottom=a+jindo.$Element(b).height();return d},_getVisibleVerticalPosition:function(){var a,b,d,c={nTop:0,nBottom:0};a=this.getWindow();b=this.getDocument();d=a.innerHeight?a.innerHeight:b.documentElement.clientHeight||b.body.clientHeight;c.nTop=a.pageYOffset||b.documentElement.scrollTop;c.nBottom=c.nTop+d;return c},_isElementVisible:function(b,a){return(b.nTop>=a.nTop&&b.nBottom<=a.nBottom)},_scrollIntoView:function(c){var d=this._getElementVerticalPosition(c),b=this._getVisibleVerticalPosition(),a=0;if(this._isElementVisible(d,b)){return}if((a=d.nBottom-b.nBottom)>0){this.getWindow().scrollTo(0,b.nTop+a);return}this.getWindow().scrollTo(0,d.nTop)},$BEFORE_MSG_EDITING_AREA_RESIZE_STARTED:function(){if(!jindo.$Agent().navigator().ie){var a=null;a=this.oApp.getSelection();this.sBM=a.placeStringBookmark()}},$AFTER_MSG_EDITING_AREA_RESIZE_ENDED:function(a,b,d){if(this.oApp.getEditingMode()!==this.sMode){return}if(!jindo.$Agent().navigator().ie){var c=this.oApp.getEmptySelection();c.moveToBookmark(this.sBM);c.select();c.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(a){}}},$ON_EVENT_EDITING_AREA_PASTE:function(a){this.oApp.delayedExec("EVENT_EDITING_AREA_PASTE_DELAY",[a],0)},$ON_EVENT_EDITING_AREA_PASTE_DELAY:function(a){this._replaceBlankToNbsp(a.element)},_replaceBlankToNbsp:function(c){var b=this.oApp.oNavigator;if(!b.ie){return}if(b.nativeVersion!==9||document.documentMode!==7){return}if(c.nodeType!==1){return}if(c.tagName==="BR"){return}var a=jindo.$$("p:empty()",this.oApp.getWYSIWYGDocument().body,{oneTimeOffCache:true});jindo.$A(a).forEach(function(e,d,f){e.innerHTML=" "})},_pageUp:function(c){var b=this._getEditorHeight(),d=jindo.$Document(this.oApp.getWYSIWYGDocument()).scrollPosition(),a;if(d.top<=b){a=0}else{a=d.top-b}this.oApp.getWYSIWYGWindow().scrollTo(0,a);c.stop()},_pageDown:function(c){var b=this._getEditorHeight(),d=jindo.$Document(this.oApp.getWYSIWYGDocument()).scrollPosition(),e=this._getBodyHeight(),a;if(d.top+b>=e){a=e-b}else{a=d.top+b}this.oApp.getWYSIWYGWindow().scrollTo(0,a);c.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||this.iframe.contentWindow.document.location.href==="about:blank"){throw new Error("Access denied")}var c=(!!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){c=nhn.husky.SE2M_Configuration.SE_EditingAreaManager.sCSSBaseURI}if(c){var h=c;var b=this.oApp&&this.oApp.htOptions.I18N_LOCALE;if(b){h+="/"+b}h+="/smart_editor2_in.css";var g=this.getDocument();var d=g.getElementsByTagName("head")[0];var a=g.createElement("link");a.type="text/css";a.rel="stylesheet";a.href=h;a.onload=jindo.$Fn(function(){if(this.oApp&&this.oApp.getEditingMode&&this.oApp.getEditingMode()===this.sMode){this.oApp.exec("RESET_STYLE_STATUS")}a.onload=null},this).bind();d.appendChild(a)}this._enableWYSIWYG();this.status=nhn.husky.PLUGIN_STATUS.READY}catch(f){if(this._nIFrameReadyCount-->0){setTimeout(jindo.$Fn(this.initIframe,this).bind(),100)}else{throw ("iframe for WYSIWYG editing mode can't be initialized. Please check if the iframe document exists and is also accessable(cross-domain issues). ")}}},getIR:function(){var a=this.iframe.contentWindow.document.body.innerHTML,b;if(this.oApp.applyConverter){b=this.oApp.applyConverter(this.sMode+"_TO_IR",a,this.oApp.getWYSIWYGDocument())}else{b=a}return b},setIR:function(h){var c,b=this.oApp.oNavigator,d=b.ie&&document.documentMode<11,g=d?"":"
";if(this.oApp.applyConverter){c=this.oApp.applyConverter("IR_TO_"+this.sMode,h,this.oApp.getWYSIWYGDocument())}else{c=h}if(c.replace(/[\r\n\t\s]*/,"")===""){if(this.oApp.sLineBreaker!=="BR"){g="

"+g+"

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

 

"||c.toLowerCase()==="


"||c.toLowerCase()==="

"){c=""}var b=jindo.$Agent().navigator();if(b.ie&&b.nativeVersion==11&&document.documentMode==11){c=c.replace(/(

$)/,"")}var a=c;if(this.oApp.applyConverter){a=this.oApp.applyConverter("IR_TO_"+this.sMode,a,this.oApp.getWYSIWYGDocument())}this.setRawContents(a)},setRawContents:function(a){if(typeof a!=="undefined"){this.elEditingArea.value=a}},getRawContents:function(){return this.elEditingArea.value},focus:function(){this.elEditingArea.focus()}});if(typeof window.TextRange=="undefined"){window.TextRange={}}TextRange=function(b,a){this._o=b;this._oDoc=(a||document)};TextRange.prototype.getSelection=function(){var d=this._o;var b=[-1,-1];if(isNaN(this._o.selectionStart)){d.focus();var a=this._oDoc.body.createTextRange();var c=null;c=this._oDoc.selection.createRange().duplicate();a.moveToElementText(d);c.collapse(true);a.setEndPoint("EndToEnd",c);b[0]=a.text.length;c=this._oDoc.selection.createRange().duplicate();a.moveToElementText(d);c.collapse(false);a.setEndPoint("EndToEnd",c);b[1]=a.text.length;d.blur()}else{b[0]=d.selectionStart;b[1]=d.selectionEnd}return b};TextRange.prototype.setSelection=function(d,a){var c=this._o;if(typeof a=="undefined"){a=d}if(c.setSelectionRange){c.setSelectionRange(d,a)}else{if(c.createTextRange){var b=c.createTextRange();b.collapse(true);b.moveStart("character",d);b.moveEnd("character",a-d);b.select();c.blur()}}};TextRange.prototype.copy=function(){var a=this.getSelection();return this._o.value.substring(a[0],a[1])};TextRange.prototype.paste=function(c){var h=this._o;var f=this.getSelection();var e=h.value;var g=e.substr(0,f[0]);var d=e.substr(f[1]);e=g+c+d;h.value=e;var j=0;if(typeof this._oDoc.body.style.maxHeight=="undefined"){var b=g.match(/\n/gi);j=(b!==null?b.length:0)}this.setSelection(f[0]+c.length-j)};TextRange.prototype.cut=function(){var a=this.copy();this.paste("");return a};nhn.husky.SE_EditingArea_TEXT=jindo.$Class({name:"SE_EditingArea_TEXT",sMode:"TEXT",sRxConverter:"@[0-9]+@",bAutoResize:false,nMinHeight:null,$init:function(a){this.elEditingArea=jindo.$(a)},$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(){if(!!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(a){if(a==this.sMode){this.elEditingArea.style.display="block";this.elEditingArea.style.position="absolute";this.elEditingArea.style.top="0px"}else{this.elEditingArea.style.display="none";this.elEditingArea.style.position="";this.elEditingArea.style.top=""}},$AFTER_CHANGE_EDITING_MODE:function(a,b){if(a==this.sMode&&!b){var c=new TextRange(this.elEditingArea);c.setSelection(0,0)}},irToText:function(d){var a=d,b=0;var c=a.match(new RegExp(this.sRxConverter));if(c!==null){a=a.replace(new RegExp(this.sRxConverter),"")}a=a.replace(/\r/g,"");a=a.replace(/[\n|\t]/g,"");a=a.replace(/[\v|\f]/g,"");a=a.replace(/


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

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

")}else{if(!jindo.$Agent().navigator().ie){c.append("


")}else{c.append("

 

")}}}return c.toString()},startAutoResize:function(){var a={nMinHeight:this.nMinHeight,wfnCallback:jindo.$Fn(this.oApp.checkResizeGripPosition,this).bind()};if(this.oNavigator.msafari){a.wfnCallback=function(){}}this.bAutoResize=true;this.AutoResizer=new nhn.husky.AutoResizer(this.elEditingArea,a);this.AutoResizer.bind()},stopAutoResize:function(){this.AutoResizer.unbind()},getIR:function(){var a=this.getRawContents();if(this.oApp.applyConverter){a=this.oApp.applyConverter(this.sMode+"_TO_IR",a,this.oApp.getWYSIWYGDocument())}return a},setIR:function(b){var a=b;if(this.oApp.applyConverter){a=this.oApp.applyConverter("IR_TO_"+this.sMode,a,this.oApp.getWYSIWYGDocument())}this.setRawContents(a)},setRawContents:function(a){if(typeof a!=="undefined"){this.elEditingArea.value=a}},getRawContents:function(){return this.elEditingArea.value},focus:function(){this.elEditingArea.focus()},htmlSpecialChars:function(a){return a.replace(/&/g,"&").replace(//g,">").replace(/ /g," ")},unhtmlSpecialChars:function(a){return a.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(b,a){this.htConversionMode=a;this._assignHTMLElements(b)},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["isUseVerticalResizer",jindo.$Fn(this.isUseVerticalResizer,this).bind()])},$ON_MSG_APP_READY:function(){if(this.oApp.bMobile){this.oResizeGrip.disabled=true;this.oResizeGrip.style.height="0"}else{this.oApp.exec("REGISTER_HOTKEY",["shift+esc","FOCUS_RESIZER"]);if(this.isUseVerticalResizer()){this.oResizeGrip.style.display="block";if(!!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")}else{this.oResizeGrip.style.display="none";if(!this.oApp.isUseModeChanger()){this.elModeToolbar.style.display="none"}}}this.oApp.exec("ADD_APP_PROPERTY",["checkResizeGripPosition",jindo.$Fn(this.checkResizeGripPosition,this).bind()]);if(!!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=true},$ON_ENABLE_ALL_UI:function(){this.oResizeGrip.style.cursor="n-resize";this.welConversionMode.removeClass("off");this.oResizeGrip.disabled=false},isUseVerticalResizer:function(){return(typeof(this.htConversionMode)==="undefined"||typeof(this.htConversionMode.bUseVerticalResizer)==="undefined"||this.htConversionMode.bUseVerticalResizer===true)?true:false},checkResizeGripPosition:function(b){var a=jindo.$Document();var c=(jindo.$Element(this.oResizeGrip).offset().top-a.scrollPosition().top+25)-a.clientSize().height;if(c<=0){return}if(b){if(this.nEditingAreaMinHeight>this.oApp.getEditingAreaHeight()-c){c=(-1)*(this.nEditingAreaMinHeight-this.oApp.getEditingAreaHeight())}this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED");this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,(-1)*c]);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(b,a){this.oResizeGrip=jindo.$$.getSingle("BUTTON.husky_seditor_editingArea_verticalResizer",b);this.elModeToolbar=jindo.$$.getSingle("DIV.se2_conversion_mode",b);this.welNoticeLayer=jindo.$Element(jindo.$$.getSingle("DIV.husky_seditor_resize_notice",b));this.welConversionMode=jindo.$Element(this.oResizeGrip.parentNode)},_mouseover:function(a){a.stopBubble();this.welConversionMode.addClass("controller_on")},_mouseout:function(a){a.stopBubble();this.welConversionMode.removeClass("controller_on")},_mousedown:function(a){this.iStartHeight=a.pos().clientY;this.iStartHeightOffset=a.pos().layerY;this.$FnMouseMove.attach(document,"mousemove");this.$FnMouseUp.attach(document,"mouseup");this.iStartHeight=a.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(b){var a=b.pos().clientY-this.iStartHeight;this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,a])},_mouseup:function(a){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,365*10)}});nhn.husky.SE_WYSIWYGEnterKey=jindo.$Class({name:"SE_WYSIWYGEnterKey",$init:function(a){if(a=="BR"){this.sLineBreaker="BR"}else{this.sLineBreaker="P"}this.htBrowser=jindo.$Agent().navigator();if(this.htBrowser.opera&&this.sLineBreaker=="P"){this.$ON_MSG_APP_READY=function(){}}if(this.htBrowser.ie){this._addCursorHolder=this._addCursorHolderSpace}else{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(a){var b=a.key();if(b.shift){return}if(b.enter){if(this.sLineBreaker=="BR"){this._insertBR(a)}else{this._wrapBlock(a)}}},$ON_REGISTER_CONVERTERS:function(){this.oApp.exec("ADD_CONVERTER",["IR_TO_DB",jindo.$Fn(this.onIrToDB,this).bind()])},onIrToDB:function(c){var b=c,a=/(]*>)(?:\s*)(<\/p>)/gi;if(this.htBrowser.ie&&this.htBrowser.version<11){b=b.replace(a,"$1 $2")}else{b=b.replace(a,"")}return b},_addBlankText:function(c){var g=c.getNodes(),b,e,f,d,a;for(b=0,e=g.length;b-1||f.id.indexOf(c.HUSKY_BOOMARK_END_ID_PREFIX)>-1){continue}d=f.firstChild;if(!d||(d.nodeType==3&&nhn.husky.SE2M_Utils.isBlankTextNode(d))||(d.nodeType==1&&f.childNodes.length==1&&(d.id.indexOf(c.HUSKY_BOOMARK_START_ID_PREFIX)>-1||d.id.indexOf(c.HUSKY_BOOMARK_END_ID_PREFIX)>-1))){a=c._document.createTextNode(unescape("%uFEFF"));f.appendChild(a)}}},_addCursorHolder:function(b){var a=b;if(b.innerHTML==""||(a=this._getStyleOnlyNode(b))){a.innerHTML="
"}if(!a){a=this._getStyleNode(b)}return a},_addCursorHolderSpace:function(c){var a;this._addSpace(c);a=this._getStyleNode(c);if(a.innerHTML==""&&a.nodeName.toLowerCase()!="param"){try{a.innerHTML=unescape("%uFEFF")}catch(b){}}return a},_getBlockEndNode:function(b,a){if(!b){return a}else{if(b.nodeName==="BR"){return b}else{if(b===a){return a}else{return this._getBlockEndNode(b.nextSibling,a)}}}},_convertHeadSpace:function(e){if(e&&e.nodeType===3){var a=e.nodeValue,d="";for(var b=0,c;(c=a[b]);b++){if(c!=="\u0020"){break}d+="\u00A0"}if(b>0){e.nodeValue=d+a.substring(b)}}},_getValidNextSibling:function(b){var a=b.nextSibling;if(!a){return null}else{if(a.nodeType==3&&a.nodeValue==""){return arguments.callee(a)}}return a},_wrapBlock:function(o){var g=this.oApp.getSelection(),n=g.placeStringBookmark(),r=g.getLineInfo(),q=r.oStart,h=r.oEnd,p,j,m;if(!q.bParentBreak||g.rxBlockContainer.test(q.oLineBreaker.tagName)){o.stop();g.deleteContents();if(!!q.oNode.parentNode&&q.oNode.parentNode.nodeType!==11){p=this.oApp.getWYSIWYGDocument().createElement(this.sLineBreaker);g.moveToBookmark(n);g.setStartBefore(q.oNode);g.surroundContents(p);g.collapseToEnd();j=this.oApp.getWYSIWYGDocument().createElement(this.sLineBreaker);var e=this._getBlockEndNode(q.oNode,h.oNode);if(e===q.oNode){e=h.oNode}g.setEndAfter(e);this._addBlankText(g);g.surroundContents(j);g.moveToStringBookmark(n,true);g.collapseToEnd();g.removeStringBookmark(n);g.select();this._addCursorHolder(p);if(j.lastChild!==null&&j.lastChild.tagName=="BR"){j.removeChild(j.lastChild)}m=this._addCursorHolder(j);if(j.nextSibling&&j.nextSibling.tagName=="BR"){j.parentNode.removeChild(j.nextSibling)}g.selectNodeContents(m);g.collapseToStart();g.select();this.oApp.exec("CHECK_STYLE_CHANGE");n=g.placeStringBookmark();setTimeout(jindo.$Fn(function(s){var t=g.getStringBookmark(s);if(!t){return}g.moveToStringBookmark(s);g.select();g.removeStringBookmark(s)},this).bind(n),0);return}}var l=g.getStringBookmark(n,true);if(this.htBrowser.firefox){if(l&&l.nextSibling&&l.nextSibling.tagName=="IFRAME"){setTimeout(jindo.$Fn(function(s){var t=g.getStringBookmark(s);if(!t){return}g.moveToStringBookmark(s);g.select();g.removeStringBookmark(s)},this).bind(n),0)}else{setTimeout(jindo.$Fn(function(s){this._convertHeadSpace(s)},this).bind(l.nextSibling),0);g.removeStringBookmark(n)}}else{if(this.htBrowser.ie){var k=l.parentNode,d=false,b=false;this._firstBR2Line(k,g,h.oLineBreaker);if(!l||!k){g.removeStringBookmark(n);return}setTimeout(jindo.$Fn(function(){this.oApp.getSelection().removeStringBookmark(n)},this).bind(n),0);d=(k.tagName==="U"||nhn.husky.SE2M_Utils.findAncestorByTagName("U",k)!==null);b=(k.tagName==="S"||k.tagName==="STRIKE"||(nhn.husky.SE2M_Utils.findAncestorByTagName("S",k)!==null&&nhn.husky.SE2M_Utils.findAncestorByTagName("STRIKE",k)!==null));if(d||b){setTimeout(jindo.$Fn(this._addTextDecorationTag,this).bind(d,b),0);return}setTimeout(jindo.$Fn(this._addExtraCursorHolder,this).bind(k),0)}else{var k=l.parentNode,c=this._getValidNextSibling(l);if(k.tagName=="SPAN"&&c&&c.nodeName=="BR"&&c.nextSibling){g.deleteContents();g.setEndNodes(l,h.oLineBreaker);var f=g.extractContents(),a=f.firstChild;k=q.oLineBreaker.parentNode;c=q.oLineBreaker.nextSibling;if(c){k.insertBefore(f,c)}else{k.appendChild(f)}g.selectNodeContents(a);g.collapseToStart();g.select();g.removeStringBookmark(n);o.stop()}else{this._convertHeadSpace(l.nextSibling);g.removeStringBookmark(n)}}}},_firstBR2Line:function(a,d,c){while(a.firstChild&&a.firstChild.nodeName==="BR"){var b=d._document.createTextNode("\u200B");a.replaceChild(b,a.firstChild);d.setStartBefore(c);d.setEndAfter(b);c.parentNode.insertBefore(d.extractContents(),c)}},_addExtraCursorHolder:function(h){var g,d,a;h=this._getStyleOnlyNode(h);if(!!h&&h.tagName==="SPAN"){g=h.lastChild;while(!!g){d=g.previousSibling;if(g.nodeType!==3){g=d;continue}if(nhn.husky.SE2M_Utils.isBlankTextNode(g)){g.parentNode.removeChild(g)}g=d}a=h.innerHTML;if(a.replace("\u200B","").replace("\uFEFF","")===""){h.innerHTML="\u200B"}}var f=this.oApp.getSelection(),c,b,e;if(!f.collapsed){return}f.fixCommonAncestorContainer();b=f.commonAncestorContainer;if(!b){return}b=f._getVeryFirstRealChild(b);if(b.nodeType===3){b=b.parentNode}if(!b||b.tagName!=="SPAN"){return}a=b.innerHTML;if(a.replace("\u200B","").replace("\uFEFF","")===""){b.innerHTML="\u200B"}f.selectNodeContents(b);f.collapseToStart();f.select()},_addSpace:function(b){var a,g,c,d,f,e;if(!b){return}if(b.nodeType===3){return b.parentNode}if(b.tagName!=="P"){return b}f=jindo.$Element(b).child(function(h){return(h.$value().nodeType===1&&h.$value().tagName==="IMG")},1);if(f.length>0){e=f[f.length-1].$value();g=e.nextSibling;while(g){c=g.nextSibling;if(g.nodeType===3&&(g.nodeValue===" "||g.nodeValue===unescape("%u00A0")||g.nodeValue==="\u200B")){b.removeChild(g)}g=c}return b}g=b.firstChild;c=g;d=false;while(g){c=g.nextSibling;if(g.nodeType===3){if(g.nodeValue===unescape("%uFEFF")){b.removeChild(g)}if(!d&&(g.nodeValue===" "||g.nodeValue===unescape("%u00A0")||g.nodeValue==="\u200B")){d=true}}g=c}if(!d){a=this.tmpTextNode.cloneNode();b.appendChild(a)}return b},_addTextDecorationTag:function(e,a){var d,b,c=this.oApp.getSelection();if(!c.collapsed){return}d=c.startContainer;while(d){if(d.nodeType===3){d=nhn.DOMFix.parentNode(d);break}if(!d.childNodes||d.childNodes.length===0){break}d=d.firstChild}if(!d){return}if(d.tagName==="U"||d.tagName==="S"||d.tagName==="STRIKE"){return}if(e){b=c._document.createElement("U");d.appendChild(b);d=b}if(a){b=c._document.createElement("STRIKE");d.appendChild(b)}b.innerHTML="\u200B";c.selectNodeContents(b);c.collapseToEnd();c.select()},_getStyleNode:function(a){while(a.firstChild&&this.oSelection._isBlankTextNode(a.firstChild)){a.removeChild(a.firstChild)}var b=a.firstChild;if(!b){return a}if(b.nodeType===3||(b.nodeType===1&&(b.tagName=="IMG"||b.tagName=="BR"||b.tagName=="HR"||b.tagName=="IFRAME"))){return a}return this._getStyleNode(a.firstChild)},_getStyleOnlyNode:function(a){if(!a){return null}if(!a.insertBefore){return null}if(a.tagName=="IMG"||a.tagName=="BR"||a.tagName=="HR"||a.tagName=="IFRAME"){return null}while(a.firstChild&&this.oSelection._isBlankTextNode(a.firstChild)){a.removeChild(a.firstChild)}if(a.childNodes.length>1){return null}if(!a.firstChild){return a}if(a.firstChild.nodeType===3){return nhn.husky.SE2M_Utils.isBlankTextNode(a.firstChild)?a:null}return this._getStyleOnlyNode(a.firstChild)},_insertBR:function(b){b.stop();var e=this.oApp.getSelection();var f=this.oApp.getWYSIWYGDocument().createElement("BR");e.insertNode(f);e.selectNode(f);e.collapseToEnd();if(!this.htBrowser.ie){var c=e.getLineInfo();var d=c.oEnd;if(d.bParentBreak){while(d.oNode&&d.oNode.nodeType==3&&d.oNode.nodeValue==""){d.oNode=d.oNode.previousSibling}var a=1;if(d.oNode==f||d.oNode.nextSibling==f){a=0}if(a===0){e.pasteHTML("
");e.collapseToEnd()}}}e.insertNode(this.oApp.getWYSIWYGDocument().createTextNode(""));e.select()}});nhn.husky.SE2M_EditingModeChanger=jindo.$Class({name:"SE2M_EditingModeChanger",htConversionMode:null,$init:function(b,a){this.htConversionMode=a;this._assignHTMLElements(b)},_assignHTMLElements:function(a){a=jindo.$(a)||document;this.elWYSIWYGButton=jindo.$$.getSingle("BUTTON.se2_to_editor",a);this.elHTMLSrcButton=jindo.$$.getSingle("BUTTON.se2_to_html",a);this.elTEXTButton=jindo.$$.getSingle("BUTTON.se2_to_text",a);this.elModeToolbar=jindo.$$.getSingle("DIV.se2_conversion_mode",a);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(){if(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"])}else{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",false]);this.showModeChanger();if(this.isUseModeChanger()===false&&this.oApp.isUseVerticalResizer()===false){this.elModeToolbar.style.display="none"}}},showModeChanger:function(){if(this.isUseModeChanger()){this.elWYSIWYGButton.style.display="block";this.elHTMLSrcButton.style.display="block";this.elTEXTButton.style.display="block"}else{this.elWYSIWYGButton.style.display="none";this.elHTMLSrcButton.style.display="none";this.elTEXTButton.style.display="none"}},isUseModeChanger:function(){return(typeof(this.htConversionMode)==="undefined"||typeof(this.htConversionMode.bUseModeChanger)==="undefined"||this.htConversionMode.bUseModeChanger===true)?true:false},$ON_EVENT_CHANGE_EDITING_MODE_CLICKED:function(b,a){if(b=="TEXT"){var c=this.oApp.getIR();if(c.length>0&&!a){if(!confirm(this.oApp.$MSG("SE2M_EditingModeChanger.confirmTextMode"))){return false}}this.oApp.exec("CHANGE_EDITING_MODE",[b])}else{this.oApp.exec("CHANGE_EDITING_MODE",[b])}if("HTMLSrc"==b){this.oApp.exec("MSG_NOTIFY_CLICKCR",["htmlmode"])}else{if("TEXT"==b){this.oApp.exec("MSG_NOTIFY_CLICKCR",["textmode"])}else{this.oApp.exec("MSG_NOTIFY_CLICKCR",["editormode"])}}},$ON_DISABLE_ALL_UI:function(a){a=a||{};var b=jindo.$A(a.aExceptions||[]);if(b.has("mode_switcher")){return}if(this.oApp.getEditingMode()=="WYSIWYG"){this.welWYSIWYGButtonLi.removeClass("active");this.elHTMLSrcButton.disabled=true;this.elTEXTButton.disabled=true}else{if(this.oApp.getEditingMode()=="TEXT"){this.welTEXTButtonLi.removeClass("active");this.elWYSIWYGButton.disabled=true;this.elHTMLSrcButton.disabled=true}else{this.welHTMLSrcButtonLi.removeClass("active");this.elWYSIWYGButton.disabled=true;this.elTEXTButton.disabled=true}}},$ON_ENABLE_ALL_UI:function(){if(this.oApp.getEditingMode()=="WYSIWYG"){this.welWYSIWYGButtonLi.addClass("active");this.elHTMLSrcButton.disabled=false;this.elTEXTButton.disabled=false}else{if(this.oApp.getEditingMode()=="TEXT"){this.welTEXTButtonLi.addClass("active");this.elWYSIWYGButton.disabled=false;this.elHTMLSrcButton.disabled=false}else{this.welHTMLSrcButtonLi.addClass("active");this.elWYSIWYGButton.disabled=false;this.elTEXTButton.disabled=false}}},$ON_CHANGE_EDITING_MODE:function(a){if(a=="HTMLSrc"){this.welWYSIWYGButtonLi.removeClass("active");this.welHTMLSrcButtonLi.addClass("active");this.welTEXTButtonLi.removeClass("active");this.elWYSIWYGButton.disabled=false;this.elHTMLSrcButton.disabled=true;this.elTEXTButton.disabled=false;this.oApp.exec("HIDE_ALL_DIALOG_LAYER");this.oApp.exec("DISABLE_ALL_UI",[{aExceptions:["mode_switcher"]}])}else{if(a=="TEXT"){this.welWYSIWYGButtonLi.removeClass("active");this.welHTMLSrcButtonLi.removeClass("active");this.welTEXTButtonLi.addClass("active");this.elWYSIWYGButton.disabled=false;this.elHTMLSrcButton.disabled=false;this.elTEXTButton.disabled=true;this.oApp.exec("HIDE_ALL_DIALOG_LAYER");this.oApp.exec("DISABLE_ALL_UI",[{aExceptions:["mode_switcher"]}])}else{this.welWYSIWYGButtonLi.addClass("active");this.welHTMLSrcButtonLi.removeClass("active");this.welTEXTButtonLi.removeClass("active");this.elWYSIWYGButton.disabled=true;this.elHTMLSrcButton.disabled=false;this.elTEXTButton.disabled=false;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 b=document.createElement("IFRAME");b.style.display="none";document.body.appendChild(b);var a=b.contentWindow.document;a.open();a.write("");a.close();this._oTmpDoc=a}return this._oTmpDoc},_getCSSStyleRule:function(b){var a={};for(var d=0,c;(c=b[d]);d++){if(c.type===CSSRule.STYLE_RULE){a[c.selectorText]=c.style}}return a},_extractStyle:function(e){if(!e){return}var b=e.match(this._rxStyleTag)||[];var f=b.join("\n");f=f.replace(this._rxStyleTagStrip,"");var d=this._getTmpDocument();var a=d.getElementsByTagName("HEAD")[0];var c=d.createElement("STYLE");c.innerHTML=f;a.appendChild(c);this._htStyleRule=this._getCSSStyleRule(c.sheet.cssRules);c.parentNode.removeChild(c)},_applyInlineStyle:function(f,c,d){for(var e=0,b=c.length,a;e=9&&g.nativeVersion<=11)&&(g.version>=9&&g.version<=11))||(this.oApp.oAgent.os().winxp&&g.ie&&g.nativeVersion<=8)||g.edge){var f=this.oApp.getSelection();var e=f.commonAncestorContainer;var b=nhn.husky.SE2M_Utils.findAncestorByTagNameWithCount("BLOCKQUOTE",e);a=b.elNode;if(a){var d=nhn.husky.SE2M_Utils.findClosestAncestorAmongTagNamesWithCount(["td","th"],e);if(d.elNode){if(d.nRecursiveCount>b.nRecursiveCount){c=true}}else{c=true}}}if(c){this._insertDummyParagraph_IE(a)}},_insertDummyParagraph_IE:function(a){this._elDummyParagraph=document.createElement("P");a.appendChild(this._elDummyParagraph)},_removeDummyParagraph_IE:function(){if(this._elDummyParagraph&&this._elDummyParagraph.parentNode){this._elDummyParagraph.parentNode.removeChild(this._elDummyParagraph)}},$ON_EXECCOMMAND:function(c,m,j){var f=false;var b={};var e=this.oApp.getSelection();m=(m==""||m)?m:false;j=(j==""||j)?j:false;this.oApp.exec("IS_SELECTED_TD_BLOCK",["bIsSelectedTd",b]);f=b.bIsSelectedTd;if(f){if(c=="indent"){this.oApp.exec("SET_LINE_BLOCK_STYLE",[null,jindo.$Fn(this._indentMargin,this).bind()])}else{if(c=="outdent"){this.oApp.exec("SET_LINE_BLOCK_STYLE",[null,jindo.$Fn(this._outdentMargin,this).bind()])}else{this._setBlockExecCommand(c,m,j)}}}else{switch(c){case"indent":case"outdent":this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",[c]);var d=e.placeStringBookmark();if(c==="indent"){this.oApp.exec("SET_LINE_STYLE",[null,jindo.$Fn(this._indentMargin,this).bind(),{bDoNotSelect:true,bDontAddUndoHistory:true}])}else{this.oApp.exec("SET_LINE_STYLE",[null,jindo.$Fn(this._outdentMargin,this).bind(),{bDoNotSelect:true,bDontAddUndoHistory:true}])}e.moveToStringBookmark(d);e.select();e.removeStringBookmark(d);setTimeout(jindo.$Fn(function(n){this.oApp.exec("RECORD_UNDO_AFTER_ACTION",[n])},this).bind(c),25);break;case"justifyleft":case"justifycenter":case"justifyright":case"justifyfull":var l=this._extendBlock();this.oEditingArea.execCommand(c,m,j);if(!!l){l.select()}if(this.oNavigator.ie){this._removeElementAlign("table")}break;default:if(e.collapsed&&this._rxCmdInline.test(c)){var h=e.placeStringBookmark(),k=e.getStringBookmark(h),a=k.previousSibling;if(!a||a.nodeValue!=="\u200B"){a=this.oApp.getWYSIWYGDocument().createTextNode("\u200B");e.insertNode(a)}e.removeStringBookmark(h);e.selectNodeContents(a);e.select();this.oEditingArea.execCommand(c,m,j);e.collapseToEnd();e.select();var g=this._findSingleNode(a);if(g&&e._hasCursorHolderOnly(g.nextSibling)){g.parentNode.removeChild(g.nextSibling)}}else{this.oEditingArea.execCommand(c,m,j)}}}this._countClickCr(c)},_findSingleNode:function(a){if(!a){return null}if(a.parentNode.childNodes.length===1){return this._findSingleNode(a.parentNode)}else{return a}},$AFTER_EXECCOMMAND:function(d,a,c,b){if(this.elP1&&this.elP1.parentNode){this.elP1.parentNode.removeChild(this.elP1)}if(this.elP2&&this.elP2.parentNode){this.elP2.parentNode.removeChild(this.elP2)}if(/^insertorderedlist|insertunorderedlist$/i.test(d)){this._removeDummyParagraph_IE();this._fixCorruptedBlockQuote(d==="insertorderedlist"?"OL":"UL");if(this.oNavigator.bGalaxyBrowser){this._removeBlockQuote()}}if((/^justify*/i.test(d))){this._fixAlign(d==="justifyfull"?"justify":d.substring(7))}if(d=="indent"||d=="outdent"){if(!b){b={}}b.bDontAddUndoHistory=true}if((!b||!b.bDontAddUndoHistory)&&!this._bOnlyCursorChanged){this.oApp.exec("RECORD_UNDO_AFTER_ACTION",[d,this.oUndoOption])}this.oApp.exec("CHECK_STYLE_CHANGE",[])},_removeElementAlign:function(c){var e=this.oApp.getSelection(),a=e.getNodes(),b=null,g=new RegExp("^"+c+"$","i");for(var d=0,f=a.length;d=0;b--){if(c.indexOf(this.aBRs[b])<0){this.aBRs[b].parentNode.removeChild(this.aBRs[b])}}},_setBlockExecCommand:function(h,d,g){var b,a,f={};this.oSelection=this.oApp.getSelection();this.oApp.exec("GET_SELECTED_TD_BLOCK",["aTdCells",f]);b=f.aTdCells;for(var e=0;e 

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

 

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

 

",this.oApp.getWYSIWYGDocument());b.parentNode.insertBefore(this.elP1,b.nextSibling)}if(a&&a.tagName==="BLOCKQUOTE"){this.elP1=jindo.$("

 

",this.oApp.getWYSIWYGDocument());a.parentNode.insertBefore(this.elP1,a)}}},_fixCorruptedBlockQuote:function(c){var j=this.oApp.getWYSIWYGDocument().getElementsByTagName(c),h,e,l,f,g,k,a,b,d;for(g=0,k=j.length;g8){this._sCursorHolder="\u2060";this.$ON_REGISTER_CONVERTERS=function(){var b=/\u2060/g;this.oApp.exec("ADD_CONVERTER",["WYSIWYG_TO_IR",jindo.$Fn(function(c){return c.replace(b,"\uFEFF")},this).bind()])}}},$PRECONDITION:function(a,b){return(this.oApp.getEditingMode()=="WYSIWYG")},$ON_SET_WYSIWYG_STYLE:function(c){var b=this.oApp.getSelection();var y={};this.oApp.exec("IS_SELECTED_TD_BLOCK",["bIsSelectedTd",y]);var g=y.bIsSelectedTd;if(b.collapsed&&!g){this.oApp.exec("RECORD_UNDO_ACTION",["FONT STYLE",{bMustBlockElement:true}]);var m,r=false;var d=b.commonAncestorContainer;if(d.nodeType==3){d=d.parentNode}if(d&&b._rxCursorHolder.test(d.innerHTML)){m=b._findParentSingleSpan(d)}if(!m){m=this.oApp.getWYSIWYGDocument().createElement("SPAN");m.innerHTML=this._sCursorHolder;r=true}else{if(m.innerHTML==""){m.innerHTML=this._sCursorHolder}}var a;for(var f in c){a=c[f];if(typeof a!="string"){continue}m.style[f]=a}if(r){if(b.startContainer.tagName=="BODY"&&b.startOffset===0){var o=b._getVeryFirstRealChild(this.oApp.getWYSIWYGDocument().body);var h=true;var q=o.cloneNode(false);try{q.innerHTML="test";if(q.innerHTML!="test"){h=false}}catch(w){h=false}if(h&&q.nodeType==1&&q.tagName=="BR"){b.selectNode(o);b.collapseToStart();b.insertNode(m)}else{if(h&&o.tagName!="IFRAME"&&o.appendChild&&typeof o.innerHTML=="string"){o.appendChild(m)}else{b.selectNode(o);b.collapseToStart();b.insertNode(m)}}}else{b.collapseToStart();b.insertNode(m)}}else{b=this.oApp.getEmptySelection()}if(!!c.color){b._checkTextDecoration(m)}b.selectNodeContents(r?m:d);b.collapseToEnd();b._window.focus();b._window.document.body.focus();b.select();return}this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["FONT STYLE",{bMustBlockElement:true}]);if(g){var s;this.oApp.exec("GET_SELECTED_TD_BLOCK",["aTdCells",y]);s=y.aTdCells;for(var t=0;t=33&&b.keyCode<=40)||b.keyCode==45||b.keyCode==46)){return}if(b.shift&&b.keyCode===35){this.oApp.exec("RESET_STYLE_STATUS");this.bAllSelected=true;return}if(this.bAllSelected){if(this.oApp.oNavigator.firefox){return}this.bAllSelected=false;return}this.oApp.exec("CHECK_STYLE_CHANGE")},$ON_CHECK_STYLE_CHANGE:function(){this._getStyle()},$ON_RESET_STYLE_STATUS:function(){this.oStyle=this._getBlankStyle();var a=this._getStyleOf(this.oApp.getWYSIWYGDocument().body);this.oStyle.fontFamily=a.fontFamily;this.oStyle.fontSize=a.fontSize;this.oStyle.justifyleft="@^";for(var b in this.oStyle){this.oApp.exec("MSG_STYLE_CHANGED",[b,this.oStyle[b]])}},getCurrentStyle:function(){return this.oStyle},_check_style_change:function(){this.oApp.exec("CHECK_STYLE_CHANGE",[])},_getBlankStyle:function(){var a={};for(var b in this.oStyleMap){if(this.oStyleMap[b].type=="Value"){a[b]=""}else{a[b]=0}}return a},_getStyle:function(){var a;if(nhn.CurrentSelection.isCollapsed()){a=this._getStyleOf(nhn.CurrentSelection.getCommonAncestorContainer())}else{var c=this.oApp.getSelection();var b=function(e){if(!e.childNodes||e.childNodes.length==0){return true}else{return false}};var d=c.getNodes(false,b);if(d.length==0){a=this._getStyleOf(c.commonAncestorContainer)}else{a=this._getStyleOf(d[0])}}for(attributeName in a){if(this.oStyleMap[attributeName].converter){a[attributeName]=this.oStyleMap[attributeName].converter(a[attributeName],a)}if(this.oStyle[attributeName]!=a[attributeName]){if((typeof(document.body.currentStyle)!="object")&&(typeof(getComputedStyle)=="function")){if((attributeName=="fontSize")&&(this.oStyle.fontFamily!=a.fontFamily)){continue}}this.oApp.exec("MSG_STYLE_CHANGED",[attributeName,a[attributeName]])}}this.oStyle=a},_getStyleOf:function(g){var a=this._getBlankStyle();if(!g){return a}if(g.nodeType==3){g=g.parentNode}else{if(g.nodeType==9){g=g.body}}var f=jindo.$Element(g);var c,j;for(var b in this.oStyle){c=this.oStyleMap[b];if(c.type&&c.type=="Value"){try{if(c.css){var h=f.css(c.css);if(b=="fontFamily"){h=h.split(/,/)[0]}a[b]=h}else{if(c.command){a[b]=this.oDocument.queryCommandState(c.command)}else{}}}catch(d){}}else{if(c.command){try{if(this.oDocument.queryCommandState(c.command)){a[b]="@^"}else{a[b]="@-"}}catch(d){}}else{}}}switch(a.textAlign){case"left":a.justifyleft="@^";break;case"center":a.justifycenter="@^";break;case"right":a.justifyright="@^";break;case"justify":a.justifyfull="@^";break}if(a.justifyleft=="@-"&&a.justifycenter=="@-"&&a.justifyright=="@-"&&a.justifyfull=="@-"){a.justifyleft="@^"}return a}});nhn.husky.SE2M_FontSizeWithLayerUI=jindo.$Class({name:"SE2M_FontSizeWithLayerUI",$init:function(a){this._assignHTMLElements(a)},_assignHTMLElements:function(a){this.oDropdownLayer=jindo.$$.getSingle("DIV.husky_se_fontSize_layer",a);this.elFontSizeLabel=jindo.$$.getSingle("SPAN.husky_se2m_current_fontSize",a);this.aLIFontSizes=jindo.$A(jindo.$$("LI",this.oDropdownLayer)).filter(function(c,d,b){return(c.firstChild!=null)})._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 a=0;a0){a=c*72/96+"pt"}else{a=this.sDefaultText}}if(this._rxPT.test(a)){var c=parseFloat(a.replace(this._rxPT,""));var f=Math.floor(c);var b=c-f;if(b>=0&&b<0.25){c=f+0}else{if(b>=0.25&&b<0.75){c=f+0.5}else{c=f+1}}a=c+"pt"}if(!a){a=this.sDefaultText}var d=this._getMatchingLI(a);this._clearFontSizeSelection();if(d){this.elFontSizeLabel.innerHTML=a;jindo.$Element(d).addClass("active")}else{this.elFontSizeLabel.innerHTML=a}}},$ON_SET_FONTSIZE:function(a){if(!a){return}this.oApp.exec("SET_WYSIWYG_STYLE",[{fontSize:a}]);this.oApp.exec("HIDE_ACTIVE_LAYER",[]);this.oApp.exec("CHECK_STYLE_CHANGE",[])},_getMatchingLI:function(c){var b;c=c.toLowerCase();for(var a=0;a0){var m=nhn.husky.SE2M_Utils.findAncestorByTagName("TD",o);var p=nhn.husky.SE2M_Utils.findAncestorByTagName("TD",n);o=(m||!o)?l[0].firstChild:o;n=(p||!n)?l[l.length-1].lastChild:n}this.oSelection.setEndNodes(o,n);this.oSelection.select();this.oApp.exec("CHECK_STYLE_CHANGE",[])},this).bind(a,c),0);return h},setLineStyle:function(m,o,l,a){thisRef=this;var p=false;function h(t,q,r){if(!t){p=true;try{t=thisRef.oSelection.surroundContentsWithNewNode("P")}catch(s){t=thisRef.oSelection.surroundContentsWithNewNode("DIV")}}if(typeof r=="function"){r(t)}else{t.style[q]=r}if(t.childNodes.length===0){t.innerHTML=" "}return t}function b(e){while(e&&e.tagName!="BODY"){e=nhn.DOMFix.parentNode(e)}if(!e){return false}return true}if(a.length===0){return}var k,n;var d=a.length;if((!l||!l.bDontAddUndoHistory)){this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["LINE STYLE"])}n=this._getLineWrapper(a[0]);n=h(n,m,o);var c=n;var g=n;for(var f=1;f0){return[a[0].firstChild,a[a.length-1].lastChild]}this.oSelection.selectNode(this.oSelection.commonAncestorContainer)}var b=this.getTextNodes(false,this.oSelection);if(b.length===0){var c=this.oSelection.getStartNode();if(c){b[0]=c}else{var e=this.oSelection._document.createTextNode("\u00A0");this.oSelection.insertNode(e);b=[e]}}return b},_getWrapperLineStyle:function(b,c){var a=null;if(c&&c.style[b]){a=c.style[b]}else{c=this.oSelection.commonAncesterContainer;while(c&&!this.oSelection.rxLineBreaker.test(c.tagName)){if(c&&c.style[b]){a=c.style[b];break}c=nhn.DOMFix.parentNode(c)}}return a},_isChildOf:function(b,a){while(b&&b.tagName!="BODY"){if(b==a){return true}b=nhn.DOMFix.parentNode(b)}return false},_getLineWrapper:function(d){var k=this.oApp.getEmptySelection();k.selectNode(d);var m=k.getLineInfo();var l=m.oStart;var f=m.oEnd;var j,h;var g,e;var c=null;j=l.oNode;g=l.oLineBreaker;h=f.oNode;e=f.oLineBreaker;this.oSelection.setEndNodes(j,h);if(g==e){if(g.tagName=="P"||g.tagName=="DIV"||g.tagName=="LI"){c=g}else{this.oSelection.setEndNodes(g.firstChild,g.lastChild)}}return c}});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:false,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(a){this.elAppContainer=a},$ON_MSG_APP_READY:function(){},_assignHTMLElements:function(b){var a=nhn.husky.SE2M_Configuration.SE2M_ColorPalette;if(a){this.bUseRecentColor=a.bUseRecentColor||false;this.URL_COLOR_ADD=a.addColorURL||"http://api.se2.naver.com/1/colortable/TextAdd.nhn";this.URL_COLOR_UPDATE=a.updateColorURL||"http://api.se2.naver.com/1/colortable/TextUpdate.nhn";this.URL_COLOR_LIST=a.colorListURL||"http://api.se2.naver.com/1/colortable/TextList.nhn"}this.elColorPaletteLayer=jindo.$$.getSingle("DIV.husky_se2m_color_palette",b);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",b);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);if(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);if(this.elDummyNode){jindo.$Element(jindo.$$.getSingle("ul.se2_pick_color > li",this.elColorPaletteLayerRecent)).leave()}if(this.bUseRecentColor){this._ajaxRecentColor(this._ajaxRecentColorCallback)}this.oApp.registerBrowserEvent(this.elColorPaletteLayer,"click","EVENT_CLICK_COLOR_PALETTE");if(!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(b){var a=b.element;while(a&&a.tagName&&a.tagName.toLowerCase()!="li"){a=a.parentNode}if(!a||!a.nodeType||a.nodeType==9){return}if(a.className==""||(!a.className)||typeof(a.className)=="undefined"){jindo.$Element(a).addClass("hover")}},$ON_EVENT_MOUSEOUT_COLOR_PALETTE:function(b){var a=b.element;while(a&&a.tagName&&a.tagName.toLowerCase()!="li"){a=a.parentNode}if(!a){return}if(a.className=="hover"){jindo.$Element(a).removeClass("hover")}},$ON_EVENT_CLICK_COLOR_PALETTE:function(b){var a=b.element;while(a.tagName=="SPAN"){a=a.parentNode}if(a.tagName&&a.tagName=="BUTTON"){if(a==this.elMoreBtn){this.oApp.exec("TOGGLE_COLOR_PICKER");return}this.oApp.exec("APPLY_COLOR",[a])}},$ON_APPLY_COLOR:function(a){var c=this.elInputColorCode.value,b=null;if(c.indexOf("#")==-1){c="#"+c;this.elInputColorCode.value=c}if(a==this.elOkBtn){if(!this._verifyColorCode(c)){this.elInputColorCode.value="";alert(this.oApp.$MSG("SE_Color.invalidColorCode"));this.elInputColorCode.focus();return}this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[c,true]);return}b=jindo.$Element(a.parentNode.parentNode.parentNode);c=a.title;if(b.hasClass("husky_se2m_color_palette")){this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[c,false])}else{if(b.hasClass("husky_se2m_color_palette_recent")){this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[c,true])}}},$ON_RESET_COLOR_PALETTE:function(){this._initColor()},$ON_TOGGLE_COLOR_PICKER:function(){if(this.elColorPaletteLayerColorPicker.style.display=="none"){this.oApp.exec("SHOW_COLOR_PICKER")}else{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 a=jindo.$Fn(function(b){this.elPreview.style.backgroundColor=b.hexColor;this.elInputColorCode.value=b.hexColor},this).bind();this.cpp.attach("colorchange",a);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(b,a){this.sCallbackCmd=b;this.oLayerContainer=a;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(b,a){a=(!a)?false:a;b=this._getHexColorCode(b);if(this.bUseRecentColor&&!!a){this.oApp.exec("ADD_RECENT_COLOR",[b])}this.oApp.exec(this.sCallbackCmd,[b])},$ON_EVENT_MOUSEUP_COLOR_PALETTE:function(a){var b=a.element;if(!b.style.backgroundColor){return}this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[b.style.backgroundColor,false])},$ON_ADD_RECENT_COLOR:function(a){var b=(this.aRecentColor.length===0);this._addRecentColor(a);if(b){this._ajaxAddColor()}else{this._ajaxUpdateColor()}this._redrawRecentColorElement()},_verifyColorCode:function(a){return this.rxColorPattern.test(a)},_getHexColorCode:function(e){if(this.rxRGBColorPattern.test(e)){var a=function(f){var g=parseInt(f,10).toString(16);if(g.length<2){g="0"+g}return g.toUpperCase()};var c=a(RegExp.$1);var b=a(RegExp.$2);var d=a(RegExp.$3);e="#"+c+b+d}return e},_addRecentColor:function(a){var b=jindo.$A(this.aRecentColor);b=b.refuse(a);b.unshift(a);if(b.length()>this.nLimitRecentColor){b.length(this.nLimitRecentColor)}this.aRecentColor=b.$value()},_redrawRecentColorElement:function(){var a=[],c=this.aRecentColor.length,b;if(c===0){return}for(b=0;bthis.nLimitRecentColor){d.length(this.nLimitRecentColor)}b=d.reverse().$value();for(a=0,c=b.length;a'+e+""}else{b=''+e+""}return d+b},$BEFORE_MSG_APP_READY:function(){var a=nhn.husky.SE2M_Configuration.SE2M_Hyperlink;if(a&&a.bAutolink===false){this.$ON_REGISTER_CONVERTERS=null;this.$ON_DISABLE_MESSAGE=null;this.$ON_ENABLE_MESSAGE=null;try{this.oApp.getWYSIWYGDocument().execCommand("AutoUrlDetect",false,false)}catch(b){}}},$ON_MSG_APP_READY:function(){this.bLayerShown=false;if(jindo.$Agent().os().mac){this.oApp.exec("REGISTER_HOTKEY",["meta+k","TOGGLE_HYPERLINK_LAYER",[]])}else{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(a){if(!!a.match(/(REGISTER_CONVERTERS)/)){this.oApp.acceptLocalBeforeFirstAgain(this,true);return true}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");this.oApp.registerBrowserEvent(this.oLinkInput,"keydown","EVENT_HYPERLINK_KEYDOWN")},$ON_EVENT_HYPERLINK_KEYDOWN:function(a){if(a.key().enter){this.oApp.exec("APPLY_HYPERLINK");a.stop()}},$ON_DISABLE_MESSAGE:function(b){if(b!=="TOGGLE_HYPERLINK_LAYER"){return}try{this.oApp.getWYSIWYGDocument().execCommand("AutoUrlDetect",false,false)}catch(a){}this._bDisabled=true},$ON_ENABLE_MESSAGE:function(b){if(b!=="TOGGLE_HYPERLINK_LAYER"){return}try{this.oApp.getWYSIWYGDocument().execCommand("AutoUrlDetect",false,true)}catch(a){}this._bDisabled=false},irToDb:function(k){if(this._bDisabled){return}var o=k.cloneNode(true);try{o.innerHTML}catch(s){o=jindo.$(k.outerHTML)}var g=this.oApp.getEmptySelection();var p=g._getFirstRealChild(o);var q=g._getLastRealChild(o);var n=jindo.$A(g._getNodesBetween(p,q));var d=n.filter(function(a){return(a&&a.nodeType===3)}).$value();var t=d;var h=d;var u=this.oApp.getWYSIWYGDocument().createElement("DIV");var j,l;var b="@"+(new Date()).getTime()+"@";var c=new RegExp(b,"g");for(var r=0,m=d.length;r0){for(c=0,nLen=this.aAdditionalFontList.length;c-1){if(a){a.style.display=e?"block":"none"}a=b;e=false}else{b.style.display="none"}}}if(a){a.style.display=e?"block":"none"}},_attachIEEvent:function(){if(!this.htBrowser.ie){return}if(this.htBrowser.nativeVersion<9){this._wfOnPasteWYSIWYGBody=jindo.$Fn(this._onPasteWYSIWYGBody,this);this._wfOnPasteWYSIWYGBody.attach(this.oApp.getWYSIWYGDocument().body,"paste");return}if(document.documentMode<9){this._wfOnFocusWYSIWYGBody=jindo.$Fn(this._onFocusWYSIWYGBody,this);this._wfOnFocusWYSIWYGBody.attach(this.oApp.getWYSIWYGDocument().body,"focus");return}this.welEditingAreaCover=jindo.$Element('
    ');this.oApp.welEditingAreaContainer.prepend(this.welEditingAreaCover);jindo.$Fn(this._onMouseupCover,this).attach(this.welEditingAreaCover.$value(),"mouseup")},_onFocusWYSIWYGBody:function(a){this._wfOnFocusWYSIWYGBody.detach(this.oApp.getWYSIWYGDocument().body,"focus");this._loadAllBaseFont()},_onPasteWYSIWYGBody:function(a){this._wfOnPasteWYSIWYGBody.detach(this.oApp.getWYSIWYGDocument().body,"paste");this._loadAllBaseFont()},_onMouseupCover:function(f){f.stop();if(this.welEditingAreaCover){this.welEditingAreaCover.leave()}var g=f.mouse(),c=this.oApp.getWYSIWYGDocument().body,a=jindo.$Element(c),b=this.oApp.getEmptySelection();b.selectNode(c);b.collapseToStart();b.select();a.fireEvent("mousedown",{left:g.left,middle:g.middle,right:g.right});a.fireEvent("mouseup",{left:g.left,middle:g.middle,right:g.right});if(this.oApp.oNavigator.ie&&document.documentMode<11&&this.oApp.getEditingMode()==="WYSIWYG"){if(this.oApp.getWYSIWYGDocument().body.innerHTML=="

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

    ';var b=this.oApp.getSelection();b.moveToStringBookmark("INIT");b.select();b.removeStringBookmark("INIT")}}else{if(this.oApp.oNavigator.ie&&this.oApp.oNavigator.nativeVersion==11&&document.documentMode==11&&this.oApp.getEditingMode()==="WYSIWYG"){if(this.oApp.getWYSIWYGDocument().body.innerHTML=="


    "){var d=jindo.$$.getSingle("br",c);b.setStartBefore(d);b.setEndBefore(d);b.select()}}}},$ON_EVENT_TOOLBAR_MOUSEDOWN:function(){if(this.htBrowser.nativeVersion<9||document.documentMode<9){return}if(this.welEditingAreaCover){this.welEditingAreaCover.leave()}},_loadAllBaseFont:function(){var b,a;if(!this.htBrowser.ie){return}if(this.htBrowser.nativeVersion<9){for(b=0,a=this.aBaseFontList.length;b20){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(a){var b=this._findLI(a.element);if(!b){return}this._clearLastHover();b.className="hover";this.elLastHover=b},$ON_EVENT_FONTNAME_LAYER_CLICKED:function(b){var e=this._findLI(b.element);if(!e){return}var c=this._getFontFamilyFromLI(e);var d=this.htAllFonts[c.replace(/\"/g,nhn.husky.SE2M_FontNameWithLayerUI.CUSTOM_FONT_MARKS)];var a;if(d){a=d.defaultSize+"pt"}else{a=0}this.oApp.exec("SET_FONTFAMILY",[c,a])},_findLI:function(a){while(a.tagName!="LI"){if(!a||a===this.oDropdownLayer){return null}a=a.parentNode}if(a.className.indexOf(this.FONT_SEPARATOR)>-1){return null}return a},_clearLastHover:function(){if(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(d,a){if(d=="fontFamily"){a=a.replace(/["']/g,"");var b=this._getMatchingLI(a);this._clearFontNameSelection();if(b){this.elFontNameLabel.innerHTML=this._getFontNameLabelFromLI(b);jindo.$Element(b).addClass("active")}else{var c=this.sDefaultText;this.elFontNameLabel.innerHTML=c}}},$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(c,b){if(!c){return}var a=this.htAllFonts[c.replace(/\"/g,nhn.husky.SE2M_FontNameWithLayerUI.CUSTOM_FONT_MARKS)];if(!!a){a.loadCSS(this.oApp.getWYSIWYGDocument())}this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["SET FONTFAMILY",{bMustBlockElement:true}]);this.bDoNotRecordUndo=true;if(parseInt(b,10)>0){this.oApp.exec("SET_WYSIWYG_STYLE",[{fontSize:b}])}this.oApp.exec("SET_WYSIWYG_STYLE",[{fontFamily:c}]);this.bDoNotRecordUndo=false;this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["SET FONTFAMILY",{bMustBlockElement:true}]);this.oApp.exec("HIDE_ACTIVE_LAYER",[]);this.oApp.exec("CHECK_STYLE_CHANGE",[])},_getMatchingLI:function(e){e=e.toLowerCase();var c,a;for(var b=0;b0){f=d+"_"+k;a=b+"_"+k}else{f=d;a=b}if(!h){f=nhn.husky.SE2M_FontNameWithLayerUI.CUSTOM_FONT_MARKS+f+nhn.husky.SE2M_FontNameWithLayerUI.CUSTOM_FONT_MARKS}if(this.htAllFonts[f]){return this.htAllFonts[f]}this.htAllFonts[f]=j;if(this.htBrowser.ie&&this.htBrowser.nativeVersion>=9&&document.documentMode>=9){j.loadCSSToMenu()}this.htFamilyName2DisplayName[f]=b;g=g||this.oApp.$MSG("SE2M_FontNameWithLayerUI.sSampleText");this._addFontToMenu(a,f,g);if(!h){this.aBaseFontList[this.aBaseFontList.length]=j}else{if(h==1){this.aDefaultFontList[this.aDefaultFontList.length]=j}else{this.aTempSavedFontList[this.aTempSavedFontList.length]=j}}return j},addFontInUse:function(c,d,g,e,b,f){var a=this.addFont(c,d,g,e,b,f);if(!a){return null}a.loadCSS(this.oApp.getWYSIWYGDocument());return a},setMainFont:function(c,d,g,e,b,f){var a=this.addFontInUse(c,d,g,e,b,f);if(!a){return null}this.setDefaultFont(a.fontFamily,g);return a},setDefaultFont:function(a,c){var b=this.oApp.getWYSIWYGDocument().body;b.style.fontFamily=a;if(c>0){b.style.fontSize=c+"pt"}}});nhn.husky.SE2M_FontNameWithLayerUI.CUSTOM_FONT_MARKS="'";function fontProperty(b,c,e,d,a){this.fontId=b;this.fontName=c;this.defaultSize=e;this.fontURL=d;this.fontCSSURL=a;this.displayName=c;this.isLoaded=true;this.fontFamily=this.fontId;if(this.fontCSSURL!=""){this.displayName+=""+e;this.fontFamily+="_"+e;this.isLoaded=false;this.loadCSS=function(f){if(this.isLoaded){return}this._importCSS(f);this.isLoaded=true};this.loadCSSToMenu=function(){this._importCSS(document)};this._importCSS=function(h){var g=h.styleSheets.length;var f=h.styleSheets[g-1];if(g===0||f.imports.length>30){f=h.createElement("style");h.documentElement.firstChild.appendChild(f);f=f.sheet||f.styleSheet}f.addImport(this.fontCSSURL)}}else{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}}}nhn.ColorPicker=jindo.$Class({elem:null,huePanel:null,canvasType:"Canvas",_hsvColor:null,$init:function(c,b){this.elem=jindo.$Element(c).empty();this.huePanel=null;this.cursor=jindo.$Element("
    ").css("overflow","hidden");this.canvasType=jindo.$(c).filters?"Filter":jindo.$("").getContext?"Canvas":null;if(!this.canvasType){return false}this.option({huePanel:null,huePanelType:"horizontal"});this.option(b);if(this.option("huePanel")){this.huePanel=jindo.$Element(this.option("huePanel")).empty()}this._hsvColor=this._hsv(0,100,100);for(var a in this){if(/^_on[A-Z][a-z]+[A-Z][a-z]+$/.test(a)){this[a+"Fn"]=jindo.$Fn(this[a],this)}}this._onDownColorFn.attach(this.elem,"mousedown");if(this.huePanel){this._onDownHueFn.attach(this.huePanel,"mousedown")}this.paint()},rgb:function(a){this.hsv(this._rgb2hsv(a.r,a.g,a.b))},hsv:function(d){if(typeof d=="undefined"){return this._hsvColor}var f=null;var k=this.elem.width();var c=this.elem.height();var b=this.cursor.width();var a=this.cursor.height();var j=0,g=0;if(this.huePanel){f=this._hsv2rgb(d.h,100,100);this.elem.css("background","#"+this._rgb2hex(f.r,f.g,f.b));j=d.s/100*k;g=(100-d.v)/100*c}else{var e=k/2;if(d.v>d.s){d.v=100;j=d.s/100*e}else{d.s=100;j=(100-d.v)/100*e+e}g=d.h/360*c}j=Math.max(Math.min(j-1,k-b),1);g=Math.max(Math.min(g-1,c-a),1);this.cursor.css({left:j+"px",top:g+"px"});this._hsvColor=d;f=this._hsv2rgb(d.h,d.s,d.v);this.fireEvent("colorchange",{type:"colorchange",element:this,currentElement:this,rgbColor:f,hexColor:"#"+this._rgb2hex(f.r,f.g,f.b),hsvColor:d})},paint:function(){if(this.huePanel){this["_paintColWith"+this.canvasType]();this["_paintHueWith"+this.canvasType]()}else{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 b=e.attr("width",e.width()).attr("height",e.height()).$value().getContext("2d");var d=null;var a=e.width();var c=e.height();d=b.createLinearGradient(0,0,a,0);d.addColorStop(0,"rgba(255,255,255,1)");d.addColorStop(1,"rgba(255,255,255,0)");b.fillStyle=d;b.fillRect(0,0,a,c);d=b.createLinearGradient(0,0,0,c);d.addColorStop(0,"rgba(0,0,0,0)");d.addColorStop(1,"rgba(0,0,0,1)");b.fillStyle=d;b.fillRect(0,0,a,c)},_paintOneWithFilter:function(){var g,b,a,f,d,j;var e=this.elem.height();for(var c=1;c<7;c++){g=Math.floor((c-1)/6*e);b=Math.floor(c/6*e);a=this._hsv2rgb((c-1)/6*360,100,100);f=this._hsv2rgb(c/6*360,100,100);d="#FF"+this._rgb2hex(a.r,a.g,a.b);j="#FF"+this._rgb2hex(f.r,f.g,f.b);jindo.$Element("
    ").css({position:"absolute",left:0,width:"100%",top:g+"px",height:(b-g)+"px",filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='"+d+"',EndColorStr='"+j+"')"}).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 c={r:0,g:0,b:0};var g=jindo.$Element("").css({width:"100%",height:"100%"});g.appendTo(this.elem.empty());var b=g.attr("width",g.width()).attr("height",g.height()).$value().getContext("2d");var a=g.width();var e=g.height();var f=b.createLinearGradient(0,0,0,e);for(var d=0;d<7;d++){c=this._hsv2rgb(d/6*360,100,100);f.addColorStop(d/6,"rgb("+c.join(",")+")")}b.fillStyle=f;b.fillRect(0,0,a,e);f=b.createLinearGradient(0,0,a,0);f.addColorStop(0,"rgba(255,255,255,1)");f.addColorStop(0.5,"rgba(255,255,255,0)");f.addColorStop(0.5,"rgba(0,0,0,0)");f.addColorStop(1,"rgba(0,0,0,1)");b.fillStyle=f;b.fillRect(0,0,a,e)},_paintHueWithFilter:function(){var b,o,n,c,j,l;var k=(this.option().huePanelType=="vertical");var m=this.huePanel.width();var g=this.huePanel.height();var d=null;var f=parseInt(this.huePanel.css("borderWidth"),10);if(!!isNaN(f)){f=0}m-=f*2;for(var e=1;e<7;e++){b=Math.floor((e-1)/6*(k?g:m));o=Math.floor(e/6*(k?g:m));n=this._hsv2rgb((e-1)/6*360,100,100);c=this._hsv2rgb(e/6*360,100,100);j="#FF"+this._rgb2hex(n.r,n.g,n.b);l="#FF"+this._rgb2hex(c.r,c.g,c.b);d=jindo.$Element("
    ").css({position:"absolute",filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType="+(k?0:1)+",StartColorStr='"+j+"',EndColorStr='"+l+"')"});var a=(o-b)+1;d.appendTo(this.huePanel);d.css(k?"left":"top",0).css(k?"width":"height","100%");d.css(k?"top":"left",b+"px").css(k?"height":"width",a+"px")}},_paintHueWithCanvas:function(){var e=this.option(),c;var b=(e.huePanelType=="vertical");var g=jindo.$Element("").css({width:"100%",height:"100%"});g.appendTo(this.huePanel.empty());var a=g.attr("width",g.width()).attr("height",g.height()).$value().getContext("2d");var f=a.createLinearGradient(0,0,b?0:g.width(),b?g.height():0);for(var d=0;d<7;d++){c=this._hsv2rgb(d/6*360,100,100);f.addColorStop(d/6,"rgb("+c.join(",")+")")}a.fillStyle=f;a.fillRect(0,0,g.width(),g.height())},_rgb2hsv:function(k,j,a){var f=0,e=0,c=Math.max(k,j,a),d=Math.min(k,j,a),l=c-d;e=(c?l/c:0);if(e){if(k==c){f=60*(j-a)/l}else{if(j==c){f=120+60*(a-k)/l}else{if(a==c){f=240+60*(k-j)/l}}}if(f<0){f+=360}}f=Math.floor(f);e=Math.floor(e*100);c=Math.floor(c/255*100);return this._hsv(f,e,c)},_hsv2rgb:function(j,u,n){j=(j%360)/60;u/=100;n/=100;var a=0,k=0,m=0;var e=Math.floor(j);var l=j-e;var d=n*(1-u);var c=n*(1-u*l);var o=n*(1-u*(1-l));switch(e){case 0:a=n;k=o;m=d;break;case 1:a=c;k=n;m=d;break;case 2:a=d;k=n;m=o;break;case 3:a=d;k=c;m=n;break;case 4:a=o;k=d;m=n;break;case 5:a=n;k=d;m=c;break;case 6:break}a=Math.floor(a*255);k=Math.floor(k*255);m=Math.floor(m*255);return this._rgb(a,k,m)},_rgb2hex:function(d,c,a){d=d.toString(16);if(d.length==1){d="0"+d}c=c.toString(16);if(c.length==1){c="0"+c}a=a.toString(16);if(a.length==1){a="0"+a}return d+c+a},_hex2rgb:function(b){var a=b.match(/#?([0-9a-f]{6}|[0-9a-f]{3})/i);if(a[1].length==3){a=a[1].match(/./g).filter(function(d){return d+d})}else{a=a[1].match(/../g)}return{r:Number("0x"+a[0]),g:Number("0x"+a[1]),b:Number("0x"+a[2])}},_rgb:function(e,d,a){var c=[e,d,a];c.r=e;c.g=d;c.b=a;return c},_hsv:function(d,c,a){var b=[d,c,a];b.h=d;b.s=c;b.v=a;return b},_onDownColor:function(a){if(!a.mouse().left){return false}var b=a.pos();this._colPagePos=[b.pageX,b.pageY];this._colLayerPos=[b.layerX,b.layerY];this._onUpColorFn.attach(document,"mouseup");this._onMoveColorFn.attach(document,"mousemove");this._onMoveColor(a)},_onUpColor:function(a){this._onUpColorFn.detach(document,"mouseup");this._onMoveColorFn.detach(document,"mousemove")},_onMoveColor:function(g){var d=this._hsvColor;var k=g.pos();var b=this._colLayerPos[0]+(k.pageX-this._colPagePos[0]);var j=this._colLayerPos[1]+(k.pageY-this._colPagePos[1]);var c=this.elem.width();var f=this.elem.height();b=Math.max(Math.min(b,c),0);j=Math.max(Math.min(j,f),0);if(this.huePanel){d.s=d[1]=b/c*100;d.v=d[2]=(f-j)/f*100}else{d.h=j/f*360;var a=c/2;if(b=0;c--){b._recursivePreorderTraversalFilter(e.childNodes[c],g,true);if(!!this._bStopFindingNextElement){break}}}else{for(var c=0,a=e.childNodes.length;c]*class=['"]?(se2_quote[0-9]+)['"]?[^>]*>/gi,"<$1 class=$2>");return a},this).bind()]);this.oApp.exec("ADD_CONVERTER",["IR_TO_DB",jindo.$Fn(function(a){var b=this.htQuoteStyles_view;a=a.replace(/<(blockquote)[^>]*class=['"]?(se2_quote[0-9]+)['"]?[^>]*>/gi,function(e,d,c){return"<"+d+" class="+c+' style="'+b[c]+'">'});return a},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(c){var a,b;if("WYSIWYG"!==this.oApp.getEditingMode()){return}if(8!==c.key().keyCode){return}a=this.oApp.getSelection();a.fixCommonAncestorContainer();b=this._findParentQuote(a.commonAncestorContainer);if(!b){return}if(this._isBlankQuote(b)){c.stop(jindo.$Event.CANCEL_DEFAULT);a.selectNode(b);a.collapseToStart();jindo.$Element(b).leave();a.select()}},$ON_EVENT_EDITING_AREA_KEYUP:function(c){var a,b,d;if("WYSIWYG"!==this.oApp.getEditingMode()){return}if(46!==c.key().keyCode){return}a=this.oApp.getSelection();a.fixCommonAncestorContainer();b=this._findParentQuote(a.commonAncestorContainer);if(!b){return false}if(!b.nextSibling){c.stop(jindo.$Event.CANCEL_DEFAULT);d=a._document.createElement("P");d.innerHTML=" ";jindo.$Element(b).after(d);setTimeout(jindo.$Fn(function(e){var f=e.placeStringBookmark();e.select();e.removeStringBookmark(f)},this).bind(a),0)}},_isBlankQuote:function(c){var n,f,g,m,l=this.oApp.oNavigator.chrome,d=this.oApp.oNavigator.safari,a=function(o){o=o.replace(/[\r\n]/ig,"").replace(unescape("%uFEFF"),"");if(o===""){return true}if(o===" "||o===" "){return true}return false},b=function(o){if(o.nodeType===3&&a(o.nodeValue)){return true}if((o.tagName==="P"||o.tagName==="SPAN")&&(a(o.innerHTML)||o.innerHTML==="
    ")){return true}return false},e=function(o){if((jindo.$$("tr",o)).length===0){return true}return false};if(a(c.innerHTML)||c.innerHTML==="
    "){return true}if(l||d){var j=jindo.$$("TABLE",c),h=j.length,k;for(g=0;gtr>td",a);jindo.$A(g).forEach(function(k,j,h){jindo.$Element(k).css({border:"",borderTop:"",borderRight:""})})}},dbToIrDOM:function(e){var f=[];var b=jindo.$$("table[class=__se_tbl]",e,{oneTimeOffCache:true});jindo.$A(b).forEach(function(h,k,j){if(jindo.$Element(h).attr("attr_no_border_tbl")){f.push(h)}},this);if(f.length<1){return}var g=[],a;for(var d=0,c=f.length;dtr>td",a);jindo.$A(g).forEach(function(k,j,h){jindo.$Element(k).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(this.oApp.getEditingMode()=="WYSIWYG")},$ON_MSG_APP_READY:function(){this.oDocument=this.oApp.getWYSIWYGDocument()},$ON_EVENT_EDITING_AREA_MOUSEUP:function(a){if(this.oApp.getEditingMode()!="WYSIWYG"){return}this.setTdBlock()},$ON_IS_SELECTED_TD_BLOCK:function(a,b){if(this.nSelectedTD>0){b[a]=true;return b[a]}else{b[a]=false;return b[a]}},$ON_GET_SELECTED_TD_BLOCK:function(a,b){b[a]=this.htSelectedTD.aTdCells},setTdBlock:function(){this.oApp.exec("GET_SELECTED_CELLS",["aTdCells",this.htSelectedTD]);var a=this.htSelectedTD.aTdCells;if(a){this.nSelectedTD=a.length}},$ON_DELETE_BLOCK_CONTENTS:function(){var b=this,a,e,d;this.setTdBlock();for(var c=0;c 

    "}else{if(f.firefox){h+="


    "}}e.selectNode(b);e.pasteHTML(h);a=e.getNodes()||[];for(var c=0;c8){var c=jindo.$$.getSingle("DIV.husky_seditor_editing_area_container").childNodes[0];if((c.tagName=="DIV")&&(c.style.zIndex==1000)){c.parentNode.removeChild(c)}}this.oApp.exec("CLOSE_QE_LAYER",[a])}},getData:function(){var a=this;jindo.$Ajax(a._sBaseAjaxUrl,{type:"jsonp",timeout:1,onload:function(c){var b=c.json().result;if(!!b&&!!b.text_data){a.setData(b.text_data)}else{a.setData("{table:'full',img:'full',review:'full'}")}},onerror:function(){a.setData("{table:'full',img:'full',review:'full'}")},ontimeout:function(){a.setData("{table:'full',img:'full',review:'full'}")}}).request({text_key:"qeditor_fold"})},setData:function(sResult){var oResult={table:"full",img:"full",review:"full"};if(sResult){oResult=eval("("+sResult+")")}this._environmentData={table:{isOpen:false,type:oResult.table,isFixed:false,position:[]},img:{isOpen:false,type:oResult.img,isFixed:false},review:{isOpen:false,type:oResult.review,isFixed:false,position:[]}};this.waTableTagNames=jindo.$A(["table","tbody","td","tfoot","th","thead","tr"])},$ON_REGISTER_HOTKEY:function(b,a,c){if(b!="tab"&&b!="shift+tab"){this.waHotkeys.push([b,a,c])}}});function Shortcut(e,c){var e=e.replace(/\s+/g,"");var b=Shortcut.Store;var d=Shortcut.Action;if(typeof c==="undefined"&&e.constructor==String){b.set("document",e,document);return d.init(b.get("document"),e)}else{if(c.constructor==String&&e.constructor==String){b.set(c,e,jindo.$(c));return d.init(b.get(c),e)}else{if(c.constructor!=String&&e.constructor==String){var a="nonID"+new Date().getTime();a=Shortcut.Store.searchId(a,c);b.set(a,e,c);return d.init(b.get(a),e)}}}alert(c+"는 반드시 string이거나 없어야 됩니다.")}Shortcut.Store={anthorKeyHash:{},datas:{},currentId:"",currentKey:"",searchId:function(b,c){var d=false;jindo.$H(this.datas).forEach(function(e,f){if(c==e.element){b=f;d=true;jindo.$H.Break()}});if(!d&&(b in this.datas)){var a=b;while(a in this.datas){a="nonID"+new Date().getTime()}return a}return b},set:function(a,d,b){this.currentId=a;this.currentKey=d;var c=this.get(a);this.datas[a]=c?c.createKey(d):new Shortcut.Data(a,d,b)},get:function(a,b){if(b){return this.datas[a].keys[b]}else{return this.datas[a]}},reset:function(a){var b=this.datas[a];Shortcut.Helper.bind(b.func,b.element,"detach");delete this.datas[a]},allReset:function(){jindo.$H(this.datas).forEach(jindo.$Fn(function(b,a){this.reset(a)},this).bind())}};Shortcut.Data=jindo.$Class({$init:function(a,c,b){this.id=a;this.element=b;this.func=jindo.$Fn(this.fire,this).bind();Shortcut.Helper.bind(this.func,b,"attach");this.keys={};this.keyStemp={};this.createKey(c)},createKey:function(b){this.keyStemp[Shortcut.Helper.keyInterpretor(b)]=b;this.keys[b]={};var a=this.keys[b];a.key=b;a.events=[];a.commonExceptions=[];a.stopDefalutBehavior=true;return this},getKeyStamp:function(a){var c=a.keyCode||a.charCode;var b="";b+=a.altKey?"1":"0";b+=a.ctrlKey?"1":"0";b+=a.metaKey?"1":"0";b+=a.shiftKey?"1":"0";b+=c;return b},fire:function(a){a=a||window.eEvent;var b=this.keyStemp[this.getKeyStamp(a)];if(b){this.excute(new jindo.$Event(a),b)}},excute:function(e,d){var a=true;var b=Shortcut.Helper;var c=this.keys[d];if(b.notCommonException(e,c.commonExceptions)){jindo.$A(c.events).forEach(function(f){if(c.stopDefalutBehavior){var h=f.exceptions.length;if(h){for(var g=0;g",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(b){if(b.match(/_DO_RECORD_UNDO_HISTORY_AT$/)){return true}try{if(this.oApp.getEditingMode()!="WYSIWYG"){return false}}catch(a){return false}return true},$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(a){this.sLastKey=a},$ON_MSG_APP_READY:function(){var a=jindo.$Agent().navigator();this.bIE=a.ie;this.bFF=a.firefox;this.oApp.exec("REGISTER_UI_EVENT",["undo","click","UNDO"]);this.oApp.exec("REGISTER_UI_EVENT",["redo","click","REDO"]);if(jindo.$Agent().os().mac){this.oApp.exec("REGISTER_HOTKEY",["meta+z","UNDO"]);this.oApp.exec("REGISTER_HOTKEY",["meta+y","REDO"])}else{this.oApp.exec("REGISTER_HOTKEY",["ctrl+z","UNDO"]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+y","REDO"])}},$ON_UNDO:function(){this._doRecordUndoHistory("UNDO",{nStep:0,bSkipIfEqual:true,bMustBlockContainer:true});if(this.oCurStateIdx.nIdx<=0){return}var d=this.aUndoHistory[this.oCurStateIdx.nIdx].oUndoCallback[this.oCurStateIdx.nStep];var e=this.aUndoHistory[this.oCurStateIdx.nIdx].sParentXPath[this.oCurStateIdx.nStep];if(d){this.oApp.exec(d.sMsg,d.aParams)}if(this.oCurStateIdx.nStep>0){this.oCurStateIdx.nStep--}else{var c=this.aUndoHistory[this.oCurStateIdx.nIdx];this.oCurStateIdx.nIdx--;if(c.nTotalSteps>1){this.oCurStateIdx.nStep=0}else{c=this.aUndoHistory[this.oCurStateIdx.nIdx];this.oCurStateIdx.nStep=c.nTotalSteps-1}}var a=this.aUndoHistory[this.oCurStateIdx.nIdx].sParentXPath[this.oCurStateIdx.nStep];var b=false;if(a!==e&&a.indexOf(e)===0){b=true}this.oApp.exec("RESTORE_UNDO_HISTORY",[this.oCurStateIdx.nIdx,this.oCurStateIdx.nStep,b]);this.oApp.exec("CHECK_STYLE_CHANGE",[]);this.sLastKey=null},$ON_REDO:function(){if(this.oCurStateIdx.nIdx>=this.aUndoHistory.length){return}var b=this.aUndoHistory[this.oCurStateIdx.nIdx];if(this.oCurStateIdx.nIdx==this.aUndoHistory.length-1&&this.oCurStateIdx.nStep>=b.nTotalSteps-1){return}if(this.oCurStateIdx.nStepthis.nHardLimit){this.aUndoHistory.splice(0,this.nAfterMaxDeleteBuffer);a.nIdx-=this.nAfterMaxDeleteBuffer}this.oCurStateIdx.nIdx=a.nIdx;this.oCurStateIdx.nStep=a.nStep},_saveSnapShot:function(){this.oSnapShot={oBookmark:this.oApp.getSelection().getXPathBookmark()}},_getTargetXPath:function(c,b){var h=this.sDefaultXPath,f=c[0].sXPath.split("/"),d=c[1].sXPath.split("/"),g=[],e=f.length-1){a=j}}if(a>-1){g.length=a}h=g.join("/");if(h.length-1){h.length=m+1}else{if(e||p){return n}}return h.join("/")},_getUndoHistory:function(){return this.aUndoHistory},_getUndoStateIdx:function(){return this.oCurStateIdx}});nhn.husky.Utils=jindo.$Class({name:"Utils",$init:function(){var a=jindo.$Agent();var b=a.navigator();if(b.ie&&b.version==6){try{document.execCommand("BackgroundImageCache",false,true)}catch(c){}}},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["htBrowser",jindo.$Agent().navigator()])},$ON_ATTACH_HOVER_EVENTS:function(c,j){j=j||[];var b=j.sHoverClass||"hover";var a=j.fnElmToSrc||function(l){return l};var k=j.fnElmToTarget||function(l){return l};if(!c){return}var d=jindo.$Fn(function(l){jindo.$Element(k(l.currentElement)).addClass(b)},this);var e=jindo.$Fn(function(l){jindo.$Element(k(l.currentElement)).removeClass(b)},this);for(var f=0,g=c.length;f-1&&d.indexOf("Version/4.0")>-1){c.bGPadBrowser=true}}if(typeof e.ios==="undefined"){e.ios=d.indexOf("iPad")>-1||d.indexOf("iPhone")>-1;if(e.ios){b=d.match(/(iPhone )?OS ([\d|_]+)/);if(b!=null&&b[2]!=undefined){e.version=String(b[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(b,a,d,c){this.oApp.exec("ADD_HOTKEY",[b,a,d,(c||this.oApp.getWYSIWYGDocument())])},$ON_SE2_ATTACH_HOVER_EVENTS:function(a){this.oApp.exec("ATTACH_HOVER_EVENTS",[a,{fnElmToSrc:this._elm2Src,fnElmToTarget:this._elm2Target}])},_elm2Src:function(a){if(a.tagName=="LI"&&a.firstChild&&a.firstChild.tagName=="BUTTON"){return a.firstChild}else{return a}},_elm2Target:function(a){if(a.tagName=="BUTTON"&&a.parentNode.tagName=="LI"){return a.parentNode}else{return a}},getScrollXY:function(){var c,b;var a=this.oApp.getWYSIWYGWindow();if(typeof a.scrollX=="undefined"){c=a.document.documentElement.scrollLeft;b=a.document.documentElement.scrollTop}else{c=a.scrollX;b=a.scrollY}return{x:c,y:b}}});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,_htFontSize:{"1":"7pt","2":"10pt","3":"12pt","4":"13.5pt","5":"18pt","6":"24pt"},isInvalidNodeInTable:function(b){if(b&&!this._rxTable.test(b.nodeName)){var a;if((a=b.previousSibling)&&this._rxTable.test(a.nodeName)){return true}if((a=b.nextSibling)&&this._rxTable.test(a.nodeName)){return true}}return false},removeInvalidNodeInTable:function(a){if(this.isInvalidNodeInTable(a)&&a.parentNode){a.parentNode.removeChild(a)}},removeInvalidFont:function(a){if(!a){return}this._removeInvalidFontInTable(a);this._removeEmptyFont(a)},_removeInvalidFontInTable:function(c){var b=jindo.$$("table font",c);for(var a=0,d;(d=b[a]);a++){this.removeInvalidNodeInTable(d)}},_removeEmptyFont:function(d){var b=jindo.$$("font",d);for(var a=0,e,c;(e=b[a]);a++){c=e.innerHTML||"";c=c.replace(this._rxSpaceOnly,"");if(!c){e.parentNode.removeChild(e)}}},convertFontToSpan:function(e){if(!e){return}var b=e.ownerDocument||document;var g=jindo.$$("font",e);for(var d=0,f,a,c;(f=g[d]);d++){a=f.parentNode;if(a.tagName!=="SPAN"||a.childNodes.length>1){a=b.createElement("SPAN");f.parentNode.insertBefore(a,f)}c=f.getAttribute("face");if(c){a.style.fontFamily=c}c=this._htFontSize[f.getAttribute("size")];if(c){a.style.fontSize=c}c=f.getAttribute("color");if(c){a.style.color=c}this._switchFontInnerToSpan(f,a);if(f.parentNode){f.parentNode.removeChild(f)}}},_switchFontInnerToSpan:function(d,a){var b=d.innerHTML;if(this._rxFontStart.test(b)){for(var c;(c=d.firstChild);){a.appendChild(c)}}else{a.innerHTML=b}},stripTag:function(a){for(var b;(b=a.firstChild);){a.parentNode.insertBefore(b,a)}a.parentNode.removeChild(a)},stripTags:function(c,a){var e=jindo.$$(a,c);for(var b=0,d;(d=e[b]);b++){this.stripTag(d)}},reviseDateFormat:function(a){if(a&&a.replace){a=a.replace(this.rxDateFormat,"$&.")}return a},getCustomCSS:function(a,d,e){var c=[];if("undefined"==typeof(a)||"undefined"==typeof(d)||!a||!d){return c}var b=a.match(d);if(b&&b[0]&&b[1]){if(e){c=b[1].split(e)}else{c[0]=b[1]}}return c},toStringSamePropertiesOfArray:function(d,f,b){if(!d){return""}if(d instanceof Array){var c=[];for(var e=0;eh*(j+0.5)){a--;e.html(b.substring(0,a)+d);f=g.height()}},ellipsisByPixel:function(j,c,h,e){c=c||"...";var d=jindo.$Element(j);var f=d.width();if(fh){if(!e()){break}a--;d.html(b.substring(0,a)+c);f=d.width()}},ellipsisElementsToDesinatedWidth:function(d,a,b,c){jindo.$A(d).forEach(function(f,e){if(!f){jindo.$A.Continue()}nhn.husky.SE2M_Utils.ellipsisByPixel(f,a,b[e],c)})},paddingZero:function(c,b){var a=c.toString();while(a.lengthc){return d.substring(0,a)+e}}}return d},getCharByte:function(a){if(a===null||a.length<1){return 0}var b=0;var c=escape(a);if(c.length==1){b++}else{if(c.indexOf("%u")!=-1){b+=2}else{if(c.indexOf("%")!=-1){b+=c.length/3}}}return b},getFilteredHashTable:function(c,b){if(!(b instanceof Array)){return arguments.callee.call(this,c,[b])}var a=jindo.$A(b);return jindo.$H(c).filter(function(e,d){if(a.has(d)&&e){return true}else{return false}}).$value()},isBlankNode:function(b){var e=this.isBlankTextNode;var a=function(h){if(!h){return true}if(e(h)){return true}if(h.tagName=="BR"){return true}if(h.innerHTML==" "||h.innerHTML==""){return true}return false};var d=function(h){if(h.tagName=="IMG"||h.tagName=="IFRAME"){return false}if(a(h)){return true}if(h.tagName=="P"){for(var j=h.childNodes.length-1;j>=0;j--){var k=h.childNodes[j];if(e(k)){k.parentNode.removeChild(k)}}if(h.childNodes.length==1){if(h.firstChild.tagName=="IMG"||h.firstChild.tagName=="IFRAME"){return false}if(a(h.firstChild)){return true}}}return false};if(d(b)){return true}for(var c=0,g=b.childNodes.length;c]*))","i");var d=c.exec(e);if(!d){return""}var b=(d[1]||d[2]||d[3]);if(!!b){b=b.replace(/[\"]/g,"")}return b},iframeAlignConverter:function(f,b){var e=f.tagName.toUpperCase();if(e=="DIV"||e=="P"){if(f.parentNode===null){return}var a=b;var d=jindo.$Element(f);var h=d.html();var c=jindo.$Element(f).attr("align")||jindo.$Element(f).css("text-align");var g=jindo.$Element(jindo.$("
    ",a));g.html(h).attr("align",c);d.replace(g)}},getJsonDatafromXML:function(a){var d={};var l=/\s*<(\/?[\w:\-]+)((?:\s+[\w:\-]+\s*=\s*(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'))*)\s*((?:\/>)|(?:><\/\1>|\s*))|\s*\s*|\s*>?([^<]*)/ig;var h=/^[0-9]+(?:\.[0-9]+)?$/;var g=/^\s+$/g;var j={"&":"&"," ":" ",""":'"',"<":"<",">":">"};var b={tags:["/"],stack:[d]};var k=function(m){if(typeof m=="undefined"){return""}return m.replace(/&[a-z]+;/g,function(n){return(typeof j[n]=="string")?j[n]:n})};var e=function(m,n){m.replace(/([\w\:\-]+)\s*=\s*(?:"((?:\\"|[^"])*)"|'((?:\\'|[^'])*)')/g,function(p,o,r,q){n[o]=k((r?r.replace(/\\"/g,'"'):undefined)||(q?q.replace(/\\'/g,"'"):undefined))})};var c=function(n){for(var m in n){if(n.hasOwnProperty(m)){if(Object.prototype[m]){continue}return false}}return true};var f=function(u,t,r,q,p,n){var B,A="";var z=b.stack.length-1;if(typeof t=="string"&&t){if(t.substr(0,1)!="/"){var y=(typeof r=="string"&&r);var w=(typeof q=="string"&&q);var s=(!y&&w)?"":{};B=b.stack[z];if(typeof B[t]=="undefined"){B[t]=s;B=b.stack[z+1]=B[t]}else{if(B[t] instanceof Array){var v=B[t].length;B[t][v]=s;B=b.stack[z+1]=B[t][v]}else{B[t]=[B[t],s];B=b.stack[z+1]=B[t][1]}}if(y){e(r,B)}b.tags[z+1]=t;if(w){b.tags.length--;b.stack.length--}}else{b.tags.length--;b.stack.length--}}else{if(typeof p=="string"&&p){A=p}else{if(typeof n=="string"&&n.replace(g,"")){A=k(n)}}}if(A.length>0){var x=b.stack[z-1];var C=b.tags[z];if(h.test(A)){}else{if(A=="true"||A=="false"){A=new Boolean(A)}}if(typeof x=="undefined"){return}if(x[C] instanceof Array){var m=x[C];if(typeof m[m.length-1]=="object"&&!c(m[m.length-1])){m[m.length-1].$cdata=A;m[m.length-1].toString=function(){return A}}else{m[m.length-1]=A}}else{if(typeof x[C]=="object"&&!c(x[C])){x[C].$cdata=A;x[C].toString=function(){return A}}else{x[C]=A}}}};a=a.replace(/<(\?|\!-)[^>]*>/g,"");a.replace(l,f);return jindo.$Json(d)},replaceSpecialChar:function(a){return(typeof(a)=="string")?(a.replace(/\&/g,"&").replace(/\"/g,""").replace(/\'/g,"'").replace(//g,">")):""},restoreSpecialChar:function(a){return(typeof(a)=="string")?(a.replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")):""}};nhn.husky.AutoResizer=jindo.$Class({welHiddenDiv:null,welCloneDiv:null,elContainer:null,$init:function(c,d){var a=["lineHeight","textDecoration","letterSpacing","fontSize","fontFamily","fontStyle","fontWeight","textTransform","textAlign","direction","wordSpacing","fontSizeAdjust","paddingTop","paddingLeft","paddingBottom","paddingRight","width"],b=a.length,e={position:"absolute",top:-9999,left:-9999,opacity:0,overflow:"hidden",wordWrap:"break-word"};this.nMinHeight=d.nMinHeight;this.wfnCallback=d.wfnCallback;this.elContainer=c.parentNode;this.welTextArea=jindo.$Element(c);this.welHiddenDiv=jindo.$Element("
    ");this.wfnResize=jindo.$Fn(this._resize,this);this.sOverflow=this.welTextArea.css("overflow");this.welTextArea.css("overflow","hidden");while(b--){e[a[b]]=this.welTextArea.css(a[b])}this.welHiddenDiv.css(e);this.nLastHeight=this.welTextArea.height()},bind:function(){this.welCloneDiv=jindo.$Element(this.welHiddenDiv.$value().cloneNode(false));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);if(this.welCloneDiv){this.welCloneDiv.leave()}},_resize:function(){var c=this.welTextArea.$value().value,b=false,a;if(c===this.sContents){return}this.sContents=c.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/\n/g,"
    ");this.sContents+="
    ";this.welCloneDiv.html(this.sContents);a=this.welCloneDiv.height();if(a=a){this._aString.length=0}else{this._aString.length=a}};(function(){var a=null,b=/,/gi;IsInstalledFont=function(g){var c=g=="Comic Sans MS"?"Courier New":"Comic Sans MS";if(!a){a=document.createElement("div")}var h="position:absolute !important; font-size:200px !important; left:-9999px !important; top:-9999px !important;";a.innerHTML="mmmmiiiii"+unescape("%uD55C%uAE00");a.style.cssText=h+'font-family:"'+c+'" !important';var f=document.body||document.documentElement;if(f.firstChild){f.insertBefore(a,f.firstChild)}else{document.body.appendChild(a)}var d=a.offsetWidth+"-"+a.offsetHeight;a.style.cssText=h+'font-family:"'+g.replace(b,'","')+'", "'+c+'" !important';var e=d!=(a.offsetWidth+"-"+a.offsetHeight);document.body.removeChild(a);return e}})();nhn.husky.SE2B_CSSLoader=jindo.$Class({name:"SE2B_CSSLoader",bCssLoaded:false,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(){this.htOptions=nhn.husky.SE2M_Configuration.SE2B_CSSLoader;if(!jindo.$Agent().navigator().ie){this.$ON_MSG_APP_READY=jindo.$Fn(function(){this.loadSE2CSS()},this).bind()}else{for(var b=0,c=this.aInstantLoadTrigger.length;b=33&&b.keyCode<=40){this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED",[]);this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,this.aHeightChangeKeyMap[b.keyCode-33]]);this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED",[]);a.stop()}},_mousedown:function(a){this.iStartHeight=a.pos().clientY;this.iStartHeightOffset=a.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=a.pos().clientY;this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])},_mousemove:function(b){var a=b.pos().clientY-this.iStartHeight;this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,a])},_mousemove_parent:function(b){var a=b.pos().pageY-(this.welIFrame.offset().top+this.iStartHeight);this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,a])},_mouseup:function(a){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:true,$init:function(a,b){this._assignHTMLObjects(a,b)},_assignHTMLObjects:function(a,b){a=jindo.$(a)||document;this.toolbarArea=cssquery.getSingle(".se2_tool",a);if(typeof(b)=="undefined"||b===true){this.toolbarArea.style.display="block"}else{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=(this.toolbarArea.style.display=="none")?"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 a=this.oApp.htOptions.elAppContainer;this.oApp.exec("LOAD_HTML",["find_and_replace"]);this.elDropdownLayer=jindo.$$.getSingle("DIV.husky_se2m_findAndReplace_layer",a);this.welDropdownLayer=jindo.$Element(this.elDropdownLayer);var b=jindo.$$("LI",this.elDropdownLayer);this.oFindTab=b[0];this.oReplaceTab=b[1];b=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);b=jindo.$$("INPUT",this.oReplaceInputSet);this.oReplaceInput_Original=b[0];this.oReplaceInput_Replacement=b[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(a){this._assignHTMLElements();this.oFindReplace=new nhn.FindReplace(this.oEditingWindow);for(var b=0;b=this.nMaxLevel){return e}}f=f.nextSibling}return e};return(a(b)>=this.nMaxLevel)},_unwrapBlock:function(a){var c=this.oApp.getSelection();var f=c.commonAncestorContainer;while(f&&f.tagName!=a){f=f.parentNode}if(!f){return}this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["CANCEL BLOCK QUOTE",{sSaveTarget:"BODY"}]);var e=c.commonAncestorContainer;if(e.nodeType!==3){var d=c.getTextNodes()||"",b=d.length-1;e=(b>-1)?d[b]:null}while(f.firstChild){f.parentNode.insertBefore(f.firstChild,f)}f.parentNode.removeChild(f);if(e){c.selectNodeContents(e);c.collapseToEnd();c.select()}this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["CANCEL BLOCK QUOTE",{sSaveTarget:"BODY"}])},_wrapBlock:function(w,f){var b,u,e,a,o=/BODY|TD|LI/i,x,c,n,t,h,k,j,l,p,m,v,g,s,q,d,r;this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["BLOCK QUOTE",{sSaveTarget:"BODY"}]);b=this.oApp.getSelection();if(b.startContainer===b.endContainer&&b.startContainer.nodeType===1&&b.startContainer.tagName==="P"){if(nhn.husky.SE2M_Utils.isBlankNode(b.startContainer)||nhn.husky.SE2M_Utils.isFirstChildOfNode("IMG",b.startContainer.tagName,b.startContainer)||nhn.husky.SE2M_Utils.isFirstChildOfNode("IFRAME",b.startContainer.tagName,b.startContainer)){u=b.getLineInfo(true)}else{u=b.getLineInfo(false)}}else{u=b.getLineInfo(false)}e=u.oStart;a=u.oEnd;if(e.bParentBreak&&!o.test(e.oLineBreaker.tagName)){x=e.oNode.parentNode}else{x=e.oNode}if(a.bParentBreak&&!o.test(a.oLineBreaker.tagName)){c=a.oNode.parentNode}else{c=a.oNode}b.setStartBefore(x);b.setEndAfter(c);n=this._expandToTableStart(b,c);if(n){c=n;b.setEndAfter(n)}n=this._expandToTableStart(b,x);if(n){x=n;b.setStartBefore(n)}n=x;b.fixCommonAncestorContainer();t=b.commonAncestorContainer;if(b.startContainer==b.endContainer&&b.endOffset-b.startOffset==1){h=b.startContainer.childNodes[b.startOffset]}else{h=b.commonAncestorContainer}k=this._findParentQuote(h);if(k){k.className=f;this._setStyle(k,this.htQuoteStyles_view[f]);return}while(!t.tagName||(t.tagName&&t.tagName.match(/UL|OL|LI|IMG|IFRAME/))){t=t.parentNode}while(n&&n!=t&&n.parentNode!=t){n=n.parentNode}if(n==t){j=t.firstChild}else{j=n}l=b._document.createElement(w);if(f){l.className=f;this._setStyle(l,this.htQuoteStyles_view[f])}t.insertBefore(l,j);b.setStartAfter(l);b.setEndAfter(c);b.surroundContents(l);if(this._isExceedMaxDepth(l)){alert(this.oApp.$MSG("SE2M_Quote.exceedMaxCount").replace("#MaxCount#",(this.nMaxLevel+1)));this.oApp.exec("HIDE_ACTIVE_LAYER",[]);p=l.nextSibling;m=l.parentNode;v=l.childNodes;g=[];jindo.$Element(l).leave();for(s=0,q=v.length;sLI",a)},$LOCAL_BEFORE_FIRST:function(c){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 b=jindo.$Fn(this.oApp.exec,this.oApp).bind("INSERT_SCHARACTERS",[this.oTextField.value]);jindo.$Fn(b,this).attach(this.oInsertButton,"click");this.oApp.exec("SET_SCHARACTER_LIST",[this.charSet]);for(var a=0;a1){return}this.oApp.exec("SELECT_SCHARACTER",[c]);b.stop()},$ON_SELECT_SCHARACTER:function(a){this.oTextField.value+=a;if(this.oTextField.createTextRange){var b=this.oTextField.createTextRange();b.collapse(false);b.select()}else{if(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(b){for(var a=0;a");if(this.bIE){b=jindo.$("