Builder/Provider/File/Roo.js
[app.Builder.js] / Builder / Provider / File / Roo.js
old mode 100755 (executable)
new mode 100644 (file)
index 74e474d..db0d28d
@@ -65,12 +65,21 @@ Roo = XObject.define(
     },
     Base,
     {
-        
+        doubleStringProps : [ 
+            'title',
+            'legend',
+            'loadingText',
+            'emptyText',
+            'qtip',
+            'value',
+            'text'
+        ],
         modOrder : '001', /// sequence id that this uses.
         region : 'center',
         parent : '',
         title : '', // the title on displayed when loading.
         disable : '', // use a function to that returns false to disable this..
+        permname: '', /// permission name
         
         setNSID : function(id)
         {
@@ -104,13 +113,14 @@ Roo = XObject.define(
                 var cfg = JSON.parse(src);
                 print("loaded data");
                 console.dump(cfg);
-                
+                _this.modOrder = cfg.modOrder || '001';
                 _this.name = cfg.name.replace(/\.bjs/, ''); // BC!
                 _this.parent =  cfg.parent;
+                _this.permname =  cfg.permname || '';
                 _this.title =  cfg.title;
                 _this.items = cfg.items || []; 
                 
-                //_this.fixItems(_this, false);
+                _this.fixItems(_this, false);
                 
                 
                 
@@ -221,7 +231,10 @@ Roo = XObject.define(
             Base.prototype.save.call(this);
             // now write the js file..
             var js = this.path.replace(/\.bjs$/, '.js');
-            File.write(js, this.toSource());
+            var d = new Date();
+            var js_src = this.toSource();
+            print("TO SOURCE in " + ((new Date()) - d) + "ms");
+            File.write(js, js_src);
             
             
             
@@ -301,7 +314,7 @@ Roo = XObject.define(
                 "",
                 "        this.callback = cb;",
                 "        this.data = data;",
-                "        this.dialog.show();",
+                "        this.dialog.show(this.data._el);",
                 "        if (this.form) {",
                 "           this.form.reset();",
                 "           this.form.setValues(data);",
@@ -346,10 +359,12 @@ Roo = XObject.define(
                     "    Pman.register({",
                     "        modKey : '" +modkey+"',",
                     "        module : " + this.name + ",",
+                    "        moduleName : '" + this.name + "',",
                     "        region : '" + this.region   +"',",
                     "        parent : " + (this.parent ||  'false') + ",",
                     "        name : " + JSON.stringify(this.title  || "unnamed module") + ",",
-                    "        disabled : " + (this.disabled || 'false') +" ",
+                    "        disabled : " + (this.disabled || 'false') +", ",
+                    "        permname: '" + (this.permname|| '') +"' ",
                     "    });",
                     "});",
                     "",
@@ -382,14 +397,17 @@ Roo = XObject.define(
                 this.outputHeader(),
                 
                 this.name  +  " = new Roo.XComponent({",
-                "    order: '" +modkey+"',",
-                "    region : '" + this.region   +"',",
-                "    parent : " + (this.parent ||  'false') + ",",
-                "    name : " + JSON.stringify(this.title  || "unnamed module") + ",",
-                "    disabled : " + (this.disabled || 'false') +" ",
-                "    items : [ ",
-                o,
-                "    ]",
+                "    order    : '" +modkey+"',",
+                "    region   : '" + this.region   +"',",
+                "    parent   : "+ (this.parent ?  "'" + this.parent + "'" :  'false') + ",",
+                "    name     : " + JSON.stringify(this.title  || "unnamed module") + ",",
+                "    disabled : " + (this.disabled || 'false') +", ",
+                "    tree : function()",
+                "    {",
+                "        var _this = this;", // bc
+                "        var MODULE = this;", /// this looks like a better name.
+                "        return " + o + ';',
+                "    }",
                 "});",
                 ""