Author: jmorliaguet
Date: Thu Jun 15 01:14:02 2006
New Revision: 3413

Modified:
   cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js
   cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py

Log:

- implemented copy / paste



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  Thu Jun 
15 01:14:02 2006
@@ -5,8 +5,7 @@
   'preset-editor');
 }
 
-function insertPortlet(info) {
-  var url = '@@insertElement';
+function insertElement(info) {
   var id = info.target.getAttribute('id');
   var model = CPSSkins.getModelById('m' + id)
   if (!model) return;
@@ -21,11 +20,10 @@
     parameters: $H(args).toQueryString(),
     onComplete: function(req) {info.controller.refreshViews();}
   };
-  new Ajax.Request(url, options);
+  new Ajax.Request('@@insertElement', options);
 }
 
 function moveElement(info) {
-  var url = '@@moveElement';
   var id = info.target.getAttribute('id');
   var data = CPSSkins.getModelById('m' + id).getData();
   var args = {
@@ -37,7 +35,7 @@
     parameters: $H(args).toQueryString(),
     onComplete: function(req) {info.controller.refreshViews();}
   };
-  new Ajax.Request(url, options);
+  new Ajax.Request('@@moveElement', options);
 }
 
 function editElement(info) {
@@ -58,7 +56,6 @@
 }
 
 function duplicateElement(info) {
-  var url = '@@duplicateElement';
   var data = info.model.getData();
   var args = {
     id: data.id
@@ -67,11 +64,33 @@
     parameters: $H(args).toQueryString(),
     onComplete: function(req) {info.controller.refreshViews();}
   }
-  new Ajax.Request(url, options);
+  new Ajax.Request('@@duplicateElement', options);
+}
+
+function copyElement(info) {
+  var data = info.model.getData();
+  var args = {
+    id: data.id
+  }
+  var options = {
+    parameters: $H(args).toQueryString()
+  }
+  new Ajax.Request('@@copyElement', options);
+}
+
+function pasteElement(info) {
+  var data = info.model.getData();
+  var args = {
+    id: data.id
+  }
+  var options = {
+    parameters: $H(args).toQueryString(),
+    onComplete: function(req) {info.controller.refreshViews();}
+  }
+  new Ajax.Request('@@pasteElement', options);
 }
 
 function deleteElement(info) {
-  var url = '@@deleteElement'
   var data = info.model.getData();
   var args = {
     id: data.id
@@ -80,14 +99,16 @@
     parameters: $H(args).toQueryString(),
     onComplete: function(req) {info.controller.refreshViews();}
   }
-  new Ajax.Request(url, options);
+  new Ajax.Request('@@deleteElement', options);
 }
 
 /* Register actions */
 CPSSkins.addActions({
-  'insert portlet': insertPortlet,
+  'insert element': insertElement,
   'move element': moveElement,
   'duplicate element': duplicateElement,
+  'copy element': copyElement,
+  'paste element': pasteElement,
   'delete element': deleteElement,
   'edit element': editElement,
   'edit format': editFormat,

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py       
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py       Thu Jun 
15 01:14:02 2006
@@ -596,7 +596,7 @@
             'highlight': {
                 'duration': 800,
             },
-            'action': 'insert portlet',
+            'action': 'insert element',
         },
     },
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to