Author: jmorliaguet
Date: Sat Oct 29 18:07:31 2005
New Revision: 28803

Added:
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.css
      - copied unchanged from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/authoring.css
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.js
      - copied, changed from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/authoring.js
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.py
      - copied, changed from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/authoring.py
   
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring_macros.pt
      - copied, changed from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/authoring_macros.pt
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/jsonrpc.py
      - copied, changed from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/jsonrpc.py
   z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/__init__.py   
(contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/configure.zcml   
(contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/content_author.css
      - copied unchanged from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/content_authoring.css
   
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/content_author.pt
      - copied, changed from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/content_authoring.pt
   
z3lab/cpsskins/branches/jmo-perspectives/engines/default/filters/style/jsonrpc.py
   (contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/engines/interfaces.py   (contents, 
props changed)
   z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/__init__.py  
 (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/configure.zcml  
 (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.css
   (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.pt
   (contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/__init__.py   
(contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/configure.zcml
      - copied, changed from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/page/configure.zcml
   
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.css
      - copied unchanged from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/page_authoring.css
   
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.pt  
 (contents, props changed)
Removed:
   z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/content/
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/page/
Modified:
   z3lab/cpsskins/branches/jmo-perspectives/browser/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/engines/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml
Log:

- saving work



Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/configure.zcml     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/configure.zcml     Sat Oct 
29 18:07:31 2005
@@ -186,8 +186,6 @@
 
   <include package=".editing" />
 
-  <include package=".authoring" />
-
   <include package=".icons" />
 
   <include package=".manager" />

Modified: z3lab/cpsskins/branches/jmo-perspectives/engines/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/__init__.py        
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/__init__.py        Sat Oct 
29 18:07:31 2005
@@ -16,6 +16,4 @@
 $Id$
 """
 __docformat__ = "reStructuredText"
-# make this directory a package
 
-pass

Modified: z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/__init__.py      
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/__init__.py      
Sat Oct 29 18:07:31 2005
@@ -16,6 +16,3 @@
 $Id$
 """
 __docformat__ = "reStructuredText"
-# make this directory a package
-
-pass

Copied: z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.js 
(from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/authoring.js)
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/authoring.js     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.js     
Sat Oct 29 18:07:31 2005
@@ -90,7 +90,6 @@
   var rendered = themeEditor.renderElement(
     id = id,
     engine = 'page-authoring',
-    canvas_mode = themeEditor.getCanvasMode()
   );
   var tag = getFirstTag(rendered);
   var wrapper = document.createElement(tag);

Copied: z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.py 
(from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/authoring.py)
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/authoring.py     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.py     
Sat Oct 29 18:07:31 2005
@@ -37,12 +37,6 @@
     def draw():
         """ """
 
-    def getCanvasMode():
-        """ """
-
-    def setCanvasMode(mode):
-        """ """
-
     def setPerspective(perspective):
         """ """
 
@@ -70,27 +64,6 @@
         viewer = getMultiAdapter((self.context, self.request), IViewer)
         return viewer(**kw)
 
-    def getCanvasMode(self):
-        """Get the canvas view mode
-        """
-        request = self.request
-        pkg_id = 'cpsskins'
-        session = ISession(request)[pkg_id]
-        try:
-            mode = session['canvas_mode']
-        except KeyError:
-            mode = None
-        return mode
-
-    def setCanvasMode(self, mode=None):
-        """Set the canvas view mode
-        """
-        pkg_id = 'cpsskins'
-        session = ISession(self.request)[pkg_id]
-        if mode is not None:
-            session['canvas_mode'] = mode
-        self._redirect()
-
     def setPerspective(self, perspective=''):
         """Set the perspective
         """

Copied: 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring_macros.pt 
(from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/authoring_macros.pt)
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/authoring_macros.pt  
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring_macros.pt  
    Sat Oct 29 18:07:31 2005
@@ -40,19 +40,6 @@
   </table>
 </metal:block>
 
-<metal:block define-macro="canvas_modes" i18n:domain="cpsskins">
-  <div class="actionPad"
-       tal:define="actions 
current_theme/@@view_get_menu/cpsskins_page_authoring_modes"
-       tal:condition="actions">
-     <a href="#"
-        tal:repeat="info actions"
-        tal:attributes="href info/action;
-                        class info/selected"
-        tal:content="info/title"
-        i18n:translate="" />
-  </div>
-</metal:block>
-
 <metal:block define-macro="perspective_selector" i18n:domain="cpsskins">
   <form class="perspective" title="Perspective selector" 
i18n:attributes="title"
         action="@@setPerspective" method="post"

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/configure.zcml   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/configure.zcml   
Sat Oct 29 18:07:31 2005
@@ -1,5 +1,7 @@
 <configure
-    xmlns="http://namespaces.zope.org/zope";>
+    xmlns="http://namespaces.zope.org/zope";
+    xmlns:browser="http://namespaces.zope.org/browser";
+    xmlns:jsonrpc="http://namespaces.zope.org/jsonrpc";>
 
   <include package=".icons" />
 
@@ -7,14 +9,81 @@
 
   <include package=".framework" />
 
-
-  <!-- Page authoring (theme designer, page designer) -->
-
-  <include package=".page" />
-
-
-  <!-- Content authoring (content author)-->
-
-  <include package=".content" />
+  <browser:resource
+      name="authoring.css" file="authoring.css"
+      layer="cpsskins" />
+
+  <browser:resource
+      name="authoring.js" file="authoring.js"
+      layer="cpsskins" />
+
+  <browser:page
+      for="*"
+      name="authoring_macros"
+      permission="zope.Public"
+      template="authoring_macros.pt"
+  />
+
+  <browser:menu
+       id="cpsskins_authoring_actions"
+       title="Authoring actions."
+  />
+
+
+  <browser:pages
+      for="cpsskins.elements.IElement"
+      layer="cpsskins"
+      permission="zope.ManageContent"
+      class=".authoring.Authoring">
+
+      <browser:page
+          name="setPerspective"
+          attribute="setPerspective"
+      />
+
+      <browser:page
+          name="clonePresentation"
+          attribute="clonePresentation"
+      />
+
+      <browser:page
+          name="addPresentation"
+          attribute="addPresentation"
+      />
+
+      <browser:page
+          name="removePresentation"
+          attribute="removePresentation"
+      />
+
+      <browser:page
+          name="customizeFormat"
+          attribute="customizeFormat"
+      />
+
+      <browser:page
+          name="uncustomizeFormat"
+          attribute="uncustomizeFormat"
+      />
+
+  </browser:pages>
+
+
+  <!-- JSON-RPC views -->
+
+  <jsonrpc:view
+      class=".jsonrpc.Methods"
+      for="*"
+      permission="zope.ManageContent"
+      methods="addElement editElement moveElement
+               reorderElement deleteElement duplicateElement"
+  />
+
+  <jsonrpc:view
+      class=".jsonrpc.Methods"
+      for="*"
+      permission="zope.Public"
+      methods="renderElement"
+  />
 
 </configure>

Copied: z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/jsonrpc.py 
(from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/jsonrpc.py)
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/jsonrpc.py       
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/jsonrpc.py       
Sat Oct 29 18:07:31 2005
@@ -153,7 +153,3 @@
         duplicating = getMultiAdapter((container, request), INodeDuplicating)
         return duplicating.duplicate(element)
 
-    def getCanvasMode(self):
-        """Get the canvas view mode
-        """
-        return Editor.getCanvasMode()

Modified: z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml     Sat Oct 
29 18:07:31 2005
@@ -1,10 +1,16 @@
 <configure
     xmlns="http://namespaces.zope.org/zope";>
 
+  <!-- default engine (HTML) -->
 
-  <!-- content authoring -->
+  <include package=".default" />
 
-  <include package=".contentauthor" />
+  <include package=".authoring" />
+
+
+  <!-- layout designer -->
+
+  <include package=".layoutdesigner" />
 
 
   <!-- page designer -->
@@ -12,19 +18,13 @@
   <include package=".pagedesigner" />
 
 
-  <!-- layout designer -->
+  <!-- content author -->
 
-  <include package=".layoutdesigner" />
+  <include package=".contentauthor" />
 
 
   <!-- JSR168-like portlets -->
 
   <include package=".jsr168" />
 
-
-  <!-- default engine (HTML) -->
-
-  <include package=".default" />
-
-
 </configure>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/__init__.py
==============================================================================
--- (empty file)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/__init__.py  
Sat Oct 29 18:07:31 2005
@@ -0,0 +1,24 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from cpsskins.engines.interfaces import IEngine
+from cpsskins.engines.authoring.authoring import Authoring
+
+class IContentAuthoring(IEngine):
+    """A rendering engine for content authoring"""

Added: 
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/configure.zcml
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/configure.zcml   
    Sat Oct 29 18:07:31 2005
@@ -0,0 +1,101 @@
+<configure
+    xmlns:browser="http://namespaces.zope.org/browser";
+    xmlns="http://namespaces.zope.org/cpsskins";>
+
+  <browser:page
+      name="content-author.html"
+      class=".Authoring"
+      for="cpsskins.elements.interfaces.ITheme"
+      template="content_author.pt"
+      permission="zope.Public"
+      layer="cpsskins"
+  />
+
+  <browser:page
+      name="content-author.html"
+      class=".Authoring"
+      for="cpsskins.elements.interfaces.IThemePage"
+      template="content_author.pt"
+      permission="zope.Public"
+      layer="cpsskins"
+  />
+
+  <browser:menuItems
+      menu="cpsskins_authoring_actions"
+      for="*">
+
+      <menuItem
+          title="Content author"
+          action="@@content-author.html"
+      />
+
+  </browser:menuItems>
+
+
+  <!-- Engine -->
+
+  <engine
+      name="content-author"
+  />
+
+  <renderer
+      for="cpsskins.elements.interfaces.ITheme"
+      engine="content-author"
+  />
+
+  <renderer
+      for="cpsskins.elements.interfaces.IThemePage
+           cpsskins.elements.interfaces.IPageBlock
+           cpsskins.elements.interfaces.ICell"
+      engine="content-author"
+      >
+
+    <filter
+        name="widget"
+    />
+
+    <filter
+        name="layout"
+    />
+
+    <filter
+        name="style"
+    />
+
+  </renderer>
+
+  <renderer
+      for="cpsskins.elements.interfaces.ISlot"
+      engine="content-author"
+      >
+
+    <filter
+        name="slot editor (content author)"
+    />
+
+  </renderer>
+
+  <renderer
+      for="cpsskins.elements.interfaces.IPortlet"
+      engine="content-author"
+      >
+
+    <filter
+        name="effect"
+    />
+
+    <filter
+        name="widget"
+    />
+
+    <filter
+        name="style"
+    />
+
+    <filter
+        name="portlet editor (content author)"
+    />
+
+  </renderer>
+
+</configure>

Copied: 
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/content_author.pt
 (from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/content_authoring.pt)
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/content_authoring.pt 
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/content_author.pt
    Sat Oct 29 18:07:31 2005
@@ -5,7 +5,7 @@
                   effective_page python:tmutil.getEffectivePage(context, 
request)">
   <head>
     <link rel="Stylesheet" type="text/css"
-          href="/++skin++cpsskins/@@/++resource++content_authoring.css" />
+          href="/++skin++cpsskins/@@/++resource++content_author.css" />
     <link rel="Stylesheet" type="text/css"
           href="/++skin++cpsskins/@@/++resource++authoring.css" />
     <link rel="Stylesheet" type="text/css"
@@ -36,7 +36,7 @@
       <metal:block use-macro="context/@@authoring_macros/pagetabs" />
       <tal:block content="structure python: view.draw(
                                     location=context,
-                                    engine='content-authoring')" />
+                                    engine='content-author')" />
     </div>
 
     <metal:block use-macro="context/@@authoring_macros/authoring_footer" />

Added: 
z3lab/cpsskins/branches/jmo-perspectives/engines/default/filters/style/jsonrpc.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/default/filters/style/jsonrpc.py
   Sat Oct 29 18:07:31 2005
@@ -0,0 +1,92 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from zope.app.container.btree import BTreeContainer
+from zope.component import adapts, getUtility
+from zope.interface import implements
+
+from jsonserver.interfaces import IJSONRPCPublisher
+
+from cpsskins.configuration.interfaces import IRegistry
+
+widget_registry = getUtility(IRegistry, 'widgets')
+
+class Methods(object):
+    """JSON-RPC methods
+
+    >>> s = Style()
+    >>> s['div.body'] = {'color': 'red'}
+    >>> s[''] = {'color': 'blue'}
+
+    >>> methods = Methods(s, None)
+    >>> methods.getWidgetStyle()
+    {u'': {'color': 'blue'}, u'div.body': {'color': 'red'}}
+
+    >>> methods.getSelectorStyle('')
+    {'color': 'blue'}
+
+    >>> methods.getSelectorStyle('div.body')
+    {'color': 'red'}
+
+    >>> methods.setSelectorStyle('', {"border": "none", "font-style": 
"normal"})
+    >>> methods.getSelectorStyle('')
+    {'border': 'none', 'font-style': 'normal'}
+
+    >>> methods.delSelectorStyle('')
+    >>> methods.getWidgetStyle()
+    {u'div.body': {'color': 'red'}}
+    """
+
+    implements(IJSONRPCPublisher)
+
+    def __init__(self, context, request):
+        self.context = context
+        self.request = request
+
+    def getWidgetStyle(self):
+        return dict(self.context)
+
+    def getSelectorStyle(self, k):
+        return self.context.get(k)
+
+    def setSelectorStyle(self, k, v):
+        self.context[k] = v
+
+    def delSelectorStyle(self, k):
+        if k in self.context:
+            del self.context[k]
+
+    def getFieldRange(self, widget_id, sel):
+        # TODO: this is for testing
+        return {
+            'color': [],
+            'background-color': [],
+            'padding': [],
+            'margin': [],
+            'font-family': ['arial, sans-serif', 'verdana', 'MS trebuchet'],
+            'font-size': ['0.8em', '12px', '13px'],
+            'border': ['1px solid #f0f0f0', 'none', '1px inset gray'],
+            }
+
+    def renderPreview(self, widget_id):
+        """Render a style preview based on the specified widget"""
+
+        widget_factory = widget_registry.get(widget_id)['factory']
+        return widget_factory(None, None).renderPreview()
+

Added: z3lab/cpsskins/branches/jmo-perspectives/engines/interfaces.py
==============================================================================
--- (empty file)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/interfaces.py      Sat Oct 
29 18:07:31 2005
@@ -0,0 +1,25 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+from zope.interface.interfaces import IInterface
+
+class IEngine(IInterface):
+    """A type interface for identifying engines"""
+

Added: 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/__init__.py
==============================================================================
--- (empty file)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/__init__.py 
Sat Oct 29 18:07:31 2005
@@ -0,0 +1,25 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from cpsskins.engines.interfaces import IEngine
+from cpsskins.engines.authoring.authoring import Authoring
+
+class IPageAuthoring(IEngine):
+    """A rendering engine for page authoring"""
+

Added: 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/configure.zcml
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/configure.zcml  
    Sat Oct 29 18:07:31 2005
@@ -0,0 +1,76 @@
+<configure
+    xmlns:browser="http://namespaces.zope.org/browser";
+    xmlns:cpsskins="http://namespaces.zope.org/cpsskins";>
+
+  <browser:page
+      name="layout-designer.html"
+      class=".Authoring"
+      for="cpsskins.elements.interfaces.ITheme"
+      template="layout_designer.pt"
+      permission="zope.Public"
+      layer="cpsskins"
+  />
+
+  <browser:menuItems
+      menu="cpsskins_authoring_actions"
+      for="*">
+
+      <menuItem
+          title="Layout designer"
+          action="@@layout-designer.html"
+      />
+
+  </browser:menuItems>
+
+
+  <!-- Engine -->
+
+  <cpsskins:engine
+      name="layout-designer"
+  />
+
+  <cpsskins:renderer
+      for="cpsskins.elements.interfaces.ITheme"
+      engine="layout-designer"
+  />
+
+  <cpsskins:renderer
+      for="cpsskins.elements.interfaces.IThemePage
+           cpsskins.elements.interfaces.IPageBlock
+           cpsskins.elements.interfaces.ICell"
+      engine="layout-designer"
+      >
+
+    <cpsskins:filter
+        name="layout editor"
+    />
+
+    <cpsskins:filter
+        name="style"
+    />
+
+  </cpsskins:renderer>
+
+  <cpsskins:renderer
+      for="cpsskins.elements.interfaces.ISlot"
+      engine="layout-designer"
+      >
+
+    <cpsskins:filter
+        name="slot editor (page designer)"
+    />
+
+  </cpsskins:renderer>
+
+  <cpsskins:renderer
+      for="cpsskins.elements.interfaces.IPortlet"
+      engine="layout-designer"
+      >
+
+    <cpsskins:filter
+        name="portlet editor (layout designer)"
+    />
+
+  </cpsskins:renderer>
+
+</configure>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.css
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.css
 Sat Oct 29 18:07:31 2005
@@ -0,0 +1,158 @@
+
+
+/* Page blocks */
+.pageBlockEdit {
+  margin-top: 30px; 
+  margin-bottom: 1px; 
+  margin-left: 1px; 
+  margin-right: 1px; 
+}
+
+.pageBlockEditHeader a, .pageBlockEditHeaderSelected a {
+  text-decoration: none;
+}
+
+.pageBlockEditHeader, .pageBlockEditHeaderSelected {
+  background-color: #e9ff30;
+  text-align: center; 
+  border-style: solid; 
+  border-width: 2px;
+  border-color: #bbe #669 #669 #bbe;
+  padding: 4px;
+  vertical-align: middle;
+  color: #000;
+}
+
+.pageBlockEditHeader label, .pageBlockEditHeaderSelected label {
+  padding-left: 1em;
+}
+
+.pageBlockEditHeader form, .pageBlockEditHeaderSelected form {
+  padding: 0x;
+  margin: 0;
+}
+
+.pageBlockEditHeader input, .pageBlockEditHeaderSelected input {
+  text-align: center;
+  background-color: #ffffdd;
+  border: 1px dotted #666;
+}
+
+.pageBlockEditHeaderSelected {
+  border-color: #f00;
+  background-color: #ccff33;
+  border-width: 2px;
+}
+
+.pageBlockEditHeader:hover {
+  background-color: #fcff00;
+}
+
+.pageBlockAddButton {
+  padding: 4px; 
+  text-align: left; 
+  margin-top: 5px;
+  margin-bottom: 5px;
+}
+
+
+/* cell */
+.sizer {
+  padding: 0;
+  margin: 0;
+  height: 25px;
+  background: url(/++skin++cpsskins/@@/sizer_line.png); 
+  background-repeat: repeat-x;
+  background-position: center top;
+  text-align: center; 
+}
+.sizer .left {
+  float: left;
+  margin-left: 1px;
+  background: url(/++skin++cpsskins/@@/sizer_left.png); 
+  background-repeat: no-repeat; 
+  height: 10px;
+  width: 7px;
+}
+
+.sizer .right {
+  float: right;
+  margin-right: 1px;
+  background: url(/++skin++cpsskins/@@/sizer_right.png); 
+  background-repeat: no-repeat; 
+  height: 10px;
+  width: 7px;
+}
+
+.sizer input {
+  border: none;
+  background-color: white;
+  text-align: center;
+}
+
+.cellEditHeader {
+  background-color: #e6e6e6;
+  border-width: 1px !important;
+  border-style: solid !important;
+  border-color: #bbb #666 #666 #bbb !important;
+  text-align: center;
+  background-image: url(/++skin++cpsskins/@@/bg_cellgrip.png);
+  padding: 0 !important;
+  margin: 5px 0 5px 0 !important;
+}
+
+.cellEditHeader form {
+  padding: 0;
+  margin: 0;
+}
+
+.cellEditHeader input {
+  border: none;
+  font: bold 11px Arial, Sans-Serif;
+  text-align: center;
+  background-color: #e3e3e3;
+  color: #666;
+  width: 40%;
+}
+
+.cellEditHeader:hover {
+  background-color: #eee;
+}
+
+.cellEditHeader input:hover {
+  background-color: #fff;
+}
+
+.cellEmpty {
+  border: 1px dotted #999;
+  background-color: #fff;
+  padding: 10px;
+  text-align: center;
+  color: #333;
+}
+
+
+/* Slots */
+.slotFrame {
+  border: 1px solid #666 !important;
+  margin: 0 !important;
+  padding: 0 !important;
+}
+
+.slotFrame .title {
+  text-align: center;
+  background-color: #fc0;
+  font: bold 12px Trebuchet MS, Verdana, Arial, Sans-Serif;
+  color: #000;
+  margin: 0;
+  padding: 0;
+  border: none;
+}
+
+.slotFrame .body {
+  background-color: #ffc;
+  padding: 0.5em;
+  font: italic 11px Verdana, Arial, Sans-Serif;
+  margin: 0;
+  border: none;
+}

Added: 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.pt
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.pt
  Sat Oct 29 18:07:31 2005
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"
+  tal:define="tmutil context/@@getThemeManager;
+              current_theme python:tmutil.getThemeInContext(context);
+              effective_page python:tmutil.getEffectivePage(context, request)">
+  <head>
+    <link rel="Stylesheet" type="text/css"
+          href="/++skin++cpsskins/@@/++resource++layout_designercss" />
+    <link rel="Stylesheet" type="text/css"
+          href="/++skin++cpsskins/@@/++resource++authoring.css" />
+    <link rel="Stylesheet" type="text/css"
+          href="/++skin++cpsskins/@@/++resource++widgets.css" />
+    <link rel="Stylesheet" type="text/css" href="./renderCSS" />
+
+    <script type="text/javascript"
+            src="/@@/jsolait/init.js"></script>
+    <script type="text/javascript"
+            src="/++skin++cpsskins/@@/++resource++utils.js"></script>
+    <script type="text/javascript"
+            src="/++skin++cpsskins/@@/++resource++pdlib.js"></script>
+    <script type="text/javascript"
+            src="/++skin++cpsskins/@@/++resource++authoring.js"></script>
+  </head>
+  <body>
+
+    <div class="floatingHeader">
+      <div id="message-box"></div>
+      <metal:block use-macro="context/@@authoring_macros/perspective_selector" 
/>
+      <metal:block use-macro="context/@@authoring_macros/navigation_pad" />
+    </div>
+    <div class="floatingHeader2">
+      <metal:block use-macro="context/@@authoring_macros/add_content_panel" />
+    </div>
+
+    <div id="editSpace">
+      <metal:block use-macro="context/@@authoring_macros/themetabs" />
+      <metal:block use-macro="context/@@authoring_macros/pagetabs" />
+      <tal:block content="structure python: view.draw(
+                          location=context,
+                          engine='layout-designer')" />
+    </div>
+
+    <metal:block use-macro="context/@@authoring_macros/authoring_footer" />
+  </body>
+</html>

Added: z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/__init__.py
==============================================================================
--- (empty file)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/__init__.py   
Sat Oct 29 18:07:31 2005
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from cpsskins.engines.interfaces import IEngine
+
+from cpsskins.engines.authoring.authoring import Authoring
+
+class IPageAuthoring(IEngine):
+    """A rendering engine for page authoring"""
+

Copied: 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/configure.zcml 
(from r28801, 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/page/configure.zcml)
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/page/configure.zcml  
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/configure.zcml    
    Sat Oct 29 18:07:31 2005
@@ -1,20 +1,42 @@
 <configure
+    xmlns:browser="http://namespaces.zope.org/browser";
     xmlns="http://namespaces.zope.org/cpsskins";>
 
+  <browser:page
+      name="page-designer.html"
+      class=".Authoring"
+      for="cpsskins.elements.interfaces.ITheme"
+      template="page_designer.pt"
+      permission="zope.Public"
+      layer="cpsskins"
+  />
+
+  <browser:menuItems
+      menu="cpsskins_authoring_actions"
+      for="*">
+
+      <menuItem
+          title="Page designer"
+          action="@@page-designer.html"
+      />
+
+  </browser:menuItems>
+
+
   <engine
-      name="page-authoring"
+      name="page-designer"
   />
 
   <renderer
       for="cpsskins.elements.interfaces.ITheme"
-      engine="page-authoring"
+      engine="page-designer"
   />
 
   <renderer
       for="cpsskins.elements.interfaces.IThemePage
            cpsskins.elements.interfaces.IPageBlock
            cpsskins.elements.interfaces.ICell"
-      engine="page-authoring"
+      engine="page-designer"
       >
 
     <filter
@@ -29,18 +51,18 @@
 
   <renderer
       for="cpsskins.elements.interfaces.ISlot"
-      engine="page-authoring"
+      engine="page-designer"
       >
 
     <filter
-        name="slot editor (page authoring)"
+        name="slot editor (page designer)"
     />
 
   </renderer>
 
   <renderer
       for="cpsskins.elements.interfaces.IPortlet"
-      engine="page-authoring"
+      engine="page-designer"
       >
 
     <filter
@@ -56,7 +78,7 @@
     />
 
     <filter
-        name="portlet editor (page authoring)"
+        name="portlet editor (page designer)"
     />
 
   </renderer>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.pt
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.pt  
    Sat Oct 29 18:07:31 2005
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"
+  tal:define="tmutil context/@@getThemeManager;
+              current_theme python:tmutil.getThemeInContext(context);
+              effective_page python:tmutil.getEffectivePage(context, request)">
+  <head>
+    <link rel="Stylesheet" type="text/css"
+          href="/++skin++cpsskins/@@/++resource++page_designer.css" />
+    <link rel="Stylesheet" type="text/css"
+          href="/++skin++cpsskins/@@/++resource++authoring.css" />
+    <link rel="Stylesheet" type="text/css"
+          href="/++skin++cpsskins/@@/++resource++widgets.css" />
+    <link rel="Stylesheet" type="text/css" href="./renderCSS" />
+
+    <script type="text/javascript"
+            src="/@@/jsolait/init.js"></script>
+    <script type="text/javascript"
+            src="/++skin++cpsskins/@@/++resource++utils.js"></script>
+    <script type="text/javascript"
+            src="/++skin++cpsskins/@@/++resource++pdlib.js"></script>
+    <script type="text/javascript"
+            src="/++skin++cpsskins/@@/++resource++authoring.js"></script>
+  </head>
+  <body>
+
+    <div class="floatingHeader">
+      <div id="message-box"></div>
+      <metal:block use-macro="context/@@authoring_macros/perspective_selector" 
/>
+      <metal:block use-macro="context/@@authoring_macros/navigation_pad" />
+    </div>
+    <div class="floatingHeader2">
+      <metal:block use-macro="context/@@authoring_macros/add_content_panel" />
+    </div>
+
+    <div id="editSpace">
+      <metal:block use-macro="context/@@authoring_macros/themetabs" />
+      <metal:block use-macro="context/@@authoring_macros/pagetabs" />
+      <tal:block content="structure python: view.draw(
+                          location=context,
+                          engine='page-designer')" />
+    </div>
+
+    <metal:block use-macro="context/@@authoring_macros/authoring_footer" />
+  </body>
+</html>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to