Author: reebalazs
Date: Thu Oct  4 18:13:40 2007
New Revision: 47151

Added:
   kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/
   kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/README
   kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/__init__.py
   kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/binderids.kss
   kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/binderids.pt
   kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/configure.zcml
   kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/selenium_tests/
   
kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/selenium_tests/README.txt
   kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/zopeconfig.py
Modified:
   kukit/kss.core/trunk/docs/HISTORY.txt
   kukit/kss.core/trunk/kss/core/plugins/core/configure.zcml
Log:
Merge from ree-binding-improvements branch:

 Implement event binding based on the ids fetched
dynamically from the dom, by value providers.

I created the demos for this in a temporary directory
under the core plugin. This will be moved to the directory
that contains the demos of all plugins.

Modified: kukit/kss.core/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.core/trunk/docs/HISTORY.txt       (original)
+++ kukit/kss.core/trunk/docs/HISTORY.txt       Thu Oct  4 18:13:40 2007
@@ -6,12 +6,17 @@
 
     - ...
 
+    - Implement event binding based on the ids fetched 
+      dynamically from the dom, by value providers.
+      [ree]
+
     - Changed kukit payload to encode HTML content of CDATA.
       This was necessary because us a supposed bug in FF, that
       prevented us to use base2 (xpath selection did not work
       on inserted elements, due to namespace issues.)
       Get rid of forceToDom, make sure all plugins accept html
       parameters as strings.
+      [ree]
 
 kss.core - 1.2 Released 2007-08-17
 

Modified: kukit/kss.core/trunk/kss/core/plugins/core/configure.zcml
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/configure.zcml   (original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/configure.zcml   Thu Oct  4 
18:13:40 2007
@@ -5,6 +5,9 @@
      xmlns:zcml="http://namespaces.zope.org/zcml";
      >
     
+    <!-- Include demo setup conditionally -->
+    <include zcml:condition="installed kss.demo" package=".demo_for_binderids" 
/>
+
      <!-- example plugin registration
      
       <kss:eventtype

Added: kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/README
==============================================================================
--- (empty file)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/README        
Thu Oct  4 18:13:40 2007
@@ -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/trunk/kss/core/plugins/core/demo_for_binderids/__init__.py
==============================================================================
--- (empty file)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/__init__.py   
Thu Oct  4 18:13:40 2007
@@ -0,0 +1,4 @@
+"""\
+Module init
+"""
+

Added: 
kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/binderids.kss
==============================================================================
--- (empty file)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/binderids.kss 
Thu Oct  4 18:13:40 2007
@@ -0,0 +1,20 @@
+
+/* Set up kss rules needed for your demo. 
+ *  Use the following rule as an example only.
+ */
+
+.buttons:click(manual) {
+    action-client:      alert;
+    alert-message:      "manual";
+}
+
+#button1:click(manual2) {
+    action-client:      alert;
+    alert-message:      "manual2";
+}
+
+.buttons.bindable_by_parm:click(kssAttr(binderid)) {
+    action-client:      alert;
+    alert-message:      kssAttr(binderid);
+}
+

Added: 
kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/binderids.pt
==============================================================================
--- (empty file)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/binderids.pt  
Thu Oct  4 18:13:40 2007
@@ -0,0 +1,48 @@
+<html tal:define="viewname string:binderids">
+  <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>Binder ids</h2>
+
+    <p>We bind the events on these two buttons with different binder ids.
+    Events bound to different binders will not merge. 
+    (Note that this is not the typical usage
+    if event ids, only a simple check that it really works.
+    )If you click the buttons, you need to
+    receive alerts per each event bound.
+    </p>
+
+    <hr/>
+
+    <input type="submit" id="button1" class="buttons"
+      value="button1">
+
+    <input type="submit" id="button2" class="buttons bindable_by_parm 
kssattr-binderid-parm1"
+      value="button2">
+
+    <input type="submit" id="button3" class="buttons bindable_by_parm 
kssattr-binderid-parm2"
+      value="button3">
+
+    <hr/>
+
+    <p>First we bind an event with id "manual" to each buttons. 
+    We also bind event manual2 to the second button. Then
+    we bind events that acquire their id from kssattr to the second and
+    third buttons. So we will have the following events bound:
+    </p>
+
+    <table><thead>
+      <td>Button</td><td>Bound event ids</td>
+    </thead><tbody>
+      <tr><td>button1</td><td>click(manual), click(manual2)</td></tr>
+      <tr><td>button1</td><td>click(manual), click(parm1))</td></tr>
+      <tr><td>button1</td><td>click(manual), click(parm2))</td></tr>
+    </tbody></table>
+
+    <!-- END of demo content -->
+  </body>
+</html>

Added: 
kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/configure.zcml
==============================================================================
--- (empty file)
+++ 
kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/configure.zcml    
    Thu Oct  4 18:13:40 2007
@@ -0,0 +1,33 @@
+<configure xmlns="http://namespaces.zope.org/zope";
+           xmlns:browser="http://namespaces.zope.org/browser";
+           xmlns:kss="http://namespaces.zope.org/kss";
+                  i18n_domain="kss"
+                  >
+
+  <!--
+    Set up the demos
+  -->
+
+  <!-- Set up the demo utility, needed for registration -->
+  <utility
+    name="core_demo_for_binderids"
+    factory=".zopeconfig.KSSDemos"
+    provides="kss.demo.interfaces.IKSSDemoResource"
+    permission="zope.Public"
+    />
+
+  <!-- Set up resources needed for the demo -->
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      template="binderids.pt"
+      name="binderids.html"
+      permission="zope.View"
+      />
+
+  <browser:resource
+    file="binderids.kss"
+    name="binderids.kss"
+    />
+
+</configure>
+

Added: 
kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/selenium_tests/README.txt
==============================================================================
--- (empty file)
+++ 
kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/selenium_tests/README.txt
     Thu Oct  4 18:13:40 2007
@@ -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/trunk/kss/core/plugins/core/demo_for_binderids/zopeconfig.py
==============================================================================
--- (empty file)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo_for_binderids/zopeconfig.py 
Thu Oct  4 18:13:40 2007
@@ -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('', 'Core syntax', 'binderids.html', 'Binder ids'),
+
+        )
+
+    # 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'),
+        )
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to