파이어폭스 68 버전에서 스마트에디터 오류 나는 부분을 예외처리
This commit is contained in:
1 parent
73478d5961
commit
c17fef6778
2 files changed
+19
-14
No files matched your search
@@ -20339,18 +20339,23 @@ nhn.husky.HuskyCore.mixin(nhn.husky.SE2M_TableEditor, {
|
||||
|
||||
addCSSClass : function(sClassName, sClassRule){
|
||||
var oDoc = this.oApp.getWYSIWYGDocument();
|
||||
if(oDoc.styleSheets[0] && oDoc.styleSheets[0].addRule){
|
||||
// IE
|
||||
oDoc.styleSheets[0].addRule("." + sClassName, sClassRule);
|
||||
}else{
|
||||
// FF
|
||||
var elHead = oDoc.getElementsByTagName("HEAD")[0];
|
||||
var elStyle = oDoc.createElement ("STYLE");
|
||||
//styleElement.type = "text / css";
|
||||
elHead.appendChild (elStyle);
|
||||
|
||||
elStyle.sheet.insertRule("." + sClassName + " { "+sClassRule+" }", 0);
|
||||
}
|
||||
|
||||
try {
|
||||
if(oDoc.styleSheets[0] && oDoc.styleSheets[0].addRule){
|
||||
// IE
|
||||
oDoc.styleSheets[0].addRule("." + sClassName, sClassRule);
|
||||
}else{
|
||||
// FF
|
||||
var elHead = oDoc.getElementsByTagName("HEAD")[0];
|
||||
var elStyle = oDoc.createElement ("STYLE");
|
||||
//styleElement.type = "text / css";
|
||||
elHead.appendChild (elStyle);
|
||||
|
||||
elStyle.sheet.insertRule("." + sClassName + " { "+sClassRule+" }", 0);
|
||||
}
|
||||
} catch (e) {
|
||||
//console.log(e);
|
||||
}
|
||||
},
|
||||
|
||||
// [SMARTEDITORSUS-1533]
|
||||
|
||||
+2
-2
@@ -1,2 +1,2 @@
|
||||
/* 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<e;k++){g[k]=j[k]}}if(h){g[g.length]=h}f=this._execMsgStep("BEFORE",m,g);if(f){f=this._execMsgStep("ON",m,g)}if(f){f=this._execMsgStep("AFTER",m,g)}}return f},registerPlugin:function(f){if(!f){throw ("An error occured in registerPlugin(): invalid plug-in")}f.nIdx=this.aPlugins.length;f.oApp=this;this.aPlugins[f.nIdx]=f;if(f.status!=nhn.husky.PLUGIN_STATUS.NOT_READY){f.status=nhn.husky.PLUGIN_STATUS.READY}if(this.appStatus!=nhn.husky.APP_STATUS.NOT_READY){for(var e in f){if(b.test(e)){this.addToMessageMap(e,f)}}}this.exec("MSG_PLUGIN_REGISTERED",[f]);return f.nIdx},disableMessage:function(e,f){this.oDisabledMessage[e]=f},registerBrowserEvent:function(j,k,f,h,e){h=h||[];var g=(e)?jindo.$Fn(this.delayedExec,this).bind(f,h,e):jindo.$Fn(this.exec,this).bind(f,h);return jindo.$Fn(g,this).attach(j,k)},run:function(h){this.htRunOptions=h||{};this._changeAppStatus(nhn.husky.APP_STATUS.WAITING_FOR_PLUGINS_READY);var g=this.messageQueue.length;for(var f=0;f<g;f++){var e=this.messageQueue[f];this.exec(e.msg,e.args,e.event)}this._fnWaitForPluginReady()},acceptLocalBeforeFirstAgain:function(f,e){f._husky_bRun=!e},createMessageMap:function(e){this.oMessageMap[e]=[];var g=this.aPlugins.length;for(var f=0;f<g;f++){this._doAddToMessageMap(e,this.aPlugins[f])}},addToMessageMap:function(e,f){if(!this.oMessageMap[e]){return}this._doAddToMessageMap(e,f)},_changeAppStatus:function(e){this.appStatus=e;if(this.appStatus==nhn.husky.APP_STATUS.READY){this.exec("MSG_APP_READY")}},_execMsgStep:function(e,f,g){return(this._execMsgStep=this.htOptions.oDebugger?this._execMsgStepWithDebugger:this._execMsgStepWithoutDebugger).call(this,e,f,g)},_execMsgStepWithDebugger:function(e,g,h){this.htOptions.oDebugger.log_MessageStepStart(e,g,h);var f=this._execMsgHandler("$"+e+"_"+g,h);this.htOptions.oDebugger.log_MessageStepEnd(e,g,h);return f},_execMsgStepWithoutDebugger:function(e,f,g){return this._execMsgHandler("$"+e+"_"+f,g)},_execMsgHandler:function(f,g){var h;if(!this.oMessageMap[f]){this.createMessageMap(f)}var k=this.oMessageMap[f];var j=k.length;if(j===0){return true}var e=true;if(c.test(f)){for(h=0;h<j;h++){if(this._execHandler(k[h],f,g)===false){e=false;break}}}else{for(h=0;h<j;h++){if(!k[h]._husky_bRun){k[h]._husky_bRun=true;if(typeof k[h].$LOCAL_BEFORE_FIRST=="function"&&this._execHandler(k[h],"$LOCAL_BEFORE_FIRST",[f,g])===false){continue}}if(typeof k[h].$LOCAL_BEFORE_ALL=="function"){if(this._execHandler(k[h],"$LOCAL_BEFORE_ALL",[f,g])===false){continue}}if(this._execHandler(k[h],f,g)===false){e=false;break}}}return e},_execHandler:function(g,f,e){return(this._execHandler=this.htOptions.oDebugger?this._execHandlerWithDebugger:this._execHandlerWithoutDebugger).call(this,g,f,e)},_execHandlerWithDebugger:function(k,h,g){this.htOptions.oDebugger.log_CallHandlerStart(k,h,g);var f;try{this.aCallerStack.push(k);f=k[h].apply(k,g);this.aCallerStack.pop()}catch(j){this.htOptions.oDebugger.handleException(j);f=false}this.htOptions.oDebugger.log_CallHandlerEnd(k,h,g);return f},_execHandlerWithoutDebugger:function(h,g,f){this.aCallerStack.push(h);var e=h[g].apply(h,f);this.aCallerStack.pop();return e},_doAddToMessageMap:function(f,h){if(typeof h[f]!="function"){return}var j=this.oMessageMap[f];for(var g=0,e=j.length;g<e;g++){if(this.oMessageMap[f][g]==h){return}}this.oMessageMap[fLine truncated
|
||||
/* Copyright (C) NAVER corp. Licensed under LGPL v2. @see https://github.com/naver/smarteditor2/blob/master/LICENSE.md */
|
||||
void 0===window.nhn&&(window.nhn={}),nhn.husky||(nhn.husky={}),function(){var d=/^\$(LOCAL|BEFORE|ON|AFTER)_/,r=/^\$(BEFORE|ON|AFTER)_MSG_APP_READY$/,c=[],a={};nhn.husky.HuskyCore=jindo.$Class({name:"HuskyCore",aCallerStack:null,bMobile:jindo.$Agent().navigator().mobile||jindo.$Agent().navigator().msafari,$init:function(e){this.htOptions=e||{},c.push(this),this.htOptions.oDebugger&&(nhn.husky.HuskyCore.getCore=function(){return c},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).setApp(this)},exec:function(e,t,i){if(this.appStatus==nhn.husky.APP_STATUS.NOT_READY)return this.messageQueue[this.messageQueue.length]={msg:e,args:t,event:i},!0;this.exec=this._exec,this.exec(e,t,i)},delayedExec:function(e,t,i,n){var o=jindo.$Fn(this.exec,this).bind(e,t,n);setTimeout(o,i)},_exec:function(e,t,i){return(this._exec=this.htOptions.oDebugger?this._execWithDebugger:this._execWithoutDebugger).call(this,e,t,i)},_execWithDebugger:function(e,t,i){this.htOptions.oDebugger.log_MessageStart(e,t);var n=this._doExec(e,t,i);return this.htOptions.oDebugger.log_MessageEnd(e,t),n},_execWithoutDebugger:function(e,t,i){return this._doExec(e,t,i)},_doExec:function(e,t,i){var n=!1;if(this.oLazyMessage[e]){var o=this.oLazyMessage[e];return this._loadLazyFiles(e,t,i,o.aFilenames,0),!1}if(!this.oDisabledMessage[e]){var s=[];if(t&&t.length)for(var r=t.length,a=0;a<r;a++)s[a]=t[a];i&&(s[s.length]=i),(n=this._execMsgStep("BEFORE",e,s))&&(n=this._execMsgStep("ON",e,s)),n&&(n=this._execMsgStep("AFTER",e,s))}return n},registerPlugin:function(e){if(!e)throw"An error occured in registerPlugin(): invalid plug-in";if(e.nIdx=this.aPlugins.length,((e.oApp=this).aPlugins[e.nIdx]=e).status!=nhn.husky.PLUGIN_STATUS.NOT_READY&&(e.status=nhn.husky.PLUGIN_STATUS.READY),this.appStatus!=nhn.husky.APP_STATUS.NOT_READY)for(var t in e)d.test(t)&&this.addToMessageMap(t,e);return this.exec("MSG_PLUGIN_REGISTERED",[e]),e.nIdx},disableMessage:function(e,t){this.oDisabledMessage[e]=t},registerBrowserEvent:function(e,t,i,n,o){n=n||[];var s=o?jindo.$Fn(this.delayedExec,this).bind(i,n,o):jindo.$Fn(this.exec,this).bind(i,n);return jindo.$Fn(s,this).attach(e,t)},run:function(e){this.htRunOptions=e||{},this._changeAppStatus(nhn.husky.APP_STATUS.WAITING_FOR_PLUGINS_READY);for(var t=this.messageQueue.length,i=0;i<t;i++){var n=this.messageQueue[i];this.exec(n.msg,n.args,n.event)}this._fnWaitForPluginReady()},acceptLocalBeforeFirstAgain:function(e,t){e._husky_bRun=!t},createMessageMap:function(e){this.oMessageMap[e]=[];for(var t=this.aPlugins.length,i=0;i<t;i++)this._doAddToMessageMap(e,this.aPlugins[i])},addToMessageMap:function(e,t){this.oMessageMap[e]&&this._doAddToMessageMap(e,t)},_changeAppStatus:function(e){this.appStatus=e,this.appStatus==nhn.husky.APP_STATUS.READY&&this.exec("MSG_APP_READY")},_execMsgStep:function(e,t,i){return(this._execMsgStep=this.htOptions.oDebugger?this._execMsgStepWithDebugger:this._execMsgStepWithoutDebugger).call(this,e,t,i)},_execMsgStepWithDebugger:function(e,t,i){this.htOptions.oDebugger.log_MessageStepStart(e,t,i);var n=this._execMsgHandler("$"+e+"_"+t,i);return this.htOptions.oDebugger.log_MessageStepEnd(e,t,i),n},_execMsgStepWithoutDebugger:function(e,t,i){return this._execMsgHandler("$"+e+"_"+t,i)},_execMsgHandler:function(e,t){var i;this.oMessageMap[e]||this.createMessageMap(e);var n=this.oMessageMap[e],o=n.length;if(0===o)return!0;var s=!0;if(r.test(e)){for(i=0;i<o;i++)if(!1===this._execHandler(n[i],e,t)){s=!1;break}}else for(i=0;i<o;i++)if((n[i]._husky_bRun||(n[i]._husky_bRun=!0,"function"!=typeof n[i].$LOCAL_BEFORE_FIRST||!1!==this._execHandler(n[i],"$LOCAL_BEFORE_FIRST",[e,t])))&&("function"!=typeof n[i].$LOCAL_BEFORE_ALL||!1!==this._execHandler(n[i],"$LOCAL_BEFORE_ALL",[e,t]))&&!1===this._execHandler(n[i],e,t)){s=!1;break}return s},_execHandler:function(e,t,i){return(this._execHandler=this.htOptions.oDebugger?this._execHandlerWithDebugger:this._execHandlerWithoutDebugger).call(this,e,t,i)},_execHandlerWithDebugger:function(e,t,i){var n;this.htOptions.oDebugger.log_CallHandlerStart(e,t,i);try{this.aCallerStack.push(e),n=e[t].apply(e,i),this.aCallerStack.pop()}catch(e){this.htOptions.oDebugger.handleException(e),n=!1}return this.htOptions.oDebugger.log_CallHandlerEnd(e,t,i),n},_execHandlerWithoutDebugger:function(e,t,i){this.aCallerStack.push(e);var n=e[t].apply(e,i);return this.aCallerStack.pop(),n},_doAddToMessageMap:function(e,t){if("function"==typeof t[e]){for(var i=0,n=this.oMessageMap[e].length;i<n;i++)if(this.oMessageMap[e][i]==t)return;this.oMessageMap[e][i]=t}},_waitForPluginReady:function(){for(var e=!0,t=0;t<this.aPlugins.length;t++)if(this.aPlugins[t].status==nhn.husky.PLUGIN_STATUS.NOT_READY){e=!1;break}e?this.Line truncated
|
||||
Reference in new issue
Block a user