ERP-node/WebContent/smarteditor/js/lib/jindo2.all.js

4 lines
103 KiB
JavaScript
Raw Normal View History

2025-08-21 09:41:46 +09:00
function isUnCacheAgent(){var e=_ua.indexOf("iPad")>-1,t=_ua.indexOf("Android")>-1,n=!(_ua.indexOf("IEMobile")>-1)&&_ua.indexOf("Mobile")>-1||e&&_ua.indexOf("Safari")>-1;return n&&!e&&!t}"undefined"!=typeof window&&"undefined"==typeof window.nhn&&(window.nhn={}),"undefined"!=typeof window?"undefined"==typeof window.jindo&&(window.jindo={}):jindo||(jindo={}),jindo.$Jindo=function(){var e=arguments.callee,t=e._cached;return t?t:this instanceof e?(t||(e._cached=this),void(this.version="1.5.2-SMART_EDITOR")):new e},jindo.$=function(e){var t=[],n=arguments,o=n.length,i=n[o-1],r=document,s=null,a=/^<([a-z]+|h[1-5])>$/i,u=/^<([a-z]+|h[1-5])(\s+[^>]+)?>/i;o>1&&"string"!=typeof i&&i.body&&(n=Array.prototype.slice.apply(n,[0,o-1]),r=i);for(var l=0;o>l;l++){if(s=n[l],"string"==typeof s)if(s=s.replace(/^\s+|\s+$/g,""),s.indexOf("<")>-1){if(a.test(s))s=r.createElement(RegExp.$1);else if(u.test(s)){for(var d={thead:"table",tbody:"table",tr:"tbody",td:"tr",dt:"dl",dd:"dl",li:"ul",legend:"fieldset",option:"select"},c=RegExp.$1.toLowerCase(),p=jindo._createEle(d[c],s,r),l=0,f=p.length;f>l;l++)t.push(p[l]);s=null}}else s=r.getElementById(s);s&&(t[t.length]=s)}return t.length>1?t:t[0]||null},jindo._createEle=function(e,t,n,o){var i="R"+(new Date).getTime()+parseInt(1e5*Math.random(),10),r=n.createElement("div");switch(e){case"select":case"table":case"dl":case"ul":case"fieldset":r.innerHTML="<"+e+' class="'+i+'">'+t+"</"+e+">";break;case"thead":case"tbody":case"col":r.innerHTML="<table><"+e+' class="'+i+'">'+t+"</"+e+"></table>";break;case"tr":r.innerHTML='<table><tbody><tr class="'+i+'">'+t+"</tr></tbody></table>";break;default:r.innerHTML='<div class="'+i+'">'+t+"</div>"}var s;for(s=r.firstChild;s&&s.className!=i;s=s.firstChild);return o?s:s.childNodes},jindo.$Class=function(oDef){function typeClass(){for(var t=this,a=[],superFunc=function(m,superClass,func){if("constructor"!=m&&func.toString().indexOf("$super")>-1){var funcArg=func.toString().replace(/function[^\(]*\(([^\)]*)[\w\W]*/g,"$1").split(","),funcStr=func.toString().replace(/function[^{]*{/,"").replace(/(\w|\.?)(this\.\$super|this)/g,function(e,t,n){return t?e:n+".$super"});funcStr=funcStr.substr(0,funcStr.length-1),func=superClass[m]=eval("false||function("+funcArg.join(",")+"){"+funcStr+"}")}return function(){var e=this.$this[m],t=this.$this,n=(t[m]=func).apply(t,arguments);return t[m]=e,n}};"undefined"!=typeof t._$superClass;){t.$super=new Object,t.$super.$this=this;for(var x in t._$superClass.prototype)t._$superClass.prototype.hasOwnProperty(x)&&("undefined"==typeof this[x]&&"$init"!=x&&(this[x]=t._$superClass.prototype[x]),"constructor"!=x&&"_$superClass"!=x&&"function"==typeof t._$superClass.prototype[x]?t.$super[x]=superFunc(x,t._$superClass,t._$superClass.prototype[x]):t.$super[x]=t._$superClass.prototype[x]);"function"==typeof t.$super.$init&&(a[a.length]=t),t=t.$super}for(var i=a.length-1;i>-1;i--)a[i].$super.$init.apply(a[i].$super,arguments);"function"==typeof this.$init&&this.$init.apply(this,arguments)}if("undefined"!=typeof oDef.$static){var i=0,x;for(x in oDef)oDef.hasOwnProperty(x)&&("$static"==x||i++);for(x in oDef.$static)oDef.$static.hasOwnProperty(x)&&(typeClass[x]=oDef.$static[x]);if(!i)return oDef.$static;delete oDef.$static}return typeClass.prototype=oDef,typeClass.prototype.constructor=typeClass,typeClass.extend=jindo.$Class.extend,typeClass},jindo.$Class.extend=function(e){if("undefined"==typeof e||null===e||!e.extend)throw new Error("extend시 슈퍼 클래스는 Class여야 합니다.");this.prototype._$superClass=e;for(var t in e)if(e.hasOwnProperty(t)){if("prototype"==t)continue;this[t]=e[t]}return this},jindo.$$=jindo.cssquery=function(){function getElementsByClass(e,t,n){var o=new Array;null==t&&(t=document),null==n&&(n="*");var r=t.getElementsByTagName(n),s=r.length,a=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0,j=0;i<s;i++)a.test(r[i].className)&&(o[j]=r[i],j++);return o}function _isNonStandardQueryButNotException(e){return/\[\s*(?:checked|selected|disabled)/.test(e)}function _commaRevise(e,t){return e.replace(/\,/gi,t)}var sVersion="3.0",debugOpt
if(r.postBody&&"XHR"==l&&"GET"!=d)t="string"==typeof e?e:jindo.$Json(e).toString();else if("undefined"!=typeof e&&e){for(var c in e)e.hasOwnProperty(c)&&(n=e[c],"function"==typeof n&&(n=n()),n instanceof Array||n instanceof jindo.$A?jindo.$A(n).forEach(function(e,t,n){s[s.length]=c+"="+encodeURIComponent(e)}):s[s.length]=c+"="+encodeURIComponent(n));t=s.join("&")}else t=null;if(t&&"XHR"==l&&"GET"==d&&(u+=-1==u.indexOf("?")?"?":"&",u+=t,t=null),i.open(d,u,!!r.async),r.withCredentials&&(i.withCredentials=!0),this._bCORS&&r.sendheader===!1&&(i.setRequestHeader=null),"XHR"==l&&"GET"==d&&/MSIE|Trident/.test(window.navigator.userAgent)&&i.setRequestHeader&&i.setRequestHeader("If-Modified-Since","Thu, 1 Jan 1970 00:00:00 GMT"),("XHR"==l||"IFRAME"==l||"FLASH"==l&&r.sendheader)&&i.setRequestHeader){this._headers["Content-Type"]||i.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),i.setRequestHeader("charset","utf-8"),this._bCORS||this._headers["X-Requested-With"]||i.setRequestHeader("X-Requested-With","XMLHttpRequest");for(var p in this._headers)if(this._headers.hasOwnProperty(p)){if("function"==typeof this._headers[p])continue;i.setRequestHeader(p,String(this._headers[p]))}}var f=navigator.userAgent;if(!i.addEventListener||f.indexOf("Opera")>-1||f.indexOf("MSIE")>-1)if("undefined"!=typeof i.onload){if(i.onload=function(e){4!=i.readyState||o._is_abort||(clearTimeout(a),a=void 0,o._onload(e))},this._bXDomainRequest){var h=i.onload;i.onload=function(e){o._request.readyState=4,o._request.status=200,h(e)},i.onerror=function(e){o._request.readyState=4,o._request.status=404,h(e)}}}else if(6==window.navigator.userAgent.match(/(?:MSIE) ([0-9.]+)/)[1]&&r.async){var y=function(e){4!=i.readyState||o._is_abort||(a&&(clearTimeout(a),a=void 0),o._onload(e),clearInterval(o._interval),o._interval=void 0)};this._interval=setInterval(y,300)}else i.onreadystatechange=function(e){4==i.readyState&&(clearTimeout(a),a=void 0,o._onload(e))};else this._loadFunc&&i.removeEventListener("load",this._loadFunc,!1),this._loadFunc=function(e){clearTimeout(a),a=void 0,o._onload(e)},i.addEventListener("load",this._loadFunc,!1),i.addEventListener("error",this._loadFunc,!1);return r.timeout>0&&(this._timer&&clearTimeout(this._timer),a=setTimeout(function(){o._is_abort=!0,o._interval&&(clearInterval(o._interval),o._interval=void 0);try{i.abort()}catch(e){}r.ontimeout(i),"function"==typeof o._oncompleted&&o._oncompleted(!1)},1e3*r.timeout),this._timer=a),this._test_url=u,i.send(t),this},jindo.$Ajax.prototype.isIdle=function(){return 0==this._status},jindo.$Ajax.prototype.abort=function(){try{this._interval&&clearInterval(this._interval),this._timer&&clearTimeout(this._timer),this._interval=void 0,this._timer=void 0,this._is_abort=!0,this._request.abort()}finally{this._status--}return this},jindo.$Ajax.prototype.option=function(e,t){if("undefined"==typeof e)return"";if("string"==typeof e)return"undefined"==typeof t?this._options[e]:(this._options[e]=t,this);try{for(var n in e)e.hasOwnProperty(n)&&(this._options[n]=e[n])}catch(o){}return this},jindo.$Ajax.prototype.header=function(e,t){if("undefined"==typeof e)return"";if("string"==typeof e)return"undefined"==typeof t?this._headers[e]:(this._headers[e]=t,this);try{for(var n in e)e.hasOwnProperty(n)&&(this._headers[n]=e[n])}catch(o){}return this},jindo.$Ajax.Response=function(e){return this===jindo.$Ajax?new jindo.$Ajax.Response(e):void(this._response=e)},jindo.$Ajax.Response.prototype.xml=function(){return this._response.responseXML},jindo.$Ajax.Response.prototype.text=function(){return this._response.responseText},jindo.$Ajax.Response.prototype.status=function(){return this._response.status},jindo.$Ajax.Response.prototype.readyState=function(){return this._response.readyState},jindo.$Ajax.Response.prototype.json=function(){if(this._response.responseJSON)return this._response.responseJSON;if(this._response.responseText)try{return eval("("+this._response.responseText+")")}catch(e){return{}}return{}},jindo.$Ajax.Response.prototype.header=function(e){return"string"==typeof e?this._respon
n=i.createElement("div"),n.innerHTML="<table><"+r+' class="'+o+'">'+e+"</"+r+"></table>";break;default:t.innerHTML=e}if(n){var s;for(s=n.firstChild;s&&s.className!=o;s=s.firstChild);if(s){for(var a,u=!0;a=t.firstChild;)a.removeNode(!0);for(var a=s.firstChild;a;a=s.firstChild)if("select"==r){var l=a.cloneNode(!0);a.selected&&u&&(u=!1,l.selected=!0),t.appendChild(l),a.removeNode(!0)}else t.appendChild(a);n.removeNode&&n.removeNode(!0)}n=null}return this}return this._element.innerHTML}:n?jindo.$Element.prototype.html=function(e){if("undefined"!=typeof e&&arguments.length){e+="";var t=this._element;if(t.parentNode)t.innerHTML=e;else{var n,o="R"+(new Date).getTime()+parseInt(1e5*Math.random(),10),i=t.ownerDocument||t.document||document,r=t.tagName.toLowerCase();switch(r){case"select":case"table":n=i.createElement("div"),n.innerHTML="<"+r+' class="'+o+'">'+e+"</"+r+">";break;case"tr":case"thead":case"tbody":case"colgroup":n=i.createElement("div"),n.innerHTML="<table><"+r+' class="'+o+'">'+e+"</"+r+"></table>";break;default:t.innerHTML=e}if(n){var s;for(s=n.firstChild;s&&s.className!=o;s=s.firstChild);if(s){for(var a;a=t.firstChild;)a.removeNode(!0);for(var a=s.firstChild;a;a=s.firstChild)t.appendChild(a);n.removeNode&&n.removeNode(!0)}n=null}}return this}return this._element.innerHTML}:jindo.$Element.prototype.html=function(e){if("undefined"!=typeof e&&arguments.length){e+="";var t=this._element;return t.innerHTML=e,this}return this._element.innerHTML},this.html(e)},jindo.$Element.prototype.outerHTML=function(){var e=this._element;if("undefined"!=typeof e.outerHTML)return e.outerHTML;var t=e.ownerDocument||e.document||document,n=t.createElement("div"),o=e.parentNode;if(!o)return e.innerHTML;o.insertBefore(n,e),n.style.display="none",n.appendChild(e);var i=n.innerHTML;return o.insertBefore(e,n),o.removeChild(n),i},jindo.$Element.prototype.toString=jindo.$Element.prototype.outerHTML,jindo.$Element._getTransition=function(){var e=!1,t="";return"undefined"!=typeof document.body.style.trasition?(e=!0,t="trasition"):"undefined"!=typeof document.body.style.webkitTransition?(e=!0,t="webkitTransition"):"undefined"!=typeof document.body.style.OTransition&&(e=!0,t="OTransition"),(jindo.$Element._getTransition=function(){return{hasTransition:e,name:t}})()},jindo.$Element.prototype.appear=function(e,t){var n=jindo.$Element._getTransition();return n.hasTransition?jindo.$Element.prototype.appear=function(e,t){e=e||.3;var o=this;t=t||function(){};var i=function(){t(),o.show(),this.removeEventListener(n.name+"End",arguments.callee,!1)},r=this._element;return this.visible()||(r.style.opacity=r.style.opacity||0,o.show()),r.addEventListener(n.name+"End",i,!1),r.style[n.name+"Property"]="opacity",r.style[n.name+"Duration"]=e+"s",r.style[n.name+"TimingFunction"]="linear",setTimeout(function(){r.style.opacity="1"},1),this}:jindo.$Element.prototype.appear=function(e,t){var n=this,o=this.opacity();if(this.visible()||(o=0),1==o)return this;try{clearTimeout(this._fade_timer)}catch(i){}t=t||function(){};var r=(1-o)/(100*(e||.3)),s=function(){o+=r,n.opacity(o),o>=1?t(n):n._fade_timer=setTimeout(s,10)};return this.show(),s(),this},this.appear(e,t)},jindo.$Element.prototype.disappear=function(e,t){var n=jindo.$Element._getTransition();return n.hasTransition?jindo.$Element.prototype.disappear=function(e,t){e=e||.3;var o=this;t=t||function(){};var i=function(){t(),this.removeEventListener(n.name+"End",arguments.callee,!1),o.hide()},r=this._element;return r.addEventListener(n.name+"End",i,!1),r.style[n.name+"Property"]="opacity",r.style[n.name+"Duration"]=e+"s",r.style[n.name+"TimingFunction"]="linear",setTimeout(function(){r.style.opacity="0"},1),this}:jindo.$Element.prototype.disappear=function(e,t){var n=this,o=this.opacity();if(0==o)return this;try{clearTimeout(this._fade_timer)}catch(i){}t=t||function(){};var r=o/(100*(e||.3)),s=function(){o-=r,n.opacity(o),0>=o?(n.hide(),n.opacity(1),t(n)):n._fade_timer=setTimeout(s,10)};return s(),this},this.disappear(e,t)},jindo.$Element.prototype.offset=function(e,t){var n=this._element,o=null;if("number"==typeof e&&
if(n=1==n.nodeType?[n]:n,arguments.length>1){var o=arguments[1];return jindo.$A(n).forEach(function(e){switch(e.type){case"radio":e.checked=e.value==o;break;case"checkbox":o.constructor==Array?e.checked=jindo.$A(o).has(e.value):e.checked=e.value==o;break;case"select-one":for(var t=-1,n=0,i=e.options.length;i>n;n++)e.options[n].value==o&&(t=n);e.selectedIndex=t;break;case"select-multiple":var t=-1;if(o.constructor==Array)for(var r=jindo.$A(o),n=0,i=e.options.length;i>n;n++)e.options[n].selected=r.has(e.options[n].value);else{for(var n=0,i=e.options.length;i>n;n++)e.options[n].value==o&&(t=n);e.selectedIndex=t}break;default:e.value=o}}),this}var i=[];return jindo.$A(n).forEach(function(e){switch(e.type){case"radio":case"checkbox":e.checked&&i.push(e.value);break;case"select-one":-1!=e.selectedIndex&&i.push(e.options[e.selectedIndex].value);break;case"select-multiple":if(-1!=e.selectedIndex)for(var t=0,n=e.options.length;n>t;t++)e.options[t].selected&&i.push(e.options[t].value);break;default:i.push(e.value)}}),i.length>1?i:i[0]},jindo.$Form.prototype.submit=function(e,t){var n=null;return"string"==typeof e&&(n=this._form.target,this._form.target=e),"function"==typeof e&&(t=e),"undefined"==typeof t||t(this._form)?(this._form.submit(),null!==n&&(this._form.target=n),this):this},jindo.$Form.prototype.reset=function(e){return"undefined"==typeof e||e(this._form)?(this._form.reset(),this):this},jindo.$Template=function(e){var t=null,n="",o=arguments.callee;return e instanceof o?e:this instanceof o?("undefined"==typeof e?e="":(t=document.getElementById(e)||e)&&t.tagName&&(n=t.tagName.toUpperCase())&&("TEXTAREA"==n||"SCRIPT"==n&&"text/template"==t.getAttribute("type"))&&(e=(t.value||t.innerHTML).replace(/^\s+|\s+$/g,"")),void(this._str=e+"")):new o(e)},jindo.$Template.splitter=/(?!\\)[\{\}]/g,jindo.$Template.pattern=/^(?:if (.+)|elseif (.+)|for (?:(.+)\:)?(.+) in (.+)|(else)|\/(if|for)|=(.+)|js (.+)|set (.+))$/,jindo.$Template.prototype.process=function(data){var key="",leftBrace="",rightBrace="",tpl=(" "+this._str+" ").replace(/\\{/g,leftBrace).replace(/\\}/g,rightBrace).replace(/(?!\\)\}\{/g,"}"+key+"{").split(jindo.$Template.splitter),i=tpl.length,map={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"," ":"\\t","\f":"\\f"},reg=[/(["'](?:(?:\\.)+|[^\\["']+)*["']|[a-zA-Z_][\w\.]*)/g,/[\n\r\t\f"\\]/g,/^\s+/,/\s+$/,/#/g],cb=[function(e){return'"'==e.substring(0,1)||"'"==e.substring(0,1)||"null"==e?e:"d."+e},function(e){return map[e]||e},"",""],stm=[],lev=0;if(tpl[0]=tpl[0].substr(1),tpl[i-1]=tpl[i-1].substr(0,tpl[i-1].length-1),2>i)return tpl[0];tpl=jindo.$A(tpl).reverse().$value();for(var delete_info;i--;)i%2?tpl[i]=tpl[i].replace(jindo.$Template.pattern,function(){var e=arguments;if(e[10])return e[10].replace(/(\w+)(?:\s*)=(?:\s*)(?:([a-zA-Z0-9_]+)|(.+))$/g,function(){var e=arguments,t="d."+e[1]+"=";return t+=e[2]?"d."+e[2]:e[3].replace(/(=(?:[a-zA-Z_][\w\.]*)+)/g,function(e){return"="==e.substring(0,1)?"d."+e.replace("=",""):e})})+";";if(e[9])return"s[i++]="+e[9].replace(/(=(?:[a-zA-Z_][\w\.]*)+)/g,function(e){return"="==e.substring(0,1)?"d."+e.replace("=",""):e})+";";if(e[8])return"s[i++]= d."+e[8]+";";if(e[1])return"if("+e[1].replace(reg[0],cb[0]).replace(/d\.(typeof) /,"$1 ").replace(/ d\.(instanceof) d\./," $1 ")+"){";if(e[2])return"}else if("+e[2].replace(reg[0],cb[0]).replace(/d\.(typeof) /,"$1 ").replace(/ d\.(instanceof) d\./," $1 ")+"){";if(e[5]){delete_info=e[4];var t=[];return t.push("var t#=d."+e[5]+"||{},p#=isArray(t#),i#=0;"),t.push("for(var x# in t#){"),t.push("if(!t#.hasOwnProperty(x#)){continue;}"),t.push(" if( (p# && isNaN(i#=parseInt(x#,10))) || (!p# && !t#.propertyIsEnumerable(x#)) ) continue;"),t.push(" d."+e[4]+"=t#[x#];"),t.push(e[3]?"d."+e[3]+"=p#?i#:x#;":""),t.join("").replace(reg[4],lev++)}return e[6]?"}else{":e[7]?"for"==e[7]?"delete d."+delete_info+"; };":"};":e[0]}):tpl[i]==key?tpl[i]="":tpl[i]&&(tpl[i]='s[i++]="'+tpl[i].replace(reg[1],cb[1])+'";');tpl=jindo.$A(tpl).reverse().$value().join("").replace(new RegExp(leftBrace,"g"),"{").replace(new RegExp(rightBrace,"g"),"}");var _aStr=[];return _aStr.push("