roojs-core.js
authorAlan Knowles <alan@akbkhome.com>
Mon, 9 Apr 2012 10:58:27 +0000 (18:58 +0800)
committerAlan Knowles <alan@akbkhome.com>
Mon, 9 Apr 2012 10:58:27 +0000 (18:58 +0800)
roojs-core-debug.js
roojs-ui.js
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index 319d35c..68e535f 100644 (file)
@@ -1140,10 +1140,10 @@ this.store.loadRecords({records:A},{},true);},onUpdate:function(ds,A,B){if(B==Ro
 Roo.LoadMask=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(this.store){this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this);this.removeMask=false;}else {var um=this.el.getUpdateManager();um.showLoadIndicator=false;um.on('beforeupdate',this.onBeforeLoad,this);um.on('update',this.onLoad,this);um.on('failure',this.onLoad,this);this.removeMask=true;}};Roo.LoadMask.prototype={msg:'Loading...',msgCls:'x-mask-loading',disabled:false,disable:function(){this.disabled=true;},enable:function(){this.disabled=false;},onLoadException:function(){if(this.store&&typeof(this.store.reader.jsonData.errorMsg)!='undefined'){Roo.MessageBox.alert("Error loading",this.store.reader.jsonData.errorMsg);}
 this.el.unmask(this.removeMask);},onLoad:function(){this.el.unmask(this.removeMask);},onBeforeLoad:function(){if(!this.disabled){this.el.mask(this.msg,this.msgCls);}},destroy:function(){if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.onLoadException,this);}else {var um=this.el.getUpdateManager();um.un('beforeupdate',this.onBeforeLoad,this);um.un('update',this.onLoad,this);um.un('failure',this.onLoad,this);}}};
 //Roo/XTemplate.js
