[Z3lab-checkins] r2484 - cpsskins/branches/jmo-perspectives/ui/framework/tests/functional
Author: jmorliaguet Date: Mon Feb 27 13:50:34 2006 New Revision: 2484 Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel1.css cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel2.css cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel3.css Log: - cosmetic Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel1.css == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel1.css (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel1.css Mon Feb 27 13:50:34 2006 @@ -1,10 +1,10 @@ .panel1 { - background-color: #fec; - padding: 0.5em; + background-color: #fd8; + padding: 0.8em; color: red; - margin: 0.5em; - border: 2px solid red; + margin: 0.2em; + border: 1px solid #f99; } .panel1 h2 { Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel2.css == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel2.css (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel2.css Mon Feb 27 13:50:34 2006 @@ -4,6 +4,7 @@ padding: 1em; color: #00c; margin: 0.5em; + border: 1px solid #cfc; } .panel2 h2 { Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel3.css == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel3.css (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel3.css Mon Feb 27 13:50:34 2006 @@ -1,7 +1,7 @@ .panel3 { - background-color: #ffc; - border: 1px solid #090; + background-color: #efc; + border: 1px solid #9c9; padding: 0.5em; color: green; margin: 1em; -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins
[Z3lab-checkins] r2485 - in cpsskins/branches/jmo-perspectives/ui/framework/tests: functional unit zope3/functional/chat zope3/unit
Author: jmorliaguet Date: Mon Feb 27 14:06:15 2006 New Revision: 2485 Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_navpanel_test.html cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_progressive_enhancement.html cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_widget_template_test.html cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/chat/cpsskins_chat.pt cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/unit/cpsskins_storage_adapters.pt Log: - the ram type of storage is used by default if none is specified. Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_navpanel_test.html == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_navpanel_test.html (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_navpanel_test.html Mon Feb 27 14:06:15 2006 @@ -47,9 +47,6 @@ {id: panel1, data: { url: panel1.html -}, -storage: { - type: ram }} /ins @@ -57,9 +54,6 @@ {id: panel2, data: { url: panel2.html -}, -storage: { - type: ram }} /ins @@ -67,9 +61,6 @@ {id: panel3, data: { url: panel3.html -}, -storage: { - type: ram }} /ins @@ -77,9 +68,6 @@ {id: panel4, data: { url: panel4.html -}, -storage: { - type: ram }} /ins Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html Mon Feb 27 14:06:15 2006 @@ -45,9 +45,6 @@ data: { url: panel1.html, css: panel1.css - }, - storage: { - type: ram }} /ins @@ -56,9 +53,6 @@ data: { url: panel2.html, css: panel2.css - }, - storage: { - type: ram }} /ins @@ -67,9 +61,6 @@ data: { url: panel3.html, css: panel3.css - }, - storage: { - type: ram }} /ins @@ -78,9 +69,6 @@ data: { url: panel4.html, css: panel4.css - }, - storage: { - type: ram }} /ins @@ -89,9 +77,6 @@ data: { url: panel5.html, css: popup.css - }, - storage: { - type: ram }} /ins Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_progressive_enhancement.html == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_progressive_enhancement.html (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_progressive_enhancement.html Mon Feb 27 14:06:15 2006 @@ -45,11 +45,8 @@ /div ins class=model - {id: ram-data-provider, - data: , - storage: { - type: ram - } + {id: dummy, + data: }} /ins @@ -58,7 +55,7 @@ template: ajax_widget_template.pt, replace: htmlwidget }, - model: ram-data-provider, + model: dummy, render_effect: { transition: fadein }} Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_widget_template_test.html == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_widget_template_test.html (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_widget_template_test.html Mon Feb 27 14:06:15 2006 @@ -58,10 +58,6 @@ } ] } - }, - storage: { - type: ram - } }} /ins Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html Mon Feb 27 14:06:15 2006 @@ -77,9 +77,6 @@ {id: p1, data: { url: p1.html -}, -storage: { - type: ram }} /ins @@ -87,9 +84,6 @@ {id: p2, data: { url:
[Z3lab-checkins] r2486 - in cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3: . functional/aggregator functional/benchmarks functional/chat functional/forms functional/latency functional/tr
Author: jmorliaguet Date: Mon Feb 27 14:34:26 2006 New Revision: 2486 Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/__init__.py cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/configure.zcml cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/configure.zcml cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/benchmarks/configure.zcml cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/chat/configure.zcml cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/chat/cpsskins_chat.pt cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/configure.zcml cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/latency/configure.zcml cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/configure.zcml cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/treeview_widget.pt Log: - removed deprecation warning when registering layers / skins cpsskins-test was renamed as cpsskinsTest Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/__init__.py == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/__init__.py (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/__init__.py Mon Feb 27 14:34:26 2006 @@ -1,9 +1,9 @@ -from zope.publisher.interfaces.browser import ILayer, IDefaultBrowserLayer +from zope.publisher.interfaces.browser import IDefaultBrowserLayer from zope.publisher.interfaces.browser import IBrowserRequest -class ITestLayer(ILayer, IBrowserRequest): +class cpsskinsTest(IBrowserRequest): The test layer -class ITestSkin(ITestLayer, IDefaultBrowserLayer): +class ITestSkin(cpsskinsTest, IDefaultBrowserLayer): The test skin Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/configure.zcml == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/configure.zcml (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/configure.zcml Mon Feb 27 14:34:26 2006 @@ -1,16 +1,13 @@ configure + xmlns=http://namespaces.zope.org/zope; xmlns:browser=http://namespaces.zope.org/browser; - !-- Default cpsskins layer -- + !-- Test cpsskins skin -- - browser:layer - name=cpsskins-test - interface=.ITestLayer - / - - browser:skin - name=cpsskins-test - interface=.ITestSkin + interface + name=cpsskinsTest + interface=cpsskins.ui.framework.tests.zope3.ITestSkin + type=zope.publisher.interfaces.browser.IBrowserSkinType / include package=.functional / Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/configure.zcml == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/configure.zcml (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/configure.zcml Mon Feb 27 14:34:26 2006 @@ -3,7 +3,7 @@ browser:page for=* - layer=cpsskins-test + layer=cpsskins.ui.framework.tests.zope3.cpsskinsTest name=cpsskins_aggregator.html permission=zope.Public template=cpsskins_aggregator.pt @@ -11,14 +11,14 @@ browser:page for=* - layer=cpsskins-test + layer=cpsskins.ui.framework.tests.zope3.cpsskinsTest name=feedbox.html permission=zope.Public template=feedbox.pt / browser:pages - layer=cpsskins-test + layer=cpsskins.ui.framework.tests.zope3.cpsskinsTest for=* class=.browser.Views permission=zope.Public Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/benchmarks/configure.zcml == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/benchmarks/configure.zcml (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/benchmarks/configure.zcml Mon Feb 27 14:34:26 2006 @@ -3,14 +3,14 @@ browser:page for=* - layer=cpsskins-test + layer=cpsskins.ui.framework.tests.zope3.cpsskinsTest name=cpsskins_benchmarks.html permission=zope.Public template=cpsskins_benchmarks.pt / browser:pages - layer=cpsskins-test + layer=cpsskins.ui.framework.tests.zope3.cpsskinsTest for=* class=.browser.Views permission=zope.Public Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/chat/configure.zcml == ---
[Z3lab-checkins] r2487 - cpsskins/branches/jmo-perspectives/locales
Author: jmorliaguet Date: Mon Feb 27 14:47:59 2006 New Revision: 2487 Modified: cpsskins/branches/jmo-perspectives/locales/custom.pot Log: - i18n updates Modified: cpsskins/branches/jmo-perspectives/locales/custom.pot == --- cpsskins/branches/jmo-perspectives/locales/custom.pot (original) +++ cpsskins/branches/jmo-perspectives/locales/custom.pot Mon Feb 27 14:47:59 2006 @@ -52,3 +52,16 @@ msgid IMacroSlotPortlet msgstr +# Hints + +msgid hint-site-designer +msgstr + +msgid hint-layout-designer +msgstr + +msgid hint-page-designer +msgstr + +msgid hint-content-author +msgstr -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins
[Z3lab-checkins] r2488 - in cpsskins/branches/jmo-perspectives: . browser browser/negociation browser/skin portlets/macroslot ui/authoring ui/authoring/icons ui/authoring/images ui/default/filters/sty
Author: jmorliaguet Date: Mon Feb 27 14:49:18 2006 New Revision: 2488 Added: cpsskins/branches/jmo-perspectives/portlets/macroslot/skin.py (contents, props changed) Modified: cpsskins/branches/jmo-perspectives/__init__.py cpsskins/branches/jmo-perspectives/browser/configure.zcml cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml cpsskins/branches/jmo-perspectives/browser/skin/__init__.py cpsskins/branches/jmo-perspectives/browser/skin/configure.zcml cpsskins/branches/jmo-perspectives/portlets/macroslot/configure.zcml cpsskins/branches/jmo-perspectives/portlets/macroslot/portlet.py cpsskins/branches/jmo-perspectives/ui/authoring/configure.zcml cpsskins/branches/jmo-perspectives/ui/authoring/icons/configure.zcml cpsskins/branches/jmo-perspectives/ui/authoring/images/configure.zcml cpsskins/branches/jmo-perspectives/ui/default/filters/style/configure.zcml cpsskins/branches/jmo-perspectives/ui/editing/configure.zcml cpsskins/branches/jmo-perspectives/ui/editing/icons/configure.zcml cpsskins/branches/jmo-perspectives/ui/framework/configure.zcml cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/quiz/configure.zcml cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/unit/configure.zcml cpsskins/branches/jmo-perspectives/ui/panels/configure.zcml cpsskins/branches/jmo-perspectives/ui/screens/configure.zcml cpsskins/branches/jmo-perspectives/ui/screens/contentauthor/configure.zcml cpsskins/branches/jmo-perspectives/ui/screens/layoutdesigner/configure.zcml cpsskins/branches/jmo-perspectives/ui/screens/pagedesigner/configure.zcml cpsskins/branches/jmo-perspectives/ui/screens/sitedesigner/configure.zcml Log: - fixed the registration of the 'cpsskins' layer according to the new way of registering skins / layers Modified: cpsskins/branches/jmo-perspectives/__init__.py == --- cpsskins/branches/jmo-perspectives/__init__.py (original) +++ cpsskins/branches/jmo-perspectives/__init__.py Mon Feb 27 14:49:18 2006 @@ -21,3 +21,4 @@ # load profiles from cpsskins.profiles import default + Modified: cpsskins/branches/jmo-perspectives/browser/configure.zcml == --- cpsskins/branches/jmo-perspectives/browser/configure.zcml (original) +++ cpsskins/branches/jmo-perspectives/browser/configure.zcml Mon Feb 27 14:49:18 2006 @@ -12,7 +12,7 @@ menu=zmi_actions title=Add class=zope.app.container.browser.adding.Adding permission=zope.ManageContent - layer=cpsskins + layer=cpsskins.browser.skin.cpsskins page name=index.html template=skin/add.pt / page name=action.html attribute=action / @@ -47,7 +47,7 @@ !-- Cache view -- pages - layer=cpsskins + layer=cpsskins.browser.skin.cpsskins for=* class=.caching.ImageCacheView permission=zope.Public Modified: cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml == --- cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml (original) +++ cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml Mon Feb 27 14:49:18 2006 @@ -10,7 +10,7 @@ class=.views.NegociationView permission=zope.Public allowed_interface=.interfaces.INegociation - layer=cpsskins + layer=cpsskins.browser.skin.cpsskins / /configure Modified: cpsskins/branches/jmo-perspectives/browser/skin/__init__.py == --- cpsskins/branches/jmo-perspectives/browser/skin/__init__.py (original) +++ cpsskins/branches/jmo-perspectives/browser/skin/__init__.py Mon Feb 27 14:49:18 2006 @@ -18,14 +18,14 @@ __docformat__ = reStructuredText from zope.app.publisher.browser import applySkin -from zope.publisher.interfaces.browser import ILayer, IDefaultBrowserLayer +from zope.publisher.interfaces.browser import IDefaultBrowserLayer from zope.publisher.interfaces.browser import IBrowserRequest from cpsskins.utils import getThemeManager -class IDefaultLayer(ILayer, IBrowserRequest): -The default layer +class cpsskins(IBrowserRequest): +The default cpsskins layer -class IDefaultSkin(IDefaultLayer, IDefaultBrowserLayer): -The default skin +class IDefaultSkin(cpsskins, IDefaultBrowserLayer): +The default cpsskins skin Modified: cpsskins/branches/jmo-perspectives/browser/skin/configure.zcml == --- cpsskins/branches/jmo-perspectives/browser/skin/configure.zcml (original) +++ cpsskins/branches/jmo-perspectives/browser/skin/configure.zcml Mon Feb 27 14:49:18 2006 @@ -3,16 +3,12 @@
[Z3lab-checkins] r2489 - cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms
Author: jmorliaguet Date: Mon Feb 27 14:52:35 2006 New Revision: 2489 Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/cpsskins_form_validation.pt Log: - skin name fix Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/cpsskins_form_validation.pt == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/cpsskins_form_validation.pt (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/cpsskins_form_validation.pt Mon Feb 27 14:52:35 2006 @@ -17,7 +17,7 @@ href=/++skin++cpsskins/@@/++resource++cpsskins.css / link rel=stylesheet type=text/css -href=/++skin++cpsskins-test/@@/++resource++form.css / +href=/++skin++cpsskinsTest/@@/++resource++form.css / /head body -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins
[Z3lab-checkins] r2490 - in cpsskins/branches/jmo-perspectives/ui/framework: . tests/functional
Author: jmorliaguet Date: Mon Feb 27 15:19:03 2006 New Revision: 2490 Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html Log: - refactoring of the perspective infrastructure (sub-perspectives will be removed, instead views will be able to specify which controller to use to switch perspectives) - registered a new controller: perspective selector that controls a collection of views. 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 Mon Feb 27 15:19:03 2006 @@ -431,6 +431,10 @@ 'drag-and-drop': function(node, def) { return new CPSSkins.DragAndDropController(node, def); + }, + + 'perspective selector': function(node, def) { +return new CPSSkins.PerspectiveSelector(node, def); } }); @@ -609,6 +613,18 @@ }); +CPSSkins.PerspectiveSelector= Class.create(); +CPSSkins.PerspectiveSelector.prototype = Object.extend( + new CPSSkins.Controller(), { + + setup: function() { + }, + + register: function(view) { + } + +}); + // Identifiable DOM elements. if (!CPSSkins.Identifiable) { CPSSkins.Identifiable = new Object() } Object.extend(CPSSkins.Identifiable, { Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html Mon Feb 27 15:19:03 2006 @@ -36,6 +36,13 @@ Element editor/a /div + !-- perspective controller -- + ins class=controller + {id: perspective-selector1, + type: perspective selector + } + /ins + table style=width:100% tr style=vertical-align: top td colspan=3 @@ -72,20 +79,13 @@ }} /ins -ins class=model -{id: panel5, - data: { - url: panel5.html, - css: popup.css -}} -/ins - ins class=view {widget: { type: panel }, model: panel1, - perspectives: [page-designer, layout-designer] + perspectives: [page-designer, layout-designer], + controllers: [perspective-selector1] } /ins @@ -94,7 +94,8 @@ type: panel }, model: panel2, - perspectives: [site-designer] + perspectives: [site-designer], + controllers: [perspective-selector1] } /ins @@ -109,7 +110,8 @@ type: panel }, model: panel2, - perspectives: [page-designer] + perspectives: [page-designer], + controllers: [perspective-selector1] } /ins @@ -118,7 +120,8 @@ type: panel }, model: panel3, - perspectives: [site-designer, layout-designer] + perspectives: [site-designer, layout-designer], + controllers: [perspective-selector1] } /ins @@ -130,7 +133,8 @@ type: panel }, model: panel3, - perspectives: [page-designer] + perspectives: [page-designer], + controllers: [perspective-selector1] } /ins @@ -139,7 +143,8 @@ type: panel }, model: panel4, - perspectives: [page-designer] + perspectives: [page-designer], + controllers: [perspective-selector1] } /ins @@ -151,7 +156,8 @@ type: panel }, model: panel4, - perspectives: [site-designer, layout-designer] + perspectives: [site-designer, layout-designer], + controllers: [perspective-selector1] } /ins @@ -160,7 +166,8 @@ type: panel }, model: panel2, - perspectives: [site-designer] + perspectives: [site-designer], + controllers: [perspective-selector1] } /ins @@ -169,14 +176,6 @@ /tr /table - ins class=view - {widget: { - type: panel - }, - model: panel5, - perspectives: [element-editor] - } - /ins /body -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins
[Z3lab-checkins] r2491 - cpsskins/branches/jmo-perspectives/ui/framework
Author: jmorliaguet Date: Mon Feb 27 16:17:33 2006 New Revision: 2491 Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Log: - fix: a same controller may control several views. - PerspectiveSelector: we register which views are visible for each perspective. 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 Mon Feb 27 16:17:33 2006 @@ -285,7 +285,7 @@ var evt_id = registered controller + c; CPSSkins.registerEventHandler(evt_id, view, function(event) { var controller = event.publisher; -controller.view = view; +controller.views.push(view); controller.register(view); CPSSkins.unsubscribe(evt_id); }); @@ -399,6 +399,7 @@ initialize: function(node, def) { this.node = this.node; this.def = def; +this.views = []; }, setup: function() { @@ -511,16 +512,17 @@ }, submitEvent: function(e) { -var view = this.view; -var model = this.view.model; -var widget = this.view.widget; +$A(this.views).each(function(view) { + var model = this.view.model; + var widget = this.view.widget; + + var form_data = {}; + $A(Form.getInputs(widget)).each(function(i) { +form_data[i.name] = Form.Element.getValue(i); + }); -var form_data = {}; -$A(Form.getInputs(widget)).each(function(i) { - form_data[i.name] = Form.Element.getValue(i); + model.setData(form_data); }); - -model.setData(form_data); return false; } @@ -618,9 +620,17 @@ new CPSSkins.Controller(), { setup: function() { +this._perspectives = {}; }, register: function(view) { +var perspectives = this._perspectives; +$A(view.def.perspectives).each(function(p) { + if (!(p in perspectives)) { +perspectives[p] = []; + } + perspectives[p].push(view); +}); } }); -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins
[Z3lab-checkins] r2492 - cpsskins/branches/jmo-perspectives/ui/framework
Author: jmorliaguet Date: Mon Feb 27 16:39:10 2006 New Revision: 2492 Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Log: - simplifications: perspectives are now managed via the perspective selector Controller instead of being managed globally. sub-perspectives are no longer needed. 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 Mon Feb 27 16:39:10 2006 @@ -45,9 +45,6 @@ _models: $H({}), _controllers: $H({}), _handlers: $H({}), - _perspectives: $H({}), - _currentPerspective: , - _previousPerspective: , init: function() { CPSSkins._parse(document); @@ -305,86 +302,12 @@ el.parentNode.insertBefore(view.widget, el); } -/* registers views per perspective */ -var perspectives = def.perspectives || []; -perspectives.each(function(p) { - if (!p) return; - if (!(p in CPSSkins._perspectives)) { -CPSSkins._perspectives[p] = []; - } - CPSSkins._perspectives[p].push(view); -}); //CPSSkins.notify(registered view + def.id, view); } break; } } - }, - - _resolvePerspective: function(perspective) { -var path = CPSSkins._currentPerspective.split(/); -var base = perspective; -var ext = ; - -if (perspective == '..') { - if (path.length 0) { -base = path.slice(0, path.length-1).join(/); - } -} - -if (perspective.substr(0,2) == ./) { - base = CPSSkins._currentPerspective; - if (base) { -base += /; - } - ext = perspective.substr(2); -} - -var up = perspective.match(new RegExp(/\.\.\//g)); -if (up (up.length = path.length)) { - base = path.slice(0, path.length - up.length).join(/); - if (base) { -base += /; - } - ext = perspective.substr(up.length*3); -} - -if (perspective == '-') { - base = CPSSkins._previousPerspective; -} - -return base + ext; - }, - - switchPerspective: function(perspective) { -var to_show = []; -var to_hide = []; - -perspective = CPSSkins._resolvePerspective(perspective); -CPSSkins._perspectives.each(function(s) { - var elements = s.value; - var path = perspective.split(/); - path.each(function(p, index) { -var subpath = path.slice(0,index+1).join(/); -if (s.key == subpath) { - elements.each(function(el) { to_show.push(el) } ); -} else { - elements.each(function(el) { to_hide.push(el) } ); -} - }); -}); - -// Do not hide objects to be shown -to_hide = to_hide.select(function(el) { - return to_show.indexOf(el) 0; -}); - -to_hide.each(function(el) { el.hide(); }); -to_show.each(function(el) { el.show(); }); - -CPSSkins._previousPerspective = CPSSkins._currentPerspective; -CPSSkins._currentPerspective = perspective; } } @@ -620,17 +543,27 @@ new CPSSkins.Controller(), { setup: function() { -this._perspectives = {}; +this._visible_views = {}; }, register: function(view) { -var perspectives = this._perspectives; +var visible = this._visible_views; $A(view.def.perspectives).each(function(p) { - if (!(p in perspectives)) { -perspectives[p] = []; + if (!(p in visible)) { +visible[p] = []; } - perspectives[p].push(view); + visible[p].push(view); }); + }, + + switchTo: function(perspective) { +var to_show = this._visible_views[perspective]; +var to_hide = this.views.select(function(el) { + return to_show.indexOf(el) 0; +}); + +to_hide.each(function(el) { el.hide(); }); +to_show.each(function(el) { el.show(); }); } }); -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins
[Z3lab-checkins] r2493 - cpsskins/branches/jmo-perspectives/ui/framework/tests/functional
Author: jmorliaguet Date: Mon Feb 27 17:21:52 2006 New Revision: 2493 Added: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel5.css (contents, props changed) cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel5_1.html (contents, props changed) cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel5_2.html (contents, props changed) Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel5.html Log: - test updates to demonstrate perspectives in perspectives Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html == --- cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html Mon Feb 27 17:21:52 2006 @@ -16,6 +16,12 @@ margin: 2px; border: 1px solid #999; } +.selector a { + font: 12px Verdana, Arial; + padding-right: 1.5em; + text-decoration: none; + color: #069; +} /style /head @@ -25,24 +31,25 @@ div id=msg/div - div - a href=javascript:CPSSkins.switchPerspective('site-designer') - Site designer/a - a href=javascript:CPSSkins.switchPerspective('page-designer') - Page designer/a - a href=javascript:CPSSkins.switchPerspective('layout-designer') - Layout designer/a - a href=javascript:CPSSkins.switchPerspective('element-editor') - Element editor/a + div class=selector + a href=javascript:CPSSkins.getControllerById('controller1').switchTo('perspective1') + Perspective 1/a + a href=javascript:CPSSkins.getControllerById('controller1').switchTo('perspective2') + Perspective 2/a + a href=javascript:CPSSkins.getControllerById('controller1').switchTo('perspective3') + Perspective 3/a + + /div - !-- perspective controller -- + !-- perspective selectors -- ins class=controller - {id: perspective-selector1, + {id: controller1, type: perspective selector } /ins + table style=width:100% tr style=vertical-align: top td colspan=3 @@ -79,13 +86,21 @@ }} /ins +ins class=model +{id: panel5, + data: { + url: panel5.html, + css: panel5.css +}} +/ins + ins class=view {widget: { type: panel }, model: panel1, - perspectives: [page-designer, layout-designer], - controllers: [perspective-selector1] + perspectives: [perspective2, perspective3], + controllers: [controller1] } /ins @@ -94,8 +109,8 @@ type: panel }, model: panel2, - perspectives: [site-designer], - controllers: [perspective-selector1] + perspectives: [perspective1], + controllers: [controller1] } /ins @@ -110,8 +125,8 @@ type: panel }, model: panel2, - perspectives: [page-designer], - controllers: [perspective-selector1] + perspectives: [perspective2], + controllers: [controller1] } /ins @@ -120,8 +135,8 @@ type: panel }, model: panel3, - perspectives: [site-designer, layout-designer], - controllers: [perspective-selector1] + perspectives: [perspective1, perspective3], + controllers: [controller1] } /ins @@ -133,8 +148,8 @@ type: panel }, model: panel3, - perspectives: [page-designer], - controllers: [perspective-selector1] + perspectives: [perspective2], + controllers: [controller1] } /ins @@ -143,11 +158,23 @@ type: panel }, model: panel4, - perspectives: [page-designer], - controllers: [perspective-selector1] + perspectives: [perspective2], + controllers: [controller1] } /ins +!-- this panel contains sub-panels -- +ins class=view +{widget: { + type: panel + }, + model: panel5, + perspectives: [perspective1], + controllers: [controller1] +} +/ins + + /td td style=width: 20% @@ -156,8 +183,8 @@ type: panel }, model: panel4, - perspectives: [site-designer, layout-designer], - controllers: [perspective-selector1] + perspectives: [perspective1, perspective3], + controllers: [controller1] } /ins @@ -166,11 +193,13 @@ type: panel }, model: panel2, - perspectives: [site-designer], -
[Z3lab-checkins] r2494 - cpsskins/branches/jmo-perspectives/ui/framework
Author: jmorliaguet Date: Mon Feb 27 19:52:38 2006 New Revision: 2494 Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Log: - fixes 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 Mon Feb 27 19:52:38 2006 @@ -46,6 +46,8 @@ _controllers: $H({}), _handlers: $H({}), + _count: 0, + init: function() { CPSSkins._parse(document); }, @@ -178,7 +180,7 @@ } }); -elements.each(function(el, index) { +elements.each(function(el) { var url = el.getAttribute(cite); if (url) { var options = { @@ -204,9 +206,10 @@ _load: function(node) { var elements = $A(node.getElementsByTagName(ins)); [view, controller, model].each(function(type) { - elements.each(function(el, index) { + elements.each(function(el) { if (Element.hasClassName(el, type)) { - CPSSkins._register(el, type, index); + CPSSkins._register(el, type, CPSSkins._count); + CPSSkins._count += 1; } }); }); @@ -557,7 +560,7 @@ }, switchTo: function(perspective) { -var to_show = this._visible_views[perspective]; +var to_show = this._visible_views[perspective] || []; var to_hide = this.views.select(function(el) { return to_show.indexOf(el) 0; }); -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins
[Z3lab-checkins] r2496 - cpsskins/branches/jmo-perspectives/ui/framework/doc
Author: jmorliaguet Date: Mon Feb 27 20:17:14 2006 New Revision: 2496 Modified: cpsskins/branches/jmo-perspectives/ui/framework/doc/index.txt Log: - doc update Modified: cpsskins/branches/jmo-perspectives/ui/framework/doc/index.txt == --- cpsskins/branches/jmo-perspectives/ui/framework/doc/index.txt (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/doc/index.txt Mon Feb 27 20:17:14 2006 @@ -56,21 +56,17 @@ The notion of perspective is borrowed from the Eclipse UI. A perspective -determines which views are visible in a given context. Perspectives are -usually task-oriented, they are selected by the *controller*. +is a collection of views which are visible. When switching between +perspectives, views get shown or hidden. -Perspectives can be nested to create sub-perspectives. Sub-perspectives can -be used to create sub-views of a given view. - -It is possible to navigate between nested perspectives. Switching perspectives -translates into switching views. Controllers --- Controllers map user actions to model updates. -Controllers can also select views -- this is done by switching *perspectives*. +Controllers can also select which views to display -- this is done by switching +*perspectives* (see the Perspective Selector). Technical implementation @@ -182,19 +178,18 @@ - local - remote - + - accessors: the storage accessors (get, set) - refresh: the refresh rate - access: the type of access - - sequence type: queue, stack + - sequence type: queue, stack - sequence signature - View @@ -296,6 +291,11 @@ - draggable +* perspective selector + + - javascript API: switchTo + + Javascript API == @@ -318,11 +318,6 @@ - registerWidgets(widgets) -- perspectives - - - switchPerspective(perspective) - - - action handlers - addActions(handlers) @@ -351,7 +346,7 @@ - writeData(data) -- high-level IO +- high-level IO - getData() -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins
[Z3lab-checkins] r2498 - in cpsskins/branches/jmo-perspectives/ui: authoring panels screens
Author: jmorliaguet Date: Mon Feb 27 21:23:01 2006 New Revision: 2498 Modified: cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js cpsskins/branches/jmo-perspectives/ui/authoring/configure.zcml cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py cpsskins/branches/jmo-perspectives/ui/authoring/views.py cpsskins/branches/jmo-perspectives/ui/panels/action_pad.pt cpsskins/branches/jmo-perspectives/ui/screens/editor.pt Log: - updated to the latest API 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.jsMon Feb 27 21:23:01 2006 @@ -36,7 +36,7 @@ this.node = node; this.bg = node.style.background; this.container = node.parentNode; -this.order = Identifiable.getOrder(node); +this.order = CPSSkins.Identifiable.getOrder(node); this.xpos = null; this.ypos = null; this.can_move = true; @@ -85,7 +85,7 @@ var new_id = request.responseText; var rendered = render_element(id=new_id); var container = current_elem.parentNode; -container.insertBefore(rendered, Identifiable.getNext(current_elem)); +container.insertBefore(rendered, CPSSkins.Identifiable.getNext(current_elem)); // set up the new nodes pd_setupPage(); } @@ -196,7 +196,7 @@ var speed = vertical_speed(e); if (Math.abs(speed) 1) return; if (speed 0) { -var target = Identifiable.getNext(el); +var target = CPSSkins.Identifiable.getNext(el); } else { var target = el; } @@ -211,10 +211,10 @@ } function save_move(elem) { - var parent = Identifiable.getParent(elem); + var parent = CPSSkins.Identifiable.getParent(elem); var src_id = elem.getAttribute(id); var dest_id = parent.getAttribute(id); - var order = Identifiable.getOrder(elem); + var order = CPSSkins.Identifiable.getOrder(elem); current_elem = elem; current_container = parent; model.move({'src_id': src_id, 'dest_id': dest_id, 'order': order}); @@ -228,15 +228,15 @@ if (!Element.hasClassName(moving, 'draggable')) return; var target = Event.element(e); if (!Element.hasClassName(target, 'container')) return; - if (!Identifiable.isEmpty(target)) return; + if (!CPSSkins.Identifiable.isEmpty(target)) return; target.appendChild(moving); current_elem = moving; } function add_element(container, el, type_name) { - var container_id = Identifiable.getIdentifiableElement(container).getAttribute(id); + var container_id = CPSSkins.Identifiable.getIdentifiableElement(container).getAttribute(id); if (el) { -var order = Identifiable.getOrder(el); +var order = CPSSkins.Identifiable.getOrder(el); } else { var order = 0; } @@ -283,7 +283,7 @@ setCursor(default); if (!moved) return; if (!current_elem) return; -if ((moved.order == Identifiable.getOrder(current_elem)) +if ((moved.order == CPSSkins.Identifiable.getOrder(current_elem)) (moved.container == current_elem.parentNode)) return; save_move(current_elem); moved = null; @@ -313,11 +313,11 @@ Event.observe(mo, 'mouseup', function(e) { if (factory) { var type_name = factory.node.getAttribute(type_name); - if (Identifiable.isEmpty(mo)) { + if (CPSSkins.Identifiable.isEmpty(mo)) { var el = null; } else { var target = Event.element(e); -var el = Identifiable.getIdentifiableElement(target); +var el = CPSSkins.Identifiable.getIdentifiableElement(target); } add_element(mo, el, type_name); } Modified: cpsskins/branches/jmo-perspectives/ui/authoring/configure.zcml == --- cpsskins/branches/jmo-perspectives/ui/authoring/configure.zcml (original) +++ cpsskins/branches/jmo-perspectives/ui/authoring/configure.zcml Mon Feb 27 21:23:01 2006 @@ -123,6 +123,12 @@ name=getView attribute=getView / + + browser:page + name=getController + attribute=getController + / + /browser:pages /configure 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 Mon Feb 27 21:23:01 2006 @@ -90,6 +90,7 @@ 'model': 'action-pad', 'perspectives': ['site-designer', 'page-designer', 'layout-designer', 'content-author'], +'controllers': ['main-editor-perspectives'], }, 'tooltip': { @@ -108,6 +109,7 @@ }, 'model':
[Z3lab-checkins] r2499 - cpsskins/branches/jmo-perspectives/ui/framework
Author: jmorliaguet Date: Mon Feb 27 22:17:24 2006 New Revision: 2499 Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Log: - the content of panels must be parsed (not only loaded) 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 Mon Feb 27 22:17:24 2006 @@ -1493,7 +1493,7 @@ var widget = this.widget; var options = { onComplete: function() { - CPSSkins._load(widget); + CPSSkins._parse(widget); } }; -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins
[Z3lab-checkins] r2500 - in cpsskins/branches/jmo-perspectives/ui: authoring panels screens/sitedesigner
Author: jmorliaguet Date: Mon Feb 27 22:25:20 2006 New Revision: 2500 Added: cpsskins/branches/jmo-perspectives/ui/panels/associations.pt (contents, props changed) cpsskins/branches/jmo-perspectives/ui/panels/management.pt (contents, props changed) cpsskins/branches/jmo-perspectives/ui/panels/settings.pt (contents, props changed) Modified: cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py cpsskins/branches/jmo-perspectives/ui/panels/configure.zcml cpsskins/branches/jmo-perspectives/ui/screens/sitedesigner/site_designer.pt Log: - the site designer panels are displayed using perspectives 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 Mon Feb 27 22:25:20 2006 @@ -78,6 +78,26 @@ } }, +'settings': { +'id': 'settings', +'data': { +'url': '@@settings.html', +} +}, + +'management': { +'id': 'management', +'data': { +'url': '@@management.html', +} +}, + +'associations': { +'id': 'associations', +'data': { +'url': '@@associations.html', +} +}, } VIEWS = { @@ -181,8 +201,35 @@ 'controllers': ['main-editor-perspectives'], }, -# Bottom area +# site designer panels +'settings': { +'widget': { +'type': 'panel', +}, +'model': 'settings', +'perspectives': ['settings'], +'controllers': ['site-designer-perspectives'], +}, + +'associations': { +'widget': { +'type': 'panel', +}, +'model': 'associations', +'perspectives': ['associations'], +'controllers': ['site-designer-perspectives'], +}, + +'management': { +'widget': { +'type': 'panel', +}, +'model': 'management', +'perspectives': ['management'], +'controllers': ['site-designer-perspectives'], +}, +# Bottom area 'portlet-factory': { 'widget': { 'type': 'panel', @@ -258,6 +305,9 @@ 'main-editor-perspectives': { 'id': 'main-editor-perspectives', 'type': 'perspective selector', -} - +}, +'site-designer-perspectives': { +'id': 'site-designer-perspectives', +'type': 'perspective selector', +}, } Added: cpsskins/branches/jmo-perspectives/ui/panels/associations.pt == --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/panels/associations.ptMon Feb 27 22:25:20 2006 @@ -0,0 +1,9 @@ + + h2Associations/h2 + div class=sections +img class=icon + src=/++skin++cpsskins/@@/++resource++associations-48.png / +span class=descriptionlocal themes, perspectives .../span +br style=clear:both/ + /div + Modified: cpsskins/branches/jmo-perspectives/ui/panels/configure.zcml == --- cpsskins/branches/jmo-perspectives/ui/panels/configure.zcml (original) +++ cpsskins/branches/jmo-perspectives/ui/panels/configure.zcml Mon Feb 27 22:25:20 2006 @@ -38,6 +38,22 @@ template=location_selector.pt / +!-- site designer -- +page + name=settings.html + template=settings.pt +/ + +page + name=associations.html + template=associations.pt +/ + +page + name=management.html + template=management.pt +/ + /pages pages Added: cpsskins/branches/jmo-perspectives/ui/panels/management.pt == --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/panels/management.pt Mon Feb 27 22:25:20 2006 @@ -0,0 +1,9 @@ + + h2Management/h2 + div class=sections +img class=icon + src=/++skin++cpsskins/@@/++resource++management-48.png / +span class=descriptionexport, import themes and settings .../span +br style=clear:both/ + /div + Added: cpsskins/branches/jmo-perspectives/ui/panels/settings.pt == --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/panels/settings.ptMon Feb 27 22:25:20 2006 @@ -0,0 +1,55 @@ +tal:block define=engine string:site-designer; + selection context/@@getSelection; + section selection/section|nothing; + subsection selection/subsection|nothing; + selected selection/selected|nothing + + table class=panel cellpadding=0 cellspacing=0 + tal:define=info context/@@getSettingInfo +tr + td class=first +h2Settings/h2 +div