[KSS-checkins] r50327 - in kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes: docs kss/core/plugins/core/demo kss/core/plugins/core/demo/markup kss/core/plugins/core/demo/markup/selenium_tests kss/core/plugins/core/demo/parameterfunction

reebalazs at codespeak.net reebalazs at codespeak.net
Fri Jan 4 18:11:10 CET 2008


Author: reebalazs
Date: Fri Jan  4 18:11:10 2008
New Revision: 50327

Added:
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/README
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/__init__.py
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/config.py
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/configure.zcml
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/markup.kss
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/markup.pt
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/selenium_tests/
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/selenium_tests/README.txt
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/selenium_tests/markup.html
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/zopeconfig.py
Modified:
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/docs/HISTORY.txt
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/config.py
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/configure.zcml
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/demoview.py
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/form_submit.kss
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/parameterfunction/forms.kss
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/parameterfunction/forms.pt
   kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/zopeconfig.py
Log:
Start of work. Adding an extra demo and test.

Modified: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/docs/HISTORY.txt
==============================================================================
--- kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/docs/HISTORY.txt	(original)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/docs/HISTORY.txt	Fri Jan  4 18:11:10 2008
@@ -6,6 +6,19 @@
 
     - ...
 
+    - refactor the value provider registry to use
+      a single registry in place of 3.
+      This will enable to define value
+      providers that recieve non-string parameters
+      like a node selection.
+
+      Remove previously deprecated form() and
+      currentForm() value providers from normal
+      action parameters (remark: they should
+      be used with kssSelector.)
+      They now give a parsing error.
+      [ree]
+
     - Fix multiple selection form fields
       marshalling on Safari 
       (fixes #22 in kssproject)

Modified: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/config.py
==============================================================================
--- kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/config.py	(original)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/config.py	Fri Jan  4 18:11:10 2008
@@ -21,7 +21,7 @@
         KSSDemo('', '', "preventdefault.html", "Preventdefault (a.k.a. Safari workarounds)"),
         KSSDemo('', '', "html_inserts.html", "HTML insertions (Change tag content returns)"),
         KSSDemo('', '', "client-server-protocol", "Client server protocol"),
-        KSSDemo('', 'Parameter functions', 'pf_forms.html', 'Forms'),
+        KSSDemo('', 'Value providers', 'pf_forms.html', 'Forms'),
         KSSDemo('', 'Selectors', 'selectors.html', 'Parent node selector'),
         KSSDemo('', 'Core syntax', "kss_selector_param.html", "Kss selector parameters"),
         KSSDemo('', 'Core syntax', "kss_url_param.html", "Kss url parameters"),

Modified: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/configure.zcml
==============================================================================
--- kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/configure.zcml	(original)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/configure.zcml	Fri Jan  4 18:11:10 2008
@@ -15,6 +15,7 @@
   <include package=".coresyntax" />
   <include package=".coreplugin" />
   <include package=".binderids" />
+  <include package=".markup" />
   
   <!--
     Set up the demos in the root of this package

Modified: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/demoview.py
==============================================================================
--- kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/demoview.py	(original)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/demoview.py	Fri Jan  4 18:11:10 2008
@@ -136,9 +136,9 @@
         self.getCommandSet('core').replaceHTML('select#%s' % slaveid, ' '.join(result))
         return self.render()
 
-    def formSubmitSave(self, data):
+    def formSubmitSave(self):
         result = ['<p>Async saved:</p><table><th>Name:</th><th>Value:</th>']
-        for key, value in data.items():
+        for key, value in self.request.form.items():
             result.append('<tr><td>%s</td><td>%s</td></tr>' % (key, value))
         result.append('</table>')
         # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode

Modified: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/form_submit.kss
==============================================================================
--- kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/form_submit.kss	(original)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/form_submit.kss	Fri Jan  4 18:11:10 2008
@@ -1,5 +1,5 @@
 input#submit:click {
     evt-click-preventdefault: true;
     action-server: formSave;
-    formSave-data: currentForm();
+    formSave-kssSubmitForm: currentForm();
 }

Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/README
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/README	Fri Jan  4 18:11:10 2008
@@ -0,0 +1,7 @@
+
+
+I put this demos under the subdirectory demo_for_binderids.
+This is temporary, the demo will be merged under "demos" when
+they are relocated from kss.demo to here.
+
+(ree)

Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/__init__.py
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/__init__.py	Fri Jan  4 18:11:10 2008
@@ -0,0 +1,4 @@
+"""\
+Module init
+"""
+

Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/config.py
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/config.py	Fri Jan  4 18:11:10 2008
@@ -0,0 +1,22 @@
+
+from kss.base.plugin import Plugin
+from kss.demo.resource import (
+    KSSDemo,
+    KSSSeleniumTestDirectory,
+    )
+
+class CoreDemos(Plugin):
+
+    zope_demos = (
+        # List your demos here. 
+        # (Second parameter can be a subcategory within the demo if needed.)
+        KSSDemo('', 'Value providers', 'markup.html', 'HTML markup'),
+
+        )
+
+    # directories are relative from the location of this .py file
+    zope_selenium_testsuites = (
+        # if you only have one test directory, you
+        # need not change anything here.
+        KSSSeleniumTestDirectory('selenium_tests'),
+        )

Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/configure.zcml
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/configure.zcml	Fri Jan  4 18:11:10 2008
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:browser="http://namespaces.zope.org/browser"
+           xmlns:kss="http://namespaces.zope.org/kss"
+           xmlns:zcml="http://namespaces.zope.org/zcml"
+		   i18n_domain="kss"
+		   >
+
+  <!--
+    Set up the demos
+  -->
+
+  <!-- Set up the demo utility, needed for registration -->
+  <configure zcml:condition="have kss_demo_version_1_2">
+      <utility
+            name="core_demo_for_markup"
+            factory=".zopeconfig.KSSDemos"
+            provides="kss.demo.interfaces.IKSSDemoResource"
+            permission="zope.Public"
+            />
+  </configure>
+
+  <!-- Set up resources needed for the demo -->
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      template="markup.pt"
+      name="markup.html"
+      permission="zope.View"
+      />
+
+  <browser:resource
+    file="markup.kss"
+    name="markup.kss"
+    />
+
+</configure>
+

Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/markup.kss
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/markup.kss	Fri Jan  4 18:11:10 2008
@@ -0,0 +1,43 @@
+
+/* Set up kss rules needed for your demo. 
+ *  Use the following rule as an example only.
+ */
+
+.buttons:click {
+    action-client: replaceInnerHTML;
+    replaceInnerHTML-kssSelector: #logger;
+}
+
+#log-reset a:click {
+    evt-click-preventdefault: true;
+    action-client: clearChildNodes;
+    clearChildNodes-kssSelector: #logger;
+}
+
+#button1:click {
+    replaceInnerHTML-html: kssValue(attr, key);
+}
+
+#button2:click {
+    replaceInnerHTML-html: kssValue(id, key);
+}
+
+#button3:click {
+    replaceInnerHTML-html: kssValue(attr, key);
+}
+
+#button4:click, #button5:click {
+    replaceInnerHTML-html: kssValue(mymarkup, key, false);
+}
+
+#button6:click {
+    replaceInnerHTML-html: kssIdOfValue(attr, key);
+}
+
+#button7:click {
+    replaceInnerHTML-html:      "Executed, look at button's text.";
+    action-client:              insertHTMLAsFirstChild;
+    insertHTMLAsFirstChild-kssSelector:   kssWidget(attr, key);
+    insertHTMLAsFirstChild-html:  'Selector succeeded';
+}
+

Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/markup.pt
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/markup.pt	Fri Jan  4 18:11:10 2008
@@ -0,0 +1,76 @@
+<html tal:define="viewname string:markup">
+  <head>
+    <metal:header use-macro="context/@@header_macros/header_resources" />
+  </head>
+  <body>
+    <p metal:use-macro="context/@@body_macros/header">header</p>
+    <!-- START of demo content -->
+
+    <h2>HTML markup</h2>
+
+    <hr/>
+
+    <!--p metal:use-macro="context/@@body_macros/logger">logger</p-->
+    <h3>Log</h3>
+    <p id="log-reset"><a>Reset log</a></p>
+    <p class="log">You clicked:</p>
+    <div id="logger" class="log">
+      <p id='log-end'></p>
+    </div>
+
+    <hr/>
+
+    <h3>kssValue(attr, key) encoding in class</h3>
+
+    <div class="foo1 kss-attr-key-value1 foo2">
+      <input type="submit" id="button1" class="buttons" value="button1">
+    </div>
+
+    <hr/>
+    <h3>kssValue(id, key) encoding in id</h3>
+
+    <div id="kss-id-key-value2">
+      <input type="submit" id="button2" class="buttons" value="button2">
+    </div>
+
+    <hr/>
+    <h3>kssValue(attr, key) as XHTML attribute</h3>
+
+    <div kss-attr:key="value3">
+      <input type="submit" id="button3" class="buttons" value="button3">
+    </div>
+    
+    <hr/>
+    <h3>kssValue(mymarkup, key, false) encoding in class</h3>
+
+    <div>
+      <input type="submit" id="button4" class="buttons kss-mymarkup-key-value4" value="button4">
+    </div>
+
+    <hr/>
+    <h3>kssValue(mymarkup, key, false) encoding in class (should give no result)</h3>
+
+    <div class="kss-mymarkup-key-value5">
+      <input type="submit" id="button5" class="buttons" value="button5">
+    </div>
+
+    <hr/>
+    <h3>kssIdOfValue(attr, key) encoding in class</h3>
+
+    <div id="value6" class="foo1 kss-attr-key-value6 foo2">
+      <input type="submit" id="button6" class="buttons" value="button6">
+    </div>
+
+    <hr/>
+    <h3>xxx-kssSelector: kssWidget(attr, key); encoding in class</h3>
+
+    <div id="value7" class="foo1 kss-attr-key-value7 foo2">
+      <input type="submit" id="button7" class="buttons" value="button7">
+    </div>
+
+
+    <hr/>
+ 
+    <!-- END of demo content -->
+  </body>
+</html>

Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/selenium_tests/README.txt
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/selenium_tests/README.txt	Fri Jan  4 18:11:10 2008
@@ -0,0 +1,4 @@
+
+Save sour selenium tests into this directory, in html format.
+All the tests ending with .html will be processed automatically.
+

Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/selenium_tests/markup.html
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/selenium_tests/markup.html	Fri Jan  4 18:11:10 2008
@@ -0,0 +1,84 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>markup</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">markup</td></tr>
+</thead><tbody>
+<tr>
+	<td>open</td>
+	<td>/demo/markup.html</td>
+	<td></td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>button1</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForTextPresent</td>
+	<td>value1</td>
+	<td></td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>button2</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForTextPresent</td>
+	<td>value2</td>
+	<td></td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>button3</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForTextPresent</td>
+	<td>value3</td>
+	<td></td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>button4</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForTextPresent</td>
+	<td>value4</td>
+	<td></td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>button5</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForTextPresent</td>
+	<td></td>
+	<td></td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>button7</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForTextPresent</td>
+	<td>Executed, look at button's text.</td>
+	<td></td>
+</tr>
+<tr>
+	<td>verifyTextPresent</td>
+	<td>Selector succeeded</td>
+	<td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>

Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/zopeconfig.py
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/markup/zopeconfig.py	Fri Jan  4 18:11:10 2008
@@ -0,0 +1,35 @@
+
+from kss.demo.interfaces import (
+    IKSSDemoResource,
+    IKSSSeleniumTestResource,
+    )
+from kss.demo.resource import (
+    KSSDemo,
+    KSSSeleniumTestDirectory,
+    )
+from zope.interface import implements
+     
+# Create a mesh of provided interfaces
+# This is needed, because an utility must have a single interface.
+class IResource(IKSSDemoResource, IKSSSeleniumTestResource):
+    pass
+
+# XXX you do not need to change anything above here
+# -------------------------------------------------
+
+class KSSDemos(object):
+    implements(IResource)
+
+    demos = (
+        # List your demos here. 
+        # (Second parameter can be a subcategory within the demo if needed.)
+        KSSDemo('', 'Value providers', 'markup.html', 'HTML markup'),
+
+        )
+
+    # directories are relative from the location of this .py file
+    selenium_tests = (
+        # if you only have one test directory, you
+        # need not change anything here.
+        KSSSeleniumTestDirectory('selenium_tests'),
+        )

