Author: jmorliaguet Date: Fri Mar 24 23:16:36 2006 New Revision: 2713 Modified: cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_dragdrop_test.html Log:
- drag-and-drop UI updates in the theme editor (drop zones are highlighted) 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 Fri Mar 24 23:16:36 2006 @@ -199,7 +199,8 @@ }, 'model': 'page-designer', 'perspectives': ['page-designer'], - 'controllers': ['main-editor-perspectives', 'theme-switcher'], + 'controllers': ['main-editor-perspectives', 'theme-switcher', + 'portlet-factory'], }, 'layout-designer': { @@ -209,7 +210,8 @@ }, 'model': 'layout-designer', 'perspectives': ['layout-designer'], - 'controllers': ['main-editor-perspectives', 'theme-switcher'], + 'controllers': ['main-editor-perspectives', 'theme-switcher', + 'portlet-factory'], }, 'interaction-designer': { @@ -229,7 +231,7 @@ }, 'model': 'content-author', 'perspectives': ['content-author'], - 'controllers': ['main-editor-perspectives'], + 'controllers': ['main-editor-perspectives', 'portlet-factory'], }, # screen @@ -388,15 +390,14 @@ 'feedback': { 'opacity': 0.8, }, - 'shift': 'slotFrame', - 'container': 'container', - 'revert': { - 'duration': 400, + 'zoomback': { + 'duration': 300, } }, 'dropping': { - 'zoomto': { - 'duration': 300, + 'targets': ['.container'], + 'highlight': { + 'duration': 800, } }, }, 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 Fri Mar 24 23:16:36 2006 @@ -1135,6 +1135,7 @@ var regExp = new RegExp("^rgb\\((\\d+),(\\d+),(\\d+)\\)$"); var bgColor = element.getStyle('background-color') || 'rgb(255,255,255)'; var match = regExp.exec(bgColor.replace(/\s+/g,'')); + if (!match) return {'r': 1, 'g': 1, 'b': 1}; return {'r': match[1]/255, 'g': match[2]/255, 'b': match[3]/255} }, Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_dragdrop_test.html ============================================================================== --- cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_dragdrop_test.html (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_dragdrop_test.html Fri Mar 24 23:16:36 2006 @@ -28,6 +28,11 @@ margin: 10px; height: 40px; } + table.factory td { + padding: 5px; + border: 1px solid #99f; + background-color: #eff; + } #dragthis { padding: 1em; border: 1px solid #fc0; @@ -145,6 +150,28 @@ }} </ins> + <ins class="controller"> + {"id": "dnd5", + "type": "drag-and-drop", + "action": "displayInfo", + "dragging": { + "sources": ["table.factory td"], + "feedback": { + "opacity": 0.8 + }, + "zoomback": { + "duration": 300 + } + }, + "dropping": { + "targets": ["#drophere"], + "highlight": { + "duration": 600 + } + } + }} + </ins> + <div style="width: 300px; float: left"> <div class="dragdrop">DRAG-AND-DROP ME <div id="dragthis">DRAG ME</div> @@ -167,7 +194,7 @@ "area": "area" }, "model": "dummy", - "controllers": ["dnd", "dnd2", "dnd3", "dnd4"] + "controllers": ["dnd", "dnd2", "dnd3", "dnd4", "dnd5"] } </ins> @@ -179,6 +206,14 @@ <div id="movethis">MOVE ME</div> </div> + <table class="factory"> + <tr> + <td>A</td> + <td>B</td> + <td>C</td> + </tr> + </table> + <div style="clear:both"></div> <table style="width: 100%"> -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins