roojs-core.js
authoredward <edward@roojs.com>
Fri, 4 Dec 2015 03:09:31 +0000 (11:09 +0800)
committeredward <edward@roojs.com>
Fri, 4 Dec 2015 03:09:31 +0000 (11:09 +0800)
roojs-core-debug.js

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

index 398a6e2..87129cb 100644 (file)
@@ -53,6 +53,7 @@ Roo.apply = function(o, c, defaults){
     var isStrict = document.compatMode == "CSS1Compat",
         isOpera = ua.indexOf("opera") > -1,
         isSafari = (/webkit|khtml/).test(ua),
+        isFirefox = ua.indexOf("firefox") > -1,
         isIE = ua.indexOf("msie") > -1,
         isIE7 = ua.indexOf("msie 7") > -1,
         isGecko = !isSafari && ua.indexOf("gecko") > -1,
@@ -610,6 +611,8 @@ Roo.factory(conf, Roo.data);
         /** @type Boolean */
         isSafari : isSafari,
         /** @type Boolean */
+        isFirefox : isFirefox,
+        /** @type Boolean */
         isIE : isIE,
         /** @type Boolean */
         isIE7 : isIE7,
index 064b062..fc61ca6 100644 (file)
@@ -1,14 +1,14 @@
 //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("msie")>-1,F=ua.indexOf("msie 7")>-1,G=!D&&ua.indexOf("gecko")>-1,H=E&&!B,I=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),J=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),K=(ua.indexOf("linux")!=-1),L=window.location.href.toLowerCase().indexOf("https")===0,M=(function(){try{document.createEvent("TouchEvent");return true;}catch(e){return false;}})();if(E&&!F){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}
-Roo.apply(Roo,{isStrict:B,isSecure:L,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 N={};for(var b in o){var O=b.split('@');if(O[1]){var s=O[0];if(!N[s]){N[s]=Roo.select(s);}
-N[s].on(O[1],o[b]);}}
-N=null;},id:function(el,N){N=N||"roo-gen";el=Roo.getDom(el);var id=N+(++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,N){if(typeof sp=='object'){N=sp;sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},O,P=sp.prototype;F.prototype=P;O=sb.prototype=new F();O.constructor=sb;sb.superclass=P;if(P.constructor==Object.prototype.constructor){P.constructor=sp;}
-sb.override=function(o){Roo.override(sb,o);};O.override=io;Roo.override(sb,N);return sb;};}(),override:function(N,O){if(O){var p=N.prototype;for(var P in O){p[P]=O[P];}}},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 N=new ns[c.xtype](c);N.xns=false;return N;}
+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=!D&&ua.indexOf("gecko")>-1,I=F&&!B,J=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),K=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),L=(ua.indexOf("linux")!=-1),M=window.location.href.toLowerCase().indexOf("https")===0,N=(function(){try{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:M,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 O={};for(var b in o){var P=b.split('@');if(P[1]){var s=P[0];if(!O[s]){O[s]=Roo.select(s);}
+O[s].on(P[1],o[b]);}}
+O=null;},id:function(el,O){O=O||"roo-gen";el=Roo.getDom(el);var id=O+(++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,O){if(typeof sp=='object'){O=sp;sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},P,Q=sp.prototype;F.prototype=Q;P=sb.prototype=new F();P.constructor=sb;sb.superclass=Q;if(Q.constructor==Object.prototype.constructor){Q.constructor=sp;}
+sb.override=function(o){Roo.override(sb,o);};P.override=io;Roo.override(sb,O);return sb;};}(),override:function(O,P){if(P){var p=O.prototype;for(var Q in P){p[Q]=P[Q];}}},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 O=new ns[c.xtype](c);O.xns=false;return O;}
 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 N=[];for(var O in o){var ov=o[O],k=Roo.encodeURIComponent(O);var P=typeof ov;if(P=='undefined'){N.push(k,"=&");}else if(P!="function"&&P!="object"){N.push(k,"=",Roo.encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,Q=ov.length;i<Q;i++){N.push(k,"=",Roo.encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");}}else {N.push(k,"=&");}}}
-N.pop();return N.join("");},encodeURIComponent:function(N){try{return encodeURIComponent(N);}catch(e){}if(N==''||N==null){return '';}function nibble_to_hex(Q){var R='0123456789ABCDEF';return R.charAt(Q);}
-N=N.toString();var O='';for(var i=0;i<N.length;i++){var c=N.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 P=nibble_to_hex((b&0xF0)>>>4)+nibble_to_hex(b&0x0F);O+='%'+P;}}return O;},urlDecode:function(N,O){if(!N||!N.length){return {};}var P={};var Q=N.split('&');var R,S,T;for(var i=0,U=Q.length;i<U;i++){R=Q[i].split('=');S=decodeURIComponent(R[0]);T=decodeURIComponent(R[1]);if(O!==true){if(typeof P[S]=="undefined"){P[S]=T;}else if(typeof P[S]=="string"){P[S]=[P[S]];P[S].push(T);}else {P[S].push(T);}}else {P[S]=T;}}return P;},each:function(N,fn,O){if(typeof N.length=="undefined"||typeof N=="string"){N=[N];}for(var i=0,P=N.length;i<P;i++){if(fn.call(O||N[i],N[i],i,N)===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,N,O,P){if(typeof cb=="function"){if(P){cb.defer(P,N,O||[]);}else {cb.apply(N,O||[]);}}},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,N){if(typeof v!='number'){return N;}return v;},destroy:function(){for(var i=0,a=arguments,N=a.length;i<N;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,N){return v===null||v===undefined||(!N?v==='':false);},isOpera:C,isSafari:D,isIE:E,isIE7:F,isGecko:G,isBorderBox:H,isWindows:I,isLinux:K,isMac:J,isTouch:M,useShims:((E&&!F)||(G&&J)),selectNode:function(N,O){var P=Roo.DomQuery.selectNode(N,O);return P?Roo.get(P):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");
+console.log(s);},urlEncode:function(o){if(!o){return "";}var O=[];for(var P in o){var ov=o[P],k=Roo.encodeURIComponent(P);var Q=typeof ov;if(Q=='undefined'){O.push(k,"=&");}else if(Q!="function"&&Q!="object"){O.push(k,"=",Roo.encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,R=ov.length;i<R;i++){O.push(k,"=",Roo.encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");}}else {O.push(k,"=&");}}}
+O.pop();return O.join("");},encodeURIComponent:function(O){try{return encodeURIComponent(O);}catch(e){}if(O==''||O==null){return '';}function nibble_to_hex(R){var S='0123456789ABCDEF';return S.charAt(R);}
+O=O.toString();var P='';for(var i=0;i<O.length;i++){var c=O.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 Q=nibble_to_hex((b&0xF0)>>>4)+nibble_to_hex(b&0x0F);P+='%'+Q;}}return P;},urlDecode:function(O,P){if(!O||!O.length){return {};}var Q={};var R=O.split('&');var S,T,U;for(var i=0,V=R.length;i<V;i++){S=R[i].split('=');T=decodeURIComponent(S[0]);U=decodeURIComponent(S[1]);if(P!==true){if(typeof Q[T]=="undefined"){Q[T]=U;}else if(typeof Q[T]=="string"){Q[T]=[Q[T]];Q[T].push(U);}else {Q[T].push(U);}}else {Q[T]=U;}}return Q;},each:function(O,fn,P){if(typeof O.length=="undefined"||typeof O=="string"){O=[O];}for(var i=0,Q=O.length;i<Q;i++){if(fn.call(P||O[i],O[i],i,O)===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,O,P,Q){if(typeof cb=="function"){if(Q){cb.defer(Q,O,P||[]);}else {cb.apply(O,P||[]);}}},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,O){if(typeof v!='number'){return O;}return v;},destroy:function(){for(var i=0,a=arguments,O=a.length;i<O;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,O){return v===null||v===undefined||(!O?v==='':false);},isOpera:C,isSafari:D,isFirefox:E,isIE:F,isIE7:G,isGecko:H,isBorderBox:I,isWindows:J,isLinux:L,isMac:K,isTouch:N,useShims:((F&&!G)||(H&&K)),selectNode:function(O,P){var Q=Roo.DomQuery.selectNode(O,P);return Q?Roo.get(Q):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);E=E.concat(B);}else if(typeof C=="number"){E=Array.prototype.slice.call(arguments,0);var F=[C,0].concat(B);Array.prototype.splice.apply(E,F);}return D.apply(A||window,E);};},defer:function(A,B,C,D){var fn=this.createDelegate(B,C,D);if(A){return setTimeout(fn,A);}