Author: xlawrence
Date: Tue Jan 10 17:06:29 2006
New Revision: 12759

URL: https://jahia.mine.nu/websvn/listing.php?sc=1&rev=12759&repname=jahia
Log:
added Zimbra example pages examples.jsp
added example of use of menus (will be use in a near future to convert the 
ActionMenus to Zimbra)

Added:
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/examples.jsp
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ButtonDown__H.gif   
(with props)
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ButtonUp__H.gif   
(with props)
    
trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/DvListViewActionMenu.js
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ExImg.js
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ExMsg.js
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/MenuExample.css
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/MenuExample.js
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/bg_button_down.gif   
(with props)
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/bg_button_up.gif   
(with props)
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/bg_pebble.gif   
(with props)
    trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/menu.jsp

Added: trunk/core/src/webapp/jsp/jahia/javascript/zimbra/examples.jsp
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/examples.jsp&rev=12759&repname=jahia
==============================================================================
--- trunk/core/src/webapp/jsp/jahia/javascript/zimbra/examples.jsp (added)
+++ trunk/core/src/webapp/jsp/jahia/javascript/zimbra/examples.jsp Tue Jan 10 
17:06:29 2006
@@ -0,0 +1,13 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8" %>
+<% final String path = request.getContextPath() + 
"/jsp/jahia/javascript/zimbra"; %>
+
+<html>
+<head>
+</head>
+
+<h2>Sample Jahia Apps using Zimbra</h2>
+<ul>
+    <li><a href="<%=path%>/complexTree/ComplexTree.jsp?debug=1">Complex 
Tree</a></li>
+    <li><a href="<%=path%>/menu/menu.jsp">Menu Example</a></li>
+</ul>
+</html>
\ No newline at end of file

Added: trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ButtonDown__H.gif
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ButtonDown__H.gif&rev=12759&repname=jahia
==============================================================================
Binary file - no diff available.

Added: trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ButtonUp__H.gif
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ButtonUp__H.gif&rev=12759&repname=jahia
==============================================================================
Binary file - no diff available.

Added: 
trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/DvListViewActionMenu.js
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/DvListViewActionMenu.js&rev=12759&repname=jahia
==============================================================================
--- 
trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/DvListViewActionMenu.js 
(added)
+++ 
trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/DvListViewActionMenu.js 
Tue Jan 10 17:06:29 2006
@@ -0,0 +1,78 @@
+function DvListViewActionMenu(parent, className, dialog) {
+
+       if (arguments.length == 0) return;
+       className = className || "ActionMenu";
+       DwtMenu.call(this, parent, DwtMenu.POPUP_STYLE, className, null, 
dialog);
+
+       this._menuItems = new Object();
+}
+
+DvListViewActionMenu.prototype = new DwtMenu;
+DvListViewActionMenu.prototype.constructor = DvListViewActionMenu;
+
+DvListViewActionMenu.prototype.toString = 
+function() {
+       return "DvListViewActionMenu";
+}
+
+DvListViewActionMenu.prototype.addSelectionListener =
+function(menuItemId, listener) {
+       this._menuItems[menuItemId].addSelectionListener(listener);
+}
+
+DvListViewActionMenu.prototype.removeSelectionListener =
+function(menuItemId, listener) {
+       this._menuItems[menuItemId].removeSelectionListener(listener);
+}
+
+DvListViewActionMenu.prototype.popup =
+function(delay, x, y) {
+       if (delay == null)
+               delay = 0;
+       if (x == null) 
+               x = Dwt.DEFAULT;
+       if (y == null)
+               y = Dwt.DEFAULT;
+       this.setLocation(x, y);
+       DwtMenu.prototype.popup.call(this, delay);
+}
+
+DvListViewActionMenu.prototype.popdown =
+function(delay) {
+    DBG.println("DvListViewActionMenu.prototype.popdown called");
+    if (delay == null)
+               delay = 0;
+    this.setLocation(Dwt.LOC_NOWHERE, Dwt.LOC_NOWHERE);
+    DwtMenu.prototype.popdown.call(this, delay);
+}
+
+DvListViewActionMenu.prototype.getItemCount =
+function() {
+       return DwtMenu.prototype.getItemCount.call(this);
+}
+
+DvListViewActionMenu.prototype.createOp =
+function(menuItemId, text, imageInfo, disImageInfo, enabled) {
+       var mi = this.createMenuItem.call(this, menuItemId, imageInfo, text, 
disImageInfo, enabled);
+       mi.setData(LmOperation.KEY_ID, menuItemId);
+       return mi;
+}
+
+DvListViewActionMenu.prototype.createMenuItem =
+function(menuItemId, imageInfo, text, disImageInfo, enabled, style, 
radioGroupId) {
+       var mi = this._menuItems[menuItemId] = new DwtMenuItem(this, style, 
radioGroupId);
+    mi.menuItemId = menuItemId;
+    if (imageInfo)
+               mi.setImage(imageInfo);
+       if (text)
+               mi.setText(text);
+       if (disImageInfo)
+               mi.setDisabledImage(disImageInfo);
+       mi.setEnabled(enabled !== false);
+    return mi;
+}
+
+DvListViewActionMenu.prototype.createSeparator =
+function() {
+       new DwtMenuItem(this, DwtMenuItem.SEPARATOR_STYLE);
+}