-Roo.XTemplate=function(){Roo.XTemplate.superclass.constructor.apply(this,arguments);if(this.html){this.compile();}};Roo.extend(Roo.XTemplate,Roo.Template,{re:/\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var s=this.html;s=['<tpl>',s,'</tpl>'].join('');var re=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,A=/^<tpl\b[^>]*?for="(.*?)"/,B=/^<tpl\b[^>]*?if="(.*?)"/,C=/^<tpl\b[^>]*?exec="(.*?)"/,m,id=0,D=[];while(true==!!(m=s.match(re))){var m2=m[0].match(A),m3=m[0].match(B),m4=m[0].match(C),E=null,fn=null,F=null,G=m2&&m2[1]?m2[1]:'';if(m3){E=m3&&m3[1]?m3[1]:null;if(E){fn=new Function('values','parent','with(values){ return '+(Roo.util.Format.htmlDecode(E))+'; }');}}if(m4){E=m4&&m4[1]?m4[1]:null;if(E){F=new Function('values','parent','with(values){ '+(Roo.util.Format.htmlDecode(E))+'; }');}}if(G){switch(G){case '.':G=new Function('values','parent','with(values){ return values; }');break;case '..':G=new Function('values','parent','with(values){ return parent; }');break;default:G=new Function('values','parent','with(values){ return '+G+'; }');}}
-D.push({id:id,target:G,exec:F,test:fn,body:m[1]||''});s=s.replace(m[0],'{xtpl'+id+'}');++id;}for(var i=D.length-1;i>=0;--i){this.compileTpl(D[i]);}
-this.master=D[D.length-1];this.tpls=D;return this;},applySubTemplate:function(id,A,B){var t=this.tpls[id];try{if(t.test&&!t.test.call(this,A,B)){return '';}}catch(e){Roo.log("Xtemplate.applySubTemplate 'test': Exception thrown");Roo.log(e.toString());Roo.log(t.test);return ''}try{if(t.exec&&t.exec.call(this,A,B)){return '';}}catch(e){Roo.log("Xtemplate.applySubTemplate 'exec': Exception thrown");Roo.log(e.toString());Roo.log(t.exec);return ''}try{var vs=t.target?t.target.call(this,A,B):A;B=t.target?A:B;if(t.target&&vs instanceof Array){var C=[];for(var i=0,D=vs.length;i<D;i++){C[C.length]=t.compiled.call(this,vs[i],B);}return C.join('');}return t.compiled.call(this,vs,B);}catch(e){Roo.log("Xtemplate.applySubTemplate : Exception thrown");Roo.log(e.toString());Roo.log(t.compiled);return '';}},compileTpl:function(A){var fm=Roo.util.Format;var B=this.disableFormats!==true;var C=Roo.isGecko?"+":",";var D=function(F){Roo.log("Property not found :"+F);return '';};var fn=function(m,F,G,H){H=H?H.replace(/\\'/g,"'"):H;if(typeof(G)=='undefined'){G='htmlEncode';}if(G=='raw'){G=false;}if(F.substr(0,4)=='xtpl'){return "'"+C+'this.applySubTemplate('+F.substr(4)+', values, parent)'+C+"'";}var I=[];var J='';Roo.each(F.split('.'),function(st){J+=(J.length?'.':'')+st;I.push("(typeof("+J+") == 'undefined')");});var K='(('+I.join(" || ")+") ? undef('"+F+"') : ";if(G&&B){H=H?','+H:"";if(G.substr(0,5)!="this."){G="fm."+G+'(';}else {G='this.call("'+G.substr(5)+'", ';H=", values";}return "'"+C+K+G+F+H+"))"+C+"'";}if(H.length){return "'"+C+K+F+'('+H+"))"+C+"'";}return "'"+C+K+F+")"+C+"'";};var E;if(Roo.isGecko){E="tpl.compiled = function(values, parent){  with(values) { return '"+A.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};};";}else {E=["tpl.compiled = function(values, parent){  with (values) { return ['"];E.push(A.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));E.push("'].join('');};};");E=E.join('');}
-Roo.debug&&Roo.log(E.replace(/\\n/,'\n'));eval(E);return this;},applyTemplate:function(A){return this.master.compiled.call(this,A,{});},apply:function(){return this.applyTemplate.apply(this,arguments);}});Roo.XTemplate.from=function(el){el=Roo.getDom(el);return new Roo.XTemplate(el.value||el.innerHTML);};
+Roo.XTemplate=function(){Roo.XTemplate.superclass.constructor.apply(this,arguments);if(this.html){this.compile();}};Roo.extend(Roo.XTemplate,Roo.Template,{tpls:false,re:/\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var s=this.html;s=['<tpl>',s,'</tpl>'].join('');var re=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,A=/^<tpl\b[^>]*?for="(.*?)"/,B=/^<tpl\b[^>]*?if="(.*?)"/,C=/^<tpl\b[^>]*?exec="(.*?)"/,D=/^<tpl\b[^>]*?name="(\w+)"/,m,id=0,E=[];while(true==!!(m=s.match(re))){var F=m[0].match(A),G=m[0].match(B),H=m[0].match(C),I=m[0].match(D),J=null,fn=null,K=null,L=F&&F[1]?F[1]:'';if(G){J=G&&G[1]?G[1]:null;if(J){fn=new Function('values','parent','with(values){ return '+(Roo.util.Format.htmlDecode(J))+'; }');}}if(H){J=H&&H[1]?H[1]:null;if(J){K=new Function('values','parent','with(values){ '+(Roo.util.Format.htmlDecode(J))+'; }');}}if(L){switch(L){case '.':L=new Function('values','parent','with(values){ return values; }');break;case '..':L=new Function('values','parent','with(values){ return parent; }');break;default:L=new Function('values','parent','with(values){ return '+L+'; }');}}var M=I?I[1]:id;E.push({id:I?I[1]:id,target:L,exec:K,test:fn,body:m[1]||''});if(I){s=s.replace(m[0],'');}else {s=s.replace(m[0],'{xtpl'+id+'}');}++id;}
+this.tpls=[];for(var i=E.length-1;i>=0;--i){this.compileTpl(E[i]);this.tpls[E[i].id]=E[i];}
+this.master=E[E.length-1];return this;},applySubTemplate:function(id,A,B){var t=this.tpls[id];try{if(t.test&&!t.test.call(this,A,B)){return '';}}catch(e){Roo.log("Xtemplate.applySubTemplate 'test': Exception thrown");Roo.log(e.toString());Roo.log(t.test);return ''}try{if(t.exec&&t.exec.call(this,A,B)){return '';}}catch(e){Roo.log("Xtemplate.applySubTemplate 'exec': Exception thrown");Roo.log(e.toString());Roo.log(t.exec);return ''}try{var vs=t.target?t.target.call(this,A,B):A;B=t.target?A:B;if(t.target&&vs instanceof Array){var C=[];for(var i=0,D=vs.length;i<D;i++){C[C.length]=t.compiled.call(this,vs[i],B);}return C.join('');}return t.compiled.call(this,vs,B);}catch(e){Roo.log("Xtemplate.applySubTemplate : Exception thrown");Roo.log(e.toString());Roo.log(t.compiled);return '';}},compileTpl:function(tpl){var fm=Roo.util.Format;var useF=this.disableFormats!==true;var A=Roo.isGecko?"+":",";var undef=function(C){Roo.log("Property not found :"+C);return '';};var fn=function(m,C,D,E){E=E?E.replace(/\\'/g,"'"):E;if(typeof(D)=='undefined'){D='htmlEncode';}if(D=='raw'){D=false;}if(C.substr(0,4)=='xtpl'){return "'"+A+'this.applySubTemplate('+C.substr(4)+', values, parent)'+A+"'";}var F=[];var G='';Roo.each(C.split('.'),function(st){G+=(G.length?'.':'')+st;F.push("(typeof("+G+") == 'undefined')");});var H='(('+F.join(" || ")+") ? undef('"+C+"') : ";if(D&&useF){E=E?','+E:"";if(D.substr(0,5)!="this."){D="fm."+D+'(';}else {D='this.call("'+D.substr(5)+'", ';E=", values";}return "'"+A+H+D+C+E+"))"+A+"'";}if(E.length){return "'"+A+H+C+'('+E+"))"+A+"'";}return "'"+A+H+C+")"+A+"'";};var B;if(Roo.isGecko){B="tpl.compiled = function(values, parent){  with(values) { return '"+tpl.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};};";}else {B=["tpl.compiled = function(values, parent){  with (values) { return ['"];B.push(tpl.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));B.push("'].join('');};};");B=B.join('');}
+Roo.debug&&Roo.log(B.replace(/\\n/,'\n'));eval(B);return this;},applyTemplate:function(A){return this.master.compiled.call(this,A,{});},apply:function(){return this.applyTemplate.apply(this,arguments);}});Roo.XTemplate.from=function(el){el=Roo.getDom(el);return new Roo.XTemplate(el.value||el.innerHTML);};
 //Roo/XComponent.js
 Roo.XComponent=function(A){Roo.apply(this,A);this.addEvents({'built':true});this.region=this.region||'center';Roo.XComponent.register(this);this.modules=false;this.el=false;}
 Roo.extend(Roo.XComponent,Roo.util.Observable,{el:false,panel:false,layout:false,disabled:false,parent:false,order:false,name:false,region:'center',items:false,_tree:false,render:function(el){el=el||false;var hp=this.parent?1:0;if(!el&&typeof(this.parent)=='string'&&this.parent.substring(0,1)=='#'){var A=this.parent.substr(1)
index 5c1bf1f..4b6fc48 100644 (file)
@@ -52329,7 +52329,7 @@ Roo.LoadMask.prototype = {
  * @extends Roo.Template
  * Provides a template that can have nested templates for loops or conditionals. The syntax is:
 <pre><code>
-var t = new Roo.MasterTemplate(
+var t = new Roo.XTemplate(
        '&lt;select name="{name}"&gt;',
                '&lt;tpl for="options"&gt;&lt;option value="{value:trim}"&gt;{text:ellipsis(10)}&lt;/option&gt;&lt;/tpl&gt;',
        '&lt;/select&gt;'
@@ -52351,6 +52351,7 @@ var t = new Roo.MasterTemplate(
  *      &lt;tpl for="a_variable or condition.."&gt;&lt;/tpl&gt;
  *      &lt;tpl if="a_variable or condition"&gt;&lt;/tpl&gt;
  *      &lt;tpl exec="some javascript"&gt;&lt;/tpl&gt;
+ *      &lt;tpl name="named_template"&gt;&lt;/tpl&gt;
  *
  *      &lt;tpl for="."&gt;&lt;/tpl&gt; - just iterate the property..
  *      &lt;tpl for=".."&gt;&lt;/tpl&gt; - iterates with the parent (probably the template) 
@@ -52368,6 +52369,10 @@ Roo.XTemplate = function()
 
 Roo.extend(Roo.XTemplate, Roo.Template, {
 
+    /**
+     * The various sub templates
+     */
+    tpls : false,
     /**
      *
      * basic tag replacing syntax
@@ -52379,7 +52384,12 @@ Roo.extend(Roo.XTemplate, Roo.Template, {
      */
     re : /\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
 
-    
+    /**
+     * compile the template
+     *
+     * This is not recursive, so I'm not sure how nested templates are really going to be handled..
+     *
+     */
     compile: function()
     {
         var s = this.html;
@@ -52390,33 +52400,39 @@ Roo.extend(Roo.XTemplate, Roo.Template, {
             nameRe = /^<tpl\b[^>]*?for="(.*?)"/,
             ifRe   = /^<tpl\b[^>]*?if="(.*?)"/,
             execRe = /^<tpl\b[^>]*?exec="(.*?)"/,
+            namedRe = /^<tpl\b[^>]*?name="(\w+)"/,  // named templates..
             m,
             id     = 0,
             tpls   = [];
     
         while(true == !!(m = s.match(re))){
-            var m2   = m[0].match(nameRe),
-                m3   = m[0].match(ifRe),
-                m4   = m[0].match(execRe),
+            var forMatch   = m[0].match(nameRe),
+                ifMatch   = m[0].match(ifRe),
+                execMatch   = m[0].match(execRe),
+                namedMatch   = m[0].match(namedRe),
+                
                 exp  = null, 
                 fn   = null,
                 exec = null,
-                name = m2 && m2[1] ? m2[1] : '';
+                name = forMatch && forMatch[1] ? forMatch[1] : '';
                 
-            if (m3) {
+            if (ifMatch) {
                 // if - puts fn into test..
-                exp = m3 && m3[1] ? m3[1] : null;
+                exp = ifMatch && ifMatch[1] ? ifMatch[1] : null;
                 if(exp){
                    fn = new Function('values', 'parent', 'with(values){ return '+(Roo.util.Format.htmlDecode(exp))+'; }');
                 }
             }
-            if (m4) {
+            
+            if (execMatch) {
                 // exec - calls a function... returns empty if true is  returned.
-                exp = m4 && m4[1] ? m4[1] : null;
+                exp = execMatch && execMatch[1] ? execMatch[1] : null;
                 if(exp){
                    exec = new Function('values', 'parent', 'with(values){ '+(Roo.util.Format.htmlDecode(exp))+'; }');
                 }
             }
+            
+            
             if (name) {
                 // for = 
                 switch(name){
@@ -52425,27 +52441,49 @@ Roo.extend(Roo.XTemplate, Roo.Template, {
                     default:   name = new Function('values', 'parent', 'with(values){ return '+name+'; }');
                 }
             }
+            var uid = namedMatch ? namedMatch[1] : id;
+            
+            
             tpls.push({
-                id:     id,
+                id:     namedMatch ? namedMatch[1] : id,
                 target: name,
                 exec:   exec,
                 test:   fn,
                 body:   m[1] || ''
             });
-            s = s.replace(m[0], '{xtpl'+ id + '}');
+            if (namedMatch) {
+                s = s.replace(m[0], '');
+            } else { 
+                s = s.replace(m[0], '{xtpl'+ id + '}');
+            }
             ++id;
         }
+        this.tpls = [];
         for(var i = tpls.length-1; i >= 0; --i){
             this.compileTpl(tpls[i]);
+            this.tpls[tpls[i].id] = tpls[i];
         }
         this.master = tpls[tpls.length-1];
-        this.tpls = tpls;
         return this;
     },
-    
+    /**
+     * same as applyTemplate, except it's done to one of the subTemplates
+     * when using named templates, you can do:
+     *
+     * var str = pl.applySubTemplate('your-name', values);
+     *
+     * 
+     * @param {Number} id of the template
+     * @param {Object} values to apply to template
+     * @param {Object} parent (normaly the instance of this object)
+     */
     applySubTemplate : function(id, values, parent)
     {
+        
+        
         var t = this.tpls[id];
+        
+        
         try { 
             if(t.test && !t.test.call(this, values, parent)){
                 return '';
@@ -52568,7 +52606,7 @@ Roo.extend(Roo.XTemplate, Roo.Template, {
         
         Roo.debug && Roo.log(body.replace(/\\n/,'\n'));
        
-        /** eval:var:zzzzzzz */
+        /** eval:var:tpl eval:var:fm eval:var:useF eval:var:undef  */
         eval(body);
         
         return this;
index f58dc6a..6bcbf55 100644 (file)
@@ -37827,7 +37827,7 @@ Roo.LoadMask.prototype = {
  * @extends Roo.Template
  * Provides a template that can have nested templates for loops or conditionals. The syntax is:
 <pre><code>
-var t = new Roo.MasterTemplate(
+var t = new Roo.XTemplate(
        '&lt;select name="{name}"&gt;',
                '&lt;tpl for="options"&gt;&lt;option value="{value:trim}"&gt;{text:ellipsis(10)}&lt;/option&gt;&lt;/tpl&gt;',
        '&lt;/select&gt;'
@@ -37849,6 +37849,7 @@ var t = new Roo.MasterTemplate(
  *      &lt;tpl for="a_variable or condition.."&gt;&lt;/tpl&gt;
  *      &lt;tpl if="a_variable or condition"&gt;&lt;/tpl&gt;
  *      &lt;tpl exec="some javascript"&gt;&lt;/tpl&gt;
+ *      &lt;tpl name="named_template"&gt;&lt;/tpl&gt;
  *
  *      &lt;tpl for="."&gt;&lt;/tpl&gt; - just iterate the property..
  *      &lt;tpl for=".."&gt;&lt;/tpl&gt; - iterates with the parent (probably the template) 
@@ -37866,6 +37867,10 @@ Roo.XTemplate = function()
 
 Roo.extend(Roo.XTemplate, Roo.Template, {
 
+    /**
+     * The various sub templates
+     */
+    tpls : false,
     /**
      *
      * basic tag replacing syntax
@@ -37877,7 +37882,12 @@ Roo.extend(Roo.XTemplate, Roo.Template, {
      */
     re : /\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
 
-    
+    /**
+     * compile the template
+     *
+     * This is not recursive, so I'm not sure how nested templates are really going to be handled..
+     *
+     */
     compile: function()
     {
         var s = this.html;
@@ -37888,33 +37898,39 @@ Roo.extend(Roo.XTemplate, Roo.Template, {
             nameRe = /^<tpl\b[^>]*?for="(.*?)"/,
             ifRe   = /^<tpl\b[^>]*?if="(.*?)"/,
             execRe = /^<tpl\b[^>]*?exec="(.*?)"/,
+            namedRe = /^<tpl\b[^>]*?name="(\w+)"/,  // named templates..
             m,
             id     = 0,
             tpls   = [];
     
         while(true == !!(m = s.match(re))){
-            var m2   = m[0].match(nameRe),
-                m3   = m[0].match(ifRe),
-                m4   = m[0].match(execRe),
+            var forMatch   = m[0].match(nameRe),
+                ifMatch   = m[0].match(ifRe),
+                execMatch   = m[0].match(execRe),
+                namedMatch   = m[0].match(namedRe),
+                
                 exp  = null, 
                 fn   = null,
                 exec = null,
-                name = m2 && m2[1] ? m2[1] : '';
+                name = forMatch && forMatch[1] ? forMatch[1] : '';
                 
-            if (m3) {
+            if (ifMatch) {
                 // if - puts fn into test..
-                exp = m3 && m3[1] ? m3[1] : null;
+                exp = ifMatch && ifMatch[1] ? ifMatch[1] : null;
                 if(exp){
                    fn = new Function('values', 'parent', 'with(values){ return '+(Roo.util.Format.htmlDecode(exp))+'; }');
                 }
             }
-            if (m4) {
+            
+            if (execMatch) {
                 // exec - calls a function... returns empty if true is  returned.
-                exp = m4 && m4[1] ? m4[1] : null;
+                exp = execMatch && execMatch[1] ? execMatch[1] : null;
                 if(exp){
                    exec = new Function('values', 'parent', 'with(values){ '+(Roo.util.Format.htmlDecode(exp))+'; }');
                 }
             }
+            
+            
             if (name) {
                 // for = 
                 switch(name){
@@ -37923,27 +37939,49 @@ Roo.extend(Roo.XTemplate, Roo.Template, {
                     default:   name = new Function('values', 'parent', 'with(values){ return '+name+'; }');
                 }
             }
+            var uid = namedMatch ? namedMatch[1] : id;
+            
+            
             tpls.push({
-                id:     id,
+                id:     namedMatch ? namedMatch[1] : id,
                 target: name,
                 exec:   exec,
                 test:   fn,
                 body:   m[1] || ''
             });
-            s = s.replace(m[0], '{xtpl'+ id + '}');
+            if (namedMatch) {
+                s = s.replace(m[0], '');
+            } else { 
+                s = s.replace(m[0], '{xtpl'+ id + '}');
+            }
             ++id;
         }
+        this.tpls = [];
         for(var i = tpls.length-1; i >= 0; --i){
             this.compileTpl(tpls[i]);
+            this.tpls[tpls[i].id] = tpls[i];
         }
         this.master = tpls[tpls.length-1];
-        this.tpls = tpls;
         return this;
     },
-    
+    /**
+     * same as applyTemplate, except it's done to one of the subTemplates
+     * when using named templates, you can do:
+     *
+     * var str = pl.applySubTemplate('your-name', values);
+     *
+     * 
+     * @param {Number} id of the template
+     * @param {Object} values to apply to template
+     * @param {Object} parent (normaly the instance of this object)
+     */
     applySubTemplate : function(id, values, parent)
     {
+        
+        
         var t = this.tpls[id];
+        
+        
         try { 
             if(t.test && !t.test.call(this, values, parent)){
                 return '';
@@ -38066,7 +38104,7 @@ Roo.extend(Roo.XTemplate, Roo.Template, {
         
         Roo.debug && Roo.log(body.replace(/\\n/,'\n'));
        
-        /** eval:var:zzzzzzz */
+        /** eval:var:tpl eval:var:fm eval:var:useF eval:var:undef  */
         eval(body);
         
         return this;
index 8d1b7cd..e6f1f24 100644 (file)
@@ -847,10 +847,10 @@ this.store.loadRecords({records:A},{},true);},onUpdate:function(ds,A,B){if(B==Ro
 Roo.LoadMask=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(this.store){this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this);this.removeMask=false;}else {var um=this.el.getUpdateManager();um.showLoadIndicator=false;um.on('beforeupdate',this.onBeforeLoad,this);um.on('update',this.onLoad,this);um.on('failure',this.onLoad,this);this.removeMask=true;}};Roo.LoadMask.prototype={msg:'Loading...',msgCls:'x-mask-loading',disabled:false,disable:function(){this.disabled=true;},enable:function(){this.disabled=false;},onLoadException:function(){if(this.store&&typeof(this.store.reader.jsonData.errorMsg)!='undefined'){Roo.MessageBox.alert("Error loading",this.store.reader.jsonData.errorMsg);}
 this.el.unmask(this.removeMask);},onLoad:function(){this.el.unmask(this.removeMask);},onBeforeLoad:function(){if(!this.disabled){this.el.mask(this.msg,this.msgCls);}},destroy:function(){if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.onLoadException,this);}else {var um=this.el.getUpdateManager();um.un('beforeupdate',this.onBeforeLoad,this);um.un('update',this.onLoad,this);um.un('failure',this.onLoad,this);}}};
 //Roo/XTemplate.js
-Roo.XTemplate=function(){Roo.XTemplate.superclass.constructor.apply(this,arguments);if(this.html){this.compile();}};Roo.extend(Roo.XTemplate,Roo.Template,{re:/\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var s=this.html;s=['<tpl>',s,'</tpl>'].join('');var re=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,A=/^<tpl\b[^>]*?for="(.*?)"/,B=/^<tpl\b[^>]*?if="(.*?)"/,C=/^<tpl\b[^>]*?exec="(.*?)"/,m,id=0,D=[];while(true==!!(m=s.match(re))){var m2=m[0].match(A),m3=m[0].match(B),m4=m[0].match(C),E=null,fn=null,F=null,G=m2&&m2[1]?m2[1]:'';if(m3){E=m3&&m3[1]?m3[1]:null;if(E){fn=new Function('values','parent','with(values){ return '+(Roo.util.Format.htmlDecode(E))+'; }');}}if(m4){E=m4&&m4[1]?m4[1]:null;if(E){F=new Function('values','parent','with(values){ '+(Roo.util.Format.htmlDecode(E))+'; }');}}if(G){switch(G){case '.':G=new Function('values','parent','with(values){ return values; }');break;case '..':G=new Function('values','parent','with(values){ return parent; }');break;default:G=new Function('values','parent','with(values){ return '+G+'; }');}}
-D.push({id:id,target:G,exec:F,test:fn,body:m[1]||''});s=s.replace(m[0],'{xtpl'+id+'}');++id;}for(var i=D.length-1;i>=0;--i){this.compileTpl(D[i]);}
-this.master=D[D.length-1];this.tpls=D;return this;},applySubTemplate:function(id,A,B){var t=this.tpls[id];try{if(t.test&&!t.test.call(this,A,B)){return '';}}catch(e){Roo.log("Xtemplate.applySubTemplate 'test': Exception thrown");Roo.log(e.toString());Roo.log(t.test);return ''}try{if(t.exec&&t.exec.call(this,A,B)){return '';}}catch(e){Roo.log("Xtemplate.applySubTemplate 'exec': Exception thrown");Roo.log(e.toString());Roo.log(t.exec);return ''}try{var vs=t.target?t.target.call(this,A,B):A;B=t.target?A:B;if(t.target&&vs instanceof Array){var C=[];for(var i=0,D=vs.length;i<D;i++){C[C.length]=t.compiled.call(this,vs[i],B);}return C.join('');}return t.compiled.call(this,vs,B);}catch(e){Roo.log("Xtemplate.applySubTemplate : Exception thrown");Roo.log(e.toString());Roo.log(t.compiled);return '';}},compileTpl:function(A){var fm=Roo.util.Format;var B=this.disableFormats!==true;var C=Roo.isGecko?"+":",";var D=function(F){Roo.log("Property not found :"+F);return '';};var fn=function(m,F,G,H){H=H?H.replace(/\\'/g,"'"):H;if(typeof(G)=='undefined'){G='htmlEncode';}if(G=='raw'){G=false;}if(F.substr(0,4)=='xtpl'){return "'"+C+'this.applySubTemplate('+F.substr(4)+', values, parent)'+C+"'";}var I=[];var J='';Roo.each(F.split('.'),function(st){J+=(J.length?'.':'')+st;I.push("(typeof("+J+") == 'undefined')");});var K='(('+I.join(" || ")+") ? undef('"+F+"') : ";if(G&&B){H=H?','+H:"";if(G.substr(0,5)!="this."){G="fm."+G+'(';}else {G='this.call("'+G.substr(5)+'", ';H=", values";}return "'"+C+K+G+F+H+"))"+C+"'";}if(H.length){return "'"+C+K+F+'('+H+"))"+C+"'";}return "'"+C+K+F+")"+C+"'";};var E;if(Roo.isGecko){E="tpl.compiled = function(values, parent){  with(values) { return '"+A.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};};";}else {E=["tpl.compiled = function(values, parent){  with (values) { return ['"];E.push(A.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));E.push("'].join('');};};");E=E.join('');}
-Roo.debug&&Roo.log(E.replace(/\\n/,'\n'));eval(E);return this;},applyTemplate:function(A){return this.master.compiled.call(this,A,{});},apply:function(){return this.applyTemplate.apply(this,arguments);}});Roo.XTemplate.from=function(el){el=Roo.getDom(el);return new Roo.XTemplate(el.value||el.innerHTML);};
+Roo.XTemplate=function(){Roo.XTemplate.superclass.constructor.apply(this,arguments);if(this.html){this.compile();}};Roo.extend(Roo.XTemplate,Roo.Template,{tpls:false,re:/\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var s=this.html;s=['<tpl>',s,'</tpl>'].join('');var re=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,A=/^<tpl\b[^>]*?for="(.*?)"/,B=/^<tpl\b[^>]*?if="(.*?)"/,C=/^<tpl\b[^>]*?exec="(.*?)"/,D=/^<tpl\b[^>]*?name="(\w+)"/,m,id=0,E=[];while(true==!!(m=s.match(re))){var F=m[0].match(A),G=m[0].match(B),H=m[0].match(C),I=m[0].match(D),J=null,fn=null,K=null,L=F&&F[1]?F[1]:'';if(G){J=G&&G[1]?G[1]:null;if(J){fn=new Function('values','parent','with(values){ return '+(Roo.util.Format.htmlDecode(J))+'; }');}}if(H){J=H&&H[1]?H[1]:null;if(J){K=new Function('values','parent','with(values){ '+(Roo.util.Format.htmlDecode(J))+'; }');}}if(L){switch(L){case '.':L=new Function('values','parent','with(values){ return values; }');break;case '..':L=new Function('values','parent','with(values){ return parent; }');break;default:L=new Function('values','parent','with(values){ return '+L+'; }');}}var M=I?I[1]:id;E.push({id:I?I[1]:id,target:L,exec:K,test:fn,body:m[1]||''});if(I){s=s.replace(m[0],'');}else {s=s.replace(m[0],'{xtpl'+id+'}');}++id;}
+this.tpls=[];for(var i=E.length-1;i>=0;--i){this.compileTpl(E[i]);this.tpls[E[i].id]=E[i];}
+this.master=E[E.length-1];return this;},applySubTemplate:function(id,A,B){var t=this.tpls[id];try{if(t.test&&!t.test.call(this,A,B)){return '';}}catch(e){Roo.log("Xtemplate.applySubTemplate 'test': Exception thrown");Roo.log(e.toString());Roo.log(t.test);return ''}try{if(t.exec&&t.exec.call(this,A,B)){return '';}}catch(e){Roo.log("Xtemplate.applySubTemplate 'exec': Exception thrown");Roo.log(e.toString());Roo.log(t.exec);return ''}try{var vs=t.target?t.target.call(this,A,B):A;B=t.target?A:B;if(t.target&&vs instanceof Array){var C=[];for(var i=0,D=vs.length;i<D;i++){C[C.length]=t.compiled.call(this,vs[i],B);}return C.join('');}return t.compiled.call(this,vs,B);}catch(e){Roo.log("Xtemplate.applySubTemplate : Exception thrown");Roo.log(e.toString());Roo.log(t.compiled);return '';}},compileTpl:function(tpl){var fm=Roo.util.Format;var useF=this.disableFormats!==true;var A=Roo.isGecko?"+":",";var undef=function(C){Roo.log("Property not found :"+C);return '';};var fn=function(m,C,D,E){E=E?E.replace(/\\'/g,"'"):E;if(typeof(D)=='undefined'){D='htmlEncode';}if(D=='raw'){D=false;}if(C.substr(0,4)=='xtpl'){return "'"+A+'this.applySubTemplate('+C.substr(4)+', values, parent)'+A+"'";}var F=[];var G='';Roo.each(C.split('.'),function(st){G+=(G.length?'.':'')+st;F.push("(typeof("+G+") == 'undefined')");});var H='(('+F.join(" || ")+") ? undef('"+C+"') : ";if(D&&useF){E=E?','+E:"";if(D.substr(0,5)!="this."){D="fm."+D+'(';}else {D='this.call("'+D.substr(5)+'", ';E=", values";}return "'"+A+H+D+C+E+"))"+A+"'";}if(E.length){return "'"+A+H+C+'('+E+"))"+A+"'";}return "'"+A+H+C+")"+A+"'";};var B;if(Roo.isGecko){B="tpl.compiled = function(values, parent){  with(values) { return '"+tpl.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};};";}else {B=["tpl.compiled = function(values, parent){  with (values) { return ['"];B.push(tpl.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));B.push("'].join('');};};");B=B.join('');}
+Roo.debug&&Roo.log(B.replace(/\\n/,'\n'));eval(B);return this;},applyTemplate:function(A){return this.master.compiled.call(this,A,{});},apply:function(){return this.applyTemplate.apply(this,arguments);}});Roo.XTemplate.from=function(el){el=Roo.getDom(el);return new Roo.XTemplate(el.value||el.innerHTML);};
 //Roo/XComponent.js
 Roo.XComponent=function(A){Roo.apply(this,A);this.addEvents({'built':true});this.region=this.region||'center';Roo.XComponent.register(this);this.modules=false;this.el=false;}
 Roo.extend(Roo.XComponent,Roo.util.Observable,{el:false,panel:false,layout:false,disabled:false,parent:false,order:false,name:false,region:'center',items:false,_tree:false,render:function(el){el=el||false;var hp=this.parent?1:0;if(!el&&typeof(this.parent)=='string'&&this.parent.substring(0,1)=='#'){var A=this.parent.substr(1)