[KSS-checkins] r50412 - in kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax: . selenium_tests
reebalazs at codespeak.net
reebalazs at codespeak.net
Mon Jan 7 00:18:21 CET 2008
Author: reebalazs
Date: Mon Jan 7 00:18:15 2008
New Revision: 50412
Added:
kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/kss_client_action_alias.kss
kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/kss_client_action_alias.pt
kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/selenium_tests/kss_client_action_alias.html
Modified:
kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/config.py
kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/configure.zcml
kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/zopeconfig.py
Log:
Adding demo and test for client action aliasing
Modified: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/config.py
==============================================================================
--- kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/config.py (original)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/config.py Mon Jan 7 00:18:15 2008
@@ -13,6 +13,7 @@
KSSDemo('', 'Core syntax', "kss_selector_param_multiprop.html", "Kss selector parameters, with multiproperties"),
KSSDemo('', 'Core syntax', "kss_url_param_multiprop.html", "Kss url parameters, with multiproperties"),
KSSDemo('', 'Core syntax', "kss_providers_multiprop.html", "Kss providers, with multiproperties"),
+ KSSDemo('', 'Core syntax', "kss_client_action_alias.html", "Client action aliases"),
)
# directories are relative from the location of this .py file
Modified: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/configure.zcml
==============================================================================
--- kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/configure.zcml (original)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/configure.zcml Mon Jan 7 00:18:15 2008
@@ -109,6 +109,18 @@
name="kss_providers_multiprop.kss"
/>
+ <!-- client action aliases -->
+ <browser:page
+ for="kss.demo.interfaces.ISimpleContent"
+ template="kss_client_action_alias.pt"
+ name="kss_client_action_alias.html"
+ permission="zope.View"
+ />
+
+ <browser:resource
+ file="kss_client_action_alias.kss"
+ name="kss_client_action_alias.kss"
+ />
</configure>
Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/kss_client_action_alias.kss
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/kss_client_action_alias.kss Mon Jan 7 00:18:15 2008
@@ -0,0 +1,92 @@
+
+
+.clickable:click {
+ evt-click-preventdefault: true;
+}
+
+#button_1:click {
+ action-client: setStyle htmlid(button_2);
+ setStyle-name: backgroundColor;
+ setStyle-value: #FFa0a0;
+ action-client: setAttribute htmlid(button_2);
+ setAttribute-name: value;
+ setAttribute-value: 'RESET ME';
+
+ action-client: setStyle htmlid(button_3) alias(setStyleRight);
+ setStyleRight-name: backgroundColor;
+ setStyleRight-value: #a0FFa0;
+ action-client: setAttribute htmlid(button_3) alias(setAttributeRight);
+ setAttributeRight-name: value;
+ setAttributeRight-value: 'RESET ME TOO';
+}
+
+/* Similar to the first case, but we check
+ * if aliased actions merge properly.
+ */
+#button_4:click {
+ action-client: setStyle htmlid(button_5);
+ setStyle-name: backgroundColor;
+ setStyle-value: #FFa0a0;
+ action-client: setAttribute htmlid(button_5);
+ setAttribute-name: value;
+ setAttribute-value: 'RESET ME';
+
+ action-client: setStyle htmlid(button_6) alias(setStyleRight);
+ setStyleRight-name: backgroundColor;
+
+ action-client: setAttribute htmlid(button_6) alias(setAttributeRight);
+ setAttributeRight-name: value;
+}
+/* this will merge to the previous one. */
+#button_4:click {
+ setStyleRight-value: #a0FFa0;
+ setAttributeRight-value: 'RESET ME TOO';
+}
+
+
+/* Similar to the first case, but we check
+ * if aliased actions merge properly.
+ * We override the action completely.
+ */
+#button_7:click {
+ action-client: setStyle htmlid(button_8);
+ setStyle-name: backgroundColor;
+ setStyle-value: #FFa0a0;
+ action-client: setAttribute htmlid(button_8);
+ setAttribute-name: value;
+ setAttribute-value: 'RESET ME';
+
+ action-client: setStyle htmlid(button_6) alias(setStyleRight);
+ setStyleRight-name: backgroundColor;
+
+ action-client: setAttribute htmlid(button_6) alias(setAttributeRight);
+ setAttributeRight-name: value;
+}
+/* this will merge to the previous one. This will act on button_9
+ * and _not_ on button_6 as the previous
+ * rule would have specified.
+ *
+ * Note that overriding the action _name_ is not allowed but we
+ * cannot test this here, because it would give parsing error.*/
+#button_7:click {
+ action-client: setStyle htmlid(button_9) alias(setStyleRight);
+ setStyleRight-value: #a0FFa0;
+
+ action-client: setAttribute htmlid(button_9) alias(setAttributeRight);
+ setAttributeRight-value: 'RESET ME TOO';
+}
+
+
+
+/* Resetting the buttons */
+#button_2:click, #button_3:click,
+#button_5:click, #button_6:click,
+#button_8:click, #button_9:click {
+ action-client: setStyle;
+ setStyle-name: backgroundColor;
+ setStyle-value: white;
+ action-client: setAttribute;
+ setAttribute-name: value;
+ setAttribute-value: 'Watch me';
+}
+
Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/kss_client_action_alias.pt
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/kss_client_action_alias.pt Mon Jan 7 00:18:15 2008
@@ -0,0 +1,84 @@
+<html tal:define="viewname string:kss_client_action_alias">
+
+ <head>
+
+ <metal:header use-macro="context/@@header_macros/header_resources" />
+
+ </head>
+
+ <body>
+
+ <p metal:use-macro="context/@@body_macros/header">header</p>
+
+ <h2>Kss client action aliasing demo</h2>
+ <form name="edit">
+ <p>There are three buttons. If you click on the first button, it changes the
+ text (and style) of the
+ second and third button. Since we have the same action twice, they would merge if we
+ had not used aliases.
+ Look at the link on the kss file to understand.
+ </p>
+
+ <h3>
+ <pre><code>action-client: setAttribute htmlid(button_2);
+setAttribute-name: value;
+setAttribute-value: 'RESET ME';
+
+action-client: setAttribute htmlid(button_3) alias(setAttributeRight);
+setAttributeRight-name: value;
+setAttributeRight-value: 'RESET ME TOO';</code></pre>
+ </h3>
+ <div class="help">
+ Click the button here.
+ </div>
+
+ <div>
+ <input type="submit" id="button_1" class="clickable"
+ value="Click me" />
+ <input type="submit" id="button_2" class="clickable"
+ value="Watch me" />
+ <input type="submit" id="button_3" class="clickable"
+ value="Watch me" />
+ </div>
+
+ <h3>
+ Check if aliased rules can merge. Click on the kss link above
+ to understand more.
+ </h3>
+ <div class="help">
+ Click the button here.
+ </div>
+
+ <div>
+ <input type="submit" id="button_4" class="clickable"
+ value="Click me" />
+ <input type="submit" id="button_5" class="clickable"
+ value="Watch me" />
+ <input type="submit" id="button_6" class="clickable"
+ value="Watch me" />
+ </div>
+
+
+ <h3>
+ Check if aliased rules can merge. This will act on the second
+ and third button, and we need to check that the third
+ button in the row above (button_6) did not change.
+ </h3>
+ <div class="help">
+ Click the button here.
+ </div>
+
+ <div>
+ <input type="submit" id="button_7" class="clickable"
+ value="Click me" />
+ <input type="submit" id="button_8" class="clickable"
+ value="Watch me" />
+ <input type="submit" id="button_9" class="clickable"
+ value="Watch me" />
+ </div>
+
+
+ </form>
+
+ </body>
+</html>
Added: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/selenium_tests/kss_client_action_alias.html
==============================================================================
--- (empty file)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/selenium_tests/kss_client_action_alias.html Mon Jan 7 00:18:15 2008
@@ -0,0 +1,129 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>kss_client_action_alias</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">kss_client_action_alias</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/demo/kss_client_action_alias.html</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>button_1</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForValue</td>
+ <td>button_2</td>
+ <td>RESET ME</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>button_3</td>
+ <td>RESET ME TOO</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>button_2</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForValue</td>
+ <td>button_2</td>
+ <td>Watch me</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>button_3</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForValue</td>
+ <td>button_3</td>
+ <td>Watch me</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>button_4</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForValue</td>
+ <td>button_5</td>
+ <td>RESET ME</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>button_6</td>
+ <td>RESET ME TOO</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>button_5</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForValue</td>
+ <td>button_5</td>
+ <td>Watch me</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>button_6</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForValue</td>
+ <td>button_6</td>
+ <td>Watch me</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>button_7</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForValue</td>
+ <td>button_8</td>
+ <td>RESET ME</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>button_9</td>
+ <td>RESET ME TOO</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>button_6</td>
+ <td>Watch me</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>button_8</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForValue</td>
+ <td>button_8</td>
+ <td>Watch me</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>button_9</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForValue</td>
+ <td>button_9</td>
+ <td>Watch me</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Modified: kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/zopeconfig.py
==============================================================================
--- kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/zopeconfig.py (original)
+++ kukit/kss.core/branch/ree-1.4-markup-and-syntax-changes/kss/core/plugins/core/demo/coresyntax/zopeconfig.py Mon Jan 7 00:18:15 2008
@@ -23,6 +23,7 @@
KSSDemo('', 'Core syntax', "kss_selector_param_multiprop.html", "Kss selector parameters, with multiproperties"),
KSSDemo('', 'Core syntax', "kss_url_param_multiprop.html", "Kss url parameters, with multiproperties"),
KSSDemo('', 'Core syntax', "kss_providers_multiprop.html", "Kss providers, with multiproperties"),
+ KSSDemo('', 'Core syntax', "kss_client_action_alias.html", "Client action aliases"),
)
# directories are relative from the location of this .py file
More information about the Kukit-checkins
mailing list