Author: jmorliaguet
Date: Thu Apr 13 00:00:36 2006
New Revision: 2829

Modified:
   cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js
   cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
   cpsskins/branches/jmo-perspectives/ui/screens/pagedesigner/filters/portlet.pt
Log:

- set up a popup window for editing portlets until this is done in Ajax.



Modified: cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js        
(original)
+++ cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js        Thu Apr 
13 00:00:36 2006
@@ -1,4 +1,13 @@
 
+/* Pop up - for testing. this will be rewritten as Ajax windows */
+
+function openWindow(url) {
+  var win = window.open(url, 'selector', "width=760, height=600, location=no, 
menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes");
+  if (!win.opener) win.opener = self;
+  if (window.focus) {window.focus()}
+  return false;
+}
+
 function insertPortlet(info) {
   var url = '@@insertElement'
   var args = {
@@ -31,8 +40,17 @@
   new Ajax.Request(url, options);
 }
 
+function editElement(info) {
+  var id = info.target.getAttribute('targetid');
+  openWindow('@@edit-panel.html?id=' + id);
+}
+
+/* Register actions */
 CPSSkins.addActions({
-  'insert_portlet': insertPortlet,
-  'move_element': moveElement
+  'insert portlet': insertPortlet,
+  'move element': moveElement,
+  'edit element': editElement
 });
 
+
+

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      Thu Apr 
13 00:00:36 2006
@@ -338,13 +338,13 @@
            {'type': 'item',
             'label': _('Edit'),
             'icon': '/++skin++cpsskins/@@/++resource++edit-16.png',
-            'action': 'edit',
+            'action': 'edit element',
             'visible': 'editable',
            },
            {'type': 'item',
             'label': _('Duplicate'),
             'icon': '/++skin++cpsskins/@@/++resource++duplicate-16.png',
-            'action': 'duplicate',
+            'action': 'duplicate element',
             'visible': 'editable',
            },
            {'type': 'separator',
@@ -352,12 +352,12 @@
            {'type': 'item',
             'label': _('Copy'),
             'icon': '/++skin++cpsskins/@@/++resource++copy-16.png',
-            'action': 'copy',
+            'action': 'copy element',
            },
            {'type': 'item',
             'label': _('Paste'),
             'icon': '/++skin++cpsskins/@@/++resource++paste-16.png',
-            'action': 'paste',
+            'action': 'paste element',
             'visible': 'editable',
            },
            {'type': 'separator',
@@ -367,7 +367,7 @@
             'visible': 'formattable',
             'items': [
               {'type': 'selection',
-               'action': 'format',
+               'action': 'format element',
                'choices': 'formats',
               },
             ]
@@ -377,7 +377,7 @@
            {'type': 'item',
             'label': _('Delete'),
             'icon': '/++skin++cpsskins/@@/++resource++delete-16.png',
-            'action': 'delete',
+            'action': 'delete element',
             'confirm': _('Deleting, are you sure?'),
            }
          ],
@@ -429,7 +429,7 @@
             'highlight': {
                 'duration': 800,
             },
-            'action': 'insert_portlet',
+            'action': 'insert portlet',
         },
     },
     'element-mover': {
@@ -451,15 +451,12 @@
             'highlight': {
                 'duration': 800,
             },
-            'action': 'move_element',
+            'action': 'move element',
         },
     },
     'menu-actions': {
         'id': 'menu-actions',
         'type': 'command',
-        'actions': {
-            'edit': 'displayChoice',
-        }
     },
     'show-hide-menu': {
         'id': 'show-hide-menu',

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 Thu Apr 13 
00:00:36 2006
@@ -2292,7 +2292,7 @@
     }
     /* notify the controller to take action */
     var info = {
-      "context": this.selected,
+      "target": this.selected,
       "publisher": this,
       "subscriber": this.controller,
       "options": {'action': action, 'choice': choice}

Modified: 
cpsskins/branches/jmo-perspectives/ui/screens/pagedesigner/filters/portlet.pt
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/screens/pagedesigner/filters/portlet.pt   
    (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/screens/pagedesigner/filters/portlet.pt   
    Thu Apr 13 00:00:36 2006
@@ -1,3 +1,11 @@
+<!-- for testing: move to a view -->
+<ins class="model">
+{"id": "m1",
+ "data": {
+   "editable":true
+}}
+</ins>
+
 <div class="elementMovable elementShiftable portletTarget"
   tal:define="
     info options/info;
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to