[KSS-checkins] r41780 - in kukit/kss.demo/trunk/kss/demo: browser browser/coreplugin tests/selenium_tests
reebalazs at codespeak.net
reebalazs at codespeak.net
Sun Apr 1 23:39:45 CEST 2007
Author: reebalazs
Date: Sun Apr 1 23:39:42 2007
New Revision: 41780
Added:
kukit/kss.demo/trunk/kss/demo/browser/coreplugin/
kukit/kss.demo/trunk/kss/demo/browser/coreplugin/__init__.py (contents, props changed)
kukit/kss.demo/trunk/kss/demo/browser/coreplugin/azaxview.py (contents, props changed)
kukit/kss.demo/trunk/kss/demo/browser/coreplugin/configure.zcml (contents, props changed)
kukit/kss.demo/trunk/kss/demo/browser/coreplugin/kss_evt_preventbubbling.kss (contents, props changed)
kukit/kss.demo/trunk/kss/demo/browser/coreplugin/kss_evt_preventbubbling.pt (contents, props changed)
kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/kss_prevent_bubbling.html (contents, props changed)
Modified:
kukit/kss.demo/trunk/kss/demo/browser/azax_demo_index.pt
kukit/kss.demo/trunk/kss/demo/browser/configure.zcml
Log:
Adding selenium test for the preventbubbling
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 Sun Apr 1 23:39:42 2007
@@ -8,7 +8,7 @@
<ul>
<li><a href="basic_commands.html">Change tag content</a></li>
<li><a href="two_selects.html">Two selects</a></li>
- <li><a href="three_autoupdate.html">Three autoupdate</a></li>
+ <li><a href="three_autoupdate.html">Three autoupdate</a></li>
<li><a href="azax_instant_edit.html">instant edit</a></li>
<!--li><a href="azax_xpath.html">xpath</a></li-->
<li><a href="cancel_submit.html">Cancel Submit Click</a></li>
@@ -35,6 +35,10 @@
<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>Core plugin</h3>
+ <ul>
+ <li><a href="kss_evt_preventbubbling.html">Prevent bubbling KSS event parameter </a></li>
+ </ul>
<h3>Commands/Actions</h3>
<ul>
<li><a href="ca_focus.html">Focus</a></li>
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 Sun Apr 1 23:39:42 2007
@@ -7,6 +7,7 @@
<include package=".commandaction" />
<include package=".selectors" />
<include package=".coresyntax" />
+ <include package=".coreplugin" />
<browser:resource
file="demo.css"
Added: kukit/kss.demo/trunk/kss/demo/browser/coreplugin/__init__.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/__init__.py Sun Apr 1 23:39:42 2007
@@ -0,0 +1,4 @@
+'''\
+Module init
+'''
+
Added: kukit/kss.demo/trunk/kss/demo/browser/coreplugin/azaxview.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/azaxview.py Sun Apr 1 23:39:42 2007
@@ -0,0 +1,23 @@
+# -*- coding: ISO-8859-15 -*-
+# Copyright (c) 2005-2007
+# Authors: KSS Project Contributors (see docs/CREDITS.txt)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+
+from kss.core import AzaxBaseView, force_unicode, KssExplicitError, kssaction
+
+class AzaxView(AzaxBaseView):
+ pass
\ No newline at end of file
Added: kukit/kss.demo/trunk/kss/demo/browser/coreplugin/configure.zcml
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/configure.zcml Sun Apr 1 23:39:42 2007
@@ -0,0 +1,23 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ i18n_domain="kss"
+ >
+
+ <!-- kss prevent bubbling parameter -->
+
+ <browser:page
+ for="kss.demo.interfaces.ISimpleContent"
+ template="kss_evt_preventbubbling.pt"
+ name="kss_evt_preventbubbling.html"
+ permission="zope.View"
+ />
+
+ <browser:resource
+ file="kss_evt_preventbubbling.kss"
+ name="kss_evt_preventbubbling.kss"
+ />
+
+
+
+</configure>
+
Added: kukit/kss.demo/trunk/kss/demo/browser/coreplugin/kss_evt_preventbubbling.kss
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/kss_evt_preventbubbling.kss Sun Apr 1 23:39:42 2007
@@ -0,0 +1,87 @@
+#parent-node:click {
+ evt-click-allowbubbling: true;
+ evt-click-preventdefault: true;
+ action-client: alert;
+ alert-message: "you clicked inside the DIV tag";
+}
+
+#bubbling-node:click {
+ evt-click-preventdefault: true;
+ action-client: alert;
+ alert-message: "you clicked the bubbling A tag";
+}
+
+#not-bubbling-node:click {
+ evt-click-preventdefault: true;
+ evt-click-preventbubbling: true;
+ action-client: alert;
+ alert-message: "you clicked the not bubbling A tag";
+}
+
+
+.clickable:click {
+ evt-click-preventdefault: true;
+}
+
+
+#button_1:click {
+ action-client: setStyle;
+ setStyle-kssSelector: htmlid(button_2);
+ setStyle-name: backgroundColor;
+ setStyle-value: #FFa0a0;
+ action-client: setAttribute;
+ setAttribute-kssSelector: htmlid(button_2);
+ setAttribute-name: value;
+ setAttribute-value: 'RESET ME';
+
+}
+
+#button_2:click {
+ action-client: setStyle;
+ setStyle-name: backgroundColor;
+ setStyle-value: white;
+ action-client: setAttribute;
+ setAttribute-name: value;
+ setAttribute-value: 'Watch me';
+}
+
+#button_3:click {
+ action-client: setStyle;
+ setStyle-kssSelector: "#button_4";
+ setStyle-name: backgroundColor;
+ setStyle-value: #FFa0a0;
+ action-client: setAttribute;
+ setAttribute-kssSelector: '#button_4';
+ setAttribute-name: value;
+ setAttribute-value: 'RESET ME';
+}
+
+#button_4:click {
+ action-client: setStyle;
+ setStyle-name: backgroundColor;
+ setStyle-value: white;
+ action-client: setAttribute;
+ setAttribute-name: value;
+ setAttribute-value: 'Watch me';
+}
+
+#button_5:click {
+ action-client: setStyle;
+ setStyle-kssSelector: css("#button_6");
+ setStyle-name: backgroundColor;
+ setStyle-value: #FFa0a0;
+ action-client: setAttribute;
+ setAttribute-kssSelector: css('#button_6');
+ setAttribute-name: value;
+ setAttribute-value: 'RESET ME';
+
+}
+
+#button_6:click {
+ action-client: setStyle;
+ setStyle-name: backgroundColor;
+ setStyle-value: white;
+ action-client: setAttribute;
+ setAttribute-name: value;
+ setAttribute-value: 'Watch me';
+}
Added: kukit/kss.demo/trunk/kss/demo/browser/coreplugin/kss_evt_preventbubbling.pt
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/kss_evt_preventbubbling.pt Sun Apr 1 23:39:42 2007
@@ -0,0 +1,46 @@
+<html>
+ <head>
+ <link rel="kinetic-stylesheet" type="text/css"
+ tal:attributes="href string:${context/@@absolute_url}/++resource++kss_evt_preventbubbling.kss"/>
+ <metal:header use-macro="context/@@header_macros/header_resources" />
+ <style type="text/css">
+ div#parent-node { border: 1px solid green; padding: 0.4em; }
+ a#bubbling-node, a#not-bubbling-node { text-decoration: underline; }
+ </style>
+</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++kss_evt_preventbubbling.kss">View KSS resource</a></li>
+ </ul>
+ </div>
+
+ <h2>Kss prevent bubbling demo</h2>
+<p>This demo shows how a rule can prevent bubbling of an event to its parent nodes</p>
+
+
+<h3>DIV</h3>
+<div id="parent-node" >
+<p>
+Click anywhere inside this DIV to show an alert
+</p>
+<p>
+<a id="bubbling-node">Click here to trigger an event in both the A tag and in the parent node</a>
+</p>
+<p>
+Text
+</p>
+<p>
+<a id="not-bubbling-node">Click here to trigger an event only in the A tag</a>
+</p>
+<p>
+Text
+</p>
+</div>
+
+ </body>
+</html>
Added: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/kss_prevent_bubbling.html
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/kss_prevent_bubbling.html Sun Apr 1 23:39:42 2007
@@ -0,0 +1,69 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>kss_prevent_bubbling</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">kss_prevent_bubbling</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/demo/kss_evt_preventbubbling.html</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>css=div#parent-node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertAlert</td>
+ <td>you clicked inside the DIV tag, rule=#0, node=DIV</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertAlertNotPresent</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>css=a#bubbling-node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertAlert</td>
+ <td>you clicked the bubbling A tag, rule=#1, node=A</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertAlert</td>
+ <td>you clicked inside the DIV tag, rule=#0, node=DIV</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertAlertNotPresent</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>css=a#not-bubbling-node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertAlert</td>
+ <td>you clicked the not bubbling A tag, rule=#2, node=A</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertAlertNotPresent</td>
+ <td></td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
More information about the Kukit-checkins
mailing list