if(typeof window.nhn=='undefined'){window.nhn={};} if(!nhn.husky){nhn.husky={};} nhn.husky.HuskyCore=$Class({name:"HuskyCore",$init:function(htOptions){this.htOptions=!htOptions?{}:$Class({}).extend({oDebugger:null}).extend(htOptions);if(this.htOptions.oDebugger){this.htOptions.oDebugger.oApp=this;} this.messageQueue=[];this.oMessageMap={};this.oDisabledMessage={};this.aPlugins=[];this.appStatus=nhn.husky.APP_STATUS.NOT_READY;this.registerPlugin(this);},exec:function(msg,args,oEvent){if(this.appStatus==nhn.husky.APP_STATUS.NOT_READY){this.messageQueue[this.messageQueue.length]={'msg':msg,'args':args,'event':oEvent};return true;} this.exec=this._exec;this.exec(msg,args,oEvent);},delayedExec:function(msg,args,nDelay,oEvent){var fExec=$Fn(this.exec,this).bind(msg,args,oEvent);setTimeout(fExec,nDelay);},_exec:function(msg,args,oEvent){return(this._exec=this.htOptions.oDebugger?this._execWithDebugger:this._execWithoutDebugger).call(this,msg,args,oEvent);},_execWithDebugger:function(msg,args,oEvent){this.htOptions.oDebugger.log_MessageStart(msg,args);var bResult=this._doExec(msg,args,oEvent);this.htOptions.oDebugger.log_MessageEnd(msg,args);return bResult;},_execWithoutDebugger:function(msg,args,oEvent){return this._doExec(msg,args,oEvent);},_doExec:function(msg,args,oEvent){var bContinue=false;if(!this.oDisabledMessage[msg]){var allArgs=[];if(args&&args.length){var iLen=args.length;for(var i=0;i -1)';case'^=':return'('+sVar+' && '+sVar+'.indexOf('+sVal+') == 0)';case'$=':return'('+sVar+' && '+sVar+'.substr('+sVar+'.length - '+oExpr.val.length+') == '+sVal+')';case'*=':return'('+sVar+' && '+sVar+'.indexOf('+sVal+') > -1)';case'!=':return'('+sVar+' != '+sVal+')';case'=':return'('+sVar+' == '+sVal+')';} return'('+sVar+')';};var getNodeIndex=function(oEl){var nUID=getUID(oEl);var nIndex=oNodeIndexes[nUID]||0;if(nIndex==0){for(var oSib=(oEl.parentNode||oEl._IE5_parentNode).firstChild;oSib;oSib=oSib.nextSibling){if(oSib.nodeType!=1)continue;nIndex++;setNodeIndex(oSib,nIndex);} nIndex=oNodeIndexes[nUID];} return nIndex;};var oNodeIndexes={};var setNodeIndex=function(oEl,nIndex){var nUID=getUID(oEl);oNodeIndexes[nUID]=nIndex;};var unsetNodeIndexes=function(){setTimeout(function(){oNodeIndexes={};},0);};var oPseudoes_dontShrink={'contains':function(oEl,sOption){return(oEl.innerText||oEl.textContent||'').indexOf(sOption)>-1;},'last-child':function(oEl,sOption){for(oEl=oEl.nextSibling;oEl;oEl=oEl.nextSibling) if(oEl.nodeType==1) return false;return true;},'first-child':function(oEl,sOption){for(oEl=oEl.previousSibling;oEl;oEl=oEl.previousSibling) if(oEl.nodeType==1) return false;return true;},'only-child':function(oEl,sOption){var nChild=0;for(var oChild=(oEl.parentNode||oEl._IE5_parentNode).firstChild;oChild;oChild=oChild.nextSibling){if(oChild.nodeType==1)nChild++;if(nChild>1)return false;} return nChild?true:false;},'empty':function(oEl,_){return oEl.firstChild?false:true;},'nth-child':function(oEl,nMul,nAdd){var nIndex=getNodeIndex(oEl);return nIndex%nMul==nAdd;},'nth-last-child':function(oEl,nMul,nAdd){var oLast=(oEl.parentNode||oEl._IE5_parentNode).lastChild;for(;oLast;oLast=oLast.previousSibling) if(oLast.nodeType==1)break;var nTotal=getNodeIndex(oLast);var nIndex=getNodeIndex(oEl);var nLastIndex=nTotal-nIndex+1;return nLastIndex%nMul==nAdd;}};var getExpression=function(sBody){var oRet={defines:'',returns:'true'};var sBody=restoreKeys(sBody,true);var aExprs=[];var aDefineCode=[],aReturnCode=[];var sId,sTagName;var sBody=sBody.replace(/:([\w-]+)(\(([^)]*)\))?/g,function(_,sType,_,sOption){switch(sType){case'not':var oInner=getExpression(sOption);var sFuncDefines=oInner.defines;var sFuncReturns=oInner.returnsID+oInner.returnsTAG+oInner.returns;aReturnCode.push('!(function() { '+sFuncDefines+' return '+sFuncReturns+' })()');break;case'nth-child':case'nth-last-child':sOption=restoreString(sOption);if(sOption=='even')sOption='2n';else if(sOption=='odd')sOption='2n+1';var nMul,nAdd;if(/([0-9]*)n([+-][0-9]+)*/.test(sOption)){nMul=parseInt(RegExp.$1)||1;nAdd=parseInt(RegExp.$2)||0;}else{nMul=Infinity;nAdd=parseInt(sOption);} aReturnCode.push('oPseudoes_dontShrink['+wrapQuot(sType)+'](oEl, '+nMul+', '+nAdd+')');break;case'first-of-type':case'last-of-type':sType=(sType=='first-of-type'?'nth-of-type':'nth-last-of-type');sOption=1;case'nth-of-type':case'nth-last-of-type':sOption=restoreString(sOption);if(sOption=='even')sOption='2n';else if(sOption=='odd')sOption='2n+1';var nMul,nAdd;if(/([0-9]*)n([+-][0-9]+)*/.test(sOption)){nMul=parseInt(RegExp.$1)||1;nAdd=parseInt(RegExp.$2)||0;}else{nMul=Infinity;nAdd=parseInt(sOption);} oRet.nth=[nMul,nAdd,sType];break;default:sOption=sOption?restoreString(sOption):'';aReturnCode.push('oPseudoes_dontShrink['+wrapQuot(sType)+'](oEl, '+wrapQuot(sOption)+')');break;} return'';});var sBody=sBody.replace(/\[(@?[\w-]+)(([!^~$*]?=)([^\]]*))?\]/g,function(_,sKey,_,sOp,sVal){sKey=restoreString(sKey);sVal=restoreString(sVal);if(sKey=='checked'||sKey=='disabled'||sKey=='enabled'||sKey=='readonly'||sKey=='selected'){if(!sVal){sOp='=';sVal='true';}} aExprs.push({key:sKey,op:sOp,val:sVal});return'';});var sBody=sBody.replace(/\.([\w-]+)/g,function(_,sClass){aExprs.push({key:'class',op:'~=',val:sClass});return'';});var sBody=sBody.replace(/#([\w-]+)/g,function(_,sIdValue){if(bXMLDocument)aExprs.push({key:'id',op:'=',val:sIdValue});else sId=sIdValue;return'';});sTagName=sBody=='*'?'':sBody;var oVars={};for(var i=0,oExpr;oExpr=aExprs[i];i++){var sKey=oExpr.key;if(!oVars[sKey])aDefineCode.push(getDefineCode(sKey));aReturnCode.unshift(getReturnCode(oExpr));oVars[sKey]=true;} if(aDefineCode.length)oRet.defines='var '+aDefineCode.join(',')+';';if(aReturnCode.length)oRet.returns=aReturnCode.join('&&');oRet.quotID=sId?wrapQuot(sId):'';oRet.quotTAG=sTagName?wrapQuot(bXMLDocument?sTagName:sTagName.toUpperCase()):'';oRet.returnsID=sId?'oEl.id == '+oRet.quotID+' && ':'';oRet.returnsTAG=sTagName&&sTagName!='*'?'oEl.tagName == '+oRet.quotTAG+' && ':'';return oRet;};var splitToParts=function(sQuery){var aParts=[];var sRel=' ';var sBody=sQuery.replace(/(.*?)\s*(!?[+>~ ]|!)\s*/g,function(_,sBody,sRelative){if(sBody)aParts.push({rel:sRel,body:sBody});sRel=sRelative.replace(/\s+$/g,'')||' ';return'';});if(sBody)aParts.push({rel:sRel,body:sBody});return aParts;};var isNth_dontShrink=function(oEl,sTagName,nMul,nAdd,sDirection){var nIndex=0;for(var oSib=oEl;oSib;oSib=oSib[sDirection]) if(oSib.nodeType==1&&(!sTagName||sTagName==oSib.tagName)) nIndex++;return nIndex%nMul==nAdd;};var compileParts=function(aParts){var aPartExprs=[];for(var i=0,oPart;oPart=aParts[i];i++) aPartExprs.push(getExpression(oPart.body));var sFunc='';var sPushCode='aRet.push(oEl); if (oOptions.single) { bStop = true; }';for(var i=aParts.length-1,oPart;oPart=aParts[i];i--){var oExpr=aPartExprs[i];var sPush=(debugOption.callback?'cost++;':'')+oExpr.defines;var sReturn='if (bStop) {'+(i==0?'return aRet;':'return;')+'}';if(oExpr.returns=='true')sPush+=(sFunc?sFunc+'(oEl);':sPushCode)+sReturn;else sPush+='if ('+oExpr.returns+') {'+(sFunc?sFunc+'(oEl);':sPushCode)+sReturn+'}';var sCheckTag='oEl.nodeType != 1';if(oExpr.quotTAG)sCheckTag='oEl.tagName != '+oExpr.quotTAG;var sTmpFunc='(function(oBase'+ (i==0?', oOptions) { var bStop = false; var aRet = [];':') {');if(oExpr.nth){sPush='if (isNth_dontShrink(oEl, '+ (oExpr.quotTAG?oExpr.quotTAG:'false')+','+ oExpr.nth[0]+','+ oExpr.nth[1]+','+'"'+(oExpr.nth[2]=='nth-of-type'?'previousSibling':'nextSibling')+'")) {'+sPush+'}';} switch(oPart.rel){case' ':if(oExpr.quotID){sTmpFunc+='var oEl = oDocument_dontShrink.getElementById('+oExpr.quotID+');'+'var oCandi = oEl;'+'for (; oCandi; oCandi = (oCandi.parentNode || oCandi._IE5_parentNode)) {'+'if (oCandi == oBase) break;'+'}'+'if (!oCandi || '+sCheckTag+') return aRet;'+ sPush;}else{sTmpFunc+='var aCandi = getChilds_dontShrink(oBase, '+(oExpr.quotTAG||'"*"')+');'+'for (var i = 0, oEl; oEl = aCandi[i]; i++) {'+ sPush+'}';} break;case'>':if(oExpr.quotID){sTmpFunc+='var oEl = oDocument_dontShrink.getElementById('+oExpr.quotID+');'+'if ((oEl.parentNode || oEl._IE5_parentNode) != oBase || '+sCheckTag+') return aRet;'+ sPush;}else{sTmpFunc+='for (var oEl = oBase.firstChild; oEl; oEl = oEl.nextSibling) {'+'if ('+sCheckTag+') { continue; }'+ sPush+'}';} break;case'+':if(oExpr.quotID){sTmpFunc+='var oEl = oDocument_dontShrink.getElementById('+oExpr.quotID+');'+'var oPrev;'+'for (oPrev = oEl.previousSibling; oPrev; oPrev = oPrev.previousSibling) { if (oPrev.nodeType == 1) break; }'+'if (!oPrev || oPrev != oBase || '+sCheckTag+') return aRet;'+ sPush;}else{sTmpFunc+='for (var oEl = oBase.nextSibling; oEl; oEl = oEl.nextSibling) { if (oEl.nodeType == 1) break; }'+'if (!oEl || '+sCheckTag+') { return aRet; }'+ sPush;} break;case'~':if(oExpr.quotID){sTmpFunc+='var oEl = oDocument_dontShrink.getElementById('+oExpr.quotID+');'+'var oCandi = oEl;'+'for (; oCandi; oCandi = oCandi.previousSibling) { if (oCandi == oBase) break; }'+'if (!oCandi || '+sCheckTag+') return aRet;'+ sPush;}else{sTmpFunc+='for (var oEl = oBase.nextSibling; oEl; oEl = oEl.nextSibling) {'+'if ('+sCheckTag+') { continue; }'+'if (!markElement_dontShrink(oEl, '+i+')) { break; }'+ sPush+'}';} break;case'!':if(oExpr.quotID){sTmpFunc+='var oEl = oDocument_dontShrink.getElementById('+oExpr.quotID+');'+'for (; oBase; oBase = (oBase.parentNode || oBase._IE5_parentNode)) { if (oBase == oEl) break; }'+'if (!oBase || '+sCheckTag+') return aRet;'+ sPush;}else{sTmpFunc+='for (var oEl = (oBase.parentNode || oBase._IE5_parentNode); oEl; oEl = (oEl.parentNode || oEl._IE5_parentNode)) {'+'if ('+sCheckTag+') { continue; }'+ sPush+'}';} break;case'!>':if(oExpr.quotID){sTmpFunc+='var oEl = oDocument_dontShrink.getElementById('+oExpr.quotID+');'+'var oRel = (oBase.parentNode || oBase._IE5_parentNode);'+'if (!oRel || oEl != oRel || ('+sCheckTag+')) return aRet;'+ sPush;}else{sTmpFunc+='var oEl = (oBase.parentNode || oBase._IE5_parentNode);'+'if (!oEl || '+sCheckTag+') { return aRet; }'+ sPush;} break;case'!+':if(oExpr.quotID){sTmpFunc+='var oEl = oDocument_dontShrink.getElementById('+oExpr.quotID+');'+'var oRel;'+'for (oRel = oBase.previousSibling; oRel; oRel = oRel.previousSibling) { if (oRel.nodeType == 1) break; }'+'if (!oRel || oEl != oRel || ('+sCheckTag+')) return aRet;'+ sPush;}else{sTmpFunc+='for (oEl = oBase.previousSibling; oEl; oEl = oEl.previousSibling) { if (oEl.nodeType == 1) break; }'+'if (!oEl || '+sCheckTag+') { return aRet; }'+ sPush;} break;case'!~':if(oExpr.quotID){sTmpFunc+='var oEl = oDocument_dontShrink.getElementById('+oExpr.quotID+');'+'var oRel;'+'for (oRel = oBase.previousSibling; oRel; oRel = oRel.previousSibling) { '+'if (oRel.nodeType != 1) { continue; }'+'if (oRel == oEl) { break; }'+'}'+'if (!oRel || ('+sCheckTag+')) return aRet;'+ sPush;}else{sTmpFunc+='for (oEl = oBase.previousSibling; oEl; oEl = oEl.previousSibling) {'+'if ('+sCheckTag+') { continue; }'+'if (!markElement_dontShrink(oEl, '+i+')) { break; }'+ sPush+'}';} break;} sTmpFunc+=(i==0?'return aRet;':'')+'})';sFunc=sTmpFunc;} eval('var fpCompiled = '+sFunc+';');return fpCompiled;};var parseQuery=function(sQuery){var sCacheKey=sQuery;var fpSelf=arguments.callee;var fpFunction=fpSelf._cache[sCacheKey];if(!fpFunction){sQuery=backupKeys(sQuery);var aParts=splitToParts(sQuery);fpFunction=fpSelf._cache[sCacheKey]=compileParts(aParts);fpFunction.depth=aParts.length;} return fpFunction;};parseQuery._cache={};var parseTestQuery=function(sQuery){var fpSelf=arguments.callee;var aSplitQuery=backupKeys(sQuery).split(/\s*,\s*/);var aResult=[];var nLen=aSplitQuery.length;var aFunc=[];for(var i=0;i'+sTag+':nth-of-type('+sTh+')';});return cssquery.getSingle(sXPath,oParent);};cssquery.debug=function(fpCallback,nRepeat){debugOption.callback=fpCallback;debugOption.repeat=nRepeat||1;};cssquery.safeHTML=function(bFlag){var bIE=/MSIE/.test(window.navigator.userAgent);if(arguments.length>0) safeHTML=bFlag&&bIE;return safeHTML||!bIE;};cssquery.version=sVersion;return cssquery;})();(function(){if(typeof $Element!='undefined'&&$Element.prototype&&'$value'in $Element.prototype){$Element.prototype.queryAll=function(sQuery){return cssquery(sQuery,this._element);};$Element.prototype.query=function(sQuery){return cssquery.getSingle(sQuery,this._element);};$Element.prototype.test=function(sQuery){return cssquery.test(this._element,sQuery);};$Element.prototype.xpathAll=function(sXpath){return cssquery.xpath(sXpath,this._element);};} if(typeof $Document!='undefined'&&$Document.prototype){$Document.prototype.queryAll=function(sQuery){return cssquery(sQuery,this._document);};$Document.prototype.query=function(sQuery){return cssquery.getSingle(sQuery,this._document);};$Document.prototype.xpathAll=function(sXpath){return cssquery.xpath(sXpath,this._document);};}})(); nhn.husky.ActiveLayerManager=$Class({name:"ActiveLayerManager",oCurrentLayer:null,$ON_TOGGLE_ACTIVE_LAYER:function(oLayer,sOnOpenCmd,aOnOpenParam,sOnCloseCmd,aOnCloseParam){if(oLayer==this.oCurrentLayer){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);}else{this.oApp.exec("SHOW_ACTIVE_LAYER",[oLayer,sOnCloseCmd,aOnCloseParam]);if(sOnOpenCmd)this.oApp.exec(sOnOpenCmd,aOnOpenParam);}},$ON_SHOW_ACTIVE_LAYER:function(oLayer,sOnCloseCmd,aOnCloseParam){oLayer=$(oLayer);var oPrevLayer=this.oCurrentLayer;if(oLayer==oPrevLayer)return;this.oApp.exec("HIDE_ACTIVE_LAYER",[]);this.sOnCloseCmd=sOnCloseCmd;this.aOnCloseParam=aOnCloseParam;oLayer.style.display="block";this.oCurrentLayer=oLayer;},$ON_HIDE_ACTIVE_LAYER:function(){var oLayer=this.oCurrentLayer;if(!oLayer)return;oLayer.style.display="none";this.oCurrentLayer=null;if(this.sOnCloseCmd) this.oApp.exec(this.sOnCloseCmd,this.aOnCloseParam);},$ON_HIDE_CURRENT_ACTIVE_LAYER:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);},$ON_EVENT_EDITING_AREA_KEYDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);},$ON_EVENT_EDITING_AREA_MOUSEDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);}}); nhn.husky.CorePlugin=$Class({name:"CorePlugin",$AFTER_MSG_APP_READY:function(){this.oApp.exec("EXEC_ON_READY_FUNCTION",[]);},$ON_ADD_APP_PROPERTY:function(sPropertyName,oProperty){this.oApp[sPropertyName]=oProperty;},$ON_REGISTER_BROWSER_EVENT:function(obj,sEvent,sMsg,aParams,nDelay){this.oApp.registerBrowserEvent(obj,sEvent,sMsg,aParams,nDelay);},$ON_DISABLE_MESSAGE:function(sMsg){this.oApp.disableMessage(sMsg,true);},$ON_ENABLE_MESSAGE:function(sMsg){this.oApp.disableMessage(sMsg,false);},$ON_EXEC_ON_READY_FUNCTION:function(){if(typeof this.oApp.htRunOptions.fnOnAppReady=="function")this.oApp.htRunOptions.fnOnAppReady();}}); nhn.husky.DialogLayerManager=$Class({name:"DialogLayerManager",aMadeDraggable:null,aOpenedLayers:null,$init:function(){this.aMadeDraggable=[];this.aOpenedLayers=[];},$ON_SHOW_DIALOG_LAYER:function(elLayer,htOptions){elLayer=$(elLayer);htOptions=htOptions||{};htOptions.nMinY=0;if(!elLayer)return;if($A(this.aOpenedLayers).has(elLayer))return;this.oApp.exec("POSITION_DIALOG_LAYER",[elLayer]);this.aOpenedLayers[this.aOpenedLayers.length]=elLayer;if(!$A(this.aMadeDraggable).has(elLayer)){new nhn.DraggableLayer(elLayer,htOptions);this.aMadeDraggable[this.aMadeDraggable.length]=elLayer;}else{elLayer.style.display="block";}},$ON_HIDE_LAST_DIALOG_LAYER:function(){this.oApp.exec("HIDE_DIALOG_LAYER",[this.aOpenedLayers[this.aOpenedLayers.length-1]]);},$ON_HIDE_ALL_DIALOG_LAYER:function(){for(var i=this.aOpenedLayers.length-1;i>=0;i--) this.oApp.exec("HIDE_DIALOG_LAYER",[this.aOpenedLayers[i]]);},$ON_HIDE_DIALOG_LAYER:function(elLayer){elLayer=$(elLayer);if(elLayer)elLayer.style.display="none";this.aOpenedLayers=$A(this.aOpenedLayers).refuse(elLayer).$value();},$ON_TOGGLE_DIALOG_LAYER:function(elLayer,htOptions){if($A(this.aOpenedLayers).indexOf(elLayer)){this.oApp.exec("SHOW_DIALOG_LAYER",[elLayer,htOptions]);}else{this.oApp.exec("HIDE_DIALOG_LAYER",[elLayer]);}},$ON_SET_DIALOG_LAYER_POSITION:function(elLayer,nTop,nLeft){elLayer.style.top=nTop;elLayer.style.left=nLeft;}}); nhn.husky.Hotkey=$Class({name:"Hotkey",$init:function(){this.oShortcut=shortcut;},$ON_REGISTER_HOTKEY:function(sHotkey,sCMD,sArgs){if(!sArgs)sArgs=[];var func=$Fn(this.oApp.exec,this.oApp).bind(sCMD,sArgs);this.oShortcut(sHotkey,this.oApp.getWYSIWYGDocument()).addEvent(func);}}); nhn.husky.HuskyRangeManager=$Class({name:"HuskyRangeManager",oWindow:null,$init:function(win){this.oWindow=win||window;},$BEFORE_MSG_APP_READY:function(){if(this.oWindow&&this.oWindow.tagName=="IFRAME") this.oWindow=this.oWindow.contentWindow;this.oApp.exec("ADD_APP_PROPERTY",["getSelection",$Fn(this.getSelection,this).bind()]);this.oApp.exec("ADD_APP_PROPERTY",["getEmptySelection",$Fn(this.getEmptySelection,this).bind()]);},$ON_SET_EDITING_WINDOW:function(oWindow){this.oWindow=oWindow;},getEmptySelection:function(){var oHuskyRange=new nhn.HuskyRange(this.oWindow);return oHuskyRange;},getSelection:function(){this.oApp.exec("RESTORE_IE_SELECTION",[]);var oHuskyRange=this.getEmptySelection();try{oHuskyRange.setFromSelection();}catch(e){} return oHuskyRange;}}); nhn.husky.MessageManager=$Class({name:"MessageManager",oMessageMap:null,$init:function(oMessageMap){this.oMessageMap=oMessageMap;},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["$MSG",$Fn(this.getMessage,this).bind()]);},getMessage:function(sMsg){if(this.oMessageMap[sMsg])return unescape(this.oMessageMap[sMsg]);return sMsg;}}); nhn.husky.SE_BGColor=$Class({name:"SE_BGColor",rxColorPattern:/^#?[0-9a-fA-F]{6}$|^rgb\(\d+, ?\d+, ?\d+\)$/i,$init:function(elAppContainer){this._assignHTMLObjects(elAppContainer);},_assignHTMLObjects:function(elAppContainer){this.elDropdownLayer=cssquery.getSingle("DIV.husky_seditor_bgcolor_layer",elAppContainer);},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["bgColor","click","TOGGLE_BGCOLOR_LAYER"]);this.oApp.registerBrowserEvent(this.elDropdownLayer,"click","EVENT_APPLY_BGCOLOR",[]);},$ON_TOGGLE_BGCOLOR_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer,null,"SHOW_COLOR_PALETTE",["APPLY_BGCOLOR",this.elDropdownLayer]]);},$ON_EVENT_APPLY_BGCOLOR:function(weEvent){var elButton=weEvent.element;if(elButton.tagName=="SPAN")elButton=elButton.parentNode;if(elButton.tagName!="BUTTON")return;var sBGColor,sFontColor;sBGColor=elButton.style.backgroundColor;sFontColor=elButton.style.color;this.oApp.exec("APPLY_BGCOLOR",[sBGColor,sFontColor]);},$ON_APPLY_BGCOLOR:function(sBGColor,sFontColor){if(!this.rxColorPattern.test(sBGColor)){alert(this.oApp.$MSG("SE_BGColor.invalidColorCode"));return;} var oStyle={"backgroundColor":sBGColor} if(sFontColor)oStyle.color=sFontColor;this.oApp.exec("SET_WYSIWYG_STYLE",[oStyle]);this.oApp.exec("HIDE_ACTIVE_LAYER");}}); nhn.husky.SE_ColorPalette=$Class({name:"SE_ColorPalette",rxRGBColorPattern:/rgb\((\d+), ?(\d+), ?(\d+)\)/i,$init:function(oAppContainer){this._assignHTMLObjects(oAppContainer);},_assignHTMLObjects:function(oAppContainer){this.elColorPaletteLayer=cssquery.getSingle("UL.husky_seditor_color_palette",oAppContainer);},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elColorPaletteLayer,"click","EVENT_MOUSEUP_COLOR_PALETTE");},$ON_SHOW_COLOR_PALETTE:function(sCallbackCmd,oLayerContainer){this.sCallbackCmd=sCallbackCmd;this.oLayerContainer=oLayerContainer;this.oLayerContainer.insertBefore(this.elColorPaletteLayer,null);this.elColorPaletteLayer.style.display="block";},$ON_HIDE_COLOR_PALETTE:function(){this.elColorPaletteLayer.style.display="none";},$ON_COLOR_PALETTE_APPLY_COLOR:function(sColorCode){if(this.rxRGBColorPattern.test(sColorCode)){function dec2Hex(sDec){var sTmp=parseInt(sDec).toString(16);if(sTmp.length<2)sTmp="0"+sTmp;return sTmp.toUpperCase();} var sR=dec2Hex(RegExp.$1);var sG=dec2Hex(RegExp.$2);var sB=dec2Hex(RegExp.$3);sColorCode="#"+sR+sG+sB;} this.oApp.exec(this.sCallbackCmd,[sColorCode]);},$ON_EVENT_MOUSEUP_COLOR_PALETTE:function(oEvent){var elButton=oEvent.element;if(!elButton.style.backgroundColor)return;this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[elButton.style.backgroundColor]);}}); nhn.husky.SE_EditingAreaManager=$Class({name:"SE_EditingAreaManager",oActivePlugin:null,oIRField:null,bIsDirty:false,$init:function(sInitialMode,oIRField,oDimension,fOnBeforeUnload,oAppContainer){this.sInitialMode=sInitialMode;this.oIRField=$(oIRField);this._assignHTMLObjects(oAppContainer);this.fOnBeforeUnload=fOnBeforeUnload;this.oEditingMode={};var welEditingAreaContiner=$Element(this.elEditingAreaContainer);this.elEditingAreaContainer.style.height=oDimension.nHeight||(this.elEditingAreaContainer.offsetHeight+"px");this.nMinHeight=oDimension.nMinHeight||10;this.niMinWidth=oDimension.nMinWidth||10;},_assignHTMLObjects:function(oAppContainer){oAppContainer=$(oAppContainer)||document;this.elEditingAreaContainer=cssquery.getSingle("DIV.husky_seditor_editing_area_container",oAppContainer);this.elEditingAreaSkipUI=cssquery.getSingle("A.skip",oAppContainer);},$BEFORE_MSG_APP_READY:function(msg){this.oApp.exec("ADD_APP_PROPERTY",["elEditingAreaContainer",this.elEditingAreaContainer]);this.oApp.exec("ADD_APP_PROPERTY",["getContents",$Fn(this.getContents,this).bind()]);this.oApp.exec("ADD_APP_PROPERTY",["getIR",$Fn(this.getIR,this).bind()]);this.oApp.exec("ADD_APP_PROPERTY",["setContents",this.setContents]);this.oApp.exec("ADD_APP_PROPERTY",["setIR",this.setIR]);this.oApp.exec("ADD_APP_PROPERTY",["getEditingMode",$Fn(this.getEditingMode,this).bind()]);},$ON_MSG_APP_READY:function(){this.elResizingBoard=document.createElement("DIV");this.elEditingAreaContainer.style.overflow="hidden";this.elEditingAreaContainer.insertBefore(this.elResizingBoard,this.elEditingAreaContainer.firstChild);this.elResizingBoard.style.position="absolute";this.elResizingBoard.style.background="#000000";this.elResizingBoard.style.filter="alpha(opacity=0)";this.elResizingBoard.style.zIndex=99999;this.elResizingBoard.style["MozOpacity"]=0;this._fitElementInEditingArea(this.elResizingBoard);this.elResizingBoard.style.display="none";this.oApp.exec("REGISTER_CONVERTERS",[]);this.oApp.exec("CHANGE_EDITING_MODE",[this.sInitialMode,true]);this.oApp.exec("LOAD_IR_FIELD",[false]);this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"focus","MSG_EDITING_AREA_SIZE_CHANGED",[],50);this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"blur","MSG_EDITING_AREA_SIZE_CHANGED",[],50);if(this.fOnBeforeUnload){window.onbeforeunload=this.fOnBeforeUnload;}else{window.onbeforeunload=$Fn(function(){if(this.getIR()!=this.oIRField.value||this.bIsDirty)return this.oApp.$MSG("SE_EditingAreaManager.onExit");},this).bind();}},$AFTER_MSG_APP_READY:function(){this.oApp.exec("UPDATE_IR_FIELD",[]);},$ON_LOAD_IR_FIELD:function(bDontAddUndo){this.oApp.setIR(this.oIRField.value,bDontAddUndo);},$ON_UPDATE_IR_FIELD:function(){this.oIRField.value=this.oApp.getIR();},$BEFORE_CHANGE_EDITING_MODE:function(sMode){if(!this.oEditingMode[sMode])return false;this._oPrevActivePlugin=this.oActivePlugin;this.oActivePlugin=this.oEditingMode[sMode];},$AFTER_CHANGE_EDITING_MODE:function(sMode,bNoFocus){if(this._oPrevActivePlugin){var sIR=this._oPrevActivePlugin.getIR();this.oApp.exec("SET_IR",[sIR]);this.oApp.exec("ENABLE_UI",[this._oPrevActivePlugin.sMode]);this._setEditingAreaDimension();} this.oApp.exec("DISABLE_UI",[this.oActivePlugin.sMode]);if(!bNoFocus){this.oApp.exec("FOCUS",[]);}},$ON_SET_IS_DIRTY:function(bIsDirty){this.bIsDirty=bIsDirty;},$ON_FOCUS:function(){if(!this.oActivePlugin||typeof this.oActivePlugin.setIR!="function")return this.oActivePlugin.focus();},$BEFORE_SET_IR:function(sIR,bDontAddUndoHistory){bDontAddUndoHistory=bDontAddUndoHistory||false;if(!bDontAddUndoHistory)this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"]);},$ON_SET_IR:function(sIR){if(!this.oActivePlugin||typeof this.oActivePlugin.setIR!="function")return this.oActivePlugin.setIR(sIR);},$AFTER_SET_IR:function(sIR,bDontAddUndoHistory){bDontAddUndoHistory=bDontAddUndoHistory||false;if(!bDontAddUndoHistory)this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"]);},$ON_REGISTER_EDITING_AREA:function(oEditingAreaPlugin){this.oEditingMode[oEditingAreaPlugin.sMode]=oEditingAreaPlugin;this.attachDocumentEvents(oEditingAreaPlugin.oEditingArea);this._setEditingAreaDimension(oEditingAreaPlugin);},$ON_MSG_EDITING_AREA_RESIZE_STARTED:function(){this._fitElementInEditingArea(this.elEditingAreaContainer);this.elResizingBoard.style.display="block";this.iStartingHeight=parseInt(this.elEditingAreaContainer.style.height);},$ON_RESIZE_EDITING_AREA:function(ipNewWidth,ipNewHeight){var iNewWidth=parseInt(ipNewWidth);var iNewHeight=parseInt(ipNewHeight);if(iNewWidth=33&&oKeyInfo.keyCode<=40)||oKeyInfo.keyCode==16)return;this._recordUndo(oKeyInfo)},$ON_PASTE_HTML:function(sHTML,oPSelection){if(this.oApp.getEditingMode()!=this.sMode)return;var oSelection=oPSelection||this.oApp.getSelection();oSelection.pasteHTML(sHTML);if(!$Agent().navigator().ie){var sTmpBookmark=oSelection.placeStringBookmark();this.oApp.getWYSIWYGDocument().body.innerHTML=this.oApp.getWYSIWYGDocument().body.innerHTML;oSelection.moveToBookmark(sTmpBookmark);oSelection.collapseToEnd();oSelection.select();oSelection.removeStringBookmark(sTmpBookmark);} this.oApp.exec("RECORD_UNDO_ACTION",["INSERT HTML"]);},$AFTER_MSG_EDITING_AREA_RESIZE_ENDED:function(FnMouseDown,FnMouseMove,FnMouseUp){this.oApp.exec("REFRESH_WYSIWYG",[]);},$ON_RESTORE_IE_SELECTION:function(){if(this._oIERange){try{this._oIERange.select();this._oPrevIERange=this._oIERange;this._oIERange=null;}catch(e){}}},initIframe:function(){try{if(this.iframe.contentWindow.document==null||this.iframe.contentWindow.document.location.href=='about:blank'){throw new Error('Access denied');} this._enableWYSIWYG();this.status=nhn.husky.PLUGIN_STATUS["READY"];}catch(e){if(this._nIFrameReadyCount-->0){setTimeout($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 sContent=this.iframe.contentWindow.document.body.innerHTML;var sIR;if(this.oApp.applyConverter) sIR=this.oApp.applyConverter(this.sMode+"_TO_IR",sContent);else sIR=sContent;return sIR;},setIR:function(sIR){var sContent;if(this.oApp.applyConverter) sContent=this.oApp.applyConverter("IR_TO_"+this.sMode,sIR);else sContent=sIR;this.iframe.contentWindow.document.body.innerHTML=sContent;if($Agent().navigator().firefox){if(this.iframe.contentWindow.document.body.innerHTML=="")this.iframe.contentWindow.document.body.innerHTML="
";}},getWindow:function(){return this.iframe.contentWindow;},getDocument:function(){return this.iframe.contentWindow.document;},focus:function(){this.getWindow().focus();this.oApp.exec("RESTORE_IE_SELECTION",[]);},_recordUndo:function(oKeyInfo){var curTime=new Date();if(curTime-this.iLastUndoRecorded .bx",this.oUILayer);this.oFindInputSet=oTmp[0];this.oReplaceInputSet=oTmp[1];this.oFindInput_Keyword=cssquery.getSingle("INPUT",this.oFindInputSet);oTmp=cssquery("INPUT",this.oReplaceInputSet);this.oReplaceInput_Original=oTmp[0];this.oReplaceInput_Replacement=oTmp[1];this.oFindNextButton=cssquery.getSingle("BUTTON.find_next",this.oUILayer);this.oCancelButton=cssquery.getSingle("BUTTON.cancel",this.oUILayer);this.oReplaceButton=cssquery.getSingle("BUTTON.replace",this.oUILayer);this.oReplaceAllButton=cssquery.getSingle("BUTTON.replace_all",this.oUILayer);this.aCloseButtons=cssquery("BUTTON.close",this.oUILayer);this.aCloseButtons[this.aCloseButtons.length]=this.oCancelButton;},$ON_MSG_APP_READY:function(){this.oEditingWindow=this.oApp.getWYSIWYGWindow();this.oFindReplace=new nhn.FindReplace(this.oEditingWindow);if(!this.oFindReplace.bBrowserSupported){this.oApp.exec("DISABLE_UI",["find_replace"]);return;} for(var i=0;i"+sURL+"";this.oSelection.pasteHTML(str);}else{var nSession=Math.ceil(Math.random()*10000);var arg=(sURL==""?["unlink"]:["createLink",false,this.sATagMarker+nSession+sURL]);this.oApp.exec("EXECCOMMAND",arg);this.oSelection.setFromSelection();var oDoc=this.oApp.getWYSIWYGDocument();var aATags=oDoc.body.getElementsByTagName("A");var nLen=aATags.length;var rxMarker=new RegExp(this.sRXATagMarker+nSession,"i");var elATag;for(var i=0;i0){for(var i=1;i=33&&oKeyInfo.keyCode<=40){this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED",[]);this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,this.aHeightChangeKeyMap[oKeyInfo.keyCode-33]]);this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED",[]);oEvent.stop();}},_mousedown:function(oEvent){this.iStartHeight=oEvent.pos().clientY;this.iStartHeightOffset=oEvent.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=oEvent.pos().clientY;this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp]);},_mousemove:function(oEvent){var iHeightChange=oEvent.pos().clientY-this.iStartHeight;this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,iHeightChange]);},_mousemove_parent:function(oEvent){var iHeightChange=oEvent.pos().pageY-(this.welIFrame.offset().top+this.iStartHeight);this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,iHeightChange]);},_mouseup:function(oEvent){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_Quote=$Class({name:"SE_Quote",$init:function(elAppContainer){this._assignHTMLObjects(elAppContainer);},_assignHTMLObjects:function(elAppContainer){this.elDropdownLayer=cssquery.getSingle("DIV.husky_seditor_blockquote_layer",elAppContainer);},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["quote","click","TOGGLE_BLOCKQUOTE_LAYER"]);this.oApp.registerBrowserEvent(this.elDropdownLayer,"click","EVENT_APPLY_SEDITOR_BLOCKQUOTE",[]);},$ON_TOGGLE_BLOCKQUOTE_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer,null,"SELECT_UI",["quote"],"DESELECT_UI",["quote"]]);},$ON_EVENT_APPLY_SEDITOR_BLOCKQUOTE:function(weEvent){var elButton=weEvent.element;if(elButton.tagName!="BUTTON")return;var sClass=elButton.parentNode.className;if(sClass!="q8") this._wrapBlock("BLOCKQUOTE",sClass);else this._unwrapBlock("BLOCKQUOTE");this.oApp.exec("HIDE_ACTIVE_LAYER",[]);},_unwrapBlock:function(tag){var oSelection=this.oApp.getSelection();var oC=oSelection.commonAncestorContainer;while(oC&&oC.tagName!=tag)oC=oC.parentNode;if(!oC)return;while(oC.firstChild)oC.parentNode.insertBefore(oC.firstChild,oC);oC.parentNode.removeChild(oC);},_wrapBlock:function(tag,className){var oSelection=this.oApp.getSelection();var oLineInfo=oSelection.getLineInfo();var oStart=oLineInfo.oStart;var oEnd=oLineInfo.oEnd;var rxDontUseAsWhole=/BODY|TD|LI/i;var oStartNode,oEndNode;if(oStart.bParentBreak&&!rxDontUseAsWhole.test(oStart.oLineBreaker.tagName))oStartNode=oStart.oNode.parentNode;else oStartNode=oStart.oNode;if(oEnd.bParentBreak&&!rxDontUseAsWhole.test(oEnd.oLineBreaker.tagName))oEndNode=oEnd.oNode.parentNode;else oEndNode=oEnd.oNode;oSelection.setStartBefore(oStartNode);oSelection.setEndAfter(oEndNode);var oNode=this._expandToTableStart(oSelection,oEndNode);if(oNode){oEndNode=oNode;oSelection.setEndAfter(oNode);} oNode=this._expandToTableStart(oSelection,oStartNode);if(oNode){oStartNode=oNode;oSelection.setStartBefore(oNode);} oNode=oStartNode;var oC=oSelection.commonAncestorContainer;while(oNode&&oNode!=oC&&oNode.parentNode!=oC)oNode=oNode.parentNode;oFormattingNode=oSelection._document.createElement(tag);if(className)oFormattingNode.className=className;if(oNode==oC){oC.insertBefore(oFormattingNode,oC.firstChild);}else{oC.insertBefore(oFormattingNode,oNode);} oSelection.setStartAfter(oFormattingNode);oSelection.setEndAfter(oEndNode);oSelection.surroundContents(oFormattingNode);var aNodes=oFormattingNode.childNodes;var oInsertionPoint;for(var i=aNodes.length-1;i>=0;i--){if(aNodes[i].nodeType==3||aNodes[i].tagName=="BR"){var oP=oSelection._document.createElement("P");oInsertionPoint=aNodes[i].nextSibling;while(i>=0&&aNodes[i]&&(aNodes[i].nodeType==3||aNodes[i].tagName=="BR")){oP.insertBefore(aNodes[i--],oP.firstChild);} oFormattingNode.insertBefore(oP,oInsertionPoint);i++;}} if(oFormattingNode&&oFormattingNode.parentNode){var oP=oSelection._document.createElement("P");oP.innerHTML=unescape("
");oFormattingNode.parentNode.insertBefore(oP,oFormattingNode.nextSibling);} this.oApp.exec("RECORD_UNDO_ACTION",["Block Quote"]);return oFormattingNode;},_expandToTableStart:function(oSelection,oNode){var oC=oSelection.commonAncestorContainer;var oResultNode=null;var bLastIteration=false;while(oNode&&!bLastIteration){if(oNode==oC)bLastIteration=true;if(/TBODY|TFOOT|THEAD|TR/i.test(oNode.tagName)){oResultNode=this._getTableRoot(oNode);break;} oNode=oNode.parentNode;} return oResultNode;},_getTableRoot:function(oNode){while(oNode&&oNode.tagName!="TABLE")oNode=oNode.parentNode;return oNode;}}); nhn.husky.SE_SCharacter=$Class({name:"SE_SCharacter",$init:function(oAppContainer){this.bIE=$Agent().navigator().ie;this._assignHTMLObjects(oAppContainer);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(a){return"%u"+a}).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(a){return"%u"+a}).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(a){return"%u"+a}).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(a){return"%u"+a}).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(a){return"%u"+a}).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(a){return"%u"+a}).split(' ');},_assignHTMLObjects:function(oAppContainer){oAppContainer=$(oAppContainer)||document;this.elDropdownLayer=cssquery.getSingle("DIV.husky_seditor_sCharacter_layer",oAppContainer);this.oTextField=cssquery.getSingle("INPUT",this.elDropdownLayer);this.oInsertButton=cssquery.getSingle("+ BUTTON",this.oTextField);this.aCloseButton=cssquery("BUTTON.close",this.elDropdownLayer);this.aSCharList=cssquery(".list",this.elDropdownLayer);var oLabelUL=cssquery.getSingle(">UL",this.elDropdownLayer);this.aLabelA=cssquery("A",oLabelUL);},$ON_MSG_APP_READY:function(){var funcInsert=$Fn(this.oApp.exec,this.oApp).bind("INSERT_SCHARACTERS",[this.oTextField.value]);$Fn(funcInsert,this).attach(this.oInsertButton,"click");this.oApp.exec("SET_SCHARACTER_LIST",[this.charSet]);for(var i=0;i");}else{button=document.createElement("BUTTON");button.type="button";} span=document.createElement("SPAN");span.innerHTML=unescape(this.charSet[i][ii]);button.appendChild(span);aLI[ii].appendChild(button);this.aSCharList[i].appendChild(aLI[ii]);}},_stopBrowserEvent:function(obj,sEvent){$Fn(function(we){we.stop();},this).attach(obj,sEvent);}}); nhn.husky.SE_Table=$Class({name:"SE_Table",iMinRows:1,iMaxRows:20,iMinColumns:1,iMaxColumns:10,iMinBorderWidth:1,iMaxBorderWidth:10,oSelection:null,$init:function(oAppContainer){this._assignHTMLObjects(oAppContainer);},_assignHTMLObjects:function(oAppContainer){var tmp=null;this.elDropdownLayer=cssquery.getSingle("DIV.husky_seditor_table_layer",oAppContainer);this.welDropdownLayer=$Element(this.elDropdownLayer);tmp=cssquery("INPUT",this.elDropdownLayer);this.oRowInput=tmp[0];this.oColumnInput=tmp[1];this.oBorderWidthInput=tmp[2];this.oBorderColorInput=tmp[3];this.oBGColorInput=tmp[4];tmp=cssquery("BUTTON",this.elDropdownLayer);this.oButton_AddRow=tmp[0];this.oButton_RemoveRow=tmp[1];this.oButton_AddColumn=tmp[2];this.oButton_RemoveColumn=tmp[3];this.oButton_IncBorderWidth=tmp[4];this.oButton_DecBorderWidth=tmp[5];this.oButton_BorderColorPreview=tmp[6];this.oButton_BorderColor=tmp[7];this.oButton_BGColorPreview=tmp[8];this.oButton_BGColor=tmp[9];this.oButton_Insert=tmp[10];this.oButton_Cancel=tmp[11];this.oSampleTable=cssquery.getSingle("TABLE",this.elDropdownLayer);},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["table","click","ST_TOGGLE_TOOLBAR_LAYER"]);this.oApp.registerBrowserEvent(this.oRowInput,"change","ST_SET_ROW_NUM",[null,0]);this.oApp.registerBrowserEvent(this.oColumnInput,"change","ST_SET_COLUMN_NUM",[null,0]);this.oApp.registerBrowserEvent(this.oBorderWidthInput,"change","ST_SET_BORDER_WIDTH",[null,0]);this.oApp.registerBrowserEvent(this.oButton_AddRow,"click","ST_ADD_ROW");this.oApp.registerBrowserEvent(this.oButton_RemoveRow,"click","ST_REMOVE_ROW");this.oApp.registerBrowserEvent(this.oButton_AddColumn,"click","ST_ADD_COLUMN");this.oApp.registerBrowserEvent(this.oButton_RemoveColumn,"click","ST_REMOVE_COLUMN");this.oApp.registerBrowserEvent(this.oButton_IncBorderWidth,"click","ST_INC_BORDER_WIDTH");this.oApp.registerBrowserEvent(this.oButton_DecBorderWidth,"click","ST_DEC_BORDER_WIDTH");this.oApp.registerBrowserEvent(this.oButton_BorderColorPreview,"click","ST_TOGGLE_BORDER_COLOR_LAYER");this.oApp.registerBrowserEvent(this.oButton_BGColorPreview,"click","ST_TOGGLE_BGCOLOR_LAYER");this.oApp.registerBrowserEvent(this.oButton_BorderColor,"click","ST_TOGGLE_BORDER_COLOR_LAYER");this.oApp.registerBrowserEvent(this.oButton_BGColor,"click","ST_TOGGLE_BGCOLOR_LAYER");this.oApp.registerBrowserEvent(this.oButton_Insert,"click","ST_INSERT_TABLE");this.oApp.registerBrowserEvent(this.oButton_Cancel,"click","ST_CLOSE");this.oApp.exec("ST_SET_BORDER_COLOR",["#CCCCCC"]);this.oApp.exec("ST_SET_BGCOLOR",["#FFFFFF"]);},$ON_ST_TOGGLE_TOOLBAR_LAYER:function(){this.oApp.exec("RECORD_UNDO_ACTION_FORCED",["KEYPRESS"]);this._showNewTable();this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer,"table"]);},$ON_ST_ADD_ROW:function(){this.oApp.exec("ST_SET_ROW_NUM",[null,1]);},$ON_ST_REMOVE_ROW:function(){this.oApp.exec("ST_SET_ROW_NUM",[null,-1]);},$ON_ST_ADD_COLUMN:function(){this.oApp.exec("ST_SET_COLUMN_NUM",[null,1]);},$ON_ST_REMOVE_COLUMN:function(){this.oApp.exec("ST_SET_COLUMN_NUM",[null,-1]);},$ON_ST_SET_ROW_NUM:function(iRows,iRowDiff){iRows=iRows||parseInt(this.oRowInput.value);iRowDiff=iRowDiff||0;iRows+=iRowDiff;if(iRowsthis.iMaxRows)iRows=this.iMaxRows;this.oRowInput.value=iRows;this._showNewTable();},$ON_ST_SET_COLUMN_NUM:function(iColumns,iColumnDiff){iColumns=iColumns||parseInt(this.oColumnInput.value);iColumnDiff=iColumnDiff||0;iColumns+=iColumnDiff;if(iColumnsthis.iMaxColumns)iColumns=this.iMaxColumns;this.oColumnInput.value=iColumns;this._showNewTable();},$ON_ST_INSERT_TABLE:function(){var sTable=this._getTableString();this.oApp.exec("PASTE_HTML",[sTable]);this.oApp.exec("ST_CLOSE",[]);},$ON_ST_CLOSE:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);},$ON_ST_SET_BORDER_WIDTH:function(iBorderWidth,iBorderWidthDiff){iBorderWidth=iBorderWidth||parseInt(this.oBorderWidthInput.value);iBorderWidthDiff=iBorderWidthDiff||0;iBorderWidth+=iBorderWidthDiff;if(iBorderWidththis.iMaxBorderWidth)iBorderWidth=this.iMaxBorderWidth;this.oBorderWidthInput.value=iBorderWidth;this._showNewTable();},$ON_ST_INC_BORDER_WIDTH:function(){this.oApp.exec("ST_SET_BORDER_WIDTH",[null,1]);},$ON_ST_DEC_BORDER_WIDTH:function(){this.oApp.exec("ST_SET_BORDER_WIDTH",[null,-1]);},$ON_ST_TOGGLE_BORDER_COLOR_LAYER:function(){if(this.welDropdownLayer.hasClass("p1")) this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER",[]);else this.oApp.exec("ST_SHOW_BORDER_COLOR_LAYER",[]);},$ON_ST_SHOW_BORDER_COLOR_LAYER:function(){this.welDropdownLayer.addClass("p1");this.welDropdownLayer.removeClass("p2");this.oApp.exec("SHOW_COLOR_PALETTE",["ST_SET_BORDER_COLOR_FROM_PALETTE",this.elDropdownLayer]);},$ON_ST_HIDE_BORDER_COLOR_LAYER:function(){this.welDropdownLayer.removeClass("p1");this.oApp.exec("HIDE_COLOR_PALETTE",[]);},$ON_ST_TOGGLE_BGCOLOR_LAYER:function(){if(this.welDropdownLayer.hasClass("p2")) this.oApp.exec("ST_HIDE_BGCOLOR_LAYER",[]);else this.oApp.exec("ST_SHOW_BGCOLOR_LAYER",[]);},$ON_ST_SHOW_BGCOLOR_LAYER:function(){this.welDropdownLayer.removeClass("p1");this.welDropdownLayer.addClass("p2");this.oApp.exec("SHOW_COLOR_PALETTE",["ST_SET_BGCOLOR_FROM_PALETTE",this.elDropdownLayer]);},$ON_ST_HIDE_BGCOLOR_LAYER:function(){this.welDropdownLayer.removeClass("p2");this.oApp.exec("HIDE_COLOR_PALETTE",[]);},$ON_ST_SET_BORDER_COLOR_FROM_PALETTE:function(sColorCode){this.oApp.exec("ST_SET_BORDER_COLOR",[sColorCode]);this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER",[]);},$ON_ST_SET_BORDER_COLOR:function(sColorCode){this.oBorderColorInput.value=sColorCode;this.oButton_BorderColorPreview.style.backgroundColor=sColorCode;this._showNewTable();},$ON_ST_SET_BGCOLOR_FROM_PALETTE:function(sColorCode){this.oApp.exec("ST_SET_BGCOLOR",[sColorCode]);this.oApp.exec("ST_HIDE_BGCOLOR_LAYER",[]);},$ON_ST_SET_BGCOLOR:function(sColorCode){this.oBGColorInput.value=sColorCode;this.oButton_BGColorPreview.style.backgroundColor=sColorCode;this._showNewTable();},_showNewTable:function(){var oTmp=document.createElement("DIV");oTmp.innerHTML=this._getTableString();var oNewTable=oTmp.firstChild;this.oSampleTable.parentNode.insertBefore(oNewTable,this.oSampleTable);this.oSampleTable.parentNode.removeChild(this.oSampleTable);this.oSampleTable=oNewTable;},_getTableString:function(){var sBorderColorCode=this.oBorderColorInput.value;var sBGColorCode=this.oBGColorInput.value;var iBorderWidth=this.oBorderWidthInput.value;var sTD="";if($Agent().navigator().ie){sTD="

";}else{if($Agent().navigator().firefox){sTD="


";}else{sTD="

 

";}} var sTable='';var sRow='';var iColumns=this.oColumnInput.value;for(var i=0;i";for(var i=0;i*:first-child",aAllLi[i]);this.htWrappedUIList[sUIName]=$Element(this.htUIList[sUIName]);}}},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.toolbarArea,"mouseover","EVENT_TOOLBAR_MOUSEOVER",[]);this.oApp.registerBrowserEvent(this.toolbarArea,"mouseout","EVENT_TOOLBAR_MOUSEOUT",[]);this.oApp.exec("ADD_APP_PROPERTY",["getToolbarButtonByUIName",$Fn(this.getToolbarButtonByUIName,this).bind()]);},$ON_EVENT_TOOLBAR_MOUSEOVER:function(weEvent){if(weEvent.element.tagName=="BUTTON")$Element(weEvent.element).addClass("hover");},$ON_EVENT_TOOLBAR_MOUSEOUT:function(weEvent){if(weEvent.element.tagName=="BUTTON")$Element(weEvent.element).removeClass("hover");},$ON_TOGGLE_TOOLBAR_ACTIVE_LAYER:function(oLayer,oBtn,sOpenCmd,aOpenArgs,sCloseCmd,aCloseArgs){this.oApp.exec("TOGGLE_ACTIVE_LAYER",[oLayer,"MSG_TOOLBAR_LAYER_SHOWN",[oLayer,oBtn,sOpenCmd,aOpenArgs],sCloseCmd,aCloseArgs]);},$ON_MSG_TOOLBAR_LAYER_SHOWN:function(oLayer,oBtn,aOpenCmd,aOpenArgs){this.oApp.exec("POSITION_TOOLBAR_LAYER",[oLayer,oBtn]);if(aOpenCmd)this.oApp.exec(aOpenCmd,aOpenArgs);},$ON_SHOW_TOOLBAR_ACTIVE_LAYER:function(oLayer,sCmd,aArgs,oBtn){this.oApp.exec("SHOW_ACTIVE_LAYER",[oLayer,sCmd,aArgs]);this.oApp.exec("POSITION_TOOLBAR_LAYER",[oLayer,oBtn]);},$ON_ENABLE_UI:function(sUIName){this._enableUI(sUIName);},$ON_DISABLE_UI:function(sUIName){this._disableUI(sUIName);},$ON_SELECT_UI:function(sUIName){var welUI=this.htWrappedUIList[sUIName];if(!welUI)return;welUI.addClass("active");},$ON_DESELECT_UI:function(sUIName){var welUI=this.htWrappedUIList[sUIName];if(!welUI)return;welUI.removeClass("active");},$ON_ENABLE_ALL_UI:function(){var sUIName,className;for(var sUIName in this.htUIList){if(sUIName){this._enableUI(sUIName);}} $Element(this.toolbarArea).removeClass("off");},$ON_DISABLE_ALL_UI:function(){var sUIName;for(var sUIName in this.htUIList){if(sUIName){this._disableUI(sUIName);}} $Element(this.toolbarArea).addClass("off");this.oApp.exec("HIDE_ACTIVE_LAYER",[]);},$ON_MSG_STYLE_CHANGED:function(sAttributeName,attributeValue){if(attributeValue==1) this.oApp.exec("SELECT_UI",[sAttributeName]);else this.oApp.exec("DESELECT_UI",[sAttributeName]);},$ON_REGISTER_UI_EVENT:function(sUIName,sEvent,sCmd,aParams){if(!this.aUICmdMap[sUIName]){this.aUICmdMap[sUIName]=[];} this.aUICmdMap[sUIName][this.aUICmdMap[sUIName].length]=sCmd;var elUI=this.htUIList[sUIName];if(!elUI)return;this.oApp.registerBrowserEvent(elUI,sEvent,sCmd,aParams);},$ON_POSITION_TOOLBAR_LAYER:function(oLayer,oBtn){oLayer=$(oLayer);oBtn=$(oBtn);if(!oLayer)return;if(oBtn&&oBtn.tagName&&oBtn.tagName=="BUTTON")oBtn.parentNode.appendChild(oLayer);oLayer.style.left="0";var welLayer=$Element(oLayer);var nLayerLeft=welLayer.offset().left;nLayerLeft+=oLayer.offsetWidth;var nToolbarLeft=this.welToolbarArea.offset().left;nToolbarLeft+=this.toolbarArea.offsetWidth;if(nLayerLeft>nToolbarLeft)oLayer.style.left=(nToolbarLeft-nLayerLeft-5)+"px";},_enableUI:function(sUIName){var welUI=this.htWrappedUIList[sUIName];var elUI=this.htUIList[sUIName];if(!welUI)return;welUI.removeClass("off");elUI.disabled=false;var sCmd="";if(this.aUICmdMap[sUIName]){for(var i=0;i",$init:function(){this.aUndoHistory=[];this.oCurStateIdx={nIdx:0,nStep:0};},$LOCAL_BEFORE_ALL:function(sCmd){if(sCmd.match(/_DO_RECORD_UNDO_HISTORY_AT$/))return true;try{if(this.oApp.getEditingMode()!="WYSIWYG")return false;}catch(e){return false;} return true;},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("DO_RECORD_UNDO_HISTORY_AT",[this.oCurStateIdx,"","",null]);},$ON_MSG_APP_READY:function(){this.bFF=$Agent().navigator().firefox;this.oApp.exec("ADD_APP_PROPERTY",["getUndoHistory",$Fn(this._getUndoHistory,this).bind()]);this.oApp.exec("ADD_APP_PROPERTY",["getUndoStateIdx",$Fn(this._getUndoStateIdx,this).bind()]);this.oApp.exec("REGISTER_UI_EVENT",["undo","click","UNDO"]);this.oApp.exec("REGISTER_UI_EVENT",["redo","click","REDO"]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+z","UNDO"]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+y","REDO"]);},$ON_UNDO:function(){var oTmpStateIdx={};this.oApp.exec("DO_RECORD_UNDO_HISTORY",["KEYPRESS",false,false,1]);if(this.oCurStateIdx.nIdx==0)return;if(this.oCurStateIdx.nStep>0){this.oCurStateIdx.nStep--;}else{var oTmpHistory=this.aUndoHistory[this.oCurStateIdx.nIdx];this.oCurStateIdx.nIdx--;if(oTmpHistory.nTotalSteps>1){this.oCurStateIdx.nStep=0;}else{oTmpHistory=this.aUndoHistory[this.oCurStateIdx.nIdx];this.oCurStateIdx.nStep=oTmpHistory.nTotalSteps-1;}} this.oApp.exec("RESTORE_UNDO_HISTORY",[this.oCurStateIdx.nIdx,this.oCurStateIdx.nStep]);this.oApp.exec("CHECK_STYLE_CHANGE",[]);},$ON_REDO:function(){if(this.oCurStateIdx.nIdx>=this.aUndoHistory.length)return;var oCurHistory=this.aUndoHistory[this.oCurStateIdx.nIdx];if(this.oCurStateIdx.nIdx==this.aUndoHistory.length-1&&this.oCurStateIdx.nStep>=oCurHistory.nTotalSteps-1)return;if(this.oCurStateIdx.nStep";if(oEWrapper.innerHTML=="")oEWrapper.innerHTML="
";if(oEWrapper.nextSibling&&oEWrapper.nextSibling.tagName=="BR")oEWrapper.parentNode.removeChild(oEWrapper.nextSibling);oSelection.selectNodeContents(oEWrapper);oSelection.collapseToStart();oSelection.select();this.oApp.exec("CHECK_STYLE_CHANGE",[]);}else{oSelection.removeStringBookmark(sBM);}},_insertBR:function(oEvent){oEvent.stop();var oSelection=this.oApp.getSelection();var elBR=this.oApp.getWYSIWYGDocument().createElement("BR");oSelection.insertNode(elBR);oSelection.selectNode(elBR);oSelection.collapseToEnd();if(!this.htBrowser.ie){var oLineInfo=oSelection.getLineInfo();var oStart=oLineInfo.oStart;var oEnd=oLineInfo.oEnd;if(oEnd.bParentBreak){while(oEnd.oNode&&oEnd.oNode.nodeType==3&&oEnd.oNode.nodeValue==""){oEnd.oNode=oEnd.oNode.previousSibling;} var nTmp=1;if(oEnd.oNode==elBR||oEnd.oNode.nextSibling==elBR){nTmp=0;} if(nTmp==0){oSelection.pasteHTML("
");oSelection.collapseToEnd();}}} oSelection.insertNode(this.oApp.getWYSIWYGDocument().createTextNode(""));oSelection.select();}}); nhn.husky.SE_WYSIWYGStyleGetter=$Class({name:"SE_WYSIWYGStyleGetter",hKeyUp:null,getStyleInterval:200,oStyleMap:{fontFamily:{type:"Value",css:"fontFamily"},fontSize:{type:"Value",css:"fontSize"},lineHeight:{type:"Value",css:"lineHeight",converter:function(sValue,oStyle){if(!sValue.match(/px$/))return sValue;return Math.ceil((parseInt(sValue)/parseInt(oStyle.fontSize))*10)/10;}},bold:{command:"bold"},underline:{command:"underline"},italic:{command:"italic"},lineThrough:{command:"strikethrough"},superscript:{command:"superscript"},subscript:{command:"subscript"},justifyleft:{command:"justifyleft"},justifycenter:{command:"justifycenter"},justifyright:{command:"justifyright"},justifyfull:{command:"justifyfull"},orderedlist:{command:"insertorderedlist"},unorderedlist:{command:"insertunorderedlist"}},$init:function(){this.oStyle=this._getBlankStyle();},$LOCAL_BEFORE_ALL:function(){if(this.oApp.getEditingMode()!="WYSIWYG")return false;return true;},$ON_MSG_APP_READY:function(){this.oDocument=this.oApp.getWYSIWYGDocument();this.oApp.exec("ADD_APP_PROPERTY",["getCurrentStyle",$Fn(this.getCurrentStyle,this).bind()]);},$ON_EVENT_EDITING_AREA_MOUSEUP:function(oEvnet){if(this.hKeyUp)clearTimeout(this.hKeyUp);this.oApp.exec("CHECK_STYLE_CHANGE",[]);},$ON_EVENT_EDITING_AREA_KEYUP:function(oEvent){var oKeyInfo=oEvent.key();if(!(oKeyInfo.keyCode==8||(oKeyInfo.keyCode>=33&&oKeyInfo.keyCode<=40)||oKeyInfo.keyCode==45||oKeyInfo.keyCode==46))return;if(this.hKeyUp)clearTimeout(this.hKeyUp);this.hKeyUp=setTimeout($Fn(this.oApp.exec,this.oApp).bind("CHECK_STYLE_CHANGE",[]),this.getStyleInterval);},$ON_CHECK_STYLE_CHANGE:function(){this._getStyle();},$ON_RESET_STYLE_STATUS:function(){var oBlankStyle=this._getBlankStyle();for(var sAttributeName in oBlankStyle) this.oApp.exec("SET_STYLE_STATUS",[sAttributeName,oBlankStyle[sAttributeName]]);},getCurrentStyle:function(){return this.oStyle;},_check_style_change:function(){this.oApp.exec("CHECK_STYLE_CHANGE",[]);},_getBlankStyle:function(){var oBlankStyle={};for(var attributeName in this.oStyleMap){if(this.oStyleMap[attributeName].type=="Value") oBlankStyle[attributeName]="";else oBlankStyle[attributeName]=0;} return oBlankStyle;},_getStyle:function(){var oSelection=this.oApp.getSelection();var funcFilter=function(oNode){if(!oNode.childNodes||oNode.childNodes.length==0) return true;else return false;} var aBottomNodes=oSelection.getNodes(false,funcFilter);var oStyle,oBaseStyle,oTmpStyle,attributeName;if(aBottomNodes.length==0){oStyle=this._getStyleOf(oSelection.commonAncestorContainer);}else{oStyle=this._getStyleOf(aBottomNodes[0]);} for(attributeName in oStyle){if(this.oStyleMap[attributeName].converter){oStyle[attributeName]=this.oStyleMap[attributeName].converter(oStyle[attributeName],oStyle);} if(this.oStyle[attributeName]!=oStyle[attributeName]) this.oApp.exec("MSG_STYLE_CHANGED",[attributeName,oStyle[attributeName]]);} this.oStyle=oStyle;},_getStyleOf:function(oNode){var oStyle=this._getBlankStyle();if(!oNode)return oStyle;if(oNode.nodeType==3)oNode=oNode.parentNode;var welNode=$Element(oNode);var attribute,cssName;for(var styleName in this.oStyle){attribute=this.oStyleMap[styleName];if(attribute.type&&attribute.type=="Value"){if(attribute.css){var sValue=welNode.css(attribute.css);if(styleName=="fontFamily"){sValue=sValue.split(/,/)[0];} oStyle[styleName]=sValue;}else{if(attribute.command){try{oStyle[styleName]=this.oDocument.queryCommandState(attribute.command);}catch(e){}}else{}}}else{if(attribute.command){try{if(this.oDocument.queryCommandState(attribute.command)){oStyle[styleName]=1;}else{oStyle[styleName]=0;}}catch(e){}}else{}}} return oStyle;}}); nhn.husky.SE_WYSIWYGStyler=$Class({name:"SE_WYSIWYGStyler",$LOCAL_BEFORE_ALL:function(sFullCommand,aArgs){return(this.oApp.getEditingMode()=="WYSIWYG");},$ON_SET_WYSIWYG_STYLE:function(oStyles){var oSelection=this.oApp.getSelection();if(oSelection.collapsed){var oSpan=this.oApp.getWYSIWYGDocument().createElement("SPAN");oSpan.innerHTML=unescape("%uFEFF");var sValue;for(var sName in oStyles){sValue=oStyles[sName];if(typeof sValue!="string")continue;oSpan.style[sName]=sValue;} if(oSelection.startContainer.tagName=="BODY"&&oSelection.startOffset==0){var oVeryFirstNode=oSelection._getVeryFirstRealChild(this.oApp.getWYSIWYGDocument().body);if(typeof oVeryFirstNode.innerHTML=="string"){oVeryFirstNode.appendChild(oSpan);}else{oSelection.selectNode(oVeryFirstNode);oSelection.collapseToStart();oSelection.insertNode(oSpan);}}else{oSelection.collapseToStart();oSelection.insertNode(oSpan);} oSelection.selectNodeContents(oSpan);oSelection.collapseToEnd();oSelection._window.focus();oSelection._window.document.body.focus();oSelection.select();if($Agent().navigator().firefox&&$Agent().navigator().version==3) oSpan.innerHTML="";return;} this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["FONT STYLE"]);oSelection.styleRange(oStyles);oSelection._window.focus();oSelection.select();this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["FONT STYLE"]);}}); nhn.husky.StringConverterManager=$Class({name:"StringConverterManager",oConverters:null,$init:function(){this.oConverters={};},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["applyConverter",$Fn(this.applyConverter,this).bind()]);this.oApp.exec("ADD_APP_PROPERTY",["addConverter",$Fn(this.addConverter,this).bind()]);},applyConverter:function(sRuleName,sContent){var aConverters=this.oConverters[sRuleName];if(!aConverters)return sContent;for(var i=0;i=0&&nhn.DOMFix.parentNode(aAllNodes[iChildIdx])==aAllNodes[iCurIdx]){iChildIdx=this._recurConstructClonedTree(aAllNodes,iChildIdx,aAllNodes[iCurIdx],oCurNodeCloneWithChildren,oClonedStartContainer,oClonedEndContainer);} oClonedParentNode.insertBefore(oCurNodeCloneWithChildren,oClonedParentNode.firstChild);return iChildIdx;};aNodes[aNodes.length]=nhn.DOMFix.parentNode(aNodes[aNodes.length-1]);_recurConstructClonedTree(aNodes,aNodes.length-1,aNodes[aNodes.length-1],oClonedParentNode);return{oStartContainer:oClonedStartContainer,oEndContainer:oClonedEndContainer};},cloneRange:function(){return this._copyRange(new nhn.W3CDOMRange(this._document));},_copyRange:function(oClonedRange){oClonedRange.collapsed=this.collapsed;oClonedRange.commonAncestorContainer=this.commonAncestorContainer;oClonedRange.endContainer=this.endContainer;oClonedRange.endOffset=this.endOffset;oClonedRange.startContainer=this.startContainer;oClonedRange.startOffset=this.startOffset;oClonedRange._document=this._document;return oClonedRange;},collapse:function(toStart){if(toStart){this.endContainer=this.startContainer;this.endOffset=this.startOffset;}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset;} this._updateRangeInfo();},compareBoundaryPoints:function(how,sourceRange){switch(how){case nhn.W3CDOMRange.START_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,sourceRange.startContainer,sourceRange.startOffset);case nhn.W3CDOMRange.START_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,sourceRange.startContainer,sourceRange.startOffset);case nhn.W3CDOMRange.END_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,sourceRange.endContainer,sourceRange.endOffset);case nhn.W3CDOMRange.END_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,sourceRange.endContainer,sourceRange.endOffset);}},_findBody:function(oNode){if(!oNode)return null;while(oNode){if(oNode.tagName=="BODY")return oNode;oNode=nhn.DOMFix.parentNode(oNode);} return null;},_compareEndPoint:function(oContainerA,iOffsetA,oContainerB,iOffsetB){var iIdxA,iIdxB;if(!oContainerA||this._findBody(oContainerA)!=this._document.body){oContainerA=this._document.body;iOffsetA=0;} if(!oContainerB||this._findBody(oContainerB)!=this._document.body){oContainerB=this._document.body;iOffsetB=0;} var compareIdx=function(iIdxA,iIdxB){if(iIdxB==-1)iIdxB=iIdxA+1;if(iIdxAoNode.nodeValue.length)iOffset=oNode.nodeValue.length;}else{if(iOffset>nhn.DOMFix.childNodes(oNode).length)iOffset=nhn.DOMFix.childNodes(oNode).length;} return iOffset;},setEnd:function(refNode,offset){offset=this._endsNodeValidation(refNode,offset);this.endContainer=refNode;this.endOffset=offset;if(!this.startContainer||this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)!=-1)this.collapse(false);this._updateRangeInfo();},setEndAfter:function(refNode){if(!refNode)throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter");if(refNode.tagName=="BODY"){this.setEnd(refNode,nhn.DOMFix.childNodes(refNode).length);return;} this.setEnd(nhn.DOMFix.parentNode(refNode),this._getPosIdx(refNode)+1);},setEndBefore:function(refNode){if(!refNode)throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore");if(refNode.tagName=="BODY"){this.setEnd(refNode,0);return;} this.setEnd(nhn.DOMFix.parentNode(refNode),this._getPosIdx(refNode));},setStart:function(refNode,offset){offset=this._endsNodeValidation(refNode,offset);this.startContainer=refNode;this.startOffset=offset;if(!this.endContainer||this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)!=-1)this.collapse(true);this._updateRangeInfo();},setStartAfter:function(refNode){if(!refNode)throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter");if(refNode.tagName=="BODY"){this.setStart(refNode,nhn.DOMFix.childNodes(refNode).length);return;} this.setStart(nhn.DOMFix.parentNode(refNode),this._getPosIdx(refNode)+1);},setStartBefore:function(refNode){if(!refNode)throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore");if(refNode.tagName=="BODY"){this.setStart(refNode,0);return;} this.setStart(nhn.DOMFix.parentNode(refNode),this._getPosIdx(refNode));},surroundContents:function(newParent){newParent.appendChild(this.extractContents());this.insertNode(newParent);this.selectNode(newParent);},toString:function(){var oTmpContainer=this._document.createElement("DIV");oTmpContainer.appendChild(this.cloneContents());return oTmpContainer.textContent||oTmpContainer.innerText||"";},_isBlankTextNode:function(oNode){if(oNode.nodeType==3&&oNode.nodeValue=="")return true;return false;},_getPosIdx:function(refNode){var idx=0;for(var node=refNode.previousSibling;node;node=node.previousSibling)idx++;return idx;},_updateRangeInfo:function(){if(!this.startContainer){this.init(this._document);return;} this.collapsed=this._isCollapsed(this.startContainer,this.startOffset,this.endContainer,this.endOffset);this.commonAncestorContainer=this._getCommonAncestorContainer(this.startContainer,this.endContainer);},_isCollapsed:function(oStartContainer,iStartOffset,oEndContainer,iEndOffset){var bCollapsed=false;if(oStartContainer==oEndContainer&&iStartOffset==iEndOffset){bCollapsed=true;}else{var oActualStartNode=this._getActualStartNode(oStartContainer,iStartOffset);var oActualEndNode=this._getActualEndNode(oEndContainer,iEndOffset);oActualStartNode=this._getNextNode(this._getPrevNode(oActualStartNode));oActualEndNode=this._getPrevNode(this._getNextNode(oActualEndNode));if(oActualStartNode&&oActualEndNode&&oActualEndNode.tagName!="BODY"&&(this._getNextNode(oActualEndNode)==oActualStartNode||(oActualEndNode==oActualStartNode&&this._isBlankTextNode(oActualEndNode)))) bCollapsed=true;} return bCollapsed;},_splitTextEndNodesOfTheRange:function(){var oEndPoints=this._splitTextEndNodes({oStartContainer:this.startContainer,iStartOffset:this.startOffset,oEndContainer:this.endContainer,iEndOffset:this.endOffset});this.startContainer=oEndPoints.oStartContainer;this.startOffset=oEndPoints.iStartOffset;this.endContainer=oEndPoints.oEndContainer;this.endOffset=oEndPoints.iEndOffset;},_splitTextEndNodes:function(oEndPoints){oEndPoints=this._splitStartTextNode(oEndPoints);oEndPoints=this._splitEndTextNode(oEndPoints);return oEndPoints;},_splitStartTextNode:function(oEndPoints){var oStartContainer=oEndPoints.oStartContainer;var iStartOffset=oEndPoints.iStartOffset;var oEndContainer=oEndPoints.oEndContainer;var iEndOffset=oEndPoints.iEndOffset;if(!oStartContainer)return oEndPoints;if(oStartContainer.nodeType!=3)return oEndPoints;if(iStartOffset==0)return oEndPoints;if(oStartContainer.nodeValue.length<=iStartOffset)return oEndPoints;var oLastPart=oStartContainer.splitText(iStartOffset);if(oStartContainer==oEndContainer){iEndOffset-=iStartOffset;oEndContainer=oLastPart;} oStartContainer=oLastPart;iStartOffset=0;return{oStartContainer:oStartContainer,iStartOffset:iStartOffset,oEndContainer:oEndContainer,iEndOffset:iEndOffset};},_splitEndTextNode:function(oEndPoints){var oStartContainer=oEndPoints.oStartContainer;var iStartOffset=oEndPoints.iStartOffset;var oEndContainer=oEndPoints.oEndContainer;var iEndOffset=oEndPoints.iEndOffset;if(!oEndContainer)return oEndPoints;if(oEndContainer.nodeType!=3)return oEndPoints;if(iEndOffset>=oEndContainer.nodeValue.length)return oEndPoints;if(iEndOffset==0)return oEndPoints;oEndContainer.splitText(iEndOffset);return{oStartContainer:oStartContainer,iStartOffset:iStartOffset,oEndContainer:oEndContainer,iEndOffset:iEndOffset};},_getNodesInRange:function(){if(this.collapsed)return[];var oStartNode=this._getActualStartNode(this.startContainer,this.startOffset);var oEndNode=this._getActualEndNode(this.endContainer,this.endOffset);return this._getNodesBetween(oStartNode,oEndNode);},_getActualStartNode:function(oStartContainer,iStartOffset){var oStartNode=oStartContainer;;if(oStartContainer.nodeType==3){if(iStartOffset>=oStartContainer.nodeValue.length){oStartNode=this._getNextNode(oStartContainer);if(oStartNode.tagName=="BODY")oStartNode=null;}else{oStartNode=oStartContainer;}}else{if(iStartOffset=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(bBefore,bStrict){if(this.collapsed&&this.startContainer&&this.startContainer.nodeType==3)return this.startContainer;if(!this.collapsed||(this.startContainer&&this.startContainer.nodeType==3))return this.getStartNode();var oBeforeRange,oAfterRange,oResult;if(this.startOffset>=nhn.DOMFix.childNodes(this.startContainer).length) oAfterRange=this._getNextNode(this.startContainer);else oAfterRange=nhn.DOMFix.childNodes(this.startContainer)[this.startOffset];if(this.endOffset==0) oBeforeRange=this._getPrevNode(this.endContainer);else oBeforeRange=nhn.DOMFix.childNodes(this.endContainer)[this.endOffset-1];if(bBefore){oResult=oBeforeRange;if(!oResult&&!bStrict)oResult=oAfterRange;}else{oResult=oAfterRange;if(!oResult&&!bStrict)oResult=oBeforeRange;} return oResult;},_getXPath:function(elNode){var sXPath="";while(elNode&&elNode.nodeType==1){sXPath="/"+elNode.tagName+"["+this._getPosIdx4XPath(elNode)+"]"+sXPath;elNode=nhn.DOMFix.parentNode(elNode);} return sXPath;},_getPosIdx4XPath:function(refNode){var idx=0;for(var node=refNode.previousSibling;node;node=node.previousSibling) if(node.tagName==refNode.tagName)idx++;return idx;},_evaluateXPath:function(sXPath,oDoc){sXPath=sXPath.substring(1,sXPath.length-1);var aXPath=sXPath.split(/\//);var elNode=oDoc.body;for(var i=2;i-1&&elContainer){var aChildNodes=nhn.DOMFix.childNodes(elContainer);var elNode=null;var nIdx=nTextNodeIdx;var nOffsetLeft=nOffset;while((elNode=aChildNodes[nIdx])&&elNode.nodeType==3&&elNode.nodeValue.length=0)return true;if(bIncludePartlyIncluded){if(startToEnd==1)return false;if(endToStart==-1)return false;return true;} return false;},isNodeInRange:function(oNode,bIncludePartlySelected,bContentOnly){var oTmpRange=new nhn.HuskyRange(this._window);if(bContentOnly&&oNode.firstChild){oTmpRange.setStartBefore(oNode.firstChild);oTmpRange.setEndAfter(oNode.lastChild);}else{oTmpRange.selectNode(oNode);} return isRangeInRange(oTmpRange,bIncludePartlySelected);},pasteHTML:function(sHTML){if(sHTML==""){this.deleteContents();return;} var oTmpDiv=this._document.createElement("DIV");oTmpDiv.innerHTML=sHTML;var oFirstNode=oTmpDiv.firstChild;var oLastNode=oTmpDiv.lastChild;var clone=this.cloneRange();var sBM=clone.placeStringBookmark();while(oTmpDiv.lastChild)this.insertNode(oTmpDiv.lastChild);this.setEndNodes(oFirstNode,oLastNode);clone.moveToBookmark(sBM);clone.deleteContents();clone.removeStringBookmark(sBM);},toString:function(){this.toString=nhn.W3CDOMRange.prototype.toString;return this.toString();},toHTMLString:function(){var oTmpContainer=this._document.createElement("DIV");oTmpContainer.appendChild(this.cloneContents());return oTmpContainer.innerHTML;},findAncestorByTagName:function(sTagName){var oNode=this.commonAncestorContainer;while(oNode&&oNode.tagName!=sTagName)oNode=nhn.DOMFix.parentNode(oNode);return oNode;},selectNodeContents:function(oNode){if(!oNode)return;var oFirstNode=oNode.firstChild?oNode.firstChild:oNode;var oLastNode=oNode.lastChild?oNode.lastChild:oNode;if(oFirstNode.nodeType==3) this.setStart(oFirstNode,0);else this.setStartBefore(oFirstNode);if(oLastNode.nodeType==3) this.setEnd(oLastNode,oLastNode.nodeValue.length);else this.setEndAfter(oLastNode);},styleRange:function(oStyle,oAttribute,sNewSpanMarker){var aStyleParents=this._getStyleParentNodes(sNewSpanMarker);if(aStyleParents.length<1)return;var sName,sValue;for(var i=0;i=0)){oSNode=this.getNodeAroundRange(false,true);oENode=this.getNodeAroundRange(false,true);oStart=this._getLineStartInfo(oSNode);oEnd=this._getLineEndInfo(oENode);} return{oStart:oStart,oEnd:oEnd};}}).extend(nhn.W3CDOMRange);nhn.SimpleSelection=function(win){this.init=function(win){this._window=win||window;this._document=this._window.document;};this.init(win);var oAgentInfo=$Agent().navigator();if(oAgentInfo.ie) nhn.SimpleSelectionImpl_IE.apply(this);else nhn.SimpleSelectionImpl_FF.apply(this);this.selectRange=function(oRng){this.selectNone();this.addRange(oRng);};this.selectionLoaded=true;if(!this._oSelection)this.selectionLoaded=false;};nhn.SimpleSelectionImpl_FF=function(){this._oSelection=this._window.getSelection();this.getRangeAt=function(iNum){iNum=iNum||0;try{var oFFRange=this._oSelection.getRangeAt(iNum);}catch(e){return new nhn.W3CDOMRange(this._document);} return this._FFRange2W3CRange(oFFRange);};this.addRange=function(oW3CRange){var oFFRange=this._W3CRange2FFRange(oW3CRange);this._oSelection.addRange(oFFRange);};this.selectNone=function(){this._oSelection.removeAllRanges();};this._FFRange2W3CRange=function(oFFRange){var oW3CRange=new nhn.W3CDOMRange(this._document);oW3CRange.setStart(oFFRange.startContainer,oFFRange.startOffset);oW3CRange.setEnd(oFFRange.endContainer,oFFRange.endOffset);return oW3CRange;};this._W3CRange2FFRange=function(oW3CRange){var oFFRange=this._document.createRange();oFFRange.setStart(oW3CRange.startContainer,oW3CRange.startOffset);oFFRange.setEnd(oW3CRange.endContainer,oW3CRange.endOffset);return oFFRange;};};nhn.SimpleSelectionImpl_IE=function(){this._oSelection=this._document.selection;this.getRangeAt=function(iNum){iNum=iNum||0;if(this._oSelection.type=="Control"){var oW3CRange=new nhn.W3CDOMRange(this._document);var oSelectedNode=this._oSelection.createRange().item(iNum);if(!oSelectedNode||oSelectedNode.ownerDocument!=this._document)return oW3CRange;oW3CRange.selectNode(oSelectedNode);return oW3CRange;}else{var oSelectedNode=this._oSelection.createRangeCollection().item(iNum).parentElement();if(!oSelectedNode||oSelectedNode.ownerDocument!=this._document){var oW3CRange=new nhn.W3CDOMRange(this._document);return oW3CRange;} return this._IERange2W3CRange(this._oSelection.createRangeCollection().item(iNum));}};this.addRange=function(oW3CRange){var oIERange=this._W3CRange2IERange(oW3CRange);oIERange.select();};this.selectNone=function(){this._oSelection.empty();};this._W3CRange2IERange=function(oW3CRange){var oStartIERange=this._getIERangeAt(oW3CRange.startContainer,oW3CRange.startOffset);var oEndIERange=this._getIERangeAt(oW3CRange.endContainer,oW3CRange.endOffset);oStartIERange.setEndPoint("EndToEnd",oEndIERange);return oStartIERange;};this._getIERangeAt=function(oW3CContainer,iW3COffset){var oIERange=this._document.body.createTextRange();var oEndPointInfoForIERange=this._getSelectableNodeAndOffsetForIE(oW3CContainer,iW3COffset);var oSelectableNode=oEndPointInfoForIERange.oSelectableNodeForIE;var iIEOffset=oEndPointInfoForIERange.iOffsetForIE;oIERange.moveToElementText(oSelectableNode);oIERange.collapse(oEndPointInfoForIERange.bCollapseToStart);oIERange.moveStart("character",iIEOffset);return oIERange;};this._getSelectableNodeAndOffsetForIE=function(oW3CContainer,iW3COffset){var oIERange=this._document.body.createTextRange();var oNonTextNode=null;var aChildNodes=null;var iNumOfLeftNodesToCount=0;if(oW3CContainer.nodeType==3){oNonTextNode=nhn.DOMFix.parentNode(oW3CContainer);aChildNodes=nhn.DOMFix.childNodes(oNonTextNode);iNumOfLeftNodesToCount=aChildNodes.length;}else{oNonTextNode=oW3CContainer;aChildNodes=nhn.DOMFix.childNodes(oNonTextNode);iNumOfLeftNodesToCount=iW3COffset;} var oNodeTester=null;var iResultOffset=0;var bCollapseToStart=true;for(var i=0;i=0)break;oPrevNonTextNode=aChildNodes[i];} var pointRangeIdx=i;if(pointRangeIdx!=0&&aChildNodes[pointRangeIdx-1].nodeType==3){var oRgTextStart=this._document.body.createTextRange();var oCurTextNode=null;if(oPrevNonTextNode){oRgTextStart.moveToElementText(oPrevNonTextNode);oRgTextStart.collapse(false);oCurTextNode=oPrevNonTextNode.nextSibling;}else{oRgTextStart.moveToElementText(oContainer);oRgTextStart.collapse(true);oCurTextNode=oContainer.firstChild;} var oRgTextsUpToThePoint=oRgOrigPoint.duplicate();oRgTextsUpToThePoint.setEndPoint("StartToStart",oRgTextStart);var textCount=oRgTextsUpToThePoint.text.length while(textCount>oCurTextNode.nodeValue.length&&oCurTextNode.nextSibling){textCount-=oCurTextNode.nodeValue.length;oCurTextNode=oCurTextNode.nextSibling;} var oTmp=oCurTextNode.nodeValue;if(bStartPt&&oCurTextNode.nextSibling&&oCurTextNode.nextSibling.nodeType==3&&textCount==oCurTextNode.nodeValue.length){textCount-=oCurTextNode.nodeValue.length;oCurTextNode=oCurTextNode.nextSibling;} oContainer=oCurTextNode;offset=textCount;}else{oContainer=oRgOrigPoint.parentElement();offset=pointRangeIdx;} return{"oContainer":oContainer,"iOffset":offset};};} nhn.DOMFix=new($Class({$init:function(){if($Agent().navigator().ie||$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(elNode){return elNode.parentNode;},_parentNode_Fix:function(elNode){if(!elNode)return elNode;while(elNode.previousSibling){elNode=elNode.previousSibling;} return elNode.parentNode;},_childNodes_Native:function(elNode){return elNode.childNodes;},_childNodes_Fix:function(elNode){var aResult=null;var nCount=0;if(elNode){var aResult=[];elNode=elNode.firstChild;while(elNode){aResult[nCount++]=elNode;elNode=elNode.nextSibling;}} return aResult;}}))();var oMessageMap={'SE_EditingAreaManager.onExit':'%uB0B4%uC6A9%uC774%20%uBCC0%uACBD%uB418%uC5C8%uC2B5%uB2C8%uB2E4.','SE_FontColor.invalidColorCode':'%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff','SE_BGColor.invalidColorCode':'%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff','SE_Hyperlink.invalidURL':'%uC785%uB825%uD558%uC2E0%20URL%uC774%20%uC62C%uBC14%uB974%uC9C0%20%uC54A%uC2B5%uB2C8%uB2E4.','SE_FindReplace.keywordMissing':'%uCC3E%uC73C%uC2E4%20%uB2E8%uC5B4%uB97C%20%uC785%uB825%uD574%20%uC8FC%uC138%uC694.','SE_FindReplace.keywordNotFound':'%uCC3E%uC73C%uC2E4%20%uB2E8%uC5B4%uAC00%20%uC5C6%uC2B5%uB2C8%uB2E4.','SE_FindReplace.replaceAllResultP1':'%uC77C%uCE58%uD558%uB294%20%uB0B4%uC6A9%uC774%20%uCD1D%20','SE_FindReplace.replaceAllResultP2':'%uAC74%20%uBC14%uB00C%uC5C8%uC2B5%uB2C8%uB2E4.','SE_FindReplace.notSupportedBrowser':'%uD604%uC7AC%20%uC0AC%uC6A9%uD558%uACE0%20%uACC4%uC2E0%20%uBE0C%uB77C%uC6B0%uC800%uC5D0%uC11C%uB294%20%uC0AC%uC6A9%uD558%uC2E4%uC218%20%uC5C6%uB294%20%uAE30%uB2A5%uC785%uB2C8%uB2E4.%5Cn%uC774%uC6A9%uC5D0%20%uBD88%uD3B8%uC744%20%uB4DC%uB824%20%uC8C4%uC1A1%uD569%uB2C8%uB2E4.'};if(typeof window.nhn=='undefined')window.nhn={};nhn.DraggableLayer=$Class({$init:function(oLayer,oOptions){this.oOptions=$Class({}).extend({bModal:"false",oHandle:oLayer,iMinX:-999999,iMinY:-999999,iMaxX:999999,iMaxY:999999}).extend(oOptions);this.oHandle=this.oOptions.oHandle;oLayer.style.display="block";oLayer.style.position="absolute";oLayer.style.zIndex="9999";this.aBasePosition=this.getBaseOffset(oLayer);oLayer.style.top=(this.toInt($Element(oLayer).offset().top)-this.aBasePosition.top)+"px";oLayer.style.left=(this.toInt($Element(oLayer).offset().left)-this.aBasePosition.left)+"px";this.$FnMouseDown=$Fn($Fn(this._mousedown,this).bind(oLayer),this);this.$FnMouseMove=$Fn($Fn(this._mousemove,this).bind(oLayer),this);this.$FnMouseUp=$Fn($Fn(this._mouseup,this).bind(oLayer),this);this.$FnMouseDown.attach(this.oHandle,"mousedown");},_mousedown:function(oLayer,oEvent){if(oEvent.element.tagName=="INPUT")return;this.MouseOffsetY=(oEvent.pos().clientY-this.toInt(oLayer.style.top)-this.aBasePosition['top']);this.MouseOffsetX=(oEvent.pos().clientX-this.toInt(oLayer.style.left)-this.aBasePosition['left']);this.$FnMouseMove.attach(oLayer,"mousemove");this.$FnMouseUp.attach(oLayer,"mouseup");},_mousemove:function(oLayer,oEvent){var iTop=(oEvent.pos().clientY-this.MouseOffsetY-this.aBasePosition['top']);var iLeft=(oEvent.pos().clientX-this.MouseOffsetX-this.aBasePosition['left']);if(iTopthis.oOptions.iMaxY)iTop=this.oOptions.iMaxY;if(iLeftthis.oOptions.iMaxX)iLeft=this.oOptions.iMaxX;oLayer.style.top=iTop+"px";oLayer.style.left=iLeft+"px";},_mouseup:function(oLayer,oEvent){this.$FnMouseMove.detach(oLayer,"mousemove");this.$FnMouseUp.detach(oLayer,"mouseup");},toInt:function(num){var result=parseInt(num);return result||0;},findNonStatic:function(oEl){if(!oEl)return null;if(oEl.tagName=="BODY")return oEl;if($Element(oEl).css("position").match(/absolute|relative/i))return oEl;return this.findNonStatic(oEl.offsetParent);},getBaseOffset:function(oEl){var oBase=this.findNonStatic(oEl.offsetParent);var tmp=$Element(oBase).offset();return{top:tmp.top,left:tmp.left};}});if(typeof window.nhn=='undefined')window.nhn={};nhn.FindReplace=$Class({sKeyword:"",window:null,document:null,bBrowserSupported:false,bEOC:false,$init:function(win){this.window=win;this.document=this.window.document;if(this.document.domain!=this.document.location.hostname){var oAgentInfo=$Agent();var oNavigatorInfo=oAgentInfo.navigator();if(oNavigatorInfo.firefox&&oNavigatorInfo.version<3){this.bBrowserSupported=false;this.find=function(){return 3};return;}} this.bBrowserSupported=true;},find:function(sKeyword,bCaseMatch,bBackwards,bWholeWord){var bSearchResult,bFreshSearch;this.window.focus();if(!sKeyword)return 2;this.bEOC=false;bSearchResult=this.findNext(sKeyword,bCaseMatch,bBackwards,bWholeWord);if(bSearchResult)return 0;this.bEOC=true;bSearchResult=this.findNew(sKeyword,bCaseMatch,bBackwards,bWholeWord);if(bSearchResult)return 0;return 1;},findNew:function(sKeyword,bCaseMatch,bBackwards,bWholeWord){this.findReset();return this.findNext(sKeyword,bCaseMatch,bBackwards,bWholeWord);},findNext:function(sKeyword,bCaseMatch,bBackwards,bWholeWord){var bSearchResult;bCaseMatch=bCaseMatch||false;bWholeWord=bWholeWord||false;bBackwards=bBackwards||false;if(this.window.find){var bWrapAround=false;return this.window.find(sKeyword,bCaseMatch,bBackwards,bWrapAround,bWholeWord);} if(this.document.body.createTextRange){var iOption=0;if(bBackwards)iOption+=1;if(bWholeWord)iOption+=2;if(bCaseMatch)iOption+=4;this.window.focus();this._range=this.document.selection.createRangeCollection().item(0);this._range.collapse(false);bSearchResult=this._range.findText(sKeyword,1,iOption);this._range.select();return bSearchResult;} return false;},findReset:function(){if(this.window.find){this.window.getSelection().removeAllRanges();return;} if(this.document.body.createTextRange){this._range=this.document.body.createTextRange();this._range.collapse(true);this._range.select();}},replace:function(sOriginalWord,Replacement,bCaseMatch,bBackwards,bWholeWord){if(!sOriginalWord)return 4;var oSelection=new nhn.HuskyRange(this.window);oSelection.setFromSelection();bCaseMatch=bCaseMatch||false;var bMatch,selectedText=oSelection.toString();if(bCaseMatch) bMatch=(selectedText==sOriginalWord);else bMatch=(selectedText.toLowerCase()==sOriginalWord.toLowerCase());if(!bMatch) return this.find(sOriginalWord,bCaseMatch,bBackwards,bWholeWord)+2;if(typeof Replacement=="function"){oSelection=Replacement(oSelection);}else{oSelection.pasteHTML(Replacement);} oSelection.select();return this.find(sOriginalWord,bCaseMatch,bBackwards,bWholeWord);},replaceAll:function(sOriginalWord,Replacement,bCaseMatch,bWholeWord){if(!sOriginalWord)return-1;var bBackwards=false;var iReplaceResult;var iResult=0;var win=this.window;var oSelection=new nhn.HuskyRange(this.window);oSelection.setFromSelection();var sBookmark=oSelection.placeStringBookmark();this.bEOC=false;while(!this.bEOC){iReplaceResult=this.replace(sOriginalWord,Replacement,bCaseMatch,bBackwards,bWholeWord);if(iReplaceResult==0||iReplaceResult==1)iResult++;} var startingPointReached=function(){var oCurSelection=new nhn.HuskyRange(win);oCurSelection.setFromSelection();oSelection.moveToBookmark(sBookmark);var pos=oSelection.compareBoundaryPoints(nhn.W3CDOMRange.START_TO_END,oCurSelection);if(pos==1)return false;return true;} iReplaceResult=0;this.bEOC=false;while(!startingPointReached()&&iReplaceResult==0&&!this.bEOC){iReplaceResult=this.replace(sOriginalWord,Replacement,bCaseMatch,bBackwards,bWholeWord);if(iReplaceResult==0||iReplaceResult==1)iResult++;} oSelection.moveToBookmark(sBookmark);oSelection.select();oSelection.removeStringBookmark(sBookmark);return iResult;}}); function createSEditorInIFrame(elIFrame,elIRField,htParams){if(!window.$Jindo){parent.document.body.innerHTML="진도 프레임웍이 필요합니다.
\nhttp://dev.naver.com/projects/jindo/download에서 jindo.min.js를 다운로드 받아 /js 폴더에 복사 해 주세요.";return;} nEditingAreaHeight=elIRField.style.height||elIRField.offsetHeight+"px";nEditingAreaWidth=elIRField.style.width||elIRField.offsetWidth+"px";elIRField.style.display="none";elIFrame.style.width=nEditingAreaWidth;elAppContainer=elIFrame.contentWindow.document.body;var oWYSIWYGIFrame=cssquery.getSingle(".input_area IFRAME.input_wysiwyg",elAppContainer);var oHTMLSrcTextarea=cssquery.getSingle(".input_area TEXTAREA.input_syntax",elAppContainer);var oIRTextarea=elIRField?elIRField:cssquery.getSingle(".input_area TEXTAREA.blind",elAppContainer);var oEditor=new nhn.husky.HuskyCore();oEditor.registerPlugin(new nhn.husky.CorePlugin());oEditor.registerPlugin(new nhn.husky.StringConverterManager());oEditor.registerPlugin(new nhn.husky.SE_EditingAreaManager("WYSIWYG",oIRTextarea,{nHeight:nEditingAreaHeight,nMinHeight:205},function(){},elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_EditingArea_WYSIWYG(oWYSIWYGIFrame));oEditor.registerPlugin(new nhn.husky.SE_EditingArea_HTMLSrc(oHTMLSrcTextarea));oEditor.registerPlugin(new nhn.husky.Utils());oEditor.registerPlugin(new nhn.husky.DialogLayerManager());oEditor.registerPlugin(new nhn.husky.ActiveLayerManager());oEditor.registerPlugin(new nhn.husky.HuskyRangeManager(oWYSIWYGIFrame));oEditor.registerPlugin(new nhn.husky.Hotkey());oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGStyler());oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGStyleGetter());oEditor.registerPlugin(new nhn.husky.SE_Toolbar(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_ExecCommand(oWYSIWYGIFrame));oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGEnterKey("P"));oEditor.registerPlugin(new nhn.husky.SE_ColorPalette(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_FontColor(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_BGColor(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_Quote(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_FontNameWithSelectUI(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_FontSizeWithSelectUI(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_LineHeightWithSelectUI(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_UndoRedo());oEditor.registerPlugin(new nhn.husky.SE_Table(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_Hyperlink(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_EditingModeToggler(elAppContainer));oEditor.registerPlugin(new nhn.husky.MessageManager(oMessageMap));oEditor.registerPlugin(new nhn.husky.SE_SCharacter(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_FindReplacePlugin(elAppContainer));oEditor.registerPlugin(new nhn.husky.SE_OuterIFrameControl(elAppContainer,100));SE_RegisterCustomPlugins(oEditor,elAppContainer);return oEditor;} function Shortcut(sKey,sId){var store=Shortcut.Store;var action=Shortcut.Action;if(typeof sId==="undefined"&&sKey.constructor==String){store.set("document",sKey,document);return action.init(store.get("document"),sKey);}else if(sId.constructor==String&&sKey.constructor==String){store.set(sId,sKey,$(sId));return action.init(store.get(sId),sKey);}else if(sId.constructor!=String&&sKey.constructor==String){var fakeId="nonID"+new Date().getTime();fakeId=Shortcut.Store.searchId(fakeId,sId);store.set(fakeId,sKey,sId);return action.init(store.get(fakeId),sKey);} alert(sId+unescape(" must be a String or null"));};Shortcut.Store={anthorKeyHash:{},datas:{},currentId:"",currentKey:"",searchId:function(sId,oElement){$H(this.datas).forEach(function(oValue,sKey){if(oElement==oValue.element){sId=sKey;$H.Break();}});return sId;},set:function(sId,sKey,oElement){this.currentId=sId;this.currentKey=sKey;var idData=this.get(sId);this.datas[sId]=idData?idData.createKey(sKey):new Shortcut.Data(sId,sKey,oElement);},get:function(sId,sKey){if(sKey){return this.datas[sId].keys[sKey];}else{return this.datas[sId];}},reset:function(sId){var data=this.datas[sId];Shortcut.Helper.bind(data.func,data.element,"detach");delete this.datas[sId];},allReset:function(){$H(this.datas).forEach($Fn(function(value,key){this.reset(key);},this).bind());}};Shortcut.Data=$Class({$init:function(sId,sKey,oElement){this.id=sId;this.element=oElement;this.func=$Fn(this.fire,this);Shortcut.Helper.bind(this.func,oElement,"attach");this.keys={};this.createKey(sKey);},createKey:function(sKey){this.keys[sKey]={};var data=this.keys[sKey];data.key=sKey;data.events=[];data.commonExceptions=[];data.keyAnalysis=Shortcut.Helper.keyInterpretor(sKey);data.stopDefalutBehavior=true;return this;},fire:function(weEvent){$H(this.keys).forEach($Fn(function(value,key){this.excute(weEvent,key);},this).bind());},excute:function(weEvent,sRawKey){var isExcute=true;var staticFun=Shortcut.Helper;var data=this.keys[sRawKey];if(staticFun.isCorrect(weEvent.key(),data.keyAnalysis)&&staticFun.notCommonException(weEvent,data.commonExceptions)){$A(data.events).forEach(function(v){if(data.stopDefalutBehavior){var leng=v.exceptions.length;if(leng){for(var i=0;i