[Bps-public-commit] r12683 - in pie/branches/named-params/pieplate/PIE-Plate: etc share/web/static/css

jesse at bestpractical.com jesse at bestpractical.com
Mon May 26 00:01:32 EDT 2008


Author: jesse
Date: Mon May 26 00:01:32 2008
New Revision: 12683

Modified:
   pie/branches/named-params/pieplate/PIE-Plate/etc/config.yml
   pie/branches/named-params/pieplate/PIE-Plate/share/web/static/css/app.css
   pie/branches/named-params/pieplate/PIE-Plate/share/web/static/js/pieui.js

Log:
checkpoint. pretty much works. want to rip it apart

Modified: pie/branches/named-params/pieplate/PIE-Plate/etc/config.yml
==============================================================================
--- pie/branches/named-params/pieplate/PIE-Plate/etc/config.yml	(original)
+++ pie/branches/named-params/pieplate/PIE-Plate/etc/config.yml	Mon May 26 00:01:32 2008
@@ -41,8 +41,8 @@
     - 
       OnlineDocs: {}
 
-#    - 
-#      CompressedCSSandJS: {}
+    - 
+      CompressedCSSandJS: {}
 
     - 
       AdminUI: {}

Modified: pie/branches/named-params/pieplate/PIE-Plate/share/web/static/css/app.css
==============================================================================
--- pie/branches/named-params/pieplate/PIE-Plate/share/web/static/css/app.css	(original)
+++ pie/branches/named-params/pieplate/PIE-Plate/share/web/static/css/app.css	Mon May 26 00:01:32 2008
@@ -1,20 +1,30 @@
+.lorzy-accepts-expression, .lorzy-accepts-appended-expression {
+        min-height: 2em;
+       border: 2px solid grey;
+        padding-top: 0.25em;
+        padding-bottom: 0.25em;
+        background: #eee;
+}
 
 .droppable-active {
-       border: 2px solid red;
+       border: 2px solid green;
+        min-height: 2em;
 
 }
 
 .droppable-hover {
-        background: #f22;
-        min-height: 3em;
+        background: #2f2;
+        min-height: 2em;
 }
 
+
 draggable-active {
         color: #66f;
 }
 
 .lorzy-expression {
     border: 2px solid #666;
+    background-color: #fff;
     
 }
 
@@ -59,4 +69,13 @@
   width: 300px;
   color: blue;
 }
+.droppable-hover .lorzy-expression {
+        color: #000;
+        background-color: #fff;
+    filter:alpha(opacity=20);
+    -moz-opacity:0.2;
+    -khtml-opacity: 0.2;
+    opacity: 0.2;
+}
+
 

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	Mon May 26 00:01:32 2008
@@ -3,15 +3,25 @@
 
       return  jQuery('<div class="lorzy-ignore">Drop here!</div>');
 }
+function lorzy_append_expression_target(after) {
+
+        var kid = after.createAppend('div', { className: 'lorzy-accepts-appended-expression'}, []);
+            var target = kid.createAppend('div',{},['']);
+
+            target.replaceWith(lorzy_make_empty_drop_target());
+}
 function lorzy_show_expression_str(str, parent) {
     var el = parent.createAppend('div', { className: 'lorzy-expression lorzy-const string' }, [str]);
+        lorzy_append_expression_target(parent);
     //el.html(str) .editable(function(value, settings) { return value}, { submit: 'OK', width: '80%', } );
 }
 
 function lorzy_show_expression(parent, add_event) {
 
     if( this.name == 'progn') {
-        jQuery.each(this.nodes, function () { lorzy_show_expression.apply(this,[parent]) });
+        jQuery.each(this.nodes, function () { lorzy_show_expression.apply(this,[parent]);
+
+});
 
         return;
     }
@@ -24,11 +34,11 @@
     ret.addClass('lorzy-code');
     var that = this;
     jQuery(ret).createAppend('div', { className: 'name'} , [this.name]);
-    ret = jQuery(ret).createAppend('div', { className: 'lorzy-code-args'});
+    var codeargs = jQuery(ret).createAppend('div', { className: 'lorzy-code-args'});
 
     jQuery.each(this.args, function(name, exp) {
         console.log(name +  ": "+exp);
-        var entry = ret.createAppend('div', { className: that.name+' '+name });
+        var entry = codeargs.createAppend('div', { className: that.name+' '+name });
         entry.addClass('lorzy-code-arg');
         entry.createAppend('div', { className: 'name'}, [ name]);
         var value = entry.createAppend('div', { className: 'value lorzy-accepts-expression'});
@@ -43,12 +53,11 @@
         var progn = value.createAppend('div', { className: 'lorzy-progn'});
 
         lorzy_show_expression.apply(exp, [progn]); //[entry]);
-
-        progn.createAppend('div', { className: 'lorzy-accepts-expression'}, [lorzy_make_empty_drop_target()]);
-
+        //lorzy_append_expression_target(progn);
         }
     });
 
