builder.html.js
[app.Builder.js] / builder.html.js
index 5db88c5..07e0d34 100644 (file)
@@ -40,7 +40,11 @@ Builder  = {
             this.dialogroot.remove();
             this.dialogroot = false;
         }
-        
+        if (this.layoutbase) {
+            //console.log(Builder.dump(this.layoutbase.el));
+            
+            this.layoutbase= false;
+        }
          
         
     },
@@ -82,27 +86,28 @@ Builder  = {
             
         }
         
-        return
-     /*
-        // force center region..
-        cfg.items[0].region = 'center';
-        cfg.items[0].background = false;
-        
-        this.panelroot = this.layout.addxtype(cfg.items[0]);
+        // otherwise we are creating a layout area on the document..
         
          
-        this.highlightElement(Pman.Tab.BuilderTree.currentNode);
-        
-        if (this.panelroot.el) {
-                
-                this.panelroot.el.scrollTo('top', this.scroll.top);
-                this.panelroot.el.scrollTo('left', this.scroll.left);
-            
-        }
-        
-        */
-        
-        
+        // handles 
+        // contentpanel, nestedlayoutpanel, contentpanel.. etc. 
+        // force center region..
+        cfg.region = 'center';
+        cfg.background = false;
+        this.layoutbase = new Ext.BorderLayout(document.body, {
+          
+             center: {
+                titlebar: false,
+                autoScroll:false,
+                closeOnTab: true,
+                tabPosition: 'top',
+                //resizeTabs: true,
+                alwaysShowTabs: true,
+                minTabWidth: 140
+            }
+        });
+         
+        this.layoutbase.addxtype(  cfg ); 
         
         
         
@@ -206,6 +211,13 @@ Builder  = {
                 var pr = xi['*prop'];
                 this.munge(xi);
                 // if prop is an array - then it's items are really the value..
+                if (pr.match(/\[\]$/)) {
+                    pr = pr.replace(/\[\]$/, '');
+                    cfg[pr] = cfg[pr]  || [];
+                    cfg[pr].push(xi);
+                    continue;
+                }
+                
                 
                 if (xi.xtype && xi.xtype  == 'Array') {
                     cfg[pr] = xi.items;
@@ -245,21 +257,33 @@ Builder  = {
     dump : function (arr,level) {
         var dumped_text = "";
         if(!level) level = 0;
-        
+        if (level >  3) {
+            return '... TO DEEP ...';
+        }
         //The padding given at the beginning of the line.
         var level_padding = "";
         for(var j=0;j<level+1;j++) level_padding += "    ";
         
         if(typeof(arr) == 'object') { //Array/Hashes/Objects 
             for(var item in arr) {
-                var value = arr[item];
                 
+                var value = arr[item];
+                if (item == 'xns') {
+                    continue;
+                }
+                if(typeof(value) == 'function') { //If it is an array,
+                    // fake dump...
+                    dumped_text += level_padding + "'" + item + "' : function() { ... },\n";
+                    continue;
+                }
                 if(typeof(value) == 'object') { //If it is an array,
-                    dumped_text += level_padding + "'" + item + "' ...\n";
+                    dumped_text += level_padding + "'" + item + "': {\n";
                     dumped_text += this.dump(value,level+1);
-                } else {
-                    dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
+                    dumped_text += level_padding + "}\n";
+                    continue;
                 }
+                dumped_text += level_padding + "'" + item + "' : \"" + value + "\"\n";
+                
             }
         } else { //Stings/Chars/Numbers etc.
             dumped_text = "===>"+arr+"<===("+typeof(arr)+")";