Author: gotcha
Date: Mon Mar 12 13:09:49 2007
New Revision: 40311

Added:
   kukit/kss.demo/trunk/kss/demo/browser/commandaction/
   kukit/kss.demo/trunk/kss/demo/browser/commandaction/__init__.py
   kukit/kss.demo/trunk/kss/demo/browser/commandaction/actions.kss
      - copied unchanged from r40167, 
kukit/kss.demo/trunk/kss/demo/browser/coreplugin/coreplugin.kss
   kukit/kss.demo/trunk/kss/demo/browser/commandaction/actions.pt
      - copied, changed from r40167, 
kukit/kss.demo/trunk/kss/demo/browser/coreplugin/coreplugin.pt
   kukit/kss.demo/trunk/kss/demo/browser/commandaction/configure.zcml
   kukit/kss.demo/trunk/kss/demo/browser/commandaction/focus.kss
   kukit/kss.demo/trunk/kss/demo/browser/commandaction/focus.pt
   kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/actions.html
      - copied, changed from r40167, 
kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/coreplugin.html
   kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/ca_focus.html
Removed:
   kukit/kss.demo/trunk/kss/demo/browser/coreplugin/
   kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/coreplugin.html
Modified:
   kukit/kss.demo/trunk/kss/demo/browser/azax_demo_index.pt
   kukit/kss.demo/trunk/kss/demo/browser/configure.zcml
   kukit/kss.demo/trunk/kss/demo/browser/demo.css
   kukit/kss.demo/trunk/kss/demo/browser/parameterfunction/forms.pt
Log:
* tests for focus action
* moved test for toggle class action


Modified: kukit/kss.demo/trunk/kss/demo/browser/azax_demo_index.pt
==============================================================================
--- kukit/kss.demo/trunk/kss/demo/browser/azax_demo_index.pt    (original)
+++ kukit/kss.demo/trunk/kss/demo/browser/azax_demo_index.pt    Mon Mar 12 
13:09:49 2007
@@ -26,10 +26,6 @@
     <ul>
       <li><a href="pf_forms.html">Forms</a></li>
     </ul>
-    <h3>Core plugins</h3>
-    <ul>
-      <li><a href="coreplugin.html">Toggle case action</a></li>
-    </ul>
     <h3>Selectors</h3>
     <ul>
       <li><a href="selectors.html">Parent node selector</a></li>
@@ -39,6 +35,12 @@
       <li><a href="kss_selector_param.html">Kss selector parameters</a></li>
       <li><a href="kss_url_param.html">Kss url parameters</a></li>
     </ul>
+    <h3>Commands/Actions</h3>
+    <ul>
+      <li><a href="ca_focus.html">Focus</a></li>
+      <li><a href="actions.html">Toggle case action</a></li>
+    </ul>
+
          <br /><br />
 
     <h3>Unit tests</h3>

Added: kukit/kss.demo/trunk/kss/demo/browser/commandaction/__init__.py
==============================================================================

Copied: kukit/kss.demo/trunk/kss/demo/browser/commandaction/actions.pt (from 
r40167, kukit/kss.demo/trunk/kss/demo/browser/coreplugin/coreplugin.pt)
==============================================================================
--- kukit/kss.demo/trunk/kss/demo/browser/coreplugin/coreplugin.pt      
(original)
+++ kukit/kss.demo/trunk/kss/demo/browser/commandaction/actions.pt      Mon Mar 
12 13:09:49 2007
@@ -2,7 +2,7 @@
   <head>
     <link rel="kinetic-stylesheet" type="text/css"
           tal:attributes="href
-          string:${context/@@absolute_url}/++resource++coreplugin.kss"/>
+          string:${context/@@absolute_url}/++resource++actions.kss"/>
     <metal:header use-macro="context/@@header_macros/header_resources" />
     <style type="text/css">
       div.nested { border: 1px solid green; padding: 0.4em; }
@@ -15,7 +15,7 @@
         <li><a href=".">All demos</a></li>
         <li><a href="javascript:void(createLoggingPane(true))">Show logging
       pane</a></li>
-        <li><a href="./++resource++coreplugin.kss">View KSS resource</a></li>
+        <li><a href="./++resource++actions.kss">View KSS resource</a></li>
       </ul>
     </div>  
     <h2>Core plugins</h2>
@@ -24,10 +24,9 @@
       <code>toggleClass</code>
     </h3>
     <div class="help">
-        Toggeling the class means adding and removing it. Click the text link
-        to see the button highlight. Click it again to remove the highlight.
+        Toggling the class means adding or removing it. Click the button to 
toggle class on (it will highlight the button). Click it again to toggle class 
off (it will remove highlighting).
     </div>
-    <div>
+    <div class="container">
       <a  class="button click cursorPointer" href="#" 
id="toggleclass-button">Click me!</a>
     </div>
   </body>

