[KSS-checkins] r53805 - in kukit/kss.core/branch/1.4/kss/core/plugins/core/demo: . commandaction selenium_tests

gotcha at codespeak.net gotcha at codespeak.net
Tue Apr 15 23:22:50 CEST 2008


Author: gotcha
Date: Tue Apr 15 23:22:50 2008
New Revision: 53805

Added:
   kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/cancel.kss
   kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/cancel.pt
   kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/selenium_tests/ca_cancel.html
Modified:
   kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/commandaction.py
   kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/configure.zcml
   kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/config.py
   kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/zopeconfig.py
Log:
add demo for action-cancel; broken under 1.4 even though it works under 1.2

Added: kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/cancel.kss
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/cancel.kss	Tue Apr 15 23:22:50 2008
@@ -0,0 +1,15 @@
+li:click {
+    action-server: cancel;
+} 
+
+#without:click {
+    action-cancel: cancel;
+} 
+
+/* Log control
+*/
+
+#log-reset a:click, #log-reset:click {
+    action-client: clearChildNodes;
+    clearChildNodes-kssSelector: #logger;
+}

Added: kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/cancel.pt
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/cancel.pt	Tue Apr 15 23:22:50 2008
@@ -0,0 +1,22 @@
+<html tal:define="viewname string:cancel">
+ 
+  <head>
+  
+    <metal:header use-macro="context/@@header_macros/header_resources" />
+  
+  </head>
+
+  <body>
+    
+    <p metal:use-macro="context/@@body_macros/header">header</p>
+
+    <h2>action-cancel</h2>
+    
+    <ul>
+      <li id="with">with</li>
+      <li id="without">without</li>
+    </ul>
+
+    <p metal:use-macro="context/@@body_macros/logger">logger</p>
+  </body>
+</html>

Modified: kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/commandaction.py
==============================================================================
--- kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/commandaction.py	(original)
+++ kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/commandaction.py	Tue Apr 15 23:22:50 2008
@@ -23,3 +23,8 @@
         selector = core.getSameNodeSelector()
         core.removeClass(selector, 'selected')
         return self.render()
+    
+    def toCancel(self):
+        core = self.getCommandSet('core')
+        core.insertHTMLAsLastChild('#logger', 'action')
+        return self.render()

Modified: kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/configure.zcml
==============================================================================
--- kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/configure.zcml	(original)
+++ kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/configure.zcml	Tue Apr 15 23:22:50 2008
@@ -39,6 +39,8 @@
       permission="zope.View"
       />
 
+  <!-- focus -->
+
   <browser:page
       for="kss.demo.interfaces.ISimpleContent"
       template="focus.pt"
@@ -59,5 +61,27 @@
       permission="zope.View"
       />
 
+  <!-- action-cancel -->
+
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      template="cancel.pt"
+      name="ca_cancel.html"
+      permission="zope.View"
+      />
+
+  <browser:resource
+    file="cancel.kss"
+    name="cancel.kss"
+  />
+  
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      class=".commandaction.ActionsView"
+      attribute="toCancel"
+      name="cancel"
+      permission="zope.View"
+      />
+
 </configure>
 

Modified: kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/config.py
==============================================================================
--- kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/config.py	(original)
+++ kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/config.py	Tue Apr 15 23:22:50 2008
@@ -25,7 +25,8 @@
         KSSDemo('', 'Core events', "kss_evt_preventbubbling.html", "Prevent bubbling KSS event parameter"),
         KSSDemo('', 'Core events', "kss_keyevents.html", "Key events"),
         KSSDemo('', 'Commands/Actions', "ca_focus.html", "Focus"),
-        KSSDemo('', 'Commands/Actions', "actions.html", "Toggle case action"),
+        KSSDemo('', 'Commands/Actions', "actions.html", "Class actions: toggle, add, remove"),
+        KSSDemo('', 'Commands/Actions', "ca_cancel.html", "action-cancel"),
         # XXX this should go to the other plugin wuth all its stuff
         KSSDemo('Effects', '', "effects.html", "Effects"),
         )

Added: kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/selenium_tests/ca_cancel.html
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/selenium_tests/ca_cancel.html	Tue Apr 15 23:22:50 2008
@@ -0,0 +1,69 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>ca_cancel</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">ca_cancel</td></tr>
+</thead><tbody>
+<tr>
+	<td>open</td>
+	<td>/demo/ca_cancel.html</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertTextPresent</td>
+	<td>action-cancel</td>
+	<td></td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>with</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForText</td>
+	<td>logger</td>
+	<td>action</td>
+</tr>
+<tr>
+	<td>assertText</td>
+	<td>logger</td>
+	<td>action</td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>without</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForText</td>
+	<td>logger</td>
+	<td>action</td>
+</tr>
+<tr>
+	<td>assertText</td>
+	<td>logger</td>
+	<td>action</td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>with</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForText</td>
+	<td>logger</td>
+	<td>actionaction</td>
+</tr>
+<tr>
+	<td>assertText</td>
+	<td>logger</td>
+	<td>actionaction</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>

Modified: kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/zopeconfig.py
==============================================================================
--- kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/zopeconfig.py	(original)
+++ kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/zopeconfig.py	Tue Apr 15 23:22:50 2008
@@ -37,7 +37,8 @@
         KSSDemo('', 'Core events', "kss_evt_preventbubbling.html", "Prevent bubbling KSS event parameter"),
         KSSDemo('', 'Core events', "kss_keyevents.html", "Key events"),
         KSSDemo('', 'Commands/Actions', "ca_focus.html", "Focus"),
-        KSSDemo('', 'Commands/Actions', "actions.html", "Toggle case action"),
+        KSSDemo('', 'Commands/Actions', "actions.html", "Class actions: toggle, add, remove"),
+        KSSDemo('', 'Commands/Actions', "ca_cancel.html", "action-cancel"),
         )
 
     # directories are relative from the location of this .py file


More information about the Kukit-checkins mailing list