Added: trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ExImg.js
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ExImg.js&rev=12759&repname=jahia
==============================================================================
--- trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ExImg.js (added)
+++ trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ExImg.js Tue Jan 10 
17:06:29 2006
@@ -0,0 +1,38 @@
+/*
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: ZAPL 1.1
+ * 
+ * The contents of this file are subject to the Zimbra AJAX Public
+ * License Version 1.1 ("License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.zimbra.com/license
+ * 
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * The Original Code is: Zimbra AJAX Toolkit.
+ * 
+ * The Initial Developer of the Original Code is Zimbra, Inc.
+ * Portions created by Zimbra are Copyright (C) 2005 Zimbra, Inc.
+ * All Rights Reserved.
+ * 
+ * Contributor(s):
+ * 
+ * ***** END LICENSE BLOCK *****
+ */
+
+function ExImg() {
+}
+
+// Data for images = filename, width, height] Images are represented in this 
mode, rather than by 
+// simple image URLs because of the way in which we provide support for 
clients over low bandwidth
+// connections.
+
+
+// Icons
+
+ExImg.I_BLANK  = [null, 16, 16];
+ExImg.I_FOLDER  = ["ImgFolderIcon", 16, 16];
+ExImg.I_ICON  = ["ImgIconIcon", 16, 16];

Added: trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ExMsg.js
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ExMsg.js&rev=12759&repname=jahia
==============================================================================
--- trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ExMsg.js (added)
+++ trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/ExMsg.js Tue Jan 10 
17:06:29 2006
@@ -0,0 +1,27 @@
+/*
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: ZAPL 1.1
+ * 
+ * The contents of this file are subject to the Zimbra AJAX Public
+ * License Version 1.1 ("License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.zimbra.com/license
+ * 
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * The Original Code is: Zimbra AJAX Toolkit.
+ * 
+ * The Initial Developer of the Original Code is Zimbra, Inc.
+ * Portions created by Zimbra are Copyright (C) 2005 Zimbra, Inc.
+ * All Rights Reserved.
+ * 
+ * Contributor(s):
+ * 
+ * ***** END LICENSE BLOCK *****
+ */
+
+function ExMsg() {
+}

