[KSS-checkins] r39898 - in kukit/kss.demo/trunk/kss/demo: browser browser/coresyntax tests/selenium_tests

reebalazs at codespeak.net reebalazs at codespeak.net
Sun Mar 4 16:24:30 CET 2007


Author: reebalazs
Date: Sun Mar  4 16:24:28 2007
New Revision: 39898

Added:
   kukit/kss.demo/trunk/kss/demo/browser/coresyntax/azaxview.py
   kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_url_param.kss
   kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_url_param.pt
   kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/urlparam.html
Modified:
   kukit/kss.demo/trunk/kss/demo/browser/azax_demo_index.pt
   kukit/kss.demo/trunk/kss/demo/browser/coresyntax/configure.zcml
Log:
Added demo and test for the kssUrl parameter.

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 Mar  4 16:24:28 2007
@@ -37,6 +37,7 @@
     <h3>Core syntax</h3>
     <ul>
       <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>
 	  <br /><br />
 

Added: kukit/kss.demo/trunk/kss/demo/browser/coresyntax/azaxview.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coresyntax/azaxview.py	Sun Mar  4 16:24:28 2007
@@ -0,0 +1,34 @@
+# -*- 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):
+
+    @kssaction
+    def urlMethod1(self):
+        self.getCommandSet('core').replaceInnerHTML('div#target', 'Method 1 called')
+
+    @kssaction
+    def urlMethod2(self):
+        self.getCommandSet('core').replaceInnerHTML('div#target', 'Method 2 called')
+
+    @kssaction
+    def urlMethod3(self):
+        self.getCommandSet('core').replaceInnerHTML('div#target', 'Method 3 called')

Modified: kukit/kss.demo/trunk/kss/demo/browser/coresyntax/configure.zcml
==============================================================================
--- kukit/kss.demo/trunk/kss/demo/browser/coresyntax/configure.zcml	(original)
+++ kukit/kss.demo/trunk/kss/demo/browser/coresyntax/configure.zcml	Sun Mar  4 16:24:28 2007
@@ -3,7 +3,8 @@
 		   i18n_domain="kss"
 		   >
 
-  <!-- forms -->
+  <!-- selector parameter -->
+
   <browser:page
       for="kss.demo.interfaces.ISimpleContent"
       template="kss_selector_param.pt"
@@ -16,5 +17,43 @@
     name="kss_selector_param.kss"
   />
 
+  <!-- url parameter -->
+
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      template="kss_url_param.pt"
+      name="kss_url_param.html"
+      permission="zope.View"
+      />
+
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      class=".azaxview.AzaxView"
+      name="urlMethod1"
+      attribute="urlMethod1"
+      permission="zope.View"
+      />
+
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      class=".azaxview.AzaxView"
+      name="urlMethod2"
+      attribute="urlMethod2"
+      permission="zope.View"
+      />
+
+  <browser:page
+      for="kss.demo.interfaces.ISimpleContent"
+      class=".azaxview.AzaxView"
+      name="urlMethod3"
+      attribute="urlMethod3"
+      permission="zope.View"
+      />
+
+  <browser:resource
+    file="kss_url_param.kss"
+    name="kss_url_param.kss"
+  />
+
 </configure>
 

Added: kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_url_param.kss
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_url_param.kss	Sun Mar  4 16:24:28 2007
@@ -0,0 +1,21 @@
+
+
+.clickable:click {
+    evt-click-preventdefault: true;
+}
+
+
+#button_1:click {
+    action-server: urlMethod1;
+}
+
+#button_2:click {
+    action-server: urlMethodAlias;
+    urlMethodAlias-kssUrl: "urlMethod2";
+}
+
+#button_3:click {
+    action-server: urlMethodAnotherAlias;
+    urlMethodAnotherAlias-kssUrl: "@@urlMethod3/urlMethod3";
+}
+

Added: kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_url_param.pt
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_url_param.pt	Sun Mar  4 16:24:28 2007
@@ -0,0 +1,45 @@
+<html>
+  <head>
+      <link rel="k-stylesheet" type="text/css"
+          tal:attributes="href string:${context/@@absolute_url}/++resource++kss_url_param.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++kss_url_param.kss">View KSS resource</a></li>
+      </ul>
+    </div>  
+
+    <h2>Kss url parameter demo</h2>
+    <form name="edit">
+    <p>All buttons should display a corresponding text.
+	</p>
+
+    <div id="target">
+    </div>
+
+    <h3>
+    	<code>kssUrl: "view2"</code>
+    </h3>
+    <div class="help">
+        Click the buttons here.
+    </div>
+
+    <div>
+      <input type="submit" id="button_1" class="clickable"
+	     value="Click me"  />
+      <input type="submit" id="button_2" class="clickable"
+	     value="Click me"  />
+      <input type="submit" id="button_3" class="clickable"
+	     value="Click me"  />
+	</div>
+
+    </form>
+
+  </body>
+</html>

Added: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/urlparam.html
==============================================================================
--- (empty file)
+++ kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/urlparam.html	Sun Mar  4 16:24:28 2007
@@ -0,0 +1,64 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>urlparam</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">urlparam</td></tr>
+</thead><tbody>
+<tr>
+	<td>open</td>
+	<td>/demo/kss_url_param.html</td>
+	<td></td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>button_1</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForTextPresent</td>
+	<td>Method 1 called</td>
+	<td></td>
+</tr>
+<tr>
+	<td>verifyTextPresent</td>
+	<td>Method 1 called</td>
+	<td></td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>button_2</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForTextPresent</td>
+	<td>Method 2 called</td>
+	<td></td>
+</tr>
+<tr>
+	<td>verifyTextPresent</td>
+	<td>Method 2 called</td>
+	<td></td>
+</tr>
+<tr>
+	<td>click</td>
+	<td>button_3</td>
+	<td></td>
+</tr>
+<tr>
+	<td>waitForTextPresent</td>
+	<td>Method 3 called</td>
+	<td></td>
+</tr>
+<tr>
+	<td>verifyTextPresent</td>
+	<td>Method 3 called</td>
+	<td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>


More information about the Kukit-checkins mailing list