[KSS-checkins] r53861 - in kukit/kss.core/trunk/kss/core/plugins/core: . demo demo/commandaction demo/selenium_tests

gotcha at codespeak.net gotcha at codespeak.net
Fri Apr 18 17:35:51 CEST 2008


Author: gotcha
Date: Fri Apr 18 17:35:51 2008
New Revision: 53861

Added:
   kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/cancel.kss
      - copied unchanged from r53859, kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/cancel.kss
   kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/cancel.pt
      - copied unchanged from r53859, kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/cancel.pt
   kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/kssattr.kss
      - copied unchanged from r53859, kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/kssattr.kss
   kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/kssattr.pt
      - copied unchanged from r53859, kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/commandaction/kssattr.pt
   kukit/kss.core/trunk/kss/core/plugins/core/demo/selenium_tests/ca_cancel.html
      - copied unchanged from r53859, kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/selenium_tests/ca_cancel.html
   kukit/kss.core/trunk/kss/core/plugins/core/demo/selenium_tests/ca_kssattr.html
      - copied unchanged from r53859, kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/selenium_tests/ca_kssattr.html
Modified:
   kukit/kss.core/trunk/kss/core/plugins/core/commands.py
   kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/commandaction.py
   kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/configure.zcml
   kukit/kss.core/trunk/kss/core/plugins/core/demo/config.py
   kukit/kss.core/trunk/kss/core/plugins/core/demo/zopeconfig.py
   kukit/kss.core/trunk/kss/core/plugins/core/interfaces.py
Log:
port of fixes for action-cancel and setKssAttribute :  merge -r 53801:53859  http://codespeak.net/svn/kukit/kss.core/branch/1.4

Modified: kukit/kss.core/trunk/kss/core/plugins/core/commands.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/commands.py	(original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/commands.py	Fri Apr 18 17:35:51 2008
@@ -2,7 +2,6 @@
 from kss.core.selectors import ParentNodeSelector, SameNodeSelector
 from kss.core.kssview import CommandSet
 from kss.core.deprecated import deprecated, deprecated_warning
-from kss.core.parsers import HtmlParser
 from kss.core.plugins.core.interfaces import IKSSCoreCommands
 from zope.interface import implements
 
@@ -45,6 +44,12 @@
         data = command.addParam('name', name)
         data = command.addParam('value', value)
 
+    def setKssAttribute(self, selector, name, value):
+        """ see interfaces.py """
+        command = self.commands.addCommand('setKssAttribute', selector)
+        data = command.addParam('name', name)
+        data = command.addParam('value', value)
+
     def setStyle(self, selector, name, value):
         """ see interfaces.py """
         command = self.commands.addCommand('setStyle', selector)

Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/commandaction.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/commandaction.py	(original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/commandaction.py	Fri Apr 18 17:35:51 2008
@@ -8,10 +8,6 @@
         core.toggleClass(selector, 'selected')
         return self.render()
 
-    def focus(self, id):
-        self.getCommandSet('core').focus('#' + id)
-        return self.render()
-
     def addClass(self):
         core = self.getCommandSet('core')
         selector = core.getSameNodeSelector()
@@ -23,3 +19,29 @@
         selector = core.getSameNodeSelector()
         core.removeClass(selector, 'selected')
         return self.render()
+    
+    #focus
+
+    def focus(self, id):
+        self.getCommandSet('core').focus('#' + id)
+        return self.render()
+
+    #action-cancel
+
+    def toCancel(self):
+        core = self.getCommandSet('core')
+        core.insertHTMLAsLastChild('#logger', 'action')
+        return self.render()
+
+    #setKssAttribute
+
+    def echo(self, value):
+        core = self.getCommandSet('core')
+        core.insertHTMLAsLastChild('#logger', value)
+        return self.render()
+    
+    def setKssAttribute(self):
+        core = self.getCommandSet('core')
+        core.setKssAttribute('#command', 'name', 'value-from-command')
+        return self.render()
+

Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/configure.zcml
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/configure.zcml	(original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/configure.zcml	Fri Apr 18 17:35:51 2008
@@ -39,6 +39,8 @@
       permission="zope.View"
       />
 
+  <!-- focus -->
+
   <browser:page
       for="kss.demo.interfaces.ISimpleContent"
       template="focus.pt"
@@ -59,5 +61,56 @@
       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"
+      />
+  <!-- setKssAttribute -->
+
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      template="kssattr.pt"
+      name="ca_kssattr.html"
+      permission="zope.View"
+      />
+
+  <browser:resource
+    file="kssattr.kss"
+    name="kssattr.kss"
+  />
+  
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      class=".commandaction.ActionsView"
+      attribute="echo"
+      name="echo"
+      permission="zope.View"
+      />
+
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      class=".commandaction.ActionsView"
+      attribute="setKssAttribute"
+      name="setKssAttribute"
+      permission="zope.View"
+      />
+
 </configure>
 

Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/config.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/demo/config.py	(original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo/config.py	Fri Apr 18 17:35:51 2008
@@ -9,7 +9,6 @@
     except ImportError: # no demo package installed
         return Plugin()
 
-
     class CoreDemos(Plugin):
 
         zope_demos = (
@@ -30,7 +29,9 @@
             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"),
+            KSSDemo('', 'Commands/Actions', "ca_kssattr.html", "setKssAttribute"),
             # XXX this should go to the other plugin wuth all its stuff
             KSSDemo('Effects', '', "effects.html", "Effects"),
             )

Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/zopeconfig.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/demo/zopeconfig.py	(original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo/zopeconfig.py	Fri Apr 18 17:35:51 2008
@@ -38,7 +38,9 @@
         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"),
+        KSSDemo('', 'Commands/Actions', "ca_kssattr.html", "setKssAttribute"),
         )
 
     # directories are relative from the location of this .py file

Modified: kukit/kss.core/trunk/kss/core/plugins/core/interfaces.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/interfaces.py	(original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/interfaces.py	Fri Apr 18 17:35:51 2008
@@ -33,6 +33,9 @@
     def setAttribute(selector, name, value):
         """Set an attribute on node(s) specified by the selector"""
 
+    def setKssAttribute(selector, name, value):
+        """Set a KSS attribute on node(s) specified by the selector"""
+
     def setStyle(selector, name, value):
         """Set the style attribute of nodes specified by the selector"""
 


More information about the Kukit-checkins mailing list