[Bps-public-commit] r12664 - pie/branches/named-params/pieplate/PIE-Plate/share/web/static/js

jesse at bestpractical.com jesse at bestpractical.com
Sat May 24 05:57:10 EDT 2008


Author: jesse
Date: Sat May 24 05:57:09 2008
New Revision: 12664

Modified:
   pie/branches/named-params/pieplate/PIE-Plate/share/web/static/js/pieui.js

Log:
* round trop

Modified: pie/branches/named-params/pieplate/PIE-Plate/share/web/static/js/pieui.js
==============================================================================
--- pie/branches/named-params/pieplate/PIE-Plate/share/web/static/js/pieui.js	(original)
+++ pie/branches/named-params/pieplate/PIE-Plate/share/web/static/js/pieui.js	Sat May 24 05:57:09 2008
@@ -53,16 +53,7 @@
 
       var ops = jQuery(parent).children();
      var tree=    jQuery.map(ops, function (op) {
-
-            if( jQuery(op).hasClass('lorzy-code')) {
-                
-                var codeargs =  jQuery(op).children('.lorzy-code-args').children();
-                return { 'name': jQuery(op).children('.name').text(), 'args': lorzy_generate_args_struct(codeargs)  };
-            } else if (jQuery(op).hasClass('lorzy-const')) {
-               return jQuery(op).text();
-            }else  {
-                    console.log('dunno what to do with' + jQuery(op).content);
-            }
+            return lorzy_generate_op(jQuery(op));
        }
 
         );
@@ -74,14 +65,27 @@
 };
 
 
+function lorzy_generate_op (op) {
+    
+            if( op.hasClass('lorzy-code')) {
+                
+                var codeargs =  op.children('.lorzy-code-args').children();
+                return { 'name': op.children('.name').text(), 'args': lorzy_generate_args_struct(codeargs)  };
+            } else if (op.hasClass('lorzy-const')) {            
+               return op.text();
+            }else  { 
+            console.log("failed to find a class on " +op.attr('class'));
+            }
+}
 
 
 function lorzy_generate_args_struct(args) {
     var myArray = {};
-     jQuery.map(args, function (op)  {
-               myArray[ jQuery(op).children('.name').text() ] =  lorzy_generate_struct(jQuery(op).children('.value').get(0));
+     jQuery.map(args, function (op)  {  
+               myArray[ jQuery(op).children('.name').text() ] =  lorzy_generate_op(jQuery(op).children('.value').children());
     });
 
+
     return myArray;
 }
 



More information about the Bps-public-commit mailing list