sync
[roojs1] / roojs-all.js
index f722686..66a4552 100644 (file)
@@ -5,8 +5,7 @@ cache=null;},id:function(el,prefix){prefix=prefix||"roo-gen";el=Roo.getDom(el);v
 sb.override=function(o){Roo.override(sb,o);};sbp.override=io;Roo.override(sb,overrides);return sb;};}(),override:function(origclass,overrides){if(overrides){var p=origclass.prototype;for(var method in overrides){p[method]=overrides[method];}}},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 ret=new ns[c.xtype](c);ret.xns=false;return ret;}
 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 buf=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var type=typeof ov;if(type=='undefined'){buf.push(k,"=&");}else if(type!="function"&&type!="object"){buf.push(k,"=",encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,len=ov.length;i<len;i++){buf.push(k,"=",encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");}}else {buf.push(k,"=&");}}}
+console.log(s);},urlEncode:function(o){if(!o){return "";}var buf=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var type=typeof ov;if(type=='undefined'){buf.push(k,"=&");}else if(type!="function"&&type!="object"){buf.push(k,"=",encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,len=ov.length;i<len;i++){buf.push(k,"=",encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");}}else {buf.push(k,"=&");}}}
 buf.pop();return buf.join("");},urlDecode:function(string,overwrite){if(!string||!string.length){return {};}var obj={};var pairs=string.split('&');var pair,name,value;for(var i=0,len=pairs.length;i<len;i++){pair=pairs[i].split('=');name=decodeURIComponent(pair[0]);value=decodeURIComponent(pair[1]);if(overwrite!==true){if(typeof obj[name]=="undefined"){obj[name]=value;}else if(typeof obj[name]=="string"){obj[name]=[obj[name]];obj[name].push(value);}else {obj[name].push(value);}}else {obj[name]=value;}}return obj;},each:function(array,fn,scope){if(typeof array.length=="undefined"||typeof array=="string"){array=[array];}for(var i=0,len=array.length;i<len;i++){if(fn.call(scope||array[i],array[i],i,array)===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,scope,args,delay){if(typeof cb=="function"){if(delay){cb.defer(delay,scope,args||[]);}else {cb.apply(scope,args||[]);}}},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,defaultValue){if(typeof v!='number'){return defaultValue;}return v;},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;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,allowBlank){return v===null||v===undefined||(!allowBlank?v==='':false);},isOpera:isOpera,isSafari:isSafari,isIE:isIE,isIE7:isIE7,isGecko:isGecko,isBorderBox:isBorderBox,isWindows:isWindows,isLinux:isLinux,isMac:isMac,useShims:((isIE&&!isIE7)||(isGecko&&isMac))});})();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");
 (function(){if(Roo.isIE){function A(){var p=Function.prototype;delete p.createSequence;delete p.defer;delete p.createDelegate;delete p.createCallback;delete p.createInterceptor;window.detachEvent("onunload",A);}
 window.attachEvent("onunload",A);}})();Roo.apply(Function.prototype,{createCallback:function(){var B=arguments;var C=this;return function(){return C.apply(window,B);};},createDelegate:function(D,E,F){var G=this;return function(){var H=E||arguments;if(F===true){H=Array.prototype.slice.call(arguments,0);H=H.concat(E);}else if(typeof F=="number"){H=Array.prototype.slice.call(arguments,0);var applyArgs=[F,0].concat(E);Array.prototype.splice.apply(H,applyArgs);}return G.apply(D||window,H);};},defer:function(H,I,J,K){var fn=this.createDelegate(I,J,K);if(H){return setTimeout(fn,H);}
@@ -94,7 +93,7 @@ el.insertBefore(P,Q);return P;};return {useDom:false,markup:function(o){return E
 F(o,el);}else {el.innerHTML=E(o);}return t?Roo.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var u=E(o);return new Roo.Template(u);}};}();
 Roo.Template=function(A){if(A instanceof Array){A=A.join("");}else if(arguments.length>1){A=Array.prototype.join.call(arguments,"");}
 this.html=A;};Roo.Template.prototype={applyTemplate:function(values){try{if(this.compiled){return this.compiled(values);}var useF=this.disableFormats!==true;var fm=Roo.util.Format,tpl=this;var fn=function(m,E,F,G){if(F&&useF){if(F.substr(0,5)=="this."){return tpl.call(F.substr(5),values[E],values);}else {if(G){var re=/^\s*['"](.*)["']\s*$/;G=G.split(',');for(var i=0,len=G.length;i<len;i++){G[i]=G[i].replace(re,"$1");}
-G=[values[E]].concat(G);}else {G=[values[E]];}return fm[F].apply(fm,G);}}else {return values[E]!==undefined?values[E]:"";}};return this.html.replace(this.re,fn);}catch(e){Roo.log(e);}return '';},set:function(B,C){this.html=B;this.compiled=null;if(C){this.compile();}return this;},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Roo.util.Format;var D=this.disableFormats!==true;var E=Roo.isGecko?"+":",";var fn=function(m,G,H,I){if(H&&D){I=I?','+I:"";if(H.substr(0,5)!="this."){H="fm."+H+'(';}else {H='this.call("'+H.substr(5)+'", ';I=", values";}}else {I='';H="(values['"+G+"'] == undefined ? '' : ";}return "'"+E+H+"values['"+G+"']"+I+")"+E+"'";};var F;if(Roo.isGecko){F="this.compiled = function(values){ return '"+this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};";}else {F=["this.compiled = function(values){ return ['"];F.push(this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));F.push("'].join('');};");F=F.join('');}eval(F);return this;},call:function(G,H,I){return this[G](H,I);},insertFirst:function(el,J,K){return this.doInsert('afterBegin',el,J,K);},insertBefore:function(el,L,M){return this.doInsert('beforeBegin',el,L,M);},insertAfter:function(el,N,O){return this.doInsert('afterEnd',el,N,O);},append:function(el,P,Q){return this.doInsert('beforeEnd',el,P,Q);},doInsert:function(R,el,S,T){el=Roo.getDom(el);var U=Roo.DomHelper.insertHtml(R,el,this.applyTemplate(S));return T?Roo.get(U,true):U;},overwrite:function(el,V,W){el=Roo.getDom(el);el.innerHTML=this.applyTemplate(V);return W?Roo.get(el.firstChild,true):el.firstChild;}};Roo.Template.prototype.apply=Roo.Template.prototype.applyTemplate;Roo.DomHelper.Template=Roo.Template;Roo.Template.from=function(el){el=Roo.getDom(el);return new Roo.Template(el.value||el.innerHTML);};
+G=[values[E]].concat(G);}else {G=[values[E]];}return fm[F].apply(fm,G);}}else {return values[E]!==undefined?values[E]:"";}};return this.html.replace(this.re,fn);}catch(e){Roo.log(e);throw e;}},set:function(B,C){this.html=B;this.compiled=null;if(C){this.compile();}return this;},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Roo.util.Format;var D=this.disableFormats!==true;var E=Roo.isGecko?"+":",";var fn=function(m,G,H,I){if(H&&D){I=I?','+I:"";if(H.substr(0,5)!="this."){H="fm."+H+'(';}else {H='this.call("'+H.substr(5)+'", ';I=", values";}}else {I='';H="(values['"+G+"'] == undefined ? '' : ";}return "'"+E+H+"values['"+G+"']"+I+")"+E+"'";};var F;if(Roo.isGecko){F="this.compiled = function(values){ return '"+this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};";}else {F=["this.compiled = function(values){ return ['"];F.push(this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));F.push("'].join('');};");F=F.join('');}eval(F);return this;},call:function(G,H,I){return this[G](H,I);},insertFirst:function(el,J,K){return this.doInsert('afterBegin',el,J,K);},insertBefore:function(el,L,M){return this.doInsert('beforeBegin',el,L,M);},insertAfter:function(el,N,O){return this.doInsert('afterEnd',el,N,O);},append:function(el,P,Q){return this.doInsert('beforeEnd',el,P,Q);},doInsert:function(R,el,S,T){el=Roo.getDom(el);var U=Roo.DomHelper.insertHtml(R,el,this.applyTemplate(S));return T?Roo.get(U,true):U;},overwrite:function(el,V,W){el=Roo.getDom(el);el.innerHTML=this.applyTemplate(V);return W?Roo.get(el.firstChild,true):el.firstChild;}};Roo.Template.prototype.apply=Roo.Template.prototype.applyTemplate;Roo.DomHelper.Template=Roo.Template;Roo.Template.from=function(el){el=Roo.getDom(el);return new Roo.Template(el.value||el.innerHTML);};
 Roo.DomQuery=function(){var A={},simpleCache={},valueCache={};var B=/\S/;var C=/^\s+|\s+$/g;var D=/\{(\d+)\}/g;var E=/^(\s?[\/>+~]\s?|\s|$)/;var F=/^(#)?([\w-\*]+)/;var G=/(\d*)n\+?(\d*)/,H=/\D/;function I(p,T){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==T){return n;}}
 n=n.nextSibling;}return null;};function J(n){while((n=n.nextSibling)&&n.nodeType!=1);return n;};function K(n){while((n=n.previousSibling)&&n.nodeType!=1);return n;};function L(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!B.test(n.nodeValue)){d.removeChild(n);}else {n.nodeIndex=++ni;}
 n=nx;}return this;};function byClassName(c,a,v){if(!v){return c;}var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((' '+ci.className+' ').indexOf(v)!=-1){r[++ri]=ci;}}return r;};function attrValue(n,T){if(!n.tagName&&typeof n.length!="undefined"){n=n[0];}if(!n){return null;}if(T=="for"){return n.htmlFor;}if(T=="class"||T=="className"){return n.className;}return n.getAttribute(T)||n[T];};function getNodes(ns,T,U){var V=[],ri=-1,cs;if(!ns){return V;}