# HG changeset patch # User luginbue # Date 1014254826 -3600 # Node ID 84a481a388bb09bf6997ea8307a08acebaf5c7e0 # Parent 054ebc8510596d6bebf05d6c39ccb14ab9c9efbc first update of new client-version diff -r 054ebc851059 -r 84a481a388bb client/digitallibrary/buttons/fw_menu.js --- a/client/digitallibrary/buttons/fw_menu.js Thu Feb 21 02:27:06 2002 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,744 +0,0 @@ -/* 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