Added: trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/MenuExample.css
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/MenuExample.css&rev=12759&repname=jahia
==============================================================================
--- trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/MenuExample.css 
(added)
+++ trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/MenuExample.css Tue 
Jan 10 17:06:29 2006
@@ -0,0 +1,136 @@
+body {
+       margin: 0px;
+       overflow: hidden;
+}
+
+.MainShell {
+       background-color: rgb(37, 87, 173);
+}
+.BusyOverlay table, .VeilOverlay table {
+       filter:alpha(opacity=50);
+       -moz-opacity:0.5;
+       opacity:0.5;
+}
+.BusyOverlay table {
+       cursor: default;
+       background-color: transparent;
+}
+.VeilOverlay table {
+       cursor: default;
+       background-color: white;
+}
+.CurtainOverlay table {
+       background-color: rgb(37, 87, 173);
+}
+
+.actionMenuDiv{
+    display: block;
+    height: 24px;
+}
+
+/*
+ * Menus
+ */
+.DwtMenu {
+    background-color: rgb( 198, 197, 215 );
+}
+
+.DwtMenuItem {
+    background-color: transparent;
+}
+
+.DwtMenuItem-selected, .DwtMenuItem-IconArea-selected, 
.DwtMenuItem-CheckedArea-selected {
+    background-color: rgb( 249, 221, 135 );
+}
+
+.DwtMenuItem-IconArea, .DwtMenuItem-CheckedArea {
+    background-color: rgb( 198, 197, 215 );
+}
+
+.DwtMenuItem-Separator {
+    background-color: rgb( 124, 124, 148 );
+}
+
+.DwtMenuItem .Text, .DwtMenuItem .DisabledText, .DwtMenuItem-selected .Text {
+    font: menu;
+}
+
+.DwtMenuItem .DisabledText {
+    color: rgb( 130, 130, 130 );
+}
+
+.ActionMenu {
+    background-color: white;
+}
+
+.actionMenuDiv {
+       display: block;
+       height: 25px;
+}
+
+.DwtMenu, .ActionMenu {
+       background-image:url(bg_pebble.gif);
+       border: 1px solid;
+       border-color: #C7C7C7 #3E3E3E #3E3E3E #C7C7C7;
+}
+
+.DwtMenu {}
+.DwtMenuItem {
+       border:1px solid #EEEEEE;
+}
+
+.DwtMenuItem-selected, .DwtMenuItem-IconArea-selected, 
.DwtMenuItem-CheckedArea-selected {
+       background-image:url(ButtonUp__H.gif);
+       border: 1px solid;
+       border-color: #E0E0E0 #555555 #555555 #E0E0E0;
+}
+
+.DwtMenuItem-triggered, .DwtMenuItem-IconArea-triggered, 
.DwtMenuItem-CheckedArea-triggered {
+       background-image:url(ButtonDown__H.gif);
+       border:1px solid;
+       border-color: #555555 #E0E0E0 #E0E0E0 #555555;
+}
+
+.DwtMenuItem-IconArea, .DwtMenuItem-CheckedArea {}
+.DwtMenuItem-Separator {
+       background-color: #999999;
+}
+
+/*
+ * Buttons
+ */
+.DwtButton {
+    display: block;
+    width: 80px;
+    height: 23px;
+    background-image:url(bg_button_up.gif);
+       border: 1px solid;
+       border-color: #E0E0E0 #555555 #555555 #E0E0E0;;
+}
+.DwtButton-activated {
+    display: block;
+    width: 80px;
+    height: 23px;
+    background-image: url( bg_button_up.gif );
+    border-top: 1px solid;
+    border-right: 2px solid;
+    border-left: 1px solid;
+    border-bottom: 2px solid;
+    border-color: #E0E0E0 #555555 #555555 #E0E0E0;
+}
+.DwtButton-triggered {
+    display: block;
+    width: 80px;
+    height: 23px;
+    background-image:url(bg_button_down.gif);
+       border:1px solid;
+       border-color: #555555 #E0E0E0 #E0E0E0 #555555;
+}
+.DwtButton-toggled {
+    display: block;
+    width: 80px;
+    height: 23px;
+    background-image:url(bg_button_down.gif);
+       border:1px solid;
+       border-color: #555555 #E0E0E0 #E0E0E0 #555555;
+}
\ No newline at end of file

