Author: jmorliaguet
Date: Sat May 27 12:03:56 2006
New Revision: 3239

Modified:
   cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js
   cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml
   cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py
   
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/wysiwyg/portlet.pt

Log:

- added a JSON model definition for portlets



Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js  
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js  Sat May 
27 12:03:56 2006
@@ -45,7 +45,8 @@
 }
 
 function editElement(info) {
-  var id = info.target.getAttribute('targetid');
+  var data = info.model.getData();
+  var id = data.id;
   CPSSkins.getModelById('element-editor').updateData({
     form: {id: id, format: ''}
   });

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml        
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml        
Sat May 27 12:03:56 2006
@@ -100,6 +100,11 @@
           attribute="getIcon"
       />
 
+      <page
+          name="getModel"
+          attribute="getModel"
+      />
+
   </pages>
 
   <!-- authoring -->

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py      
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py      Sat May 
27 12:03:56 2006
@@ -58,6 +58,9 @@
     def getIcon():
         """Return the element's icon path."""
 
+    def getModel():
+        """Return the model information for this element."""
+
 class Editing(object):
 
     implements(IEditing)
@@ -82,8 +85,18 @@
             icon_url = icon.url()
         return icon_url
 
+    def getModel(self):
+        id = self.context.identifier
+        return json.write({
+            'id': u'm%s' % id,
+            'data': {
+                'id': id,
+                'editable': True,
+                }
+            })
+
 class Rendering(object):
-    """Page rendering view
+    """Rendering of page elements
     """
 
     def __init__(self, context, request):

Modified: 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/wysiwyg/portlet.pt
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/wysiwyg/portlet.pt  
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/wysiwyg/portlet.pt  
    Sat May 27 12:03:56 2006
@@ -1,24 +1,5 @@
-<!-- for testing: move to a view -->
-<ins class="model">
-{"id": "m1",
- "data": {
-   "editable":true
-}}
-</ins>
+<ins class="model" tal:content="context/@@getModel" />
 
 <div class="elementMovable elementShiftable portletTarget"
-  tal:define="
-    info options/info;
-    globals info/globals;
-    display info/display;
-    perspective globals/perspective;
-    formats display/formattable:getFormatNames;
-    title context/title;
-    id context/identifier"
-  tal:attributes="
-    editable python:1;
-    formattable python: formats and 1 or 0;
-    formats python: ' '.join(formats);
-    targetid id;
-    id id"
+  tal:attributes="id context/identifier"
   tal:content="structure options/markup" />
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to