+        lorzy_append_expression_target(parent);
 
     jQuery('div.lorzy-code > div.name', parent)
     .click(function(e) {
@@ -82,9 +91,14 @@
        // var tree = lorzy_generate_struct(jQuery('#wrapper'));
         //console.log(tree.toJSON());
 
+     var lorzy_draggable_opts = { snap: true, revert: true, activeClass: 'draggable-active', opacity: '0.80', stop: function(e, ui) {
+                    var x = jQuery(ui.draggable);//.clone;
+                    x.attr({style: ''});
+ }
+}; 
+
 
-    jQuery('.lorzy-expression .lorzy-expression').draggable({ snap: true, revert: true, activeClass: 'draggable-active'
-} );
+    jQuery('.lorzy-expression .lorzy-expression').draggable(lorzy_draggable_opts);
 
     jQuery('#wrapper').after(jQuery('<a href="#">Remove</a>').attr('id', 'remove-entry'));
     jQuery('#wrapper').after(jQuery('<a href="#">Add If</a>').attr('id', 'add-entry-if'));
@@ -98,19 +112,36 @@
             hoverClass: 'droppable-hover',
             tolerance: 'pointer',
             drop: function(ev, ui) { 
-                    //jQuery(ui.draggable).attr({'style': '' });
-                    var x = jQuery(ui.draggable);//.clone;
-                     var y = jQuery(x).parent().children();
-                    y.replaceWith(lorzy_make_empty_drop_target()
-);//attr({style:'border: 10px solid blue;'});
-                 //    jQuery(x).parent().css('border: 10px solid green;');
-                    y.droppable('enable');
-                    jQuery(this).children().replaceWith(x);
-                    x.draggable('enable');
-                    x.attr({style: false});
+                    var newitem = jQuery(ui.draggable).clone();
+                      var orig = jQuery(ui.draggable); 
+                    orig.replaceWith(lorzy_make_empty_drop_target());
+                    orig.droppable('enable');
+                    jQuery(this).children().replaceWith(newitem);
+                    newitem.draggable(lorzy_draggable_opts);
+                    newitem.attr({style: ''});
+                    return true;
+}});
+
+jQuery('.lorzy-accepts-appended-expression').droppable({
+            accept: '.lorzy-expression',
+            greedy: 'true',
+            hover: 'pointer',
+            activeClass: 'droppable-active',
+            hoverClass: 'droppable-hover',
+            tolerance: 'pointer',
+            drop: function(ev, ui) { 
+                    var newitem = jQuery(ui.draggable).clone();
+                      var orig = jQuery(ui.draggable); 
+                    orig.replaceWith(lorzy_make_empty_drop_target());
+                    orig.droppable('enable');
+                    newitem.draggable(lorzy_draggable_opts);
+                    newitem.attr({style: ''});
+                    jQuery(this).css("color: #f00");
+                    newitem.insertBefore(jQuery(this));
+                    console.log(jQuery(this));
                     return true;
-                    //y.children().append(jQuery('<div>foo</div>'));
 }});
+
     jQuery('#testy').click(function () {
         jQuery.ajax({
     'url': '/=/action/Pie.Plate.Action.RunL.xml',



More information about the Bps-public-commit mailing list