roojs-core.js
authorjohn <john@roojs.com>
Fri, 2 Feb 2018 08:19:33 +0000 (16:19 +0800)
committerjohn <john@roojs.com>
Fri, 2 Feb 2018 08:19:33 +0000 (16:19 +0800)
roojs-core-debug.js

roojs-core-debug.js
roojs-core.js

index 63c2c5e..f040ea7 100644 (file)
@@ -60,6 +60,7 @@ Roo.apply = function(o, c, defaults){
         isIE = ua.indexOf("msie") > -1,
         isIE7 = ua.indexOf("msie 7") > -1,
         isIE11 = /trident.*rv\:11\./.test(ua),
+        isEdge = ua.indexOf("edge/") > -1,
         isGecko = !isSafari && ua.indexOf("gecko") > -1,
         isBorderBox = isIE && !isStrict,
         isWindows = (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1),
@@ -6632,6 +6633,7 @@ Roo.onReady(function(){
     var cls = [
             Roo.isIE ? "roo-ie"
             : Roo.isIE11 ? "roo-ie11"
+            : Roo.isEdge ? "roo-edge"
             : Roo.isGecko ? "roo-gecko"
             : Roo.isOpera ? "roo-opera"
             : Roo.isSafari ? "roo-safari" : ""];
index 7b9fbee..c7ad537 100644 (file)
@@ -1,25 +1,25 @@
 // Roo.js
 window["undefined"]=window["undefined"];var Roo={};Roo.apply=function(o,c,A){if(A){Roo.apply(o,A);}if(o&&c&&typeof c=='object'){for(var p in c){o[p]=c[p];}}return o;};(function(){var A=0;var ua=navigator.userAgent.toLowerCase();console.log('-------ua---------');
-console.log(ua);var B=document.compatMode=="CSS1Compat",C=ua.indexOf("opera")>-1,D=(/webkit|khtml/).test(ua),E=ua.indexOf("firefox")>-1,F=ua.indexOf("msie")>-1,G=ua.indexOf("msie 7")>-1,H=/trident.*rv\:11\./.test(ua),I=!D&&ua.indexOf("gecko")>-1,J=F&&!B,K=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),L=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),M=(ua.indexOf("linux")!=-1),N=window.location.href.toLowerCase().indexOf("https")===0,O=/iphone|ipad/.test(ua),P=/android/.test(ua),Q=(function(){try{if(ua.indexOf('chrome')!=-1&&ua.indexOf('android')==-1){window.addEventListener('touchstart',function __set_has_touch__(){Roo.isTouch=true;
-window.removeEventListener('touchstart',__set_has_touch__);});return false;}document.createEvent("TouchEvent");return true;}catch(e){return false;}})();if(F&&!G){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}Roo.apply(Roo,{isStrict:B,isSecure:N,isReady:false,debug:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/localhost/s.gif",emptyFn:function(){}
-,applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},addBehaviors:function(o){if(!Roo.isReady){Roo.onReady(function(){Roo.addBehaviors(o);});return;}var R={};for(var b in o){var S=b.split('@');if(S[1]){var s=S[0];
-if(!R[s]){R[s]=Roo.select(s);}R[s].on(S[1],o[b]);}}R=null;},id:function(el,R){R=R||"roo-gen";el=Roo.getDom(el);var id=R+(++A);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sb,sp,R){if(typeof sp=='object'){R=sp;
-sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},S,T=sp.prototype;F.prototype=T;S=sb.prototype=new F();S.constructor=sb;sb.superclass=T;if(T.constructor==Object.prototype.constructor){T.constructor=sp;}sb.override=function(o){Roo.override(sb,o);
-};S.override=io;Roo.override(sb,R);return sb;};}(),override:function(R,S){if(S){var p=R.prototype;for(var T in S){p[T]=S[T];}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval('if (typeof '+rt+' == "undefined"){'+rt+' = {};} o = '+rt+';');
+console.log(ua);var B=document.compatMode=="CSS1Compat",C=ua.indexOf("opera")>-1,D=(/webkit|khtml/).test(ua),E=ua.indexOf("firefox")>-1,F=ua.indexOf("msie")>-1,G=ua.indexOf("msie 7")>-1,H=/trident.*rv\:11\./.test(ua),I=ua.indexOf("edge/")>-1,J=!D&&ua.indexOf("gecko")>-1,K=F&&!B,L=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),M=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),N=(ua.indexOf("linux")!=-1),O=window.location.href.toLowerCase().indexOf("https")===0,P=/iphone|ipad/.test(ua),Q=/android/.test(ua),R=(function(){try{if(ua.indexOf('chrome')!=-1&&ua.indexOf('android')==-1){window.addEventListener('touchstart',function __set_has_touch__(){Roo.isTouch=true;
+window.removeEventListener('touchstart',__set_has_touch__);});return false;}document.createEvent("TouchEvent");return true;}catch(e){return false;}})();if(F&&!G){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}Roo.apply(Roo,{isStrict:B,isSecure:O,isReady:false,debug:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/localhost/s.gif",emptyFn:function(){}
+,applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},addBehaviors:function(o){if(!Roo.isReady){Roo.onReady(function(){Roo.addBehaviors(o);});return;}var S={};for(var b in o){var T=b.split('@');if(T[1]){var s=T[0];
+if(!S[s]){S[s]=Roo.select(s);}S[s].on(T[1],o[b]);}}S=null;},id:function(el,S){S=S||"roo-gen";el=Roo.getDom(el);var id=S+(++A);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sb,sp,S){if(typeof sp=='object'){S=sp;
+sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},T,U=sp.prototype;F.prototype=U;T=sb.prototype=new F();T.constructor=sb;sb.superclass=U;if(U.constructor==Object.prototype.constructor){U.constructor=sp;}sb.override=function(o){Roo.override(sb,o);
+};T.override=io;Roo.override(sb,S);return sb;};}(),override:function(S,T){if(T){var p=S.prototype;for(var U in T){p[U]=T[U];}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval('if (typeof '+rt+' == "undefined"){'+rt+' = {};} o = '+rt+';');
 for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}},factory:function(c,ns){if(!c.xtype||(!ns&&!c.xns)||(c.xns===false)){return c;}ns=c.xns?c.xns:ns;if(c.constructor==ns[c.xtype]){return c;}if(ns[c.xtype]){if(Roo.debug){Roo.log("Roo.Factory("+c.xtype+")");
-}var R=new ns[c.xtype](c);R.xns=false;return R;}c.xns=false;return c;},log:function(s){if((typeof(console)=='undefined')||(typeof(console.log)=='undefined')){return;}console.log(s);},urlEncode:function(o){if(!o){return "";}var R=[];for(var S in o){var ov=o[S],k=Roo.encodeURIComponent(S);
-var T=typeof ov;if(T=='undefined'){R.push(k,"=&");}else if(T!="function"&&T!="object"){R.push(k,"=",Roo.encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,U=ov.length;i<U;i++){R.push(k,"=",Roo.encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");
-}}else{R.push(k,"=&");}}}R.pop();return R.join("");},encodeURIComponent:function(R){try{return encodeURIComponent(R);}catch(e){}if(R==''||R==null){return '';}function nibble_to_hex(U){var V='0123456789ABCDEF';return V.charAt(U);}R=R.toString();var S='';for(var i=0;
-i<R.length;i++){var c=R.charCodeAt(i);var bs=new Array();if(c>0x10000){bs[0]=0xF0|((c&0x1C0000)>>>18);bs[1]=0x80|((c&0x3F000)>>>12);bs[2]=0x80|((c&0xFC0)>>>6);bs[3]=0x80|(c&0x3F);}else if(c>0x800){bs[0]=0xE0|((c&0xF000)>>>12);bs[1]=0x80|((c&0xFC0)>>>6);bs[2]=0x80|(c&0x3F);
-}else if(c>0x80){bs[0]=0xC0|((c&0x7C0)>>>6);bs[1]=0x80|(c&0x3F);}else{bs[0]=c;}for(var j=0;j<bs.length;j++){var b=bs[j];var T=nibble_to_hex((b&0xF0)>>>4)+nibble_to_hex(b&0x0F);S+='%'+T;}}return S;},urlDecode:function(R,S){if(!R||!R.length){return {};}var T={}
-;var U=R.split('&');var V,W,X;for(var i=0,Y=U.length;i<Y;i++){V=U[i].split('=');W=decodeURIComponent(V[0]);X=decodeURIComponent(V[1]);if(S!==true){if(typeof T[W]=="undefined"){T[W]=X;}else if(typeof T[W]=="string"){T[W]=[T[W]];T[W].push(X);}else{T[W].push(X);
-}}else{T[W]=X;}}return T;},each:function(R,fn,S){if(typeof R.length=="undefined"||typeof R=="string"){R=[R];}for(var i=0,T=R.length;i<T;i++){if(fn.call(S||R[i],R[i],i,R)===false){return i;};}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;
-i<l;i++){var a=as[i];if(a instanceof Array){r=r.concat(a);}else if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0));}else{r.push(a);}}return r;},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");},callback:function(cb,R,S,T){if(typeof cb=="function"){if(T){cb.defer(T,R,S||[]);
-}else{cb.apply(R,S||[]);}}},getDom:function(el){if(!el){return null;}return el.dom?el.dom:(typeof el=='string'?document.getElementById(el):el);},getCmp:function(id){return Roo.ComponentMgr.get(id);},num:function(v,R){if(typeof v!='number'){return R;}return v;
-},destroy:function(){for(var i=0,a=arguments,R=a.length;i<R;i++){var as=a[i];if(as){if(as.dom){as.removeAllListeners();as.remove();continue;}if(typeof as.purgeListeners=='function'){as.purgeListeners();}if(typeof as.destroy=='function'){as.destroy();}}}},type:function(o){if(o===undefined||o===null){return false;
+}var S=new ns[c.xtype](c);S.xns=false;return S;}c.xns=false;return c;},log:function(s){if((typeof(console)=='undefined')||(typeof(console.log)=='undefined')){return;}console.log(s);},urlEncode:function(o){if(!o){return "";}var S=[];for(var T in o){var ov=o[T],k=Roo.encodeURIComponent(T);
+var U=typeof ov;if(U=='undefined'){S.push(k,"=&");}else if(U!="function"&&U!="object"){S.push(k,"=",Roo.encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,V=ov.length;i<V;i++){S.push(k,"=",Roo.encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");
+}}else{S.push(k,"=&");}}}S.pop();return S.join("");},encodeURIComponent:function(S){try{return encodeURIComponent(S);}catch(e){}if(S==''||S==null){return '';}function nibble_to_hex(V){var W='0123456789ABCDEF';return W.charAt(V);}S=S.toString();var T='';for(var i=0;
+i<S.length;i++){var c=S.charCodeAt(i);var bs=new Array();if(c>0x10000){bs[0]=0xF0|((c&0x1C0000)>>>18);bs[1]=0x80|((c&0x3F000)>>>12);bs[2]=0x80|((c&0xFC0)>>>6);bs[3]=0x80|(c&0x3F);}else if(c>0x800){bs[0]=0xE0|((c&0xF000)>>>12);bs[1]=0x80|((c&0xFC0)>>>6);bs[2]=0x80|(c&0x3F);
+}else if(c>0x80){bs[0]=0xC0|((c&0x7C0)>>>6);bs[1]=0x80|(c&0x3F);}else{bs[0]=c;}for(var j=0;j<bs.length;j++){var b=bs[j];var U=nibble_to_hex((b&0xF0)>>>4)+nibble_to_hex(b&0x0F);T+='%'+U;}}return T;},urlDecode:function(S,T){if(!S||!S.length){return {};}var U={}
+;var V=S.split('&');var W,X,Y;for(var i=0,Z=V.length;i<Z;i++){W=V[i].split('=');X=decodeURIComponent(W[0]);Y=decodeURIComponent(W[1]);if(T!==true){if(typeof U[X]=="undefined"){U[X]=Y;}else if(typeof U[X]=="string"){U[X]=[U[X]];U[X].push(Y);}else{U[X].push(Y);
+}}else{U[X]=Y;}}return U;},each:function(S,fn,T){if(typeof S.length=="undefined"||typeof S=="string"){S=[S];}for(var i=0,U=S.length;i<U;i++){if(fn.call(T||S[i],S[i],i,S)===false){return i;};}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;
+i<l;i++){var a=as[i];if(a instanceof Array){r=r.concat(a);}else if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0));}else{r.push(a);}}return r;},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");},callback:function(cb,S,T,U){if(typeof cb=="function"){if(U){cb.defer(U,S,T||[]);
+}else{cb.apply(S,T||[]);}}},getDom:function(el){if(!el){return null;}return el.dom?el.dom:(typeof el=='string'?document.getElementById(el):el);},getCmp:function(id){return Roo.ComponentMgr.get(id);},num:function(v,S){if(typeof v!='number'){return S;}return v;
+},destroy:function(){for(var i=0,a=arguments,S=a.length;i<S;i++){var as=a[i];if(as){if(as.dom){as.removeAllListeners();as.remove();continue;}if(typeof as.purgeListeners=='function'){as.purgeListeners();}if(typeof as.destroy=='function'){as.destroy();}}}},type:function(o){if(o===undefined||o===null){return false;
 }if(o.htmlElement){return 'element';}var t=typeof o;if(t=='object'&&o.nodeName){switch(o.nodeType){case 1:return 'element';case 3:return (/\S/).test(o.nodeValue)?'textnode':'whitespace';}}if(t=='object'||t=='function'){switch(o.constructor){case Array:return 'array';
-case RegExp:return 'regexp';}if(typeof o.length=='number'&&typeof o.item=='function'){return 'nodelist';}}return t;},isEmpty:function(v,R){return v===null||v===undefined||(!R?v==='':false);},isOpera:C,isSafari:D,isFirefox:E,isIE:F,isIE7:G,isIE11:H,isGecko:I,isBorderBox:J,isWindows:K,isLinux:M,isMac:L,isIOS:O,isAndroid:P,isTouch:Q,useShims:((F&&!G)||(I&&L)),selectNode:function(R,S){var T=Roo.DomQuery.selectNode(R,S);
-return T?Roo.get(T):new Roo.Element(false);}});})();Roo.namespace("Roo","Roo.util","Roo.grid","Roo.dd","Roo.tree","Roo.data","Roo.form","Roo.menu","Roo.state","Roo.lib","Roo.layout","Roo.app","Roo.ux","Roo.bootstrap","Roo.bootstrap.dash");
+case RegExp:return 'regexp';}if(typeof o.length=='number'&&typeof o.item=='function'){return 'nodelist';}}return t;},isEmpty:function(v,S){return v===null||v===undefined||(!S?v==='':false);},isOpera:C,isSafari:D,isFirefox:E,isIE:F,isIE7:G,isIE11:H,isGecko:J,isBorderBox:K,isWindows:L,isLinux:N,isMac:M,isIOS:P,isAndroid:Q,isTouch:R,useShims:((F&&!G)||(J&&M)),selectNode:function(S,T){var U=Roo.DomQuery.selectNode(S,T);
+return U?Roo.get(U):new Roo.Element(false);}});})();Roo.namespace("Roo","Roo.util","Roo.grid","Roo.dd","Roo.tree","Roo.data","Roo.form","Roo.menu","Roo.state","Roo.lib","Roo.layout","Roo.app","Roo.ux","Roo.bootstrap","Roo.bootstrap.dash");
 // Function.js
 (function(){if(Roo.isIE){function fnCleanUp(){var p=Function.prototype;delete p.createSequence;delete p.defer;delete p.createDelegate;delete p.createCallback;delete p.createInterceptor;window.detachEvent("onunload",fnCleanUp);}window.attachEvent("onunload",fnCleanUp);
 }})();Roo.apply(Function.prototype,{createCallback:function(){var A=arguments;var B=this;return function(){return B.apply(window,A);};},createDelegate:function(A,B,C){var D=this;return function(){var E=B||arguments;if(C===true){E=Array.prototype.slice.call(arguments,0);
@@ -291,7 +291,7 @@ A.fire();A.clearListeners();return;}if(!A){K();}A.addListener(fn,T,U);},onWindow
 }else{F.fire(D.getViewWidth(),D.getViewHeight());}});}F.addListener(fn,T,U);},onTextResize:function(fn,T,U){if(!H){H=new Roo.util.Event();var V=new Roo.Element(document.createElement('div'));V.dom.className='x-text-resize';V.dom.innerHTML='X';V.appendTo(document.body);
 I=V.dom.offsetHeight;setInterval(function(){if(V.dom.offsetHeight!=I){H.fire(I,I=V.dom.offsetHeight);}},this.textResizeInterval);}H.addListener(fn,T,U);},removeResizeListener:function(fn,T){if(F){F.removeListener(fn,T);}},fireResize:function(){if(F){F.fire(D.getViewWidth(),D.getViewHeight());
 }},ieDeferSrc:false,textResizeInterval:50};S.on=S.addListener;S.un=S.removeListener;S.stoppedMouseDownEvent=new Roo.util.Event();return S;}();Roo.onReady=Roo.EventManager.onDocumentReady;Roo.onReady(function(){var bd=Roo.get(document.body);if(!bd){return;
-}var A=[Roo.isIE?"roo-ie":Roo.isIE11?"roo-ie11":Roo.isGecko?"roo-gecko":Roo.isOpera?"roo-opera":Roo.isSafari?"roo-safari":""];if(Roo.isMac){A.push("roo-mac");}if(Roo.isLinux){A.push("roo-linux");}if(Roo.isIOS){A.push("roo-ios");}if(Roo.isTouch){A.push("roo-touch");
+}var A=[Roo.isIE?"roo-ie":Roo.isIE11?"roo-ie11":Roo.isEdge?"roo-edge":Roo.isGecko?"roo-gecko":Roo.isOpera?"roo-opera":Roo.isSafari?"roo-safari":""];if(Roo.isMac){A.push("roo-mac");}if(Roo.isLinux){A.push("roo-linux");}if(Roo.isIOS){A.push("roo-ios");}if(Roo.isTouch){A.push("roo-touch");
 }if(Roo.isBorderBox){A.push('roo-border-box');}if(Roo.isStrict){var p=bd.dom.parentNode;if(p){p.className+=' roo-strict';}}bd.addClass(A.join(' '));});Roo.EventObject=function(){var E=Roo.lib.Event;var A={63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35}
 ;var B=Roo.isIE?{1:0,4:1,2:2}:(Roo.isSafari?{1:0,2:1,3:2}:{0:0,1:1,2:2});Roo.EventObjectImpl=function(e){if(e){this.setEvent(e.browserEvent||e);}};Roo.EventObjectImpl.prototype={browserEvent:null,button:-1,shiftKey:false,ctrlKey:false,altKey:false,BACKSPACE:8,TAB:9,RETURN:13,ENTER:13,SHIFT:16,CONTROL:17,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,F5:116,setEvent:function(e){if(e==this||(e&&e.browserEvent)){return e;
 }this.browserEvent=e;if(e){this.button=e.button?B[e.button]:(e.which?e.which-1:-1);if(e.type=='click'&&this.button==-1){this.button=0;}this.type=e.type;this.shiftKey=e.shiftKey;this.ctrlKey=e.ctrlKey||e.metaKey;this.altKey=e.altKey;this.keyCode=e.keyCode;