Author: jmorliaguet
Date: Mon Mar  6 21:55:25 2006
New Revision: 2550

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/ctal.js
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_ctal_test.html
Log:

- ctal: added the equivalent of TAL's 'not:...' 



Modified: cpsskins/branches/jmo-perspectives/ui/framework/ctal.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/ctal.js     (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/ctal.js     Mon Mar  6 
21:55:25 2006
@@ -225,6 +225,8 @@
     return value
   } else if (etype == 'path') {
     return ctal.eval_pathexpr(data, value)
+  } else if (etype == 'not') {
+    return !ctal.eval_pathexpr(data, value)
   } else if (etype == 'javascript') {
     // evaluate the expression in context
     with (data) { return eval(value) };

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_ctal_test.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_ctal_test.html
  (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_ctal_test.html
  Mon Mar  6 21:55:25 2006
@@ -30,6 +30,8 @@
 <div id="e1"><span ctal:content="c/d">...</span></div>
 <div id="e2"><span ctal:content="string:a">...</span></div>
 <div id="e3"><span ctal:content="k/l/m">...</span></div>
+<div id="e3b"><span ctal:content="not:cfalse">...</span></div>
+<div id="e3c"><span ctal:content="not:ctrue">...</span></div>
 
 <!-- ctal:condition / ctal:content -->
 <div id="e4"><span ctal:condition="ctrue"
@@ -369,6 +371,8 @@
       assertEqual('<span>3</span>', htmlOf("e1"));
       assertEqual('<span>a</span>', htmlOf("e2"));
       assertEqual('<span>10</span>', htmlOf("e3"));
+      assertEqual('<span>true</span>', htmlOf("e3b"));
+      assertEqual('<span>false</span>', htmlOf("e3c"));
     }},
 
     testTALConditionTALContent: function() { with(this) {
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to