Index: trunk/admin/browse/fw_menu.js =================================================================== diff -u -N -r4971 -r7635 --- trunk/admin/browse/fw_menu.js (.../fw_menu.js) (revision 4971) +++ trunk/admin/browse/fw_menu.js (.../fw_menu.js) (revision 7635) @@ -14,7 +14,7 @@ * Modified By Intechnic Corporation for use in In-Portal * 6/28/02 * - */ + */ function Menu(label) { this.version = "990702 [xMenu; fw_menu.js]"; @@ -38,11 +38,12 @@ var $base_path = ''; var $base_tag = document.getElementsByTagName('BASE'); if ($base_tag.length) { - $base_path = $base_tag[0].href.replace('kernel/admin_templates', 'admin'); + $base_path = $base_tag[0].href.replace('kernel/admin_templates', 'admin').replace('core/admin_templates', 'admin'); } +// alert('base: '+$base_tag[0].href+' => '+$base_path) this.imagePath = $base_path + 'images/'; - + this.childMenuIcon = "menu_arrow.gif"; this.items = new Array(); this.actions = new Array(); @@ -90,7 +91,7 @@ default: this.types[this.types.length] = ''; } -} +} function addMenuSeparator() { this.items[this.items.length] = "separator"; @@ -99,7 +100,7 @@ this.menuItemBorder = 0; } -// For NS6. +// For NS6. function FIND(item,called_from) { if (document.all) return(document.all[item]); @@ -131,7 +132,7 @@ } else { - return false; + return false; } } else @@ -141,11 +142,11 @@ } window.fwHideMenuTimer = null; - if (!container) return; window.triedToWriteMenus = true; + if (!container) return; window.triedToWriteMenus = true; container.isContainer = true; container.menus = new Array(); - - for (var i=0; i \n'; content += ' \n \n\n'; } i=x; } - if (document.layers) { + if (document.layers) { container.clip.width = window.innerWidth; container.clip.height = window.innerHeight; container.onmouseout = mouseoutMenu; @@ -334,7 +335,7 @@ } else { container.document.open("text/html"); container.document.writeln(content); - container.document.close(); + container.document.close(); } if (!FIND("menuLayer0")) return; var menuCount = 0; @@ -356,14 +357,14 @@ var l = FIND("menuItem" + menuCount); l.Menu = container.menus[x]; if (l.addEventListener) { // ns6 - l.style.width = menu.menuItemWidth; + l.style.width = menu.menuItemWidth; l.style.height = menu.menuItemHeight; l.style.top = top; l.addEventListener("mouseover", onMenuItemOver, false); l.addEventListener("click", onMenuItemAction, false); l.addEventListener("mouseout", mouseoutMenu, false); } else { //ie - l.style.pixelWidth = menu.menuItemWidth; + l.style.pixelWidth = menu.menuItemWidth; l.style.pixelHeight = menu.menuItemHeight; l.style.pixelTop = top; } @@ -389,11 +390,11 @@ var sep = FIND("menuSeparator" + menuCount); if (sep) { sep.style.clip = "rect(0 " + (menu.menuItemWidth - 3) + " 1 0)"; - sep.style.width = sep.style.pixelWidth = menu.menuItemWidth; + sep.style.width = sep.style.pixelWidth = menu.menuItemWidth; sep.style.backgroundColor = menu.bgColor; sep = FIND("menuSeparatorLite" + menuCount); sep.style.clip = "rect(1 " + (menu.menuItemWidth - 3) + " 2 0)"; - sep.style.width = sep.style.pixelWidth = menu.menuItemWidth; + sep.style.width = sep.style.pixelWidth = menu.menuItemWidth; sep.style.backgroundColor = menu.menuLiteBgColor; l.style.height = l.style.pixelHeight = menu.menuItemHeight/2; l.isSeparator = true @@ -421,10 +422,10 @@ s.height = s.pixelHeight = menu.menuHeight+(menu.menuBorder*4); } } - if (document.captureEvents) { + if (document.captureEvents) { document.captureEvents(Event.MOUSEUP); } - if (document.addEventListener) { + if (document.addEventListener) { document.addEventListener("mouseup", onMenuItemOver, false); } if (document.layers && window.innerWidth) { @@ -438,10 +439,10 @@ } function NS4resize() { - if (NS4sIW < window.innerWidth || - NS4sIW > window.innerWidth || - NS4sIH > window.innerHeight || - NS4sIH < window.innerHeight ) + if (NS4sIW < window.innerWidth || + NS4sIW > window.innerWidth || + NS4sIH > window.innerHeight || + NS4sIH < window.innerHeight ) { window.location.reload(); } @@ -481,7 +482,7 @@ if (a.Menu.bgImageUp) { a.style.background = "url(" + a.Menu.bgImageUp +")";; } - } + } if (l.isSeparator) return; l.style.backgroundColor = l.menuHiliteBgColor; l.zIndex = 100; // magic IE 4.5 mac happy doohicky. jba @@ -539,7 +540,7 @@ } function FW_showMenu(menu, x, y, child) { - if (!window.fwWroteMenu) + if (!window.fwWroteMenu) { alert('No Menu Written'); return; @@ -557,18 +558,18 @@ var l = child; } if (!l) return; - for (var i=0; i 0) + if (l.layers[i].document.layers.length > 0) FW_showMenu(null, "relative", "relative", l.layers[i]); } if (l.parentLayer) { - if (x != "relative") + if (x != "relative") l.parentLayer.left = x || window.pageX || 0; - if (l.parentLayer.left + l.clip.width > window.innerWidth) + if (l.parentLayer.left + l.clip.width > window.innerWidth) l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth); - if (y != "relative") + if (y != "relative") l.parentLayer.top = y || window.pageY || 0; if (l.parentLayer.isContainer) { l.Menu.xOffset = window.pageXOffset; @@ -581,17 +582,17 @@ l.visibility = "inherit"; if (l.Menu) l.Menu.container.visibility = "inherit"; } else if (FIND("menuItem0")) { - var l = menu.menuLayer || menu; + var l = menu.menuLayer || menu; hideActiveMenus(); if (typeof(l) == "string") { l = FIND(l); } window.ActiveMenu = l; var s = l.style; s.visibility = "inherit"; - if (x != "relative") + if (x != "relative") s.left = s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0; - if (y != "relative") + if (y != "relative") s.top = s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0; l.Menu.xOffset = document.body.scrollLeft; l.Menu.yOffset = document.body.scrollTop; @@ -697,7 +698,7 @@ childMenu.left = l.parentLayer.left + l.parentLayer.clip.width + l.Menu.menuLayer.left -5; } var w = childMenu.clip.width+childMenu.left-l.Menu.container.clip.left; - if (w > l.Menu.container.clip.width) + if (w > l.Menu.container.clip.width) l.Menu.container.clip.width = w; var h = childMenu.clip.height+childMenu.top-l.Menu.container.clip.top; if (h > l.Menu.container.clip.height) l.Menu.container.clip.height = h; @@ -714,7 +715,7 @@ // alert(left + parseInt(s.width) - document.body.scrollLeft) if (left + parseInt(s.width) > document.body.scrollLeft + document.body.offsetWidth) left -= parseInt(s.width) + l.offsetWidth - 5; - s.left = left; + s.left = left; } else { // zilla case @@ -724,7 +725,7 @@ // alert() if (left + parseInt(s.width) > document.body.offsetWidth) left -= parseInt(s.width) + l.offsetWidth - 5; - s.left = left; + s.left = left; } childMenu.style.visibility = "inherit"; } else { @@ -759,4 +760,4 @@ { if(variable==null) return false; return (typeof(variable)=='undefined')?false:true; -} +}