JSDOC/RooFile.js
authorAlan Knowles <alan@akbkhome.com>
Tue, 23 Aug 2011 04:29:54 +0000 (12:29 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 23 Aug 2011 04:29:54 +0000 (12:29 +0800)
JSDOC/RooFile.js

index b8453bd..377132d 100644 (file)
@@ -34,40 +34,10 @@ RooFile  =  XObject.define(
         {
             
             if (this.tokens[0].data == 'Pman.on') {
-                // then it's a layout style..
-                
-                //Seed.quit();
-                
-                
-                //console.dump(this.tokens);
-                //              the list of statements inside of function..?
-                
-                
-                var stmts =  this.tokens[1].items[1][2].items;
-                
-                // look for register..
-                var topp = false;
-                stmts.map( function(s, i) {
-                    if (s[0].data == 'Pman.register') {
-                        topp = brace = s[1].items[0][0].props;
-                    }
-                });
-                if (!topp) {
-                    console.dump(this.tokens);
-                    throw "could not find top props...";
-                    
-                }
-                
-                this.cfg = this.parseProps(topp);
-                this.cfg.name = this.tokens[3].data;
-                
-                
-                //                  (            {          add    { this.panel (  {
-                var cfg = this.tokens[7].items[0][0].props.add.val[2].items[2][3].items[0][0].props;
-                this.cfg.items = [ this.parseProps(cfg) ];
-                //console.dump(this.cfg); 
                 
+                this.parsePmanLayout();
                 return;
+          
             }
             
             //print(JSON.stringify(this.tokens,null,4)); Seed.quit();
@@ -76,19 +46,7 @@ RooFile  =  XObject.define(
             
             // Standard Pman Dialog - 
             if (this.tokens[2].props && typeof(this.tokens[2].props.create) != 'undefined') {
-                //console.dump(this.tokens);
-                this.cfg.name = this.tokens[0].data;
-                
-                
-                
-                var cfg = this.tokens[2].props.create.val[2].items[1][3].items[0][0].props;
-                //console.dump(this.tokens);
-                //print(JSON.stringify(cfg,null,4)); Seed.quit();
-                
-               // print("Trying standard dialog");Seed.quit();;
-                
-                this.cfg.items = [ this.parseProps(cfg) ];
-                return;
+                this.parsePmanDialog();
                 
             }
             // perfect for dialogs...
@@ -220,6 +178,59 @@ RooFile  =  XObject.define(
             
             
                 
+        },
+        
+        parsePmanLayout : function()
+        {
+                // then it's a layout style..
+            
+            //Seed.quit();
+            
+            
+            //console.dump(this.tokens);
+            //              the list of statements inside of function..?
+            
+            
+            var stmts =  this.tokens[1].items[1][2].items;
+            
+            // look for register..
+            var topp = false;
+            stmts.map( function(s, i) {
+                if (s[0].data == 'Pman.register') {
+                    topp = brace = s[1].items[0][0].props;
+                }
+            });
+            if (!topp) {
+                console.dump(this.tokens);
+                throw "could not find top props...";
+                
+            }
+            
+            this.cfg = this.parseProps(topp);
+            this.cfg.name = this.tokens[3].data;
+            
+            
+            //                  (            {          add    { this.panel (  {
+            var cfg = this.tokens[7].items[0][0].props.add.val[2].items[2][3].items[0][0].props;
+            this.cfg.items = [ this.parseProps(cfg) ];
+            //console.dump(this.cfg); 
+        },
+        parsePmanDialog : function() {
+            
+            //console.dump(this.tokens);
+            this.cfg.name = this.tokens[0].data;
+            
+            
+            
+            var cfg = this.tokens[2].props.create.val[2].items[1][3].items[0][0].props;
+            //console.dump(this.tokens);
+            //print(JSON.stringify(cfg,null,4)); Seed.quit();
+            
+           // print("Trying standard dialog");Seed.quit();;
+            
+            this.cfg.items = [ this.parseProps(cfg) ];
+            return;
+            
         },
         
         parseProps:  function(o)