roojs-core.js
authoredward <edward@roojs.com>
Tue, 9 Jan 2018 06:15:09 +0000 (14:15 +0800)
committeredward <edward@roojs.com>
Tue, 9 Jan 2018 06:15:09 +0000 (14:15 +0800)
roojs-core-debug.js
roojs-debug.js

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

index f19ffd2..0562a0c 100644 (file)
@@ -64,6 +64,7 @@ Roo.apply = function(o, c, defaults){
         isLinux = (ua.indexOf("linux") != -1),
         isSecure = window.location.href.toLowerCase().indexOf("https") === 0,
         isIOS = /iphone|ipad/.test(ua),
+        isAndroid = /android/.test(ua),
         isTouch =  (function() {
             try {
                 if (ua.indexOf('chrome') != -1 && ua.indexOf('android') == -1) {
@@ -640,6 +641,8 @@ Roo.factory(conf, Roo.data);
         /** @type Boolean */
         isIOS : isIOS,
         /** @type Boolean */
+        isAndroid : isAndroid,
+        /** @type Boolean */
         isTouch : isTouch,
 
         /**
@@ -7171,7 +7174,7 @@ if(opt.anim.isAnimated()){
             var overflowRegex = /(auto|scroll)/;
             
             if(this.getStyle('position') === 'fixed'){
-                return Roo.isIOS ? Roo.get(document.body) : Roo.get(document.documentElement);
+                return Roo.isAndroid ? Roo.get(document.documentElement) : Roo.get(document.body);
             }
             
             var excludeStaticParent = this.getStyle('position') === "absolute";
@@ -7187,11 +7190,11 @@ if(opt.anim.isAnimated()){
                 }
                 
                 if(parent.dom.nodeName.toLowerCase() == 'body'){
-                    return Roo.isIOS ? Roo.get(document.body) : Roo.get(document.documentElement);
+                    return Roo.isAndroid ? Roo.get(document.documentElement) : Roo.get(document.body);
                 }
             }
             
-            return Roo.isIOS ? Roo.get(document.body) : Roo.get(document.documentElement);
+            return Roo.isAndroid ? Roo.get(document.documentElement) : Roo.get(document.body);
         },
 
         /**
index a5b5f4c..fe59a72 100644 (file)
@@ -1,24 +1,24 @@
 // 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();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=(function(){try{if(ua.indexOf('chrome')!=-1&&ua.indexOf('android')==-1){window.addEventListener('touchstart',function __set_has_touch__(){Roo.isTouch=true;
+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();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 Q={};for(var b in o){var R=b.split('@');if(R[1]){var s=R[0];
-if(!Q[s]){Q[s]=Roo.select(s);}Q[s].on(R[1],o[b]);}}Q=null;},id:function(el,Q){Q=Q||"roo-gen";el=Roo.getDom(el);var id=Q+(++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,Q){if(typeof sp=='object'){Q=sp;
-sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},R,S=sp.prototype;F.prototype=S;R=sb.prototype=new F();R.constructor=sb;sb.superclass=S;if(S.constructor==Object.prototype.constructor){S.constructor=sp;}sb.override=function(o){Roo.override(sb,o);
-};R.override=io;Roo.override(sb,Q);return sb;};}(),override:function(Q,R){if(R){var p=Q.prototype;for(var S in R){p[S]=R[S];}}},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+';');
+,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+';');
 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 Q=new ns[c.xtype](c);Q.xns=false;return Q;}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 Q=[];for(var R in o){var ov=o[R],k=Roo.encodeURIComponent(R);
-var S=typeof ov;if(S=='undefined'){Q.push(k,"=&");}else if(S!="function"&&S!="object"){Q.push(k,"=",Roo.encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,T=ov.length;i<T;i++){Q.push(k,"=",Roo.encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");
-}}else{Q.push(k,"=&");}}}Q.pop();return Q.join("");},encodeURIComponent:function(Q){try{return encodeURIComponent(Q);}catch(e){}if(Q==''||Q==null){return '';}function nibble_to_hex(T){var U='0123456789ABCDEF';return U.charAt(T);}Q=Q.toString();var R='';for(var i=0;
-i<Q.length;i++){var c=Q.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 S=nibble_to_hex((b&0xF0)>>>4)+nibble_to_hex(b&0x0F);R+='%'+S;}}return R;},urlDecode:function(Q,R){if(!Q||!Q.length){return {};}var S={}
-;var T=Q.split('&');var U,V,W;for(var i=0,X=T.length;i<X;i++){U=T[i].split('=');V=decodeURIComponent(U[0]);W=decodeURIComponent(U[1]);if(R!==true){if(typeof S[V]=="undefined"){S[V]=W;}else if(typeof S[V]=="string"){S[V]=[S[V]];S[V].push(W);}else{S[V].push(W);
-}}else{S[V]=W;}}return S;},each:function(Q,fn,R){if(typeof Q.length=="undefined"||typeof Q=="string"){Q=[Q];}for(var i=0,S=Q.length;i<S;i++){if(fn.call(R||Q[i],Q[i],i,Q)===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,Q,R,S){if(typeof cb=="function"){if(S){cb.defer(S,Q,R||[]);
-}else{cb.apply(Q,R||[]);}}},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,Q){if(typeof v!='number'){return Q;}return v;
-},destroy:function(){for(var i=0,a=arguments,Q=a.length;i<Q;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 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;
 }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,Q){return v===null||v===undefined||(!Q?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,isTouch:P,useShims:((F&&!G)||(I&&L)),selectNode:function(Q,R){var S=Roo.DomQuery.selectNode(Q,R);
-return S?Roo.get(S):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,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");
 // 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);
@@ -306,8 +306,8 @@ return Roo.isSafari?(A[k]||k):k;},getPageX:function(){return this.xy[0];},getPag
 if(!L){return null;}var id=L.id;if(K!==true&&id&&Roo.Element.cache[id]){return Roo.Element.cache[id];}this.dom=L;this.id=id||Roo.id(L);};var El=Roo.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(J){this.visibilityMode=J;
 return this;},enableDisplayMode:function(J){this.setVisibilityMode(El.DISPLAY);if(typeof J!="undefined"){this.originalDisplay=J;}return this;},findParent:function(J,K,L){var p=this.dom,b=document.body,M=0,dq=Roo.DomQuery,N;K=K||50;if(typeof K!="number"){N=Roo.getDom(K);
 K=10;}while(p&&p.nodeType==1&&M<K&&p!=b&&p!=N){if(dq.is(p,J)){return L?Roo.get(p):p;}M++;p=p.parentNode;}return null;},findParentNode:function(J,K,L){var p=Roo.fly(this.dom.parentNode,'_internal');return p?p.findParent(J,K,L):null;},findScrollableParent:function(){var J=/(auto|scroll)/;
-if(this.getStyle('position')==='fixed'){return Roo.isIOS?Roo.get(document.body):Roo.get(document.documentElement);}var K=this.getStyle('position')==="absolute";for(var L=this;(L=Roo.get(L.dom.parentNode));){if(K&&L.getStyle('position')==="static"){continue;
-}if(J.test(L.getStyle('overflow')+L.getStyle('overflow-x')+L.getStyle('overflow-y'))){return L;}if(L.dom.nodeName.toLowerCase()=='body'){return Roo.isIOS?Roo.get(document.body):Roo.get(document.documentElement);}}return Roo.isIOS?Roo.get(document.body):Roo.get(document.documentElement);
+if(this.getStyle('position')==='fixed'){return Roo.isAndroid?Roo.get(document.documentElement):Roo.get(document.body);}var K=this.getStyle('position')==="absolute";for(var L=this;(L=Roo.get(L.dom.parentNode));){if(K&&L.getStyle('position')==="static"){continue;
+}if(J.test(L.getStyle('overflow')+L.getStyle('overflow-x')+L.getStyle('overflow-y'))){return L;}if(L.dom.nodeName.toLowerCase()=='body'){return Roo.isAndroid?Roo.get(document.documentElement):Roo.get(document.body);}}return Roo.isAndroid?Roo.get(document.documentElement):Roo.get(document.body);
 },up:function(J,K){return this.findParentNode(J,K,true);},is:function(J){return Roo.DomQuery.is(this.dom,J);},animate:function(J,K,L,M,N){this.anim(J,{duration:K,callback:L,easing:M},N);return this;},anim:function(J,K,L,M,N,cb){L=L||'run';K=K||{};var O=Roo.lib.Anim[L](this.dom,J,(K.duration||M)||.35,(K.easing||N)||'easeOut',function(){Roo.callback(cb,this);
 Roo.callback(K.callback,K.scope||this,[this,K]);},this);K.anim=O;return O;},preanim:function(a,i){return !a[i]?false:(typeof a[i]=="object"?a[i]:{duration:a[i+1],callback:a[i+2],easing:a[i+3]});},clean:function(J){if(this.isCleaned&&J!==true){return this;
 }var ns=/\S/;var d=this.dom,n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!ns.test(n.nodeValue)){d.removeChild(n);}else{n.nodeIndex=++ni;}n=nx;}this.isCleaned=true;return this;},calcOffsetsTo:function(el){el=Roo.get(el);var d=el.dom;
index e33dafc..689ea83 100644 (file)
@@ -64,6 +64,7 @@ Roo.apply = function(o, c, defaults){
         isLinux = (ua.indexOf("linux") != -1),
         isSecure = window.location.href.toLowerCase().indexOf("https") === 0,
         isIOS = /iphone|ipad/.test(ua),
+        isAndroid = /android/.test(ua),
         isTouch =  (function() {
             try {
                 if (ua.indexOf('chrome') != -1 && ua.indexOf('android') == -1) {
@@ -640,6 +641,8 @@ Roo.factory(conf, Roo.data);
         /** @type Boolean */
         isIOS : isIOS,
         /** @type Boolean */
+        isAndroid : isAndroid,
+        /** @type Boolean */
         isTouch : isTouch,
 
         /**
@@ -7171,7 +7174,7 @@ if(opt.anim.isAnimated()){
             var overflowRegex = /(auto|scroll)/;
             
             if(this.getStyle('position') === 'fixed'){
-                return Roo.isIOS ? Roo.get(document.body) : Roo.get(document.documentElement);
+                return Roo.isAndroid ? Roo.get(document.documentElement) : Roo.get(document.body);
             }
             
             var excludeStaticParent = this.getStyle('position') === "absolute";
@@ -7187,11 +7190,11 @@ if(opt.anim.isAnimated()){
                 }
                 
                 if(parent.dom.nodeName.toLowerCase() == 'body'){
-                    return Roo.isIOS ? Roo.get(document.body) : Roo.get(document.documentElement);
+                    return Roo.isAndroid ? Roo.get(document.documentElement) : Roo.get(document.body);
                 }
             }
             
-            return Roo.isIOS ? Roo.get(document.body) : Roo.get(document.documentElement);
+            return Roo.isAndroid ? Roo.get(document.documentElement) : Roo.get(document.body);
         },
 
         /**