Author: jmorliaguet
Date: Fri May 12 13:42:13 2006
New Revision: 3106

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

Log:

- stylesheet is now getting reloaded (added a StyleSheet widget)



Modified: cpsskins/branches/paris-sprint-2006/ui/authoring/authoring.js
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/authoring/authoring.js       
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/authoring/authoring.js       Fri May 
12 13:42:13 2006
@@ -73,5 +73,25 @@
   'edit element': editElement
 });
 
+/* Register widgets */
+CPSSkins.registerWidgets({
 
+  'stylesheet': function(def) {
+    var widget = CPSSkins.Canvas.createNode({
+      tag: "link",
+      attributes: {'rel': 'stylesheet', 'type': 'text/css'}
+    });
+    return new StyleSheet(widget, def);
+  }
+
+});
+
+StyleSheet = Class.create();
+StyleSheet.prototype = Object.extend(new CPSSkins.View(), {
+
+  render: function(data) {
+    this.widget.href = './renderCSS?timestamp=' + new Date().getTime();
+  }
+
+});
 

Modified: cpsskins/branches/paris-sprint-2006/ui/authoring/definitions.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/authoring/definitions.py     
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/authoring/definitions.py     Fri May 
12 13:42:13 2006
@@ -160,12 +160,12 @@
     'stylesheet': {
         'id': 'stylesheet',
         'widget': {
-            'type': 'panel',
+            'type': 'stylesheet',
         },
         'model': 'stylesheet',
         'perspectives': ['page-designer', 'layout-designer', 'content-author',
                          'element-editor'],
-        'controllers': ['main-editor-perspectives'],
+        'controllers': ['main-editor-perspectives', 'element-editor-actions'],
     },
 
     # Top area

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/editor.pt
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/editor.pt    (original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/editor.pt    Fri May 12 
13:42:13 2006
@@ -14,12 +14,12 @@
     <script type="text/javascript" src="++resource++cpsskins.js"></script>
     <script type="text/javascript" src="++resource++authoring.js"></script>
 
-  </head>
-  <body>
-
     <ins class="model" cite="@@getModel?id=stylesheet"></ins>
     <ins class="view" cite="@@getView?id=stylesheet"></ins>
 
+  </head>
+  <body>
+
     <div class="floatingHeader">
       <ins class="model" cite="@@getModel?id=action-pad"></ins>
       <ins class="view" cite="@@getView?id=action-pad"></ins>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to