Modified: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/parameterfunction/forms.kss
==============================================================================
--- kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/parameterfunction/forms.kss	(original)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/parameterfunction/forms.kss	Fri Jan  4 18:11:10 2008
@@ -53,16 +53,6 @@
     executeCommand-html: currentFormVar(radio-by-name);
 } 
 
-#fullform-simple:click {
-    action-server: submitFullForm;
-    submitFullForm-form: currentForm();
-}
-
-#fullform-simplenamed:click {
-    action-server: submitFullForm;
-    submitFullForm-form: form(full1);
-}
-
 #fullform-current:click {
     action-server:                             submitFullFormIntoRequest;
     submitFullFormIntoRequest-kssSubmitForm:   currentForm();

Modified: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/parameterfunction/forms.pt
==============================================================================
--- kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/parameterfunction/forms.pt	(original)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/parameterfunction/forms.pt	Fri Jan  4 18:11:10 2008
@@ -143,24 +143,14 @@
       <code>form(full1)</code> with simple field names, named form
     </h3>
     <div class="help">
-        Click the button.
+        Removed after deprecation.
+    </div>
+    <h3>
+      <code>currentForm()</code> with simple field names
+    </h3>
+    <div class="help">
+        Removed after deprecation.
     </div>
-    <a class="button click cursorPointer" id="fullform-simplenamed">Click me !</a>
-    <form name="full1">
-      <fieldset>
-        <h3>
-          <code>currentForm()</code> with simple field names
-        </h3>
-        <div class="help">
-            Click the button.
-        </div>
-        <a class="button click cursorPointer" id="fullform-simple">Click me !</a>
-        <input class="click cursorPointer" 
-               type="text" name="value1" value="first value" />
-        <input class="click cursorPointer" 
-               type="text" name="value2" value="second value"/>
-      </fieldset>
-    </form>
     <h3>
       <code>xxx-kssSubmitForm: form(full2)</code> with complex field names, named form
     </h3>

Modified: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/zopeconfig.py
==============================================================================
--- kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/zopeconfig.py	(original)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/zopeconfig.py	Fri Jan  4 18:11:10 2008
@@ -33,7 +33,7 @@
         KSSDemo('', '', "html_inserts.html", "HTML insertions (Change tag content returns)"),
         KSSDemo('', '', "client-server-protocol", "Client server protocol"),
 ##      KSSDemo('', '',  "draganddrop.html", "Scriptaculous drag and drop"),
-        KSSDemo('', 'Parameter functions', 'pf_forms.html', 'Forms'),
+        KSSDemo('', 'Value providers', 'pf_forms.html', 'Forms'),
         KSSDemo('', 'Selectors', 'selectors.html', 'Parent node selector'),
         KSSDemo('', 'Core syntax', "kss_selector_param.html", "Kss selector parameters"),
         KSSDemo('', 'Core syntax', "kss_url_param.html", "Kss url parameters"),


More information about the Kukit-checkins mailing list