# HG changeset patch
# User robcast
# Date 1011277792 -3600
# Node ID d484237a9794f5541d478e7690561fd53cf878e4
# Parent bb7864627cfa2288ccc99f0c54a7b7c2dfad79ec
First import of client module
diff -r bb7864627cfa -r d484237a9794 client/digitallibrary/buttons/fw_menu.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/buttons/fw_menu.js Thu Jan 17 15:29:52 2002 +0100
@@ -0,0 +1,744 @@
+/* fw_menu -- JS library for digilib buttons
+
+ Digital Image Library servlet components
+
+ Copyright (C) 2001, 2002 Christian Luginbuehl (luginbuehl@student.unibe.ch)
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ Please read license.txt for the full details. A copy of the GPL
+ may be found at http://www.gnu.org/copyleft/lgpl.html
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh) {
+ this.version = "990702 [Menu; menu.js]";
+ this.type = "Menu";
+ this.menuWidth = mw;
+ this.menuItemHeight = mh;
+ this.fontSize = fs||12;
+ this.fontWeight = "plain";
+ this.fontFamily = fnt||"arial,helvetica,verdana,sans-serif";
+ this.fontColor = fclr||"#000000";
+ this.fontColorHilite = fhclr||"#ffffff";
+ this.bgColor = "#555555";
+ this.menuBorder = 1;
+ this.menuItemBorder = 1;
+ this.menuItemBgColor = bg||"#cccccc";
+ this.menuLiteBgColor = "#ffffff";
+ this.menuBorderBgColor = "#777777";
+ this.menuHiliteBgColor = bgh||"#000084";
+ this.menuContainerBgColor = "#cccccc";
+ this.childMenuIcon = "arrows.gif";
+ this.items = new Array();
+ this.actions = new Array();
+ this.childMenus = new Array();
+
+ this.hideOnMouseOut = true;
+
+ this.addMenuItem = addMenuItem;
+ this.addMenuSeparator = addMenuSeparator;
+ this.writeMenus = writeMenus;
+ this.FW_showMenu = FW_showMenu;
+ this.onMenuItemOver = onMenuItemOver;
+ this.onMenuItemAction = onMenuItemAction;
+ this.hideMenu = hideMenu;
+ this.hideChildMenu = hideChildMenu;
+
+ if (!window.menus) window.menus = new Array();
+ this.label = label || "menuLabel" + window.menus.length;
+ window.menus[this.label] = this;
+ window.menus[window.menus.length] = this;
+ if (!window.activeMenus) window.activeMenus = new Array();
+}
+
+function addMenuItem(label, action) {
+ this.items[this.items.length] = label;
+ this.actions[this.actions.length] = action;
+}
+
+function addMenuSeparator() {
+ this.items[this.items.length] = "separator";
+ this.actions[this.actions.length] = "";
+ this.menuItemBorder = 0;
+}
+
+// For NS6.
+function FIND(item) {
+ if (document.all) return(document.all[item]);
+ if (document.getElementById) return(document.getElementById(item));
+ return(false);
+}
+
+function writeMenus(container) {
+ if (window.triedToWriteMenus) return;
+
+ if (!container && document.layers) {
+ window.delayWriteMenus = this.writeMenus;
+ var timer = setTimeout('delayWriteMenus()', 250);
+ container = new Layer(100);
+ clearTimeout(timer);
+ } else if (document.all || document.hasChildNodes) {
+ document.writeln('');
+ container = FIND("menuContainer");
+ }
+
+ window.fwHideMenuTimer = null;
+ if (!container) return;
+ window.triedToWriteMenus = true;
+ container.isContainer = true;
+ container.menus = new Array();
+ for (var i=0; i