Author: jmorliaguet
Date: Sun Apr  9 21:10:18 2006
New Revision: 2800

Modified:
   cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/panels/views.py
   cpsskins/branches/jmo-perspectives/ui/panels/io.pt
   cpsskins/branches/jmo-perspectives/ui/panels/settings.pt
   cpsskins/branches/jmo-perspectives/ui/screens/sitemanager/views.py
Log:

- simplifications: the form data passed to panel widgets is set in the model's
  'form' variable.



Modified: cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py      
(original)
+++ cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py      Sun Apr 
 9 21:10:18 2006
@@ -42,7 +42,10 @@
     'page-designer': {
         'id': 'page-designer',
         'data': {
-            'url': '@@renderPage.html?engine=page-designer',
+            'url': '@@renderPage.html',
+            'form': {
+                'engine': 'page-designer',
+            },
             'css': '/++skin++cpsskins/@@/++resource++page-designer.css',
         }
     },
@@ -50,7 +53,10 @@
     'layout-designer': {
         'id': 'layout-designer',
         'data': {
-            'url': '@@renderPage.html?engine=layout-designer',
+            'url': '@@renderPage.html',
+            'form': {
+                'engine': 'layout-designer',
+            },
             'css': '/++skin++cpsskins/@@/++resource++layout-designer.css',
         }
     },
@@ -58,7 +64,10 @@
     'content-author': {
         'id': 'content-author',
         'data': {
-            'url': '@@renderPage.html?engine=content-author',
+            'url': '@@renderPage.html',
+            'form': {
+                'engine': 'content-author',
+            },
             'css': '/++skin++cpsskins/@@/++resource++content-author.css',
         }
     },
@@ -97,6 +106,7 @@
         'id': 'settings-section',
         'data': {
             'url': '@@settings-section.html',
+            'form': {},
         }
     },
 

Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Sun Apr  9 
21:10:18 2006
@@ -2053,17 +2053,13 @@
 
       var parts = url.split('?');
       var method = url;
-      var parameters = '';
       if (parts.length == 2) {
         method = parts[0];
-        parameters = parts[1];
       }
       var form_data = $H(data.form) || {};
       if (form_data.keys().length > 0) {
-        if (parameters) parameters += '&';
-        parameters += form_data.toQueryString();
+        options.parameters = form_data.toQueryString();
       }
-      options.parameters = parameters;
       new Ajax.Request(method, options);
     }
   },

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/panels/views.py
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/panels/views.py
      (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/panels/views.py
      Sun Apr  9 21:10:18 2006
@@ -7,4 +7,4 @@
 
     def doSomething(self):
         self.request.response.setHeader('content-type', 'text/x-json')
-        return json.write({'url': '@@panels-form.html?updated=1'})
+        return json.write({'form': {'updated': 1}})

Modified: cpsskins/branches/jmo-perspectives/ui/panels/io.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/panels/io.pt  (original)
+++ cpsskins/branches/jmo-perspectives/ui/panels/io.pt  Sun Apr  9 21:10:18 2006
@@ -11,7 +11,7 @@
         <ul>
           <li tal:repeat="section python: ['export', 'import', 'snapshots']">
             <a class="section"
-               tal:attributes="href 
string:javascript:CPSSkins.getModelById('io-section').setData({'url': 
'@@io-section.html?section=$section'})"
+               tal:attributes="href 
string:javascript:CPSSkins.getModelById('io-section').setData({'form': 
{'section': '$section'}})"
                tal:content="section">SECTION</a>
           </li>
         </ul>

Modified: cpsskins/branches/jmo-perspectives/ui/panels/settings.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/panels/settings.pt    (original)
+++ cpsskins/branches/jmo-perspectives/ui/panels/settings.pt    Sun Apr  9 
21:10:18 2006
@@ -10,7 +10,7 @@
         <span class="description">manage settings ...</span>
         <ul>
           <li tal:repeat="section python: ['perspective', 'style', 'color']">
-            <a class="section" tal:attributes="href 
string:javascript:CPSSkins.getModelById('settings-section').setData({'url': 
'@@settings-section.html?section=$section'})" 
tal:content="section">SECTION</a></li>
+            <a class="section" tal:attributes="href 
string:javascript:CPSSkins.getModelById('settings-section').setData({'form': 
{'section': '$section'}})" tal:content="section">SECTION</a></li>
         </ul>
         <br style="clear:both"/>
       </div>

Modified: cpsskins/branches/jmo-perspectives/ui/screens/sitemanager/views.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/screens/sitemanager/views.py  
(original)
+++ cpsskins/branches/jmo-perspectives/ui/screens/sitemanager/views.py  Sun Apr 
 9 21:10:18 2006
@@ -165,7 +165,10 @@
         snapshots.add(snapshot, snapshot.filename)
 
         self.request.response.setHeader('content-type', 'text/x-json')
-        return json.write({'form': {'snapshot': snapshot.filename}})
+        return json.write({'form': {
+            'snapshot': snapshot.filename,
+            'section': 'export',
+            }})
 
     def listSnapshots(self):
         return list(getThemeManager().getSnapshotStorage())
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to