roojs-core.js
authoredward <edward@roojs.com>
Thu, 19 May 2016 04:04:48 +0000 (12:04 +0800)
committeredward <edward@roojs.com>
Thu, 19 May 2016 04:04:48 +0000 (12:04 +0800)
roojs-core-debug.js

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

index 32f8f0a..2b586a8 100644 (file)
@@ -314,7 +314,7 @@ Roo.factory(conf, Roo.data);
                 return c;
             }
             if (ns[c.xtype]) {
-                if (Roo.debug) Roo.log("Roo.Factory(" + c.xtype + ")");
+                if (Roo.debug) { Roo.log("Roo.Factory(" + c.xtype + ")"); }
                 var ret = new ns[c.xtype](c);
                 ret.xns = false;
                 return ret;
@@ -941,7 +941,7 @@ Roo.applyIf(Array.prototype, {
      */
     indexOf : function(o){
        for (var i = 0, len = this.length; i < len; i++){
-             if(this[i] == o) return i;
+             if(this[i] == o) { return i; }
        }
           return -1;
     },
@@ -963,15 +963,16 @@ Roo.applyIf(Array.prototype, {
     map : function(fun )
     {
         var len = this.length >>> 0;
-        if (typeof fun != "function")
+        if (typeof fun != "function") {
             throw new TypeError();
-
+        }
         var res = new Array(len);
         var thisp = arguments[1];
         for (var i = 0; i < len; i++)
         {
-            if (i in this)
+            if (i in this) {
                 res[i] = fun.call(thisp, this[i], i, this);
+            }
         }
 
         return res;
@@ -980,7 +981,8 @@ Roo.applyIf(Array.prototype, {
 });
 
 
- /*
+/*
  * Based on:
  * Ext JS Library 1.1.1
  * Copyright(c) 2006-2007, Ext JS, LLC.
@@ -1757,7 +1759,7 @@ document.write(dt3); //returns 'Fri Oct 06 2006 07:30:00'
  */
 Date.prototype.add = function(interval, value){
   var d = this.clone();
-  if (!interval || value === 0) return d;
+  if (!interval || value === 0) { return d; }
   switch(interval.toLowerCase()){
     case Date.MILLI:
       d.setMilliseconds(this.getMilliseconds() + value);
@@ -4151,7 +4153,7 @@ Roo.DomHelper = function(){
         }
         b += "<" + o.tag;
         for(var attr in o){
-            if(attr == "tag" || attr == "children" || attr == "cn" || attr == "html" || typeof o[attr] == "function") continue;
+            if(attr == "tag" || attr == "children" || attr == "cn" || attr == "html" || typeof o[attr] == "function") { continue; }
             if(attr == "style"){
                 var s = o["style"];
                 if(typeof s == "function"){
@@ -4234,7 +4236,7 @@ Roo.DomHelper = function(){
         for(var attr in o){
             
             if(attr == "tag" || attr == "ns" ||attr == "xmlns" ||attr == "children" || attr == "cn" || attr == "html" || 
-                    attr == "style" || typeof o[attr] == "function") continue;
+                    attr == "style" || typeof o[attr] == "function") { continue; }
                     
             if(attr=="cls" && Roo.isIE){
                 el.className = o["cls"];
@@ -7066,7 +7068,7 @@ if(opt.anim.isAnimated()){
          */
         enableDisplayMode : function(display){
             this.setVisibilityMode(El.DISPLAY);
-            if(typeof display != "undefined") this.originalDisplay = display;
+            if(typeof display != "undefined") { this.originalDisplay = display; }
             return this;
         },
 
@@ -7287,7 +7289,7 @@ if(opt.anim.isAnimated()){
                     this.setHeight(oldHeight); // restore original height
                     this.setHeight(height, animate, duration, function(){
                         this.unclip();
-                        if(typeof onComplete == "function") onComplete();
+                        if(typeof onComplete == "function") { onComplete(); }
                     }.createDelegate(this), easing);
                 }
             }.createDelegate(this), 0);
@@ -9385,12 +9387,15 @@ if(opt.anim.isAnimated()){
             var el = this.dom;
             useSet = typeof useSet == 'undefined' ? (el.setAttribute ? true : false) : useSet;
             for(var attr in o){
-                if(attr == "style" || typeof o[attr] == "function") continue;
+                if(attr == "style" || typeof o[attr] == "function")  { continue; }
                 if(attr=="cls"){
                     el.className = o["cls"];
                 }else{
-                    if(useSet) el.setAttribute(attr, o[attr]);
-                    else el[attr] = o[attr];
+                    if(useSet) {
+                        el.setAttribute(attr, o[attr]);
+                    } else {
+                        el[attr] = o[attr];
+                    }
                 }
             }
             if(o.style){
@@ -10998,7 +11003,9 @@ Roo.CompositeElement = function(els){
 Roo.CompositeElement.prototype = {
     isComposite: true,
     addElements : function(els){
-        if(!els) return this;
+        if(!els) {
+            return this;
+        }
         if(typeof els == "string"){
             els = Roo.Element.selectorFunction(els);
         }
@@ -13089,7 +13096,9 @@ mc.add(otherEl);
     indexOf : function(o){
         if(!this.items.indexOf){
             for(var i = 0, len = this.items.length; i < len; i++){
-                if(this.items[i] == o) return i;
+                if(this.items[i] == o) {
+                    return i;
+                }
             }
             return -1;
         }else{
@@ -13105,7 +13114,9 @@ mc.add(otherEl);
     indexOfKey : function(key){
         if(!this.keys.indexOf){
             for(var i = 0, len = this.keys.length; i < len; i++){
-                if(this.keys[i] == key) return i;
+                if(this.keys[i] == key) {
+                    return i;
+                }
             }
             return -1;
         }else{
@@ -14804,7 +14815,9 @@ Roo.extend(Roo.state.Provider, Roo.util.Observable, {
     decodeValue : function(cookie){
         var re = /^(a|n|d|b|s|o)\:(.*)$/;
         var matches = re.exec(unescape(cookie));
-        if(!matches || !matches[1]) return; // non state cookie
+        if(!matches || !matches[1]) {
+            return; // non state cookie
+        }
         var type = matches[1];
         var v = matches[2];
         switch(type){
@@ -14851,7 +14864,9 @@ Roo.extend(Roo.state.Provider, Roo.util.Observable, {
             var flat = "";
             for(var i = 0, len = v.length; i < len; i++){
                 flat += this.encodeValue(v[i]);
-                if(i != len-1) flat += "^";
+                if(i != len-1) {
+                    flat += "^";
+                }
             }
             enc = "a:" + flat;
         }else if(typeof v == "object"){
index e21dd45..eedc56b 100644 (file)
@@ -5,8 +5,8 @@ return true;}catch(e){return false;}})();if(F&&!G){try{document.execCommand("Bac
 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+';');
-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);
+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);
@@ -31,8 +31,8 @@ return A.replace(/\{(\d+)\}/g,function(m,i){return Roo.util.Format.htmlEncode(B[
 // Number.js
 Roo.applyIf(Number.prototype,{constrain:function(A,B){return Math.min(Math.max(this,A),B);}});
 // Array.js
-Roo.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,A=this.length;i<A;i++){if(this[i]==o)return i;}return -1;},remove:function(o){var A=this.indexOf(o);if(A!=-1){this.splice(A,1);}},map:function(A){var B=this.length>>>0;if(typeof A!="function")throw new TypeError();
-var C=new Array(B);var D=arguments[1];for(var i=0;i<B;i++){if(i in this)C[i]=A.call(D,this[i],i,this);}return C;}});
+Roo.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,A=this.length;i<A;i++){if(this[i]==o){return i;}}return -1;},remove:function(o){var A=this.indexOf(o);if(A!=-1){this.splice(A,1);}},map:function(A){var B=this.length>>>0;if(typeof A!="function"){throw new TypeError();
+}var C=new Array(B);var D=arguments[1];for(var i=0;i<B;i++){if(i in this){C[i]=A.call(D,this[i],i,this);}}return C;}});
 // Date.js
 Date.prototype.getElapsed=function(A){return Math.abs((A||new Date()).getTime()-this.getTime());};Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(A){if(Date.formatFunctions[A]==null){Date.createNewFormat(A);
 }var B=Date.formatFunctions[A];return this[B]();};Date.prototype.format=Date.prototype.dateFormat;Date.createNewFormat=function(A){var B="format"+Date.formatFunctions.count++;Date.formatFunctions[A]=B;var C="Date.prototype."+B+" = function(){return ";var D=false;
@@ -63,7 +63,7 @@ case 2:case 22:return "nd";case 3:case 23:return "rd";default:return "th";}};Dat
 Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.y2kYear=50;Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};Date.prototype.clone=function(){return new Date(this.getTime());
 };Date.prototype.clearTime=function(A){if(A){return this.clone().clearTime();}this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};if(Roo.isSafari){Date.brokenSetMonth=Date.prototype.setMonth;Date.prototype.setMonth=function(A){if(A<=-1){var n=Math.ceil(-A);
 var B=Math.ceil(n/12);var C=(n%12)?12-n%12:0;this.setFullYear(this.getFullYear()-B);return Date.brokenSetMonth.call(this,C);}else{return Date.brokenSetMonth.apply(this,arguments);}};}Date.MILLI="ms";Date.SECOND="s";Date.MINUTE="mi";Date.HOUR="h";Date.DAY="d";
-Date.MONTH="mo";Date.YEAR="y";Date.prototype.add=function(A,B){var d=this.clone();if(!A||B===0)return d;switch(A.toLowerCase()){case Date.MILLI:d.setMilliseconds(this.getMilliseconds()+B);break;case Date.SECOND:d.setSeconds(this.getSeconds()+B);break;case Date.MINUTE:d.setMinutes(this.getMinutes()+B);
+Date.MONTH="mo";Date.YEAR="y";Date.prototype.add=function(A,B){var d=this.clone();if(!A||B===0){return d;}switch(A.toLowerCase()){case Date.MILLI:d.setMilliseconds(this.getMilliseconds()+B);break;case Date.SECOND:d.setSeconds(this.getSeconds()+B);break;case Date.MINUTE:d.setMinutes(this.getMinutes()+B);
 break;case Date.HOUR:d.setHours(this.getHours()+B);break;case Date.DAY:d.setDate(this.getDate()+B);break;case Date.MONTH:var C=this.getDate();if(C>28){C=Math.min(C,this.getFirstDateOfMonth().add('mo',B).getLastDateOfMonth().getDate());}d.setDate(C);d.setMonth(this.getMonth()+B);
 break;case Date.YEAR:d.setFullYear(this.getFullYear()+B);break;}return d;};
 // Roo/lib/Dom.js
@@ -191,11 +191,11 @@ var id=el.id||el.tagName;return ("Scroll "+id);};B.doMethod=function(C,D,E){var
 // Roo/DomHelper.js
 if(typeof Range!="undefined"&&typeof Range.prototype.createContextualFragment=="undefined"){Range.prototype.createContextualFragment=function(A){var B=window.document;var C=B.createElement("div");C.innerHTML=A;var D=B.createDocumentFragment(),n;while((n=C.firstChild)){D.appendChild(n);
 }return D;};}Roo.DomHelper=function(){var A=null;var B=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;var C=/^table|tbody|tr|td$/i;var D={};var E=function(o){if(typeof o=='string'){return o;}var b="";if(!o.tag){o.tag="div";}b+="<"+o.tag;
-for(var M in o){if(M=="tag"||M=="children"||M=="cn"||M=="html"||typeof o[M]=="function")continue;if(M=="style"){var s=o["style"];if(typeof s=="function"){s=s.call();}if(typeof s=="string"){b+=' style="'+s+'"';}else if(typeof s=="object"){b+=' style="';for(var N in s){if(typeof s[N]!="function"){b+=N+":"+s[N]+";";
+for(var M in o){if(M=="tag"||M=="children"||M=="cn"||M=="html"||typeof o[M]=="function"){continue;}if(M=="style"){var s=o["style"];if(typeof s=="function"){s=s.call();}if(typeof s=="string"){b+=' style="'+s+'"';}else if(typeof s=="object"){b+=' style="';for(var N in s){if(typeof s[N]!="function"){b+=N+":"+s[N]+";";
 }}b+='"';}}else{if(M=="cls"){b+=' class="'+o["cls"]+'"';}else if(M=="htmlFor"){b+=' for="'+o["htmlFor"]+'"';}else{b+=" "+M+'="'+o[M]+'"';}}}if(B.test(o.tag)){b+="/>";}else{b+=">";var cn=o.children||o.cn;if(cn){if((cn instanceof Array)||(Roo.isSafari&&typeof(cn.join)=="function")){for(var i=0,O=cn.length;
 i<O;i++){b+=E(cn[i],b);}}else{b+=E(cn,b);}}if(o.html){b+=o.html;}b+="</"+o.tag+">";}return b;};var F=function(o,M){var ns=false;if(o.ns&&o.ns!='html'){if(o.xmlns&&typeof(D[o.ns])=='undefined'){D[o.ns]=o.xmlns;ns=o.xmlns;}if(typeof(D[o.ns])=='undefined'){console.log("Trying to create namespace element "+o.ns+", however no xmlns was sent to builder previously");
 }ns=D[o.ns];}if(typeof(o)=='string'){return M.appendChild(document.createTextNode(o));}o.tag=o.tag||div;if(o.ns&&Roo.isIE){ns=false;o.tag=o.ns+':'+o.tag;}var el=ns?document.createElementNS(ns,o.tag||'div'):document.createElement(o.tag||'div');var N=el.setAttribute?true:false;
-for(var O in o){if(O=="tag"||O=="ns"||O=="xmlns"||O=="children"||O=="cn"||O=="html"||O=="style"||typeof o[O]=="function")continue;if(O=="cls"&&Roo.isIE){el.className=o["cls"];}else{if(N){el.setAttribute(O=="cls"?'class':O,o[O]);}else{el[O]=o[O];}}}Roo.DomHelper.applyStyles(el,o.style);
+for(var O in o){if(O=="tag"||O=="ns"||O=="xmlns"||O=="children"||O=="cn"||O=="html"||O=="style"||typeof o[O]=="function"){continue;}if(O=="cls"&&Roo.isIE){el.className=o["cls"];}else{if(N){el.setAttribute(O=="cls"?'class':O,o[O]);}else{el[O]=o[O];}}}Roo.DomHelper.applyStyles(el,o.style);
 var cn=o.children||o.cn;if(cn){if((cn instanceof Array)||(Roo.isSafari&&typeof(cn.join)=="function")){for(var i=0,P=cn.length;i<P;i++){F(cn[i],el);}}else{F(cn,el);}}if(o.html){el.innerHTML=o.html;}if(M){M.appendChild(el);}return el;};var G=function(M,s,h,e){A.innerHTML=[s,h,e].join('');
 var i=-1,el=A;while(++i<M){el=el.firstChild;}return el;};var ts='<table>',te='</table>',H=ts+'<tbody>',I='</tbody>'+te,J=H+'<tr>',K='</tr>'+I;var L=function(M,N,el,O){if(!A){A=document.createElement('div');}var P;var Q=null;if(M=='td'){if(N=='afterbegin'||N=='beforeend'){return;
 }if(N=='beforebegin'){Q=el;el=el.parentNode;}else{Q=el.nextSibling;el=el.parentNode;}P=G(4,J,O,K);}else if(M=='tr'){if(N=='beforebegin'){Q=el;el=el.parentNode;P=G(3,H,O,I);}else if(N=='afterend'){Q=el.nextSibling;el=el.parentNode;P=G(3,H,O,I);}else{if(N=='afterbegin'){Q=el.firstChild;
@@ -302,7 +302,7 @@ return Roo.isSafari?(A[k]||k):k;},getPageX:function(){return this.xy[0];},getPag
 // Roo/Element.js
 (function(){var D=Roo.lib.Dom;var E=Roo.lib.Event;var A=Roo.lib.Anim;var B={};var C=/(-[a-z])/gi;var F=function(m,a){return a.charAt(1).toUpperCase();};var G=document.defaultView;Roo.Element=function(J,K){var L=typeof J=="string"?document.getElementById(J):J;
 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);
+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;},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;
@@ -310,7 +310,7 @@ Roo.callback(K.callback,K.scope||this,[this,K]);},this);K.anim=O;return O;},prea
 var J=false;if(el.getStyle('position')=='static'){el.position('relative');J=true;}var x=0,y=0;var op=this.dom;while(op&&op!=d&&op.tagName!='HTML'){x+=op.offsetLeft;y+=op.offsetTop;op=op.offsetParent;}if(J){el.position('static');}return [x,y];},scrollIntoView:function(J,K){var c=Roo.getDom(J)||document.body;
 var el=this.dom;var o=this.calcOffsetsTo(c),l=o[0],t=o[1],b=t+el.offsetHeight,r=l+el.offsetWidth;var ch=c.clientHeight;var ct=parseInt(c.scrollTop,10);var cl=parseInt(c.scrollLeft,10);var cb=ct+ch;var cr=cl+c.clientWidth;if(t<ct){c.scrollTop=t;}else if(b>cb){c.scrollTop=b-ch;
 }if(K!==false){if(l<cl){c.scrollLeft=l;}else if(r>cr){c.scrollLeft=r-c.clientWidth;}}return this;},scrollChildIntoView:function(J,K){Roo.fly(J,'_scrollChildIntoView').scrollIntoView(this,K);},autoHeight:function(J,K,L,M){var N=this.getHeight();this.clip();
-this.setHeight(1);setTimeout(function(){var O=parseInt(this.dom.scrollHeight,10);if(!J){this.setHeight(O);this.unclip();if(typeof L=="function"){L();}}else{this.setHeight(N);this.setHeight(O,J,K,function(){this.unclip();if(typeof L=="function")L();}.createDelegate(this),M);
+this.setHeight(1);setTimeout(function(){var O=parseInt(this.dom.scrollHeight,10);if(!J){this.setHeight(O);this.unclip();if(typeof L=="function"){L();}}else{this.setHeight(N);this.setHeight(O,J,K,function(){this.unclip();if(typeof L=="function"){L();}}.createDelegate(this),M);
 }}.createDelegate(this),0);return this;},contains:function(el){if(!el){return false;}return D.isAncestor(this.dom,el.dom?el.dom:el);},isVisible:function(J){var K=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(J!==true||!K){return K;
 }var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Roo.fly(p,'_isVisible').isVisible()){return false;}p=p.parentNode;}return true;},select:function(J,K){return El.select(J,K,this.dom);},query:function(J,K){return Roo.DomQuery.select(J,this.dom);
 },child:function(J,K){var n=Roo.DomQuery.selectNode(J,this.dom);return K?n:Roo.get(n);},down:function(J,K){var n=Roo.DomQuery.selectNode(" > "+J,this.dom);return K?n:Roo.get(n);},initDD:function(J,K,L){var dd=new Roo.dd.DD(Roo.id(this.dom),J,K);return Roo.apply(dd,L);
@@ -393,8 +393,8 @@ if(J===true){this.fitToParentDelegate=this.fitToParent.createDelegate(this,[true
 this.dom.insertBefore(el,this.dom.firstChild);return !J?Roo.get(el):el;}},insertSibling:function(el,J,K){J=J?J.toLowerCase():'before';el=el||{};var rt,L=J=='before'?this.dom:this.dom.nextSibling;if(typeof el=='object'&&!el.nodeType){if(J=='after'&&!this.dom.nextSibling){rt=Roo.DomHelper.append(this.dom.parentNode,el,!K);
 }else{rt=Roo.DomHelper[J=='after'?'insertAfter':'insertBefore'](this.dom,el,!K);}}else{rt=this.dom.parentNode.insertBefore(Roo.getDom(el),J=='before'?this.dom:this.dom.nextSibling);if(!K){rt=Roo.get(rt);}}return rt;},wrap:function(J,K){if(!J){J={tag:"div"}
 ;}var L=Roo.DomHelper.insertBefore(this.dom,J,!K);L.dom?L.dom.appendChild(this.dom):L.appendChild(this.dom);return L;},replace:function(el){el=Roo.get(el);this.insertBefore(el);el.remove();return this;},insertHtml:function(J,K,L){var el=Roo.DomHelper.insertHtml(J,this.dom,K);
-return L?Roo.get(el):el;},set:function(o,J){var el=this.dom;J=typeof J=='undefined'?(el.setAttribute?true:false):J;for(var K in o){if(K=="style"||typeof o[K]=="function")continue;if(K=="cls"){el.className=o["cls"];}else{if(J)el.setAttribute(K,o[K]);elseel[K]=o[K];
-}}if(o.style){Roo.DomHelper.applyStyles(el,o.style);}return this;},addKeyListener:function(J,fn,K){var L;if(typeof J!="object"||J instanceof Array){L={key:J,fn:fn,scope:K};}else{L={key:J.key,shift:J.shift,ctrl:J.ctrl,alt:J.alt,fn:fn,scope:K};}return new Roo.KeyMap(this,L);
+return L?Roo.get(el):el;},set:function(o,J){var el=this.dom;J=typeof J=='undefined'?(el.setAttribute?true:false):J;for(var K in o){if(K=="style"||typeof o[K]=="function"){continue;}if(K=="cls"){el.className=o["cls"];}else{if(J){el.setAttribute(K,o[K]);}else{el[K]=o[K];
+}}}if(o.style){Roo.DomHelper.applyStyles(el,o.style);}return this;},addKeyListener:function(J,fn,K){var L;if(typeof J!="object"||J instanceof Array){L={key:J,fn:fn,scope:K};}else{L={key:J.key,shift:J.shift,ctrl:J.ctrl,alt:J.alt,fn:fn,scope:K};}return new Roo.KeyMap(this,L);
 },addKeyMap:function(J){return new Roo.KeyMap(this,J);},isScrollable:function(){var J=this.dom;return J.scrollHeight>J.clientHeight||J.scrollWidth>J.clientWidth;},scrollTo:function(J,K,L){var M=J.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!L||!A){this.dom[M]=K;
 }else{var to=M=="scrollLeft"?[K,this.dom.scrollTop]:[this.dom.scrollLeft,K];this.anim({scroll:{"to":to}},this.preanim(arguments,2),'scroll');}return this;},scroll:function(J,K,L){if(!this.isScrollable()){return;}var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;
 var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;J=J.toLowerCase();var M=false;var a=this.preanim(arguments,2);switch(J){case "l":case "left":if(w-l>cw){var v=Math.min(l+K,w-cw);this.scrollTo("left",v,a);M=true;}break;case "r":case "right":if(l>0){var v=Math.max(l-K,0);
@@ -452,7 +452,7 @@ return {pos:this.getPositioning(),width:st.width,height:st.height};},afterFx:fun
 if(!o.concurrent){this.fxQueue.shift();this.nextFx();}},getFxEl:function(){return Roo.get(this.dom);},fxanim:function(A,B,C,D,E,cb){C=C||'run';B=B||{};var F=Roo.lib.Anim[C](this.dom,A,(B.duration||D)||.35,(B.easing||E)||'easeOut',function(){Roo.callback(cb,this);
 },this);B.anim=F;return F;}};Roo.Fx.resize=Roo.Fx.scale;Roo.apply(Roo.Element.prototype,Roo.Fx);
 // Roo/CompositeElement.js
-Roo.CompositeElement=function(A){this.elements=[];this.addElements(A);};Roo.CompositeElement.prototype={isComposite:true,addElements:function(A){if(!A)return this;if(typeof A=="string"){A=Roo.Element.selectorFunction(A);}var B=this.elements;var C=B.length-1;
+Roo.CompositeElement=function(A){this.elements=[];this.addElements(A);};Roo.CompositeElement.prototype={isComposite:true,addElements:function(A){if(!A){return this;}if(typeof A=="string"){A=Roo.Element.selectorFunction(A);}var B=this.elements;var C=B.length-1;
 for(var i=0,D=A.length;i<D;i++){B[++C]=Roo.get(A[i]);}return this;},fill:function(A){this.elements=[];this.add(A);return this;},filter:function(A,B){var C=[];B=B||false;this.each(function(el){var D=B?!el.is(A):el.is(A);if(D){C[C.length]=el.dom;}});this.fill(C);
 return this;},invoke:function(fn,A){var B=this.elements;for(var i=0,C=B.length;i<C;i++){Roo.Element.prototype[fn].apply(B[i],A);}return this;},add:function(A){if(typeof A=="string"){this.addElements(Roo.Element.selectorFunction(A));}else if(A.length!==undefined){this.addElements(A);
 }else{this.addElements([A]);}return this;},each:function(fn,A){var B=this.elements;for(var i=0,C=B.length;i<C;i++){if(fn.call(A||B[i],B[i],this,i)===false){break;}}return this;},item:function(A){return this.elements[A]||null;},first:function(){return this.item(0);
@@ -536,8 +536,8 @@ for(var i=0,C=B.length;i<C;i++){this.add(B[i]);}}else{for(var D in A){if(this.al
 }}},eachKey:function(fn,A){for(var i=0,B=this.keys.length;i<B;i++){fn.call(A||window,this.keys[i],this.items[i],i,B);}},find:function(fn,A){for(var i=0,B=this.items.length;i<B;i++){if(fn.call(A||window,this.items[i],this.keys[i])){return this.items[i];}}return null;
 },insert:function(A,B,o){if(arguments.length==2){o=arguments[1];B=this.getKey(o);}if(A>=this.length){return this.add(B,o);}this.length++;this.items.splice(A,0,o);if(typeof B!="undefined"&&B!=null){this.map[B]=o;}this.keys.splice(A,0,B);this.fireEvent("add",A,o,B);
 return o;},remove:function(o){return this.removeAt(this.indexOf(o));},removeAt:function(A){if(A<this.length&&A>=0){this.length--;var o=this.items[A];this.items.splice(A,1);var B=this.keys[A];if(typeof B!="undefined"){delete this.map[B];}this.keys.splice(A,1);
-this.fireEvent("remove",o,B);}},removeKey:function(A){return this.removeAt(this.indexOfKey(A));},getCount:function(){return this.length;},indexOf:function(o){if(!this.items.indexOf){for(var i=0,A=this.items.length;i<A;i++){if(this.items[i]==o)return i;}return -1;
-}else{return this.items.indexOf(o);}},indexOfKey:function(A){if(!this.keys.indexOf){for(var i=0,B=this.keys.length;i<B;i++){if(this.keys[i]==A)return i;}return -1;}else{return this.keys.indexOf(A);}},item:function(A){var B=typeof this.map[A]!="undefined"?this.map[A]:this.items[A];
+this.fireEvent("remove",o,B);}},removeKey:function(A){return this.removeAt(this.indexOfKey(A));},getCount:function(){return this.length;},indexOf:function(o){if(!this.items.indexOf){for(var i=0,A=this.items.length;i<A;i++){if(this.items[i]==o){return i;}}
+return -1;}else{return this.items.indexOf(o);}},indexOfKey:function(A){if(!this.keys.indexOf){for(var i=0,B=this.keys.length;i<B;i++){if(this.keys[i]==A){return i;}}return -1;}else{return this.keys.indexOf(A);}},item:function(A){var B=typeof this.map[A]!="undefined"?this.map[A]:this.items[A];
 return typeof B!='function'||this.allowFunctions?B:null;},itemAt:function(A){return this.items[A];},key:function(A){return this.map[A];},contains:function(o){return this.indexOf(o)!=-1;},containsKey:function(A){return typeof this.map[A]!="undefined";},clear:function(){this.length=0;
 this.items=[];this.keys=[];this.map={};this.fireEvent("clear");},first:function(){return this.items[0];},last:function(){return this.items[this.length-1];},_sort:function(A,B,fn){var C=String(B).toUpperCase()=="DESC"?-1:1;fn=fn||function(a,b){return a-b;}
 ;var c=[],k=this.keys,D=this.items;for(var i=0,E=D.length;i<E;i++){c[c.length]={key:k[i],value:D[i],index:i};}c.sort(function(a,b){var v=fn(a[A],b[A])*C;if(v==0){v=(a.index<b.index?-1:1);}return v;});for(var i=0,E=c.length;i<E;i++){D[i]=c[i].value;k[i]=c[i].key;
@@ -606,10 +606,10 @@ var s=ml.getSize();ml.update('');return s;},bind:function(el){ml.setStyle(Roo.fl
 return this.getSize(D).width;},getHeight:function(D){return this.getSize(D).height;}};C.bind(A);return C;};Roo.Element.measureText=Roo.util.TextMetrics.measure;
 // Roo/state/Provider.js
 Roo.state.Provider=function(){this.addEvents({"statechange":true});this.state={};Roo.state.Provider.superclass.constructor.call(this);};Roo.extend(Roo.state.Provider,Roo.util.Observable,{get:function(A,B){return typeof this.state[A]=="undefined"?B:this.state[A];
-},clear:function(A){delete this.state[A];this.fireEvent("statechange",this,A,null);},set:function(A,B){this.state[A]=B;this.fireEvent("statechange",this,A,B);},decodeValue:function(A){var re=/^(a|n|d|b|s|o)\:(.*)$/;var B=re.exec(unescape(A));if(!B||!B[1])return;
-var C=B[1];var v=B[2];switch(C){case "n":return parseFloat(v);case "d":return new Date(Date.parse(v));case "b":return (v=="1");case "a":var D=[];var E=v.split("^");for(var i=0,F=E.length;i<F;i++){D.push(this.decodeValue(E[i]));}return D;case "o":var D={};
-var E=v.split("^");for(var i=0,F=E.length;i<F;i++){var kv=E[i].split("=");D[kv[0]]=this.decodeValue(kv[1]);}return D;default:return v;}},encodeValue:function(v){var A;if(typeof v=="number"){A="n:"+v;}else if(typeof v=="boolean"){A="b:"+(v?"1":"0");}else if(v instanceof Date){A="d:"+v.toGMTString();
-}else if(v instanceof Array){var B="";for(var i=0,C=v.length;i<C;i++){B+=this.encodeValue(v[i]);if(i!=C-1)B+="^";}A="a:"+B;}else if(typeof v=="object"){var B="";for(var D in v){if(typeof v[D]!="function"){B+=D+"="+this.encodeValue(v[D])+"^";}}A="o:"+B.substring(0,B.length-1);
+},clear:function(A){delete this.state[A];this.fireEvent("statechange",this,A,null);},set:function(A,B){this.state[A]=B;this.fireEvent("statechange",this,A,B);},decodeValue:function(A){var re=/^(a|n|d|b|s|o)\:(.*)$/;var B=re.exec(unescape(A));if(!B||!B[1]){return;
+}var C=B[1];var v=B[2];switch(C){case "n":return parseFloat(v);case "d":return new Date(Date.parse(v));case "b":return (v=="1");case "a":var D=[];var E=v.split("^");for(var i=0,F=E.length;i<F;i++){D.push(this.decodeValue(E[i]));}return D;case "o":var D={}
+;var E=v.split("^");for(var i=0,F=E.length;i<F;i++){var kv=E[i].split("=");D[kv[0]]=this.decodeValue(kv[1]);}return D;default:return v;}},encodeValue:function(v){var A;if(typeof v=="number"){A="n:"+v;}else if(typeof v=="boolean"){A="b:"+(v?"1":"0");}else if(v instanceof Date){A="d:"+v.toGMTString();
+}else if(v instanceof Array){var B="";for(var i=0,C=v.length;i<C;i++){B+=this.encodeValue(v[i]);if(i!=C-1){B+="^";}}A="a:"+B;}else if(typeof v=="object"){var B="";for(var D in v){if(typeof v[D]!="function"){B+=D+"="+this.encodeValue(v[D])+"^";}}A="o:"+B.substring(0,B.length-1);
 }else{A="s:"+v;}return escape(A);}});
 // Roo/state/Manager.js
 Roo.state.Manager=function(){var A=new Roo.state.Provider();return {setProvider:function(B){A=B;},get:function(B,C){return A.get(B,C);},set:function(B,C){A.set(B,C);},clear:function(B){A.clear(B);},getProvider:function(){return A;}};}();