[Zope3-checkins] SVN: Zope3/trunk/ Initial cut at a menu
demonstration, including sub-menus and icons.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Mar 1 12:56:04 EST 2005
Log message for revision 29363:
Initial cut at a menu demonstration, including sub-menus and icons.
Access via: http://localhost:8080/@@menudemo.html
Changed:
A Zope3/trunk/package-includes/zope.app.demo.menu-configure.zcml
A Zope3/trunk/src/zope/app/demo/menu/
A Zope3/trunk/src/zope/app/demo/menu/__init__.py
A Zope3/trunk/src/zope/app/demo/menu/configure.zcml
A Zope3/trunk/src/zope/app/demo/menu/editcopy.png
A Zope3/trunk/src/zope/app/demo/menu/editcut.png
A Zope3/trunk/src/zope/app/demo/menu/editpaste.png
A Zope3/trunk/src/zope/app/demo/menu/filenew.png
A Zope3/trunk/src/zope/app/demo/menu/fileopen.png
A Zope3/trunk/src/zope/app/demo/menu/filesave.png
A Zope3/trunk/src/zope/app/demo/menu/filesaveas.png
A Zope3/trunk/src/zope/app/demo/menu/macros.py
A Zope3/trunk/src/zope/app/demo/menu/menu_macros.pt
A Zope3/trunk/src/zope/app/demo/menu/menudemo.css
A Zope3/trunk/src/zope/app/demo/menu/menudemo.pt
A Zope3/trunk/src/zope/app/demo/menu/redo.png
A Zope3/trunk/src/zope/app/demo/menu/undo.png
-=-
Added: Zope3/trunk/package-includes/zope.app.demo.menu-configure.zcml
===================================================================
--- Zope3/trunk/package-includes/zope.app.demo.menu-configure.zcml 2005-03-01 17:54:46 UTC (rev 29362)
+++ Zope3/trunk/package-includes/zope.app.demo.menu-configure.zcml 2005-03-01 17:56:03 UTC (rev 29363)
@@ -0,0 +1 @@
+<include package="zope.app.demo.menu" />
Property changes on: Zope3/trunk/package-includes/zope.app.demo.menu-configure.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/demo/menu/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/demo/menu/__init__.py 2005-03-01 17:54:46 UTC (rev 29362)
+++ Zope3/trunk/src/zope/app/demo/menu/__init__.py 2005-03-01 17:56:03 UTC (rev 29363)
@@ -0,0 +1 @@
+# Make a package
Property changes on: Zope3/trunk/src/zope/app/demo/menu/__init__.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/demo/menu/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/demo/menu/configure.zcml 2005-03-01 17:54:46 UTC (rev 29362)
+++ Zope3/trunk/src/zope/app/demo/menu/configure.zcml 2005-03-01 17:56:03 UTC (rev 29363)
@@ -0,0 +1,305 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ i18n_domain="zope">
+
+ <!-- Presentation -->
+ <browser:page
+ for="*"
+ name="menudemo_macros"
+ permission="zope.Public"
+ class=".macros.MenuDemoMacros"
+ allowed_interface="zope.interface.common.mapping.IItemMapping"
+ />
+
+ <browser:page
+ for="*"
+ name="menudemo_macros_page"
+ permission="zope.Public"
+ template="menu_macros.pt"
+ />
+
+ <browser:resource
+ name="menudemo.css"
+ file="menudemo.css" />
+
+ <browser:page
+ name="menudemo.html"
+ for="zope.interface.Interface"
+ template="menudemo.pt"
+ permission="zope.Public" />
+
+ <browser:resource
+ name="filenew.png"
+ image="filenew.png" />
+
+ <browser:resource
+ name="fileopen.png"
+ image="fileopen.png" />
+
+ <browser:resource
+ name="filesave.png"
+ image="filesave.png" />
+
+ <browser:resource
+ name="filesaveas.png"
+ image="filesaveas.png" />
+
+ <browser:resource
+ name="undo.png"
+ image="undo.png" />
+
+ <browser:resource
+ name="redo.png"
+ image="redo.png" />
+
+ <browser:resource
+ name="editcopy.png"
+ image="editcopy.png" />
+
+ <browser:resource
+ name="editcut.png"
+ image="editcut.png" />
+
+ <browser:resource
+ name="editpaste.png"
+ image="editpaste.png" />
+
+
+ <!-- Menus -->
+
+ <browser:menu
+ id="openrecent"
+ title="Open Recent" />
+
+ <browser:menuItems
+ menu="openrecent"
+ for="zope.interface.Interface">
+
+ <browser:menuItem
+ action="javascript:alert('Open myfile.txt')"
+ title="myfile.txt"
+ permission="zope.Public"
+ />
+
+ <browser:menuItem
+ action="javascript:alert('Open folderX')"
+ title="folderX"
+ permission="zope.Public"
+ />
+
+ <browser:menuItem
+ action="javascript:alert('Open picture.png')"
+ title="picture.png"
+ permission="zope.Public"/>
+
+ </browser:menuItems>
+
+ <browser:menu
+ id="save"
+ title="Save" />
+
+ <browser:menuItems
+ menu="save"
+ for="zope.interface.Interface">
+
+ <browser:menuItem
+ action="javascript:alert('Save All')"
+ title="Save All"
+ permission="zope.Public"
+ icon="/@@/filesave.png"
+ />
+
+ <browser:menuItem
+ action="javascript:alert('Save As...')"
+ title="Save As ..."
+ permission="zope.Public"
+ icon="/@@/filesaveas.png"
+ />
+
+ </browser:menuItems>
+
+ <browser:menu
+ id="file"
+ title="File" />
+
+ <browser:menuItems
+ menu="file"
+ for="zope.interface.Interface">
+
+ <browser:menuItem
+ action="javascript:alert('New')"
+ title="New"
+ permission="zope.Public"
+ icon="/@@/filenew.png"
+ />
+
+ <browser:menuItem
+ action="javascript:alert('Open')"
+ title="Open"
+ permission="zope.Public"
+ icon="/@@/fileopen.png"
+ />
+
+ <browser:subMenuItem
+ submenu="openrecent"
+ title="Open Recent"
+ permission="zope.Public"
+ icon="/@@/fileopen.png"
+ />
+
+ <browser:subMenuItem
+ submenu="save"
+ action="javascript:alert('Save')"
+ title="Save"
+ permission="zope.Public"
+ icon="/@@/filesave.png"
+ />
+
+ </browser:menuItems>
+
+
+ <browser:menu
+ id="undo"
+ title="Undo" />
+
+ <browser:menuItems
+ menu="undo"
+ for="zope.interface.Interface">
+
+ <browser:menuItem
+ action="javascript:alert('Undo Last')"
+ title="Undo Last"
+ permission="zope.Public"
+ />
+
+ <browser:menuItem
+ action="javascript:alert('Undo All')"
+ title="Undo All"
+ permission="zope.Public"
+ />
+
+ </browser:menuItems>
+
+ <browser:menu
+ id="redo"
+ title="Redo" />
+
+ <browser:menuItems
+ menu="redo"
+ for="zope.interface.Interface">
+
+ <browser:menuItem
+ action="javascript:alert('Redo Last')"
+ title="Redo Last"
+ permission="zope.Public"
+ />
+
+ <browser:menuItem
+ action="javascript:alert('Redo All')"
+ title="Redo All"
+ permission="zope.Public"
+ />
+
+ </browser:menuItems>
+
+
+ <browser:menu
+ id="edit"
+ title="Edit" />
+
+ <browser:menuItems
+ menu="edit"
+ for="zope.interface.Interface">
+
+ <browser:subMenuItem
+ submenu="undo"
+ title="Undo"
+ permission="zope.Public"
+ icon="/@@/undo.png"
+ />
+
+ <browser:subMenuItem
+ submenu="redo"
+ title="Redo"
+ permission="zope.Public"
+ icon="/@@/redo.png"
+ />
+
+ <browser:menuItem
+ action="javascript:alert('Cut')"
+ title="Cut"
+ permission="zope.Public"
+ icon="/@@/editcut.png"
+ />
+
+ <browser:menuItem
+ action="javascript:alert('Copy')"
+ title="Copy"
+ permission="zope.Public"
+ icon="/@@/editcopy.png"
+ />
+
+ <browser:menuItem
+ action="javascript:alert('Paste')"
+ title="Paste"
+ permission="zope.Public"
+ icon="/@@/editpaste.png"
+ />
+
+ </browser:menuItems>
+
+
+ <browser:menu
+ id="help"
+ title="Help" />
+
+ <browser:menuItems
+ menu="help"
+ for="zope.interface.Interface">
+
+ <browser:menuItem
+ action="javascript:alert('About Menus')"
+ title="About Menus"
+ permission="zope.Public"
+ />
+
+ <browser:menuItem
+ action="javascript:alert('About Zope 3')"
+ title="About Zope 3"
+ permission="zope.Public"
+ icon="/@@/favicon.png"
+ />
+
+ </browser:menuItems>
+
+
+ <browser:menu
+ id="menubar"
+ title="Menu Bar" />
+
+ <browser:menuItems
+ menu="menubar"
+ for="zope.interface.Interface">
+
+ <browser:subMenuItem
+ submenu="file"
+ title="File"
+ permission="zope.Public"
+ />
+
+ <browser:subMenuItem
+ submenu="edit"
+ title="Edit"
+ permission="zope.Public"
+ />
+
+ <browser:subMenuItem
+ submenu="help"
+ title="Help"
+ permission="zope.Public"
+ />
+
+ </browser:menuItems>
+
+</configure>
Property changes on: Zope3/trunk/src/zope/app/demo/menu/configure.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/demo/menu/editcopy.png
===================================================================
(Binary files differ)
Property changes on: Zope3/trunk/src/zope/app/demo/menu/editcopy.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: Zope3/trunk/src/zope/app/demo/menu/editcut.png
===================================================================
(Binary files differ)
Property changes on: Zope3/trunk/src/zope/app/demo/menu/editcut.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: Zope3/trunk/src/zope/app/demo/menu/editpaste.png
===================================================================
(Binary files differ)
Property changes on: Zope3/trunk/src/zope/app/demo/menu/editpaste.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: Zope3/trunk/src/zope/app/demo/menu/filenew.png
===================================================================
(Binary files differ)
Property changes on: Zope3/trunk/src/zope/app/demo/menu/filenew.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: Zope3/trunk/src/zope/app/demo/menu/fileopen.png
===================================================================
(Binary files differ)
Property changes on: Zope3/trunk/src/zope/app/demo/menu/fileopen.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: Zope3/trunk/src/zope/app/demo/menu/filesave.png
===================================================================
(Binary files differ)
Property changes on: Zope3/trunk/src/zope/app/demo/menu/filesave.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: Zope3/trunk/src/zope/app/demo/menu/filesaveas.png
===================================================================
(Binary files differ)
Property changes on: Zope3/trunk/src/zope/app/demo/menu/filesaveas.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: Zope3/trunk/src/zope/app/demo/menu/macros.py
===================================================================
--- Zope3/trunk/src/zope/app/demo/menu/macros.py 2005-03-01 17:54:46 UTC (rev 29362)
+++ Zope3/trunk/src/zope/app/demo/menu/macros.py 2005-03-01 17:56:03 UTC (rev 29363)
@@ -0,0 +1,24 @@
+##############################################################################
+#
+# Copyright (c) 2003 Zope Corporation 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.
+#
+##############################################################################
+"""API Documentation macros
+
+$Id: macros.py 25177 2004-06-02 13:17:31Z jim $
+"""
+from zope.app.basicskin.standardmacros import StandardMacros
+
+BaseMacros = StandardMacros
+
+class MenuDemoMacros(BaseMacros):
+ """Page Template METAL macros for API Documentation"""
+ macro_pages = ('menudemo_macros_page',)
Property changes on: Zope3/trunk/src/zope/app/demo/menu/macros.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/demo/menu/menu_macros.pt
===================================================================
--- Zope3/trunk/src/zope/app/demo/menu/menu_macros.pt 2005-03-01 17:54:46 UTC (rev 29362)
+++ Zope3/trunk/src/zope/app/demo/menu/menu_macros.pt 2005-03-01 17:56:03 UTC (rev 29363)
@@ -0,0 +1,22 @@
+<metal:block define-macro="itemdisplay">
+ <img class="itemicon"
+ tal:condition="menuitem/icon"
+ tal:attributes="src menuitem/icon" />
+
+ <span tal:content="menuitem/title" />
+</metal:block>
+
+<metal:block define-macro="menuitem">
+ <a href=""
+ tal:attributes="href menuitem/action;">
+ <metal:block use-macro="context/@@menudemo_macros/itemdisplay" />
+ </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>
\ No newline at end of file
Property changes on: Zope3/trunk/src/zope/app/demo/menu/menu_macros.pt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/demo/menu/menudemo.css
===================================================================
--- Zope3/trunk/src/zope/app/demo/menu/menudemo.css 2005-03-01 17:54:46 UTC (rev 29362)
+++ Zope3/trunk/src/zope/app/demo/menu/menudemo.css 2005-03-01 17:56:03 UTC (rev 29363)
@@ -0,0 +1,98 @@
+a {
+ color: black;
+ text-decoration: none;
+}
+
+img#appicon {
+ float: left;
+ vertical-align: bottom;
+ clear: both;
+}
+
+img.itemicon {
+ float: left;
+ vertical-align: bottom;
+}
+
+div.window {
+ border: 2px #529CEC solid;
+ margin: 10pt;
+ padding: 0;
+}
+
+div.titlebar {
+ background: #529CEC;
+ padding: 3px;
+ font-weight: bold;
+ color: white;
+ text-align: center;
+}
+
+div.menubar {
+ background: #EEE;
+ padding: 6px;
+ padding-left: 10px;
+}
+
+div.menubar span {
+ margin-right: 15px;
+}
+
+
+ul {
+ padding: 0;
+ margin: 0;
+}
+
+ul li {
+ list-style-type: none;
+ position: relative;
+ margin: 0;
+ padding: 2px;
+ background: #EEE;
+}
+
+ul ul {
+ display: none;
+}
+
+ul li:hover > ul {
+ display: block;
+ position: absolute;
+ top: -1px;
+ left: 100%;
+}
+
+li a {
+ display: block;
+ padding: 1px;
+ text-decoration: none;
+ background: #EEE;
+}
+
+ul.topmenu li a:hover {
+ background: #DDD;
+}
+
+li.sub > a {
+ background: #EEE;
+}
+
+ul.topmenu {
+ width: 6em;
+ float: left;
+}
+
+ul.topmenu ul {
+ border: 1px solid #BBB;
+}
+
+ul.topmenu > li:hover > ul {
+ width: 10em;
+ top: 1.5em;
+ left: -3px;
+}
+
+ul ul {
+ width: 10em;
+}
Added: Zope3/trunk/src/zope/app/demo/menu/menudemo.pt
===================================================================
--- Zope3/trunk/src/zope/app/demo/menu/menudemo.pt 2005-03-01 17:54:46 UTC (rev 29362)
+++ Zope3/trunk/src/zope/app/demo/menu/menudemo.pt 2005-03-01 17:56:03 UTC (rev 29363)
@@ -0,0 +1,59 @@
+<!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"
+ i18n:domain="zope">
+
+ <head>
+ <title i18n:translate="">Menu Demo</title>
+
+ <style type="text/css" media="all">
+ @import url(/++resource++menudemo.css);
+ </style>
+
+ <link rel="icon" type="image/png"
+ tal:attributes="href context/++resource++favicon.png|default" />
+ </head>
+
+<head>
+
+<body>
+
+<div class="window">
+
+ <div class="titlebar">
+ <img id="appicon" src="/++resource++favicon.png" />
+ Zope 3 Editor - myfile.txt
+ </div>
+
+ <div class="menubar">
+
+ <ul class="topmenu" tal:repeat="menuitem context/@@view_get_menu/menubar">
+ <li class="sub">
+ <metal:block use-macro="context/@@menudemo_macros/menuitem" />
+ </li>
+ </ul>
+
+ </div>
+
+ <div class="content">
+
+ <h1>Silly Menu Demo</h1>
+
+ <p>This is a silly demo</p>
+ <p>This is a silly demo</p>
+ <p>This is a silly demo</p>
+ <p>This is a silly demo</p>
+ <p>This is a silly demo</p>
+ <p>This is a silly demo</p>
+ <p>This is a silly demo</p>
+ <p>This is a silly demo</p>
+
+ </div>
+
+</div>
+
+</body>
+</html>
Property changes on: Zope3/trunk/src/zope/app/demo/menu/menudemo.pt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/demo/menu/redo.png
===================================================================
(Binary files differ)
Property changes on: Zope3/trunk/src/zope/app/demo/menu/redo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: Zope3/trunk/src/zope/app/demo/menu/undo.png
===================================================================
(Binary files differ)
Property changes on: Zope3/trunk/src/zope/app/demo/menu/undo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the Zope3-Checkins
mailing list