Added: kukit/kss.demo/trunk/kss/demo/browser/commandaction/configure.zcml
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/commandaction/configure.zcml  Mon Mar 
12 13:09:49 2007
@@ -0,0 +1,31 @@
+<configure xmlns="http://namespaces.zope.org/zope";
+           xmlns:browser="http://namespaces.zope.org/browser";
+                  i18n_domain="kss"
+                  >
+
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      template="actions.pt"
+      name="actions.html"
+      permission="zope.View"
+      />
+
+  <browser:resource
+    file="actions.kss"
+    name="actions.kss"
+  />
+
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      template="focus.pt"
+      name="ca_focus.html"
+      permission="zope.View"
+      />
+
+  <browser:resource
+    file="focus.kss"
+    name="focus.kss"
+  />
+
+</configure>
+

Added: kukit/kss.demo/trunk/kss/demo/browser/commandaction/focus.kss
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/commandaction/focus.kss       Mon Mar 
12 13:09:49 2007
@@ -0,0 +1,37 @@
+.focus:focus {
+    action-client: executeCommand;
+    executeCommand-name: replaceInnerHTML;
+    executeCommand-selector: "#target code";
+    executeCommand-html: nodeAttr(id);
+} 
+
+#focus-to-text:click {
+    action-client: executeCommand;
+    executeCommand-name: focus;
+    executeCommand-selector: "#text";
+} 
+
+#focus-to-textarea:click {
+    action-client: executeCommand;
+    executeCommand-name: focus;
+    executeCommand-selector: "#textarea";
+} 
+
+#focus-to-select:click {
+    action-client: executeCommand;
+    executeCommand-name: focus;
+    executeCommand-selector: "#select";
+} 
+
+#focus-to-radio:click {
+    action-client: executeCommand;
+    executeCommand-name: focus;
+    executeCommand-selector: "#radio-1";
+} 
+
+#focus-to-checkbox:click {
+    action-client: executeCommand;
+    executeCommand-name: focus;
+    executeCommand-selector: "#checkbox-1";
+} 
+

Added: kukit/kss.demo/trunk/kss/demo/browser/commandaction/focus.pt
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/commandaction/focus.pt        Mon Mar 
12 13:09:49 2007
@@ -0,0 +1,98 @@
+<html>
+  <head>
+    <link rel="kinetic-stylesheet" type="text/css"
+          tal:attributes="href
+          string:${context/@@absolute_url}/++resource++focus.kss"/>
+    <metal:header use-macro="context/@@header_macros/header_resources" />
+  </head>
+  <body>
+    <div id="global-links">
+      <ul>
+        <li><a href=".">All demos</a></li>
+        <li><a href="javascript:void(createLoggingPane(true))">Show logging
+      pane</a></li>
+        <li><a href="./++resource++focus.kss">View KSS resource</a></li>
+      </ul>
+    </div>  
+    <h2>Focus</h2>
+    <p>We test the focus action/command : it is used to set focus to form
+    widgets. </p>
+    <p>The focus is set to various widgets : <code>input</code>,
+    <code>select</code>, <code>textarea</code>...</p> 
+    <div id="target">Focus on <code>none</code>.</div>
+    <form name="main">
+      <h3>
+        Focus to <code>input type="text"<code>.
+      </h3>
+      <div class="help">
+        Click the button to set focus to the input.
+      </div>
+      <fieldset>
+        <div>
+          <a class="button click cursorPointer" id="focus-to-text">Click me 
!</a>
+          <input class="focus" id="text"
+                 type="text" name="text" value="text" />
+        </div>
+      </fieldset>  
+      <h3>
+        Focus to <code>textarea<code>.
+      </h3>
+      <div class="help">
+        Click the button to set focus to the textarea.
+      </div>
+      <fieldset>
+        <div>
+          <a class="button click cursorPointer" id="focus-to-textarea">Click 
me !</a>
+          <textarea id="textarea" class="focus" 
name="textarea">textarea</textarea>
+        </div>
+      </fieldset>
+      <h3>
+        Focus to <code>select<code>.
+      </h3>
+      <div class="help">
+        Click the button to set focus to the select.
+      </div>
+      <fieldset>
+        <div>
+          <a class="button click cursorPointer" id="focus-to-select">Click me 
!</a>
+          <select id="select" class="focus" name="select">
+            <option selected="selected">select</option>
+            <option>second option</option>
+          </select>
+        </div>
+      </fieldset>
+      <h3>
+        Focus to <code>input type="radio"<code>.
+      </h3>
+      <div class="help">
+        Click the button to set focus to the radio.
+      </div>
+      <fieldset>
+        <div>
+          <a class="button click cursorPointer" id="focus-to-radio">Click me 
!</a>
+          <input class="focus" id="radio-1" 
+                 type="radio" name="radio" value="radio"
+                 checked="checked" />
+          <input class="focus" id="radio-2"
+                 type="radio" name="radio" value="radio-2" />
+        </div>
+      </fieldset>  
+      <h3>
+        Focus to <code>input type="checkbox"<code>.
+      </h3>
+      <div class="help">
+        Click the button to set focus to the checkbox.
+      </div>
+      <fieldset>
+        <div>
+          <a class="button click cursorPointer" id="focus-to-checkbox">Click 
me !</a>
+          <input class="focus" id="checkbox-1" 
+                 type="checkbox" name="checkbox" value="checkbox"
+                 checked="checked" />
+          <input class="focus" id="checkbox-2"
+                 type="checkbox" name="checkbox" value="checkbox-2" />
+        </div>
+      </fieldset>  
+    </form>
+  </body>
+</html>

