Author: twilight
Date: Wed Nov 12 17:22:17 2008
New Revision: 59893

Added:
   
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.kss
   
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.pt
Modified:
   kukit/kss.core/branch/bluraction/kss/core/plugins/core/configure.zcml
   
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py
   
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/configure.zcml
   kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/config.py
   kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/zopeconfig.py
   kukit/kss.core/branch/bluraction/kss/core/plugins/core/interfaces.py
Log:
Added tests for blur action.

Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/configure.zcml
==============================================================================
--- kukit/kss.core/branch/bluraction/kss/core/plugins/core/configure.zcml       
(original)
+++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/configure.zcml       
Wed Nov 12 17:22:17 2008
@@ -276,6 +276,11 @@
         />
 
     <kss:action
+        name="blur"
+        command_factory="selector"
+        />
+
+    <kss:action
         name="setStateVar"
         command_factory="global"
         params_mandatory="varname value"

Added: 
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.kss
==============================================================================
--- (empty file)
+++ 
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.kss
  Wed Nov 12 17:22:17 2008
@@ -0,0 +1,11 @@
+.blurrable:keypress {
+    evt-keypress-preventdefault: true;
+    evt-keypress-keycodes: 32;
+    action-client: blur samenode();
+} 
+.remote-blurrable:keypress {
+    evt-keypress-preventdefault: true;
+    evt-keypress-keycodes: 32;
+    action-server: blur;
+    blur-id: nodeAttr('id');
+} 

Added: 
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.pt
==============================================================================
--- (empty file)
+++ 
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.pt
   Wed Nov 12 17:22:17 2008
@@ -0,0 +1,62 @@
+<html tal:define="viewname string:blur">
+ 
+  <head>
+  
+    <metal:header use-macro="context/@@header_macros/header_resources" />
+  
+  </head>
+
+  <body>
+    
+    <p metal:use-macro="context/@@body_macros/header">header</p>
+
+    <h2>Blur</h2>
+    <p>We test the blur action/command : it is used to remove focus from form
+    widgets. </p>
+    <p>The focus is removed from various widgets : <code>input</code>,
+    <code>select</code>, <code>textarea</code>, with both client and server 
+    actions</p> 
+    <form name="main">
+      <h3>
+        Blur <code>input</code>.
+      </h3>
+      <div class="help">
+        Select the <code>input</code>, then press the 'Space' key to remove 
focus from it.
+      </div>
+      <fieldset>
+        <div>
+          <input type="text" id="input" class="blurrable" name="input" 
value="input"/>
+          <input type="text" id="blurrable-input" class="remote-blurrable" 
name="input" value="input"/>
+        </div>
+      </fieldset>
+      <h3>
+        Blur <code>textarea</code>.
+      </h3>
+      <div class="help">
+        Select the <code>textarea</code>, then press the 'Space' key to remove 
focus from it.
+      </div>
+      <fieldset>
+        <div>
+          <textarea id="textarea" class="blurrable" 
name="textarea">textarea</textarea>
+          <textarea id="remote-textarea" class="remote-blurrable" 
name="textarea">textarea</textarea>
+        </div>
+      </fieldset>
+      <h3>
+        Blur <code>select</code>.
+      </h3>
+      <div class="help">
+        Select the <code>select</code>, then press the 'Space' key to remove 
focus from it.
+      </div>
+      <fieldset>
+        <div>
+          <select id="select" class="blurrable" name="select">
+            <option>xxx</option>
+          </select>
+          <select id="remote-select" class="remote-blurrable" name="select">
+            <option>xxx</option>
+          </select>
+        </div>
+      </fieldset>
+    </form>
+  </body>
+</html>

Modified: 
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py
==============================================================================
--- 
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py
  (original)
+++ 
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py
  Wed Nov 12 17:22:17 2008
@@ -26,6 +26,12 @@
         self.getCommandSet('core').focus('#' + id)
         return self.render()
 
+    #blur
+
+    def blur(self, id):
+        self.getCommandSet('core').blur('#' + id)
+        return self.render()
+
     #action-cancel
 
     def toCancel(self):

Modified: 
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/configure.zcml
==============================================================================
--- 
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/configure.zcml
    (original)
+++ 
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/configure.zcml
    Wed Nov 12 17:22:17 2008
@@ -61,6 +61,28 @@
       permission="zope.View"
       />
 
+  <!-- blur -->
+
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      template="blur.pt"
+      name="ca_blur.html"
+      permission="zope.View"
+      />
+
+  <browser:resource
+    file="blur.kss"
+    name="blur.kss"
+  />
+  
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      class=".commandaction.ActionsView"
+      attribute="blur"
+      name="blur"
+      permission="zope.View"
+      />
+
   <!-- action-cancel -->
 
   <browser:page

Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/config.py
==============================================================================
--- kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/config.py       
(original)
+++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/config.py       
Wed Nov 12 17:22:17 2008
@@ -29,6 +29,7 @@
             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', "ca_blur.html", "Blur"),
             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"),

Modified: 
kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/zopeconfig.py
==============================================================================
--- kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/zopeconfig.py   
(original)
+++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/zopeconfig.py   
Wed Nov 12 17:22:17 2008
@@ -38,6 +38,7 @@
         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', "ca_blur.html", "Blur"),
         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"),

Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/interfaces.py
==============================================================================
--- kukit/kss.core/branch/bluraction/kss/core/plugins/core/interfaces.py        
(original)
+++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/interfaces.py        
Wed Nov 12 17:22:17 2008
@@ -97,3 +97,6 @@
 
     def focus(selector):
         """Set focus to selected node."""
+
+    def blur(selector):
+        """Remove focus from selected node."""
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to