resources/RooUsage.txt
[app.Builder.js] / src / JsRender / NodeToJs.vala
index 64af1b8..1bdb3b9 100644 (file)
@@ -176,6 +176,12 @@ public class JsRender.NodeToJs : Object {
                // output the items...
                // work out remaining items...
         
+               // output xns / xtype first..
+               if (this.out_props.has_key("xtype")) {
+                       var v = this.out_props.get("xtype");
+                       this.node.setLine(this.cur_line, "p","xtype"); 
+                       this.addLine(this.pad + "xtype" + " : " + v + suffix, ',');
+               }
                
                // plain properties.
                var iter = this.orderedPropKeys().list_iterator();
@@ -183,9 +189,16 @@ public class JsRender.NodeToJs : Object {
  
                         
                        var k = iter.get();
+                       if (k == "xns" || k == "xtype") {
+                               continue;
+                       }
+
                        var v = this.out_props.get(k);
-                       this.node.setLine(this.cur_line, "p",k); //listener
+                       this.node.setLine(this.cur_line, "p",k); 
                        this.addLine(this.pad + k + " : " + v + suffix, ',');
+                        
+                       this.node.setLine(this.cur_line, "e", "");
+                       
                }
         
                // listeners..
@@ -201,7 +214,7 @@ public class JsRender.NodeToJs : Object {
                                var v = this.out_listeners.get(k);
                                this.node.setLine(this.cur_line, "l",k); //listener
                                this.addLine(this.pad + indent_str + k + " : " + v , ',');
-                               
+                               this.node.setLine(this.cur_line, "e", "");
                        }
                        
                        this.closeLine();
@@ -211,9 +224,16 @@ public class JsRender.NodeToJs : Object {
                
                //------- at this point it is the end of the code relating directly to the object..
                
-               this.node.line_end = this.cur_line;
-               
+               if (this.out_props.has_key("xns")) {
+                       var v = this.out_props.get("xns");
+                       this.node.setLine(this.cur_line, "p","xns"); 
+                       this.addLine(this.pad + "xns" + " : " + v + suffix, ',');
+                       this.node.setLine(this.cur_line, "p","| xns"); 
+                       this.addLine(this.pad + "'|xns' : '" + v + "'", ',');
+                       this.node.setLine(this.cur_line, "e", "");
+               }
                
+               this.node.line_end = this.cur_line;
                
                // * prop
 
@@ -221,23 +241,25 @@ public class JsRender.NodeToJs : Object {
 
                while(niter.next()) {
                        var addstr = this.mungeChildNew(this.pad + indent_str, niter.get_value());
+                       //print("add str: %s\n", addstr);
                        this.node.setLine(this.cur_line, "p",niter.get_key());
                        this.addLine(this.pad + niter.get_key() + " : " + addstr, ',');
                        
-                       
+                       this.node.setLine(this.cur_line, "e", "");
                }                        
                // prop arrays...
                
                var piter = this.out_props_array.map_iterator();
 
                while(piter.next()) {
-                       this.node.setLine(this.cur_line, "p",niter.get_key());
+                       this.node.setLine(this.cur_line, "p",piter.get_key());
                        this.addLine(this.pad + piter.get_key() + " : [", 0);
                        
                        var pliter = piter.get_value().list_iterator();
                        while (pliter.next()) {
                                var addstr = this.mungeChildNew(this.pad + indent_str  + indent_str, pliter.get());
                                this.addLine(this.pad + indent_str + addstr, ',');
+                               this.node.setLine(this.cur_line, "e", "");
                        }
                        this.closeLine();
                        this.addLine(this.pad + "]" , ',');                     
@@ -251,12 +273,13 @@ public class JsRender.NodeToJs : Object {
                                suffix = cniter.has_next()  ? "," : "";
                                var addstr = this.mungeChildNew(this.pad + indent_str  + indent_str, cniter.get());
                                this.addLine(this.pad + indent_str + addstr, ',');
+                               this.node.setLine(this.cur_line, "e", "");
                                
                        }
                        this.closeLine();
                        this.addLine(this.pad +   "]",',');
                }
-               
+               this.node.setLine(this.cur_line, "e", "");
                this.closeLine();
                if (this.node.props.has_key("* xinclude")) {
                        this.addLine(spad + "})",0);
@@ -266,6 +289,9 @@ public class JsRender.NodeToJs : Object {
                }
                
                this.node.sortLines();
+               
+               
+               
                return this.ret;
        
        }
@@ -289,7 +315,9 @@ public class JsRender.NodeToJs : Object {
        */
        public void addLine(string str, char line_end)
        {
-               this.ret += (this.last_line_end == 0 ? "" : this.last_line_end.to_string()) + "\n"; 
+               if (this.last_line_end != '!') {
+                       this.ret += (this.last_line_end == 0 ? "" : this.last_line_end.to_string()) + "\n"; 
+               }
                this.last_line_end = line_end;
                this.cur_line += str.split("\n").length;
                this.ret += str;
@@ -555,10 +583,7 @@ public class JsRender.NodeToJs : Object {
                                }
                                this.out_props.set(left, nstr);
                                
-                               if (left == "xns") {
-               
-                                       this.out_props.set("'|xns'", "'" +  nstr + "'" );
-                               }
+