Modified: kukit/kss.demo/trunk/kss/demo/browser/configure.zcml
==============================================================================
--- kukit/kss.demo/trunk/kss/demo/browser/configure.zcml        (original)
+++ kukit/kss.demo/trunk/kss/demo/browser/configure.zcml        Mon Mar 12 
13:09:49 2007
@@ -4,8 +4,8 @@
                   >
 
   <include package=".parameterfunction" />
+  <include package=".commandaction" />
   <include package=".selectors" />
-  <include package=".coreplugin" />
   <include package=".coresyntax" />
   
   <browser:resource

Modified: kukit/kss.demo/trunk/kss/demo/browser/demo.css
==============================================================================
--- kukit/kss.demo/trunk/kss/demo/browser/demo.css      (original)
+++ kukit/kss.demo/trunk/kss/demo/browser/demo.css      Mon Mar 12 13:09:49 2007
@@ -75,3 +75,7 @@
   font-size: 80%;
   color: #AAAAAA;
 }
+
+.container {
+  padding : 1em;
+}

Modified: kukit/kss.demo/trunk/kss/demo/browser/parameterfunction/forms.pt
==============================================================================
--- kukit/kss.demo/trunk/kss/demo/browser/parameterfunction/forms.pt    
(original)
+++ kukit/kss.demo/trunk/kss/demo/browser/parameterfunction/forms.pt    Mon Mar 
12 13:09:49 2007
@@ -56,7 +56,7 @@
                   name="textarea">textarea</textarea>
       </fieldset>  
       <h3>
-        <code>currentFormVar()</code> with textarea field.
+        <code>currentFormVar(name)</code> with textarea field.
       </h3>
       <div class="help">
         Click the button.

Copied: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/actions.html (from 
r40167, kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/coreplugin.html)
==============================================================================
--- kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/coreplugin.html  
(original)
+++ kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/actions.html     Mon Mar 
12 13:09:49 2007
@@ -10,7 +10,7 @@
 </thead><tbody>
 <tr>
        <td>open</td>
-       <td>/demo/coreplugin.html</td>
+       <td>/demo/actions.html</td>
        <td></td>
 </tr>
 <tr>

Added: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/ca_focus.html
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/ca_focus.html    Mon Mar 
12 13:09:49 2007
@@ -0,0 +1,99 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>ca_focus</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">ca_focus</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/demo/ca_focus.html</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertTextPresent</td>
+       <td>Focus on none.</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>focus-to-text</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForTextPresent</td>
+       <td>Focus on text.</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertTextPresent</td>
+       <td>Focus on text.</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>focus-to-textarea</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForTextPresent</td>
+       <td>Focus on textarea.</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertTextPresent</td>
+       <td>Focus on textarea.</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>focus-to-select</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForTextPresent</td>
+       <td>Focus on select.</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertTextPresent</td>
+       <td>Focus on select.</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>focus-to-radio</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForTextPresent</td>
+       <td>Focus on radio-1.</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertTextPresent</td>
+       <td>Focus on radio-1.</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>focus-to-checkbox</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForTextPresent</td>
+       <td>Focus on checkbox-1.</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertTextPresent</td>
+       <td>Focus on checkbox-1.</td>
+       <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>

Deleted: /kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/coreplugin.html
==============================================================================
--- /kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/coreplugin.html Mon Mar 
12 13:09:49 2007
+++ (empty file)
@@ -1,44 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>coreplugin</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">coreplugin</td></tr>
-</thead><tbody>
-<tr>
-       <td>open</td>
-       <td>/demo/coreplugin.html</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertAttribute</td>
-       <td>[EMAIL PROTECTED]</td>
-       <td>button click cursorPointer</td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>toggleclass-button</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertAttribute</td>
-       <td>[EMAIL PROTECTED]</td>
-       <td>button click cursorPointer selected</td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>toggleclass-button</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertAttribute</td>
-       <td>[EMAIL PROTECTED]</td>
-       <td>button click cursorPointer</td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to