[Bps-public-commit] r12657 - in pie/branches/named-params/pieplate/PIE-Plate: lib/PIE lib/PIE/Plate share/web/static/js var

clkao at bestpractical.com clkao at bestpractical.com
Sat May 24 00:42:23 EDT 2008


Author: clkao
Date: Sat May 24 00:42:18 2008
New Revision: 12657

Added:
   pie/branches/named-params/pieplate/PIE-Plate/lib/PIE/Plate.pm
   pie/branches/named-params/pieplate/PIE-Plate/share/web/static/js/
   pie/branches/named-params/pieplate/PIE-Plate/share/web/static/js/pieui.js
Removed:
   pie/branches/named-params/pieplate/PIE-Plate/pie::plate
   pie/branches/named-params/pieplate/PIE-Plate/var/jifty-server.pid
Modified:
   pie/branches/named-params/pieplate/PIE-Plate/lib/PIE/Plate/View.pm

Log:
sketch some basic structure passed in js.

Added: pie/branches/named-params/pieplate/PIE-Plate/lib/PIE/Plate.pm
==============================================================================
--- (empty file)
+++ pie/branches/named-params/pieplate/PIE-Plate/lib/PIE/Plate.pm	Sat May 24 00:42:18 2008
@@ -0,0 +1,8 @@
+package PIE::Plate;
+
+Jifty->web->add_javascript(
+    qw( pieui.js ));
+
+
+1;
+

Modified: pie/branches/named-params/pieplate/PIE-Plate/lib/PIE/Plate/View.pm
==============================================================================
--- pie/branches/named-params/pieplate/PIE-Plate/lib/PIE/Plate/View.pm	(original)
+++ pie/branches/named-params/pieplate/PIE-Plate/lib/PIE/Plate/View.pm	Sat May 24 00:42:18 2008
@@ -1,8 +1,36 @@
 package PIE::Plate::View;
 use Jifty::View::Declare -base;
+use JSON;
 
+template 'index.html' => page {'hey'};
+template 'lorzy' => page { 
 
-template 'index.html' => sub { 'hey'};
+my $ops = [
+            {   name => 'IfThen',
+                args => {
+                    'if_true'   => 'hate',
+                    'if_false'  => 'love',
+                    'condition' => {
+                        name => 'match-regexp',
+                        args => {
+                            regexp           => 'software',
+                            'tested-string' => 'foo',
+                        }
+                    }
+                }
+            }
+        ];
+
+my $json_text   = JSON->new->encode($ops);
+
+
+outs_raw(qq{<script type="text/javascript">
+
+lorzy_show($json_text);
+
+</script>});
+
+};
 
 
 1;

Added: pie/branches/named-params/pieplate/PIE-Plate/share/web/static/js/pieui.js
==============================================================================
--- (empty file)
+++ pie/branches/named-params/pieplate/PIE-Plate/share/web/static/js/pieui.js	Sat May 24 00:42:18 2008
@@ -0,0 +1,7 @@
+function pieui_show(ops) {
+    jQuery(ops).each(
+        function() {
+            console.log(this);
+        });
+};
+



More information about the Bps-public-commit mailing list