Author: jmorliaguet
Date: Mon Jan 30 01:37:48 2006
New Revision: 2245

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/browser.py
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/cpsskins_storage_adapters.pt
Log:

- better example (we separate the data and the message)



Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/browser.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/browser.py      
(original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/browser.py      
Mon Jan 30 01:37:48 2006
@@ -33,11 +33,16 @@
 
         # get the data
         data = json.read(data)
-        content = data['content']
 
         # validate the data
-        comment = content in RIGHT_ANSWERS and 'RIGHT :-)' or 'WRONG :-('
-        data['content'] = "You answered '%s': %s" % (content, comment)
+        content = data['content']
+        if content in RIGHT_ANSWERS:
+           comment = u'Right answer!'
+        else:
+           comment = u'WRONG answer :-('
+
+        # write a message
+        data['message'] = "You answered '%s': %s" % (content, comment)
 
         # store the data in the session
         self.session['data1'] = data

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/cpsskins_storage_adapters.pt
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/cpsskins_storage_adapters.pt
    (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/cpsskins_storage_adapters.pt
    Mon Jan 30 01:37:48 2006
@@ -5,10 +5,14 @@
 <head>
   <title>CPSSkins Unit test file</title>
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-  <script src="/++skin++cpsskins/@@/++resource++prototype.js" 
type="text/javascript"></script>
-  <script src="/++skin++cpsskins/@@/++resource++json.js" 
type="text/javascript"></script>
-  <script src="/++skin++cpsskins/@@/++resource++cpsskins.js" 
type="text/javascript"></script>
-  <link rel="stylesheet" href="/++skin++cpsskins/@@/++resource++cpsskins.css" 
type="text/css" />
+  <script src="/++skin++cpsskins/@@/++resource++prototype.js"
+          type="text/javascript"></script>
+  <script src="/++skin++cpsskins/@@/++resource++json.js"
+          type="text/javascript"></script>
+  <script src="/++skin++cpsskins/@@/++resource++cpsskins.js"
+          type="text/javascript"></script>
+  <link rel="stylesheet" type="text/css"
+        href="/++skin++cpsskins/@@/++resource++cpsskins.css" />
 
   <style type="text/css">
     .choices {
@@ -17,18 +21,19 @@
 
     div.inputbox {
       padding: 0.5em;
-      width: 260px;
-      border: 1px solid gray;
+      width: 300px;
+      border: 1px solid #666;
       background-color: #efc;
-      font: 1.3em arial;
     }
 
     input {
-      margin-bottom: 1em;
+      margin-bottom: 0.5em;
+      margin-top: 0.5em;
       border-width: 1px;
       border-style: solid;
-      border-color: #333 #ccc #ccc #333;
+      border-color: #000 #999 #999 #000;
       width: 175px;
+      font: 1.3em arial;
     }
 
     div.content {
@@ -37,6 +42,12 @@
       padding: 1em;
     }
 
+    div.message {
+      border: 1px solid #000;
+      background-color: #fc0;
+      padding: 0.5em;
+      margin-bottom: 0.5em;
+    } 
   </style>
 
   <script type="text/javascript">
@@ -79,6 +90,15 @@
         });
         content.appendChild(document.createTextNode(data.content));
 
+        if (data.message) {
+          var message = Canvas.createNode({
+            tag: "div",
+            classes: "message"
+          });
+          widget.appendChild(message);
+          message.appendChild(document.createTextNode(data.message));
+        }
+
         widget.appendChild(input);
         widget.appendChild(content);
       },
@@ -106,8 +126,8 @@
 
   <h1>CPSSkins: storage adapters</h1>
 
-  <p>A storage adapter can be specified in the model definition to describe
-     how the model will access the data.
+  <p>A <strong>storage adapter</strong> can be specified in the model
+     definition to describe how the model will access the data.
   </p>
 
   <ins class="controller">
@@ -120,7 +140,8 @@
 
   <h2>Local storage</h2>
 
-  <p>In a local storage the data is store on the client.</p>
+  <p>In a <strong>local storage</strong> the data is entirely stored on the
+     client. The server is never accessed.</p>
 
   <div id="area1">
 
@@ -148,15 +169,21 @@
   </div>
 
   <h2>Remote storage</h2>
-  <p>In this example the data is stored on the server inside the session.
-     This provides persistence which means that the page can be reloaded and
-     the current data will be restored.
+  <p>In this example the data is stored <strong>on the server</strong> inside
+     the session.
+     This provides some persistence which means that the page can be reloaded
+     or the user can leave and return to the page and the current data will be
+     restored.
   </p>
 
-  <p>An extra delay has been added when retrieving and storing data to
-     simulate network or database latency.</p>
+  <p>An extra delay has been added when retrieving and when storing data to
+     simulate network or database latency. Calls are made
+     <strong>asynchronously</strong> which means that the browser can load the
+     page entirely before the data is retrieved.</p>
 
-  <p>The input is validated before storing the data.</p>
+  <p>The user input is <strong>validated</strong> before the data is getting
+     stored.
+  </p>
 
   <p>Finally the view gets refreshed when the model is updated.</p>
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to