[Zope3-checkins]
SVN: Zope3/branches/roger-bostonskin2/src/zope/app/boston/
Remove nested menu implementation
Roger Ineichen
roger at projekt01.ch
Sat Oct 29 19:51:34 EDT 2005
Log message for revision 39725:
Remove nested menu implementation
Cleanup CSS formatting
Changed:
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/__init__.py
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/skin.css
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/template.pt
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/configure.zcml
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo.zcml
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/configure.zcml
D Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/divmenu.js
D Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/javascript.pt
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/macros.pt
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar.css
D Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbarArrow.gif
D Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbarArrowOver.gif
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/browser/views.py
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar.zcml
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.zcml
-=-
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/__init__.py
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/__init__.py 2005-10-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/__init__.py 2005-10-29 23:51:33 UTC (rev 39725)
@@ -49,10 +49,6 @@
"""Toolbar viewlet manager."""
-class IToolBarTopMenu(IViewletManager):
- """Toolbar viewlet manager."""
-
-
class ILeft(IViewletManager):
"""Left viewlet manager."""
@@ -63,7 +59,6 @@
BostonXMLTreeCSSViewlet = viewlet.CSSViewlet('xmltree.css', 'all')
-ToolBarCSSViewlet = viewlet.CSSViewlet('toolbar.css', 'all')
+BostonToolBarCSSViewlet = viewlet.CSSViewlet('toolbar.css', 'all')
-
BostonJavascriptViewlet = viewlet.JavaScriptViewlet('boston.js')
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/skin.css
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/skin.css 2005-10-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/skin.css 2005-10-29 23:51:33 UTC (rev 39725)
@@ -143,7 +143,6 @@
textarea {
color: Black;
- width: 100%;
border: 1px solid #9B9B9B;
padding: 0.1em;
}
@@ -229,6 +228,11 @@
background-color: #2475BB;
}
+
+#layout tr.head td {
+ border-bottom: 1px solid #D8D2BD;
+}
+
#layout td.logo {
height: 55px;
width: 250px;
@@ -263,9 +267,11 @@
margin: 0px;
}
-#userdetails {
- color: #898074;
- float: right;
+#userDetails {
+ color: #CCCCCC;
+ right: 0px;
+ top: 30px;
+ position: absolute;
padding: 4px 5px 0px 5px;
}
@@ -294,7 +300,7 @@
*/
#slotbox {
width: 200px;
- padding: 20px 5px 0px 5px;
+ padding: 15px 5px 0px 5px;
}
.slotbox {
@@ -365,25 +371,24 @@
padding: 18px 0px 0px 0px;
}
-#contextmenu div {
+#contextmenu {
font: 100% Verdana, Helvetica, Arial, sans-serif;
background-color: #EBE9DF;
- border: 1px solid #C1BBAC;
- padding: 5px 0px 5px 5px;
+ padding: 3px 0px 5px 5px;
margin: 2px 0px 10px 0px;
}
-#contextmenu div span {
+#contextmenu span {
white-space: nowrap;
}
-#contextmenu div a {
+#contextmenu a {
color: #666666;
font-weight: normal;
padding: 2px 6px 2px 6px;
}
-#contextmenu div a:hover {
+#contextmenu a:hover {
color: black;
text-decoration: none;
background-color: #CECEFF;
@@ -391,7 +396,7 @@
padding: 2px 5px 2px 5px;
}
-#contextmenu div a.selected {
+#contextmenu a.selected {
color: black;
text-decoration: none;
background-color: #D9DAF2;
@@ -402,12 +407,16 @@
#content {
width: 100%;
margin: 0px;
- padding: 0px 10px 0px 10px;
+ padding: 15px 10px 0px 10px;
}
/* standard fields
*/
+div.row {
+ padding-top: 1em;
+}
+
div.row div.field {
clear: left;
}
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/template.pt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/template.pt 2005-10-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/template.pt 2005-10-29 23:51:33 UTC (rev 39725)
@@ -35,21 +35,19 @@
<td colspan="2">
<!-- toolbar region (zmi_action) -->
<tal:block replace="structure provider:zope.app.boston.IToolBar" />
- <div id="userdetails">
- <metal:block define-macro="logged_user">
- <span tal:omit-tag="" i18n:translate="">User:</span>
- <tal:block replace="request/principal/title">User</tal:block>
- </metal:block>
- <a href=""
- tal:attributes="href string:@@logout.html?nextURL=${request/URL}"
- tal:condition="python: hasattr(view.request.principal, 'getLogin')"
- i18n:translate="">[Logout]</a>
- <a href=""
- tal:attributes="href string:@@login.html?nextURL=${request/URL}"
- tal:condition="python: not hasattr(view.request.principal,
- 'getLogin')"
- i18n:translate="">[Login]</a>
- </div>
+ <div id="userDetails" metal:define-slot="user_details">
+ <metal:block define-macro="logged_user">
+ <span tal:omit-tag="" i18n:translate="">User:</span>
+ <tal:block replace="request/principal/title">
+ User
+ </tal:block>
+ </metal:block>
+ <metal:block define-slot="login_logout">
+ <metal:macro define-macro="login_logout">
+ <tal:block content="structure context/@@login_logout" />
+ </metal:macro>
+ </metal:block>
+ </div>
</td>
</tr>
<tr class="head">
@@ -77,19 +75,25 @@
</div>
</td>
</tr>
- <tr>
- <td id="navigation">
+ <tr class="content">
+ <td id="navigation" class="navigation">
<div id="slotbox">
<tal:block replace="structure provider:zope.app.boston.ILeft" />
</div>
</td>
<td id="content">
<!-- context menu (zmi_views) just visible in view template -->
-<!--
- <div id="contextmenu" tal:condition="python: macroname == 'view'">
- <tal:block replace="structure provider:zope.app.boston.IContextMenu" />
- </div>
--->
+ <div id="contextmenu"
+ tal:define="views context/@@view_get_menu/zmi_views"
+ tal:condition="views">
+ <span tal:repeat="view views">
+ <a href=""
+ tal:attributes="href view/action;
+ class view/selected;"
+ tal:content="view/title"
+ i18n:translate="">label</a>
+ </span>
+ </div>
<!-- content area -->
<div metal:define-slot="message" id="message" />
<div id="body" metal:define-slot="body">
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/configure.zcml
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/configure.zcml 2005-10-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/configure.zcml 2005-10-29 23:51:33 UTC (rev 39725)
@@ -60,7 +60,7 @@
<configure zcml:condition="have onlinehelp">
<help:register
id="boston"
- title="Boston Skin (experimental)"
+ title="Boston Skin"
doc_path="README.txt"
class="zope.app.onlinehelp.onlinehelptopic.RESTOnlineHelpTopic"
/>
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo.zcml
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo.zcml 2005-10-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo.zcml 2005-10-29 23:51:33 UTC (rev 39725)
@@ -11,7 +11,7 @@
class=".addinginfo.browser.views.AddingInfoViewlet"
template="addinginfo/browser/viewlet.pt"
layer="zope.app.boston.boston"
- weight="3"
+ weight="11"
/>
</configure>
\ No newline at end of file
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/configure.zcml
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/configure.zcml 2005-10-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/configure.zcml 2005-10-29 23:51:33 UTC (rev 39725)
@@ -2,37 +2,8 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser">
-
<include file="xmltree.zcml" />
- <include file="toolbar.zcml" />
<include file="addinginfo.zcml" />
-
-
- <!-- IHead slot pagelets -->
- <!--<include file="head.zcml" />-->
-
- <!-- IJavaScript slot pagelets -->
-<!--
- <include file="toggle.zcml" />
--->
-
- <!-- IToolBar slot pagelets -->
-<!--
<include file="toolbar.zcml" />
- <include file="zmiactions.zcml" />
- <include file="helpaction.zcml" />
--->
- <!-- ILeft slot pagelets -->
-<!--
- <include file="zmicookietreebox.zcml" />
- <include file="addbox.zcml" />
- <include file="tooltipbox.zcml" />
--->
-
- <!-- IContent slot pagelets -->
-<!--
- <include file="contextmenu.zcml" />
--->
-
</configure>
Deleted: 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-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/divmenu.js 2005-10-29 23:51:33 UTC (rev 39725)
@@ -1,429 +0,0 @@
-//----------------------------------------------------------------------------
-// DivMenu renders a nested list of <div> tags to a menu bar. See README.html
-// for a static sample.
-// We move this javascript to zope.app.skintools.javascripts.divmenu later
-//----------------------------------------------------------------------------
-
-var menus = new Array(); // we put each menu in this Array
-
-function DivMenu(id) {
- this.type = "horizontal";
- this.menuPosTop = 0;
- this.menuPosLeft = 0;
- this.subPosTop = 0;
- this.subPosLeft = 0;
- this.arrow = null;
- this.arrowOver = null;
- this.id = id;
- menus[self.id] = this;
- this.tree = new Array();
- this.visible = new Array();
-
- // Browser detection
- this.browser = {
- "ie": Boolean(document.body.currentStyle),
- "ie5": (navigator.appVersion.indexOf("MSIE 5.5") != -1 || navigator.appVersion.indexOf("MSIE 5.0") != -1)
- };
- if (!this.browser.ie) {
- this.browser.ie5 = false;
- }
-}
-
-/* Initialize the menu */
-DivMenu.prototype.init = function() {
- document.onmousedown = this.click;
- if (this.browser.ie && this.browser.ie5) {
- this.fixWrap();
- }
- this.fixSections();
- this.parse(document.getElementById(this.id).childNodes, this.tree, this.id);
-}
-
-/* Search for menugroup elements and set width for them */
-DivMenu.prototype.fixSections = function() {
- var arr = document.getElementById(this.id).getElementsByTagName("div");
- var menugroups = new Array();
- var widths = new Array();
-
- for (var i = 0; i < arr.length; i++) {
- if (arr[i].className == "menugroup") {
- menugroups.push(arr[i]);
- }
- }
- for (var i = 0; i < menugroups.length; i++) {
- widths.push(this.getMaxWidth(menugroups[i].childNodes));
- }
- for (var i = 0; i < menugroups.length; i++) {
- menugroups[i].style.width = (widths[i]) + "px";
- }
- if (menus[self.id].browser.ie) {
- for (var i = 0; i < menugroups.length; i++) {
- this.setMaxWidth(menugroups[i].childNodes, widths[i]);
- }
- }
-
-}
-
-DivMenu.prototype.fixWrap = function() {
- var elements = document.getElementById(this.id).getElementsByTagName("a");
- for (var i = 0; i < elements.length; i++) {
- if (/submenu/.test(elements[i].className)) {
- elements[i].innerHTML = '<div nowrap="nowrap">'+elements[i].innerHTML+'</div>';
- }
- }
-}
-
-/* Search for highest width */
-DivMenu.prototype.getMaxWidth = function(nodes) {
- var maxWidth = 0;
- for (var i = 0; i < nodes.length; i++) {
- if (nodes[i].nodeType != 1 || nodes[i].className == "menugroup") {
- continue;
- }
- if (nodes[i].offsetWidth > maxWidth) maxWidth = nodes[i].offsetWidth;
- }
- return maxWidth;
-}
-
-/* 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"
- }
- }
- }
-}
-
-/* Parse menu structure, create events and position elements */
-DivMenu.prototype.parse = function(nodes, tree, id) {
- for (var i = 0; i < nodes.length; i++) {
- if (nodes[i].nodeType != 1) { continue };
- switch (nodes[i].className) {
- case "topmenu":
- nodes[i].id = id + "-" + tree.length;
- tree.push(new Array());
- nodes[i].onmouseover = this.topmenuOverShowsChilds;
- nodes[i].onclick = this.topmenuClick;
- break;
- case "submenu":
- nodes[i].id = id + "-" + tree.length;
- tree.push(new Array());
- nodes[i].onmouseover = this.submenuOver;
- nodes[i].onmouseout = this.submenuOut;
- nodes[i].onclick = this.submenuClick;
- break;
- case "menugroup":
- nodes[i].id = id + "-" + (tree.length - 1) + "-menugroup";
- var parentDiv = document.getElementById(id + "-" + (tree.length - 1));
- var childDiv = document.getElementById(nodes[i].id);
- var el = new DivMenuGroup(parentDiv.id);
- if (el.level == 1) {
- if (this.type == "horizontal") {
- childDiv.style.top = (parentDiv.offsetTop + parentDiv.offsetHeight + this.menuPosTop-3) + "px";
- if (this.browser.ie5) {
- childDiv.style.left = (2+this.menuPosLeft) + "px";
- } else {
- childDiv.style.left = (2+parentDiv.offsetLeft + this.menuPosLeft) + "px";
- }
- } else if (this.type == "vertical") {
- childDiv.style.top = (parentDiv.offsetTop + this.menuPosTop) + "px";
- if (this.browser.ie5) {
- childDiv.style.left = (2+parentDiv.offsetWidth + this.menuPosLeft) + "px";
- } else {
- childDiv.style.left = (2+parentDiv.offsetLeft + parentDiv.offsetWidth + this.menuPosLeft) + "px";
- }
- }
- } else {
- childDiv.style.top = (parentDiv.offsetTop + this.subPosTop-3) + "px";
- childDiv.style.left = (2+parentDiv.offsetLeft + parentDiv.offsetWidth + this.subPosLeft) + "px";
- }
- break;
- case "menuarrow":
- nodes[i].id = id + "-" + (tree.length - 1) + "-menuarrow";
- break;
- }
- if (nodes[i].childNodes) {
- if (nodes[i].className == "menugroup") {
- this.parse(nodes[i].childNodes, tree[tree.length - 1], id + "-" + (tree.length - 1));
- } else {
- this.parse(nodes[i].childNodes, tree, id);
- }
- }
- }
-}
-
-/* Hide all menugroups */
-DivMenu.prototype.hideAll = function() {
- for (var i = this.visible.length - 1; i >= 0; i--) {
- this.hide(this.visible[i]);
- }
-}
-
-/* Hide higher or equal levels */
-DivMenu.prototype.hideHigherOrEqualLevels = function(n) {
- for (var i = this.visible.length - 1; i >= 0; i--) {
- var el = new DivMenuGroup(this.visible[i]);
- if (el.level >= n) {
- this.hide(el.id);
- } else {
- return;
- }
- }
-}
-
-/* Hide a menugroup */
-DivMenu.prototype.hide = function(id) {
- var el = new DivMenuGroup(id);
- document.getElementById(id).className = (el.level == 1 ? "topmenu" : "submenu");
- if (el.level > 1 && this.arrowOver) {
- document.getElementById(id + "-menuarrow").src = this.arrow;
- }
- document.getElementById(id + "-menugroup").style.visibility = "hidden";
- document.getElementById(id + "-menugroup").style.zIndex = -1;
- if (this.visible.contains(id)) {
- if (this.visible[this.visible.length - 1] == id) {
- this.visible.pop();
- }
- }
-}
-
-/* Show a menugroup */
-DivMenu.prototype.show = function(id) {
- var el = new DivMenuGroup(id);
- document.getElementById(id).className = (el.level == 1 ? "topmenu-active" : "submenu-active");
- if (el.level > 1 && this.arrowOver) {
- document.getElementById(id + "-menuarrow").src = this.arrowOver;
- }
- document.getElementById(id + "-menugroup").style.visibility = "visible";
- document.getElementById(id + "-menugroup").style.zIndex = 1;
- this.visible.push(id);
-}
-
-/* event, document.onmousedown */
-DivMenu.prototype.click = function(e) {
- var el;
- if (e) {
- el = e.target.tagName ? e.target : e.target.parentNode;
- } else {
- el = window.event.srcElement;
- if (el.parentNode && /submenu/.test(el.parentNode.className)) {
- el = el.parentNode;
- }
- }
- if (!menus[self.id].visible.length) { return };
- if (!el.onclick) { menus[self.id].hideAll(); }
-}
-
-/* event, topmenu.onmouseover will show children*/
-DivMenu.prototype.topmenuOverShowsChilds = function() {
- var el = new DivMenuGroup(this.id);
- menus[self.id].hideHigherOrEqualLevels(el.level);
- if (el.hasChilds()) {
- menus[self.id].show(this.id);
- }
-}
-
-/* event, topmenu.onmouseover */
-DivMenu.prototype.topmenuOver = function() {
- if (!menus[self.id].visible.length) {
- return;
- }
- if (menus[self.id].visible.contains(this.id)) { return };
- menus[self.id].hideAll();
- var el = new DivMenuGroup(this.id);
- if (el.hasChilds()) {
- menus[self.id].show(this.id);
- }
-}
-
-/* event, topmenu.onclick */
-DivMenu.prototype.topmenuClick = function() {
- this.blur();
- if (menus[self.id].visible.length) {
- menus[self.id].hideAll();
- } else {
- var el = new DivMenuGroup(this.id);
- if (el.hasChilds()) {
- menus[self.id].show(this.id);
- }
- }
-}
-
-/* event, submenu.onmouseover */
-DivMenu.prototype.submenuOver = function() {
- var el = new DivMenuGroup(this.id);
- menus[self.id].hideHigherOrEqualLevels(el.level);
- if (el.hasChilds()) {
- menus[self.id].show(this.id);
- }
-}
-
-/* event, onmouseout hide all children */
-DivMenu.prototype.mouseOutHideAll = function() {
- menus[self.id].hideAll();
-}
-
-/* event, submenu.onmouseout */
-DivMenu.prototype.submenuOut = function() {
- var el = new DivMenuGroup(this.id);
- if (!el.hasChilds()) {
- document.getElementById(this.id).className = "submenu";
- }
-}
-
-/* event, submenu.onclick */
-DivMenu.prototype.submenuClick = function() {
- this.blur();
- var el = new DivMenuGroup(this.id);
- menus[self.id].hideHigherOrEqualLevels(el.level);
- if (el.hasChilds()) {
- menus[self.id].show(this.id);
- }
-}
-
-/* DivMenuGroup */
-function DivMenuGroup(id) {
- this.id = id;
- this.level = this.getLevel();
-}
-
-/* Get Level of given id */
-DivMenuGroup.prototype.getLevel = function() {
- menu = menus[self.id]
- var s = this.id.substr(menu.id.length);
- return s.split("-").length - 1;
-}
-
-
-/* Check whether an element has a sub menugroup */
-DivMenuGroup.prototype.hasChilds = function() {
- return Boolean(document.getElementById(this.id + "-menugroup"));
-}
-
-/* add missing Array function if needed (e.g. ie5) */
-if (!Array.prototype.contains) {
- Array.prototype.contains = function(s) {
- for (var i = 0; i < this.length; i++) {
- if (this[i] == s) {
- return true;
- }
- }
- return false;
- }
-}
-
-if(!Array.prototype.copy) {
- Array.prototype.copy=function(a){
- var i = 0;
- var b = [];
- for(i;i<this.length;i++)
- b[i] = (typeof this[i].copy != 'undefined')?
- this[i].copy():
- this[i];
- return b
- };
-}
-
-if(!Array.prototype.concat) {
- Array.prototype.concat=function(a){
- var i = 0;
- var b = this.copy();
- for(i;i<a.length;i++) {
- b[b.length]=a[i];
- }
- return b
- };
-}
-
-if(!Array.prototype.pop) {
- Array.prototype.pop=function(){
- var response = this[this.length - 1]
- this.length--
- return response
- };
-}
-
-if(!Array.prototype.push) {
- Array.prototype.push=function(){
- var i = 0;
- var b = this.length;
- var a = arguments;
- for(i;i<a.length;i++) {
- this[b+i] = a[i];
- }
- return this.length
- };
-}
-
-if(!Array.prototype.shift) {
- Array.prototype.shift=function(){
- var i = 0;
- var b = this[0];
- for(i;i<this.length-1;i++) {
- this[i] = this[i+1];
- }
- this.length--;
- return b
- };
-}
-
-if(!Array.prototype.slice) {
- Array.prototype.slice=function(a,c){
- var i = 0;
- var b;
- var d = [];
- if(!c) {
- c=this.length;
- }
- if(c<0) {
- c=this.length+c;
- }
- if(a<0) {
- a=this.length-a;
- }
- if(c<a){
- b = a;
- a = c;
- c = b
- }
- for(i;i<c-a;i++)
- d[i] = this[a+i];
- return d
- };
-}
-
-if(!Array.prototype.splice) {
- Array.prototype.splice=function(a,c){
- var i = 0;
- var e = arguments;
- var d = this.copy();
- var f = a;
- if(!c) {
- c=this.length-a;
- }
- for(i;i<e.length-2;i++) {
- this[a+i]=e[i+2];
- }
- for(a;a<this.length-c;a++) {
- this[a+e.length-2]=d[a-c];
- }
- this.length-=c-e.length+2;
- return d.slice(f,f+c)
- };
-}
-
-if(!Array.prototype.unshift) {
- Array.prototype.unshift=function(a){
- var b;
- this.reverse();
- b = this.push(a);
- this.reverse();
- return b
- };
-}
Deleted: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/javascript.pt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/javascript.pt 2005-10-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/javascript.pt 2005-10-29 23:51:33 UTC (rev 39725)
@@ -1,11 +0,0 @@
-<script type="text/javascript" src="divmenu.js"
- tal:attributes="src string:${context/++resource++divmenu.js}" ></script>
-
-<script type="text/javascript"
- tal:attributes="language string:JavaScript"
- tal:content="structure string:
- var divMenuArrow = new Image(4, 7);
- divMenuArrow.src = '${context/++resource++toolbarArrow.gif}';
- var divMenuArrowOver = new Image(4, 7);
- divMenuArrowOver.src = '${context/++resource++toolbarArrowOver.gif}';">
-</script>
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-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/macros.pt 2005-10-29 23:51:33 UTC (rev 39725)
@@ -1,28 +1,27 @@
<!-- topmenu macro, render first level items with class name 'topmenu' -->
<metal:block define-macro="topmenu">
<a href="#" class="topmenu"
- tal:content="menuitem/title"
- i18n:translate="">
+ tal:attributes="href menuitem/action"
+ tal:content="menuitem/title"
+ i18n:translate="">
</a>
- <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="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')" />
+<!-- helpmenu macro, render first level items with class name 'topmenu' -->
+<metal:block define-macro="helpmenu">
+ <a href="#" class="topmenu"
+ tal:define="url string:'${view/__name__}/${menuitem/action}';
+ name string:'OnlineHelp';
+ settings string:'height=500
+ ,width=950
+ ,resizable=1
+ ,scrollbars=yes
+ ,location=no
+ ,status=no
+ ,toolbar=no
+ ,menubar=no'"
+ tal:attributes="href python:'javascript:popup('+ url + ',' + name + ','+ settings +')'"
+ tal:content="menuitem/title" i18n:translate="">
+ Action name
+ </a>
</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>
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar.css
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar.css 2005-10-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbar.css 2005-10-29 23:51:33 UTC (rev 39725)
@@ -7,7 +7,7 @@
}
.ToolBar {
- font-family: tahoma, verdana, arial, sans-serif;
+ font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 11px;
}
@@ -21,7 +21,7 @@
.ToolBar .topmenu-active,
.ToolBar .topmenu-active:hover {
line-height: normal;
- padding: 5px 6px 4px 6px;
+ padding: 4px 6px 4px 6px;
margin: 1px;
color: #000000;
text-decoration: none;
Deleted: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbarArrow.gif
===================================================================
(Binary files differ)
Deleted: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/toolbarArrowOver.gif
===================================================================
(Binary files differ)
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-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/viewlet.pt 2005-10-29 23:51:33 UTC (rev 39725)
@@ -6,14 +6,9 @@
<td tal:repeat="menuitem python:view.menus('zmi_actions')">
<metal:block use-macro="python:view.macros('topmenu')" />
</td>
+ <td tal:repeat="menuitem python:view.menus('help_actions')">
+ <metal:block use-macro="python:view.macros('helpmenu')" />
+ </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/browser/views.py
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/views.py 2005-10-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/views.py 2005-10-29 23:51:33 UTC (rev 39725)
@@ -47,7 +47,7 @@
def render(self):
"""See zope.contentprovider.interfaces.IContentProvider"""
- # Now render the view without to use the template
+ # Now render the view without the template
return u'\n'.join([viewlet.render() for viewlet in self.viewlets])
@@ -56,20 +56,8 @@
implements(IToolBarViewlet)
-# def __getitem__(self, menuId):
-# return getMenu(menuId, self.context, self.request)
-
def macros(self, name):
- print ""
- print "macros name ", name
return self.manager.macros(name)
def menus(self, menuId):
- print ""
- print "menus menuId ", menuId
- menu = getMenu(menuId, self.context, self.request)
- for submenu in menu:
- print submenu
- return menu
-
-
+ return getMenu(menuId, self.context, self.request)
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-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar.zcml 2005-10-29 23:51:33 UTC (rev 39725)
@@ -5,12 +5,6 @@
<configure package="zope.app.boston.viewlets.toolbar.browser">
<resource
- name="divmenu.js"
- file="divmenu.js"
- layer="zope.app.boston.boston"
- />
-
- <resource
name="toolbar.css"
file="toolbar.css"
layer="zope.app.boston.boston"
@@ -22,33 +16,12 @@
layer="zope.app.boston.boston"
/>
- <resource
- name="toolbarArrow.gif"
- file="toolbarArrow.gif"
- layer="zope.app.boston.boston"
- />
-
- <resource
- name="toolbarArrowOver.gif"
- file="toolbarArrowOver.gif"
- layer="zope.app.boston.boston"
- />
-
<viewlet
- for="*"
- manager="zope.app.boston.IJavaScript"
- name="toolbar-js"
- permission="zope.Public"
- template="javascript.pt"
- layer="zope.app.boston.boston"
- />
-
- <viewlet
name="toolbar-css"
for="*"
manager="zope.app.boston.ICSS"
+ class="zope.app.boston.BostonToolBarCSSViewlet"
permission="zope.Public"
- template="css.pt"
layer="zope.app.boston.boston"
/>
@@ -60,71 +33,8 @@
template="viewlet.pt"
permission="zope.View"
layer="zope.app.boston.boston"
- weight="1"
/>
- <menu
- id="standalone"
- title="Standalone"
- />
-
- <menu
- id="foo"
- title="Foo" />
-
- <subMenuItem
- menu="zmi_actions"
- submenu="standalone"
- title="Standalone"
- permission="zope.Public"
- 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="bar"
- title="Bar sub"
- permission="zope.Public"
- />
-
- </menuItems>
-<!--
-
- <menuItems
- menu="file2"
- for="zope.interface.Interface">
-
- <menuItem
- action="javascript:alert('New')"
- title="New"
- permission="zope.Public"
- icon="/@@/filenew.png"
- />
-
- <menuItem
- action="javascript:alert('Open')"
- title="Open"
- permission="zope.Public"
- icon="/@@/fileopen.png"
- />
-
- </menuItems>
--->
</configure>
</configure>
\ No newline at end of file
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.zcml
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.zcml 2005-10-29 23:38:48 UTC (rev 39724)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.zcml 2005-10-29 23:51:33 UTC (rev 39725)
@@ -53,6 +53,7 @@
template="xmltree/browser/viewlet.pt"
permission="zope.View"
layer="zope.app.boston.boston"
+ weight="1"
/>
<pages
More information about the Zope3-Checkins
mailing list