[Zope3-checkins]
SVN: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar
Last working version of toolbar (only moz) before removing
toolbar package
Roger Ineichen
roger at projekt01.ch
Fri Oct 28 09:15:08 EDT 2005
Log message for revision 39689:
Last working version of toolbar (only moz) before removing toolbar package
Menus have to be re-implemented first. There is
no support for register submenu for allready
registred menu items.
Changed:
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/divmenu.js
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/macros.pt
D Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/template.pt
D Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar.pt
D Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar_layout.pt
D Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/topmenu.pt
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/viewlet.pt
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar.zcml
-=-
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/divmenu.js
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/divmenu.js 2005-10-28 12:57:00 UTC (rev 39688)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/divmenu.js 2005-10-28 13:15:07 UTC (rev 39689)
@@ -87,12 +87,14 @@
/* Set width for submenu elements */
DivMenu.prototype.setMaxWidth = function(nodes, maxWidth) {
+
for (var i = 0; i < nodes.length; i++) {
+ alert("nodes[i].tagName: " + nodes[i].outerHTML)
if (nodes[i].nodeType == 1 && /submenu/.test(nodes[i].className) && nodes[i].currentStyle) {
if (this.browser.ie5) {
nodes[i].style.width = (maxWidth) + "px";
} else {
- nodes[i].style.width = (maxWidth - parseInt(nodes[i].currentStyle.paddingLeft) - parseInt(nodes[i].currentStyle.paddingRight)) + "px";
+ nodes[i].style.width = (maxWidth - parseInt(nodes[i].currentStyle.paddingLeft) - parseInt(nodes[i].currentStyle.paddingRight)) + "px"
}
}
}
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/macros.pt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/macros.pt 2005-10-28 12:57:00 UTC (rev 39688)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/macros.pt 2005-10-28 13:15:07 UTC (rev 39689)
@@ -1,58 +1,28 @@
<!-- topmenu macro, render first level items with class name 'topmenu' -->
<metal:block define-macro="topmenu">
- <a href="" class="topmenu"
- tal:attributes="href menuitem/action"
+ <a href="#" class="topmenu"
tal:content="menuitem/title"
i18n:translate="">
</a>
- <div tal:condition="menuitem/submenu">
- <tal:block tal:repeat="subitem menuitem/submenu">
- <tal:block define="menuitem subitem">
- <metal:block use-macro="python:view.macros('submenu')" />
- </tal:block>
- </tal:block>
- </div>
+ <metal:block use-macro="python:view.macros('menugroup')" />
</metal:block>
<!-- submenu macro, render all except first level items with class name 'item' -->
-<metal:block define-macro="submenu2">
- <a href="" class="submenu"
- tal:attributes="href menuitem/action"
- tal:content="menuitem/title"
- i18n:translate="">
- </a>
- <div tal:condition="menuitem/submenu">
- <tal:block tal:repeat="subitem menuitem/submenu">
+<metal:block define-macro="submenu">
+ <a href="#" class="submenu">
+ <img class="menuarrow"
+ tal:condition="menuitem/icon"
+ tal:attributes="src menuitem/icon"
+ /><tal:block content="menuitem/title" /></a>
+ <metal:block use-macro="python:view.macros('menugroup')" />
+</metal:block>
+
+<metal:block define-macro="menugroup">
+ <div tal:condition="menuitem/submenu" class="menugroup">
+ <tal:block repeat="subitem menuitem/submenu">
<tal:block define="menuitem subitem">
<metal:block use-macro="python:view.macros('submenu')" />
</tal:block>
</tal:block>
</div>
</metal:block>
-
-<!-- item display macro -->
-<metal:block define-macro="itemdisplay">
- <img class="itemicon"
- tal:condition="menuitem/icon"
- tal:attributes="src menuitem/icon" />
-
- <span tal:content="menuitem/title" />
-
- <img class="submenuhint" src="/++resource++submenuhint.png"
- tal:condition="menuitem/submenu"/>
-</metal:block>
-
-<!-- menu item macro -->
-<metal:block define-macro="submenu">
- <a href=""
- tal:attributes="href menuitem/action;">
- <metal:block use-macro="python:view.macros('itemdisplay')" />
- </a>
- <ul tal:condition="menuitem/submenu">
- <li tal:repeat="subitem menuitem/submenu">
- <tal:block define="menuitem subitem">
- <metal:block use-macro="python:view.macros('submenu')" />
- </tal:block>
- </li>
- </ul>
-</metal:block>
Deleted: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/template.pt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/template.pt 2005-10-28 12:57:00 UTC (rev 39688)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/template.pt 2005-10-28 13:15:07 UTC (rev 39689)
@@ -1,24 +0,0 @@
-<div class="ToolBarContainer">
- <table cellspacing="0" cellpadding="0" id="toolbar" class="ToolBar">
- <tr>
- <td><img src="/++resource++toolbarGrip.gif" width="5" height="18"
- tal:attributes="src string:${context/++resource++toolbarGrip.gif}" /></td>
- <td tal:repeat="menuitem python:view.menus('zmi_actions')">
- <metal:block use-macro="python:view.macros('topmenu')" />
- </td>
- <!--
- <td>
- <tal:block content="python:view.menus('zmi_actions')" />
- </td>
- -->
- </tr>
- </table>
-</div>
-<script type="text/javascript"
- tal:attributes="language string:JavaScript"
- tal:content="structure string:
- var toolbar = new DivMenu('toolbar');
- toolbar.divMenuArrow = '${context/++resource++toolbarArrow.gif}';
- toolbar.divMenuArrowOver = '${context/++resource++toolbarArrowOver.gif}';
- toolbar.init();">
-</script>
Deleted: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar.pt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar.pt 2005-10-28 12:57:00 UTC (rev 39688)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar.pt 2005-10-28 13:15:07 UTC (rev 39689)
@@ -1,57 +0,0 @@
-<metal:block define-macro="toolbar">
-<div class="ToolBarContainer">
- <table cellspacing="0" cellpadding="0" id="toolbar" class="ToolBar">
- <tr>
- <td><img src="/++resource++toolbarGrip.gif" width="5" height="18"
- tal:attributes="src string:${context/++resource++toolbarGrip.gif}" /></td>
- <td tal:repeat="menuitem context/@@view_get_menu/zmi_actions">
-<!-- <metal:block use-macro="pagelet:zope.app.skintools.toolbar.IToolBarLayout/toolbar-button" /> -->
- </td>
- </tr>
- </table>
-</div>
-<script type="text/javascript"
- tal:attributes="language string:JavaScript"
- tal:content="structure string:
- var toolbar = new DivMenu('toolbar');
- toolbar.divMenuArrow = '${context/++resource++toolbarArrow.gif}';
- toolbar.divMenuArrowOver = '${context/++resource++toolbarArrowOver.gif}';
- toolbar.init();">
-</script>
-</metal:block>
-
-<!-- render first level items with class name 'button' -->
-<!--
-<metal:block define-macro="toolbar-button">
- <a href="" class="topmenu"
- tal:attributes="href menuitem/action"
- tal:content="menuitem/title"
- i18n:translate="">
- </a>
- <div tal:condition="menuitem/submenu">
- <tal:block tal:repeat="subitem menuitem/submenu">
- <tal:block define="menuitem subitem">
- <metal:block use-macro="pagelet:zope.app.skintools.toolbar.IToolBarLayout/toolbar-item" />
- </tal:block>
- </tal:block>
- </div>
-</metal:block>
--->
-
-<!-- render all except first level items with class name 'item' -->
-<!--
-<metal:block define-macro="toolbar-item">
- <a href="" class="submenu"
- tal:attributes="href menuitem/action"
- tal:content="menuitem/title"
- i18n:translate="">
- </a>
- <div tal:condition="menuitem/submenu">
- <tal:block tal:repeat="subitem menuitem/submenu">
- <tal:block define="menuitem subitem">
- <metal:block use-macro="pagelet:zope.app.skintools.toolbar.IToolBarLayout/toolbar-item" />
- </tal:block>
- </tal:block>
- </div>
-</metal:block>
--->
Deleted: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar_layout.pt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar_layout.pt 2005-10-28 12:57:00 UTC (rev 39688)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar_layout.pt 2005-10-28 13:15:07 UTC (rev 39689)
@@ -1,25 +0,0 @@
-<html>
-<body>
-
-
-<metal:block define-macro="menuitem">
- <a href=""
- tal:attributes="href menuitem/action;">
- <img class="itemicon"
- tal:condition="menuitem/icon"
- tal:attributes="src menuitem/icon" />
- <span tal:content="menuitem/title" />
- <img class="submenuhint" src="/++resource++submenuhint.png"
- tal:condition="menuitem/submenu"/>
- </a>
- <ul tal:condition="menuitem/submenu">
- <li tal:repeat="subitem menuitem/submenu">
- <tal:block define="menuitem subitem">
- <metal:block use-macro="context/@@menudemo_macros/menuitem" />
- </tal:block>
- </li>
- </ul>
-</metal:block>
-
-</body>
-</html>
Deleted: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/topmenu.pt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/topmenu.pt 2005-10-28 12:57:00 UTC (rev 39688)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/topmenu.pt 2005-10-28 13:15:07 UTC (rev 39689)
@@ -1,14 +0,0 @@
-<!-- topemnu -->
- <a href="" class="topmenu"
- tal:attributes="href menuitem/action"
- tal:content="menuitem/title"
- i18n:translate="">
- </a>
- <div tal:condition="menuitem/submenu">
- <tal:block tal:repeat="subitem menuitem/submenu">
- <tal:block define="menuitem subitem">
- <!--<metal:block use-macro="pagelet:zope.app.skintools.toolbar.IToolBarLayout/toolbar-item" />-->
- </tal:block>
- </tal:block>
- </div>
-<!-- topmenu -->
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/viewlet.pt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/viewlet.pt 2005-10-28 12:57:00 UTC (rev 39688)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/viewlet.pt 2005-10-28 13:15:07 UTC (rev 39689)
@@ -1,51 +1,19 @@
-<!-- topemnu -->
- <a href="" class="topmenu"
- tal:attributes="href menuitem/action"
- tal:content="menuitem/title"
- i18n:translate="">
- </a>
- <div tal:condition="menuitem/submenu">
- <tal:block tal:repeat="subitem menuitem/submenu">
- <tal:block define="menuitem subitem">
- <!--<metal:block use-macro="pagelet:zope.app.skintools.toolbar.IToolBarLayout/toolbar-item" />-->
- </tal:block>
- </tal:block>
- </div>
-<!-- topmenu -->
-
-
-<!-- render first level items with class name 'button' -->
-<!--
-<metal:block define-macro="toolbar-button">
- <a href="" class="topmenu"
- tal:attributes="href menuitem/action"
- tal:content="menuitem/title"
- i18n:translate="">
- </a>
- <div tal:condition="menuitem/submenu">
- <tal:block tal:repeat="subitem menuitem/submenu">
- <tal:block define="menuitem subitem">
- <metal:block use-macro="pagelet:zope.app.skintools.toolbar.IToolBarLayout/toolbar-item" />
- </tal:block>
- </tal:block>
- </div>
-</metal:block>
--->
-
-<!-- render all except first level items with class name 'item' -->
-<!--
-<metal:block define-macro="toolbar-item">
- <a href="" class="submenu"
- tal:attributes="href menuitem/action"
- tal:content="menuitem/title"
- i18n:translate="">
- </a>
- <div tal:condition="menuitem/submenu">
- <tal:block tal:repeat="subitem menuitem/submenu">
- <tal:block define="menuitem subitem">
- <metal:block use-macro="pagelet:zope.app.skintools.toolbar.IToolBarLayout/toolbar-item" />
- </tal:block>
- </tal:block>
- </div>
-</metal:block>
--->
+<div class="ToolBarContainer">
+ <table cellspacing="0" cellpadding="0" id="ToolBar" class="ToolBar">
+ <tr>
+ <td><img src="/++resource++toolbarGrip.gif" width="5" height="18"
+ tal:attributes="src string:${context/++resource++toolbarGrip.gif}" /></td>
+ <td tal:repeat="menuitem python:view.menus('zmi_actions')">
+ <metal:block use-macro="python:view.macros('topmenu')" />
+ </td>
+ </tr>
+ </table>
+</div>
+<script type="text/javascript"
+ tal:attributes="language string:JavaScript"
+ tal:content="structure string:
+ var toolbar = new DivMenu('ToolBar');
+ toolbar.divMenuArrow = '${context/++resource++toolbarArrow.gif}';
+ toolbar.divMenuArrowOver = '${context/++resource++toolbarArrowOver.gif}';
+ toolbar.init();">
+</script>
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar.zcml
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar.zcml 2005-10-28 12:57:00 UTC (rev 39688)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar.zcml 2005-10-28 13:15:07 UTC (rev 39689)
@@ -57,7 +57,7 @@
for="*"
manager="zope.app.boston.IToolBar"
class=".views.ToolBarViewlet"
- template="template.pt"
+ template="viewlet.pt"
permission="zope.View"
layer="zope.app.boston.boston"
weight="1"
@@ -65,8 +65,13 @@
<menu
id="standalone"
- title="Standalone" />
+ title="Standalone"
+ />
+ <menu
+ id="foo"
+ title="Foo" />
+
<subMenuItem
menu="zmi_actions"
submenu="standalone"
@@ -75,34 +80,31 @@
for="zope.interface.Interface"
/>
+ <subMenuItem
+ menu="standalone"
+ submenu="foo"
+ title="Foo"
+ permission="zope.Public"
+ for="zope.interface.Interface"
+ />
+
+ <menu
+ id="bar"
+ title="Bar" />
+
<menuItems
menu="zmi_actions"
for="zope.interface.Interface">
<subMenuItem
- submenu="file2"
- title="File"
+ submenu="bar"
+ title="Bar sub"
permission="zope.Public"
/>
- <subMenuItem
- submenu="edit"
- title="Edit"
- permission="zope.Public"
- />
-
- <subMenuItem
- submenu="help"
- title="Help"
- permission="zope.Public"
- />
-
</menuItems>
+<!--
- <menu
- id="file2"
- title="File" />
-
<menuItems
menu="file2"
for="zope.interface.Interface">
@@ -122,7 +124,7 @@
/>
</menuItems>
-
+-->
</configure>
</configure>
\ No newline at end of file
More information about the Zope3-Checkins
mailing list