Author: gchapelle
Date: Tue Jan 31 01:10:58 2006
New Revision: 2258

Added:
   azax/branches/snowsprint/demos/azaxdemo/browser/cancel_submit.azax
   azax/branches/snowsprint/demos/azaxdemo/browser/cancel_submit.pt
Modified:
   azax/branches/snowsprint/demos/azaxdemo/azaxview.py
   azax/branches/snowsprint/demos/azaxdemo/browser/azax_demo_index.pt
   azax/branches/snowsprint/demos/azaxdemo/configure.zcml
Log:
add cancelSubmitClick demo

Modified: azax/branches/snowsprint/demos/azaxdemo/azaxview.py
==============================================================================
--- azax/branches/snowsprint/demos/azaxdemo/azaxview.py (original)
+++ azax/branches/snowsprint/demos/azaxdemo/azaxview.py Tue Jan 31 01:10:58 2006
@@ -103,5 +103,10 @@
         """ returns the current time """
         return_object = AzaxResponse(self.request.response)
         return_object.setHtmlAsChild('div#text', 'works')
-        return return_object()
+        return return_object()
+        
+    def cancelSubmitSave(self, text_save):
+        return_object = AzaxResponse(self.request.response)
+        return_object.setHtmlAsChild('div#async', 'Async saved %s' % text_save)
+        return return_object()
 

Modified: azax/branches/snowsprint/demos/azaxdemo/browser/azax_demo_index.pt
==============================================================================
--- azax/branches/snowsprint/demos/azaxdemo/browser/azax_demo_index.pt  
(original)
+++ azax/branches/snowsprint/demos/azaxdemo/browser/azax_demo_index.pt  Tue Jan 
31 01:10:58 2006
@@ -7,6 +7,7 @@
      <li><a href="two_selects.html">Two selects</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="cancel_submit.html">Cancel Submit Click</a></li>
      <!-- we'll need parameter passing first do this in a sane way...-->
      <!--<li><a href="azax_tree.html">Tree</a></li>-->
     </ul>

Added: azax/branches/snowsprint/demos/azaxdemo/browser/cancel_submit.azax
==============================================================================
--- (empty file)
+++ azax/branches/snowsprint/demos/azaxdemo/browser/cancel_submit.azax  Tue Jan 
31 01:10:58 2006
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<rules>
+  <rule selector="input#submit">
+    <kukitevent name="cancelSubmitClick">save</kukitevent>
+  </rule>
+</rules>

Added: azax/branches/snowsprint/demos/azaxdemo/browser/cancel_submit.pt
==============================================================================
--- (empty file)
+++ azax/branches/snowsprint/demos/azaxdemo/browser/cancel_submit.pt    Tue Jan 
31 01:10:58 2006
@@ -0,0 +1,40 @@
+<html>
+  <head>
+    <link rel="kukit"
+          tal:attributes="href
+          string:${context/absolute_url}/++resource++cancel_submit.azax"/>
+    <script type="text/javascript"
+      tal:attributes="src 
string:${context/absolute_url}/++resource++sarissa.js;"
+      src="++resource++sarissa.js">
+    </script>
+    <script type="text/javascript"
+      tal:attributes="src 
string:${context/absolute_url}/++resource++cssQuery.js;"
+      src="++resource++cssQuery.js">
+    </script>
+    <script type="text/javascript"
+      tal:attributes="src 
string:${context/absolute_url}/++resource++MochiKit.js;"
+      src="++resource++MochiKit.js">
+    </script>
+    <script type="text/javascript"
+      tal:attributes="src string:${context/absolute_url}/++resource++kukit.js;"
+      src="++resource++kukit.js">
+    </script>
+</head>
+  <body>
+    <p><a href=".">All demos</a></p>
+
+<h3>Cancel Submit Click Demo</h3>
+   <p tal:condition="request/text_save | nothing"><span 
tal:replace="request/text_save | nothing" /> saved !</p>
+   <p><a href="cancel_submit.html">Empty</a></p>
+   <form action="cancel_submit.html">
+        <div id="text">
+        <input type="text" name="text_save"
+               tal:attributes="value request/text_save | nothing" />
+        <input type="submit" id="submit" value="Save"  />
+        <input type="reset" />
+        </div>
+   </form>
+   <div id="async" />
+   <p><a href="save?text_save=example">Kukit response</a></p>
+  </body>
+</html>

Modified: azax/branches/snowsprint/demos/azaxdemo/configure.zcml
==============================================================================
--- azax/branches/snowsprint/demos/azaxdemo/configure.zcml      (original)
+++ azax/branches/snowsprint/demos/azaxdemo/configure.zcml      Tue Jan 31 
01:10:58 2006
@@ -127,9 +127,9 @@
       attribute="getCurrentTime"
       name="getCurrentTime"
       permission="zope2.View"
-      />
-      
-      
+      />
+      
+      
   <!-- instant edit content -->
   <browser:page
       for=".interfaces.ISimpleContent"
@@ -188,5 +188,26 @@
       name="getSubTree"
       permission="zope2.View"
       />
-
+
+  <!-- cancel submit -->
+  <browser:page
+      for=".interfaces.ISimpleContent"
+      template="browser/cancel_submit.pt"
+      name="cancel_submit.html"
+      permission="zope2.View"
+      />
+
+  <browser:resource
+    file="browser/cancel_submit.azax"
+    name="cancel_submit.azax"
+  />
+
+  <browser:page
+      for=".interfaces.ISimpleContent"
+      class=".azaxview.AzaxView"
+      attribute="cancelSubmitSave"
+      name="save"
+      permission="zope2.View"
+      />
+
 </configure>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to