Added: trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/MenuExample.js
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/MenuExample.js&rev=12759&repname=jahia
==============================================================================
--- trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/MenuExample.js 
(added)
+++ trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/MenuExample.js Tue 
Jan 10 17:06:29 2006
@@ -0,0 +1,47 @@
+/**
+* Constructor
+*/
+function MenuExample() {
+}
+
+MenuExample.prototype.run = function () {
+    // Create the shell
+    var shell = new DwtShell("MainShell", false, null, null, null, true);
+    shell.setSize(0, 0);
+
+    var composite = new DwtComposite(shell, null, Dwt.ABSOLUTE_STYLE);
+    this.createButtonMenu(composite, 5, 1);
+    composite.zShow(true);
+
+    composite = new DwtComposite(shell, null, Dwt.ABSOLUTE_STYLE);
+    this.createButtonMenu(composite, 4, 2);
+    composite.zShow(true);
+}
+
+MenuExample.prototype._myListener = function(ev) {
+    DBG.println("_myListener: " + ev.item.menuItemId);
+    var actionMenu = ev.item.parent;
+}
+
+MenuExample.prototype._buttonListener = function(ev) {
+    DBG.println("_buttonListener called");
+    var bounds = ev.item.getBounds();
+    ev.item._actionMenu.popup(null, bounds.x + bounds.width, bounds.y);
+}
+
+MenuExample.prototype.createButtonMenu = function (composite, menuItems, 
index) {
+    var menu = new DvListViewActionMenu(composite);
+    menu.setBounds(Dwt.LOC_NOWHERE, Dwt.LOC_NOWHERE);
+
+    for (var i = 0; i < menuItems; i++) {
+        menu.createMenuItem(i, null, "Item " + i, null, null, 
DwtMenuItem.SELECT_STYLE);
+        menu.addSelectionListener(i, this._myListener);
+    }
+
+    var b = new DwtButton(composite);
+    b.setText("Button " + index);
+    b.addSelectionListener(new AjxListener(this, this._buttonListener));
+    b._actionMenu = menu;
+    //b.setSize(80, 22);
+    
document.getElementById("menu"+index).appendChild(composite.getHtmlElement());
+}
\ No newline at end of file

Added: trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/bg_button_down.gif
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/bg_button_down.gif&rev=12759&repname=jahia
==============================================================================
Binary file - no diff available.

Added: trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/bg_button_up.gif
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/bg_button_up.gif&rev=12759&repname=jahia
==============================================================================
Binary file - no diff available.

Added: trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/bg_pebble.gif
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/bg_pebble.gif&rev=12759&repname=jahia
==============================================================================
Binary file - no diff available.

Added: trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/menu.jsp
URL: 
https://jahia.mine.nu/websvn/filedetails.php?path=/trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/menu.jsp&rev=12759&repname=jahia
==============================================================================
--- trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/menu.jsp (added)
+++ trunk/core/src/webapp/jsp/jahia/javascript/zimbra/menu/menu.jsp Tue Jan 10 
17:06:29 2006
@@ -0,0 +1,55 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8" %>
+<%@ taglib uri="ajaxLib" prefix="ajax" %>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+    <title>Menu Example</title>
+
+    <ajax:zimbraInclude/>
+
+    <style type="text/css">
+        <!--
+        @import url( MenuExample.css );
+        -->
+    </style>
+    
+    <script type="text/javascript" src="DvListViewActionMenu.js"></script>
+    <script type="text/javascript" src="MenuExample.js"></script>
+</head>
+
+<body>
+<noscript><p><b>Javascript must be enabled to use this.</b></p></noscript>
+
+<script type="text/javascript" language="javascript">
+    function launch() {
+        DBG = new AjxDebug(AjxDebug.DBG3, null, false);
+        // DBG = new AjxDebug(AjxDebug.NONE, null, false);
+        Instance = new MenuExample();
+        Instance.run();
+    }
+
+    AjxCore.addOnloadListener(launch);
+</script>
+
+<table>
+    <tr>
+        <td width="200">&nbsp;</td>
+        <td>
+            <p>Menu should be below</p>
+
+            <div class="actionMenuDiv" id="menu1"></div>
+
+            <p>Menu should be above</p>
+
+            <p>Menu should be below</p>
+
+            <div class="actionMenuDiv" id="menu2"></div>
+
+            <p>Menu should be above</p>
+        </td>
+    </tr>
+</table>
+
+</body>
+</html>
\ No newline at end of file

Reply via email to