File indexing completed on 2025-05-04 05:29:34
0001 /** 0002 * ocs-webserver 0003 * 0004 * Copyright 2016 by pling GmbH. 0005 * 0006 * This file is part of ocs-webserver. 0007 * 0008 * This program is free software: you can redistribute it and/or modify 0009 * it under the terms of the GNU Affero General Public License as 0010 * published by the Free Software Foundation, either version 3 of the 0011 * License, or (at your option) any later version. 0012 * 0013 * This program is distributed in the hope that it will be useful, 0014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0016 * GNU Affero General Public License for more details. 0017 * 0018 * You should have received a copy of the GNU Affero General Public License 0019 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0020 **/ 0021 /** 0022 * backend navigation with yui-lib 0023 */ 0024 var aItemData = [ 0025 0026 { 0027 text: "General", 0028 submenu: { 0029 id: "allabout", 0030 itemdata: [ 0031 {text: "Dashboard", url: "/backend/"}, 0032 {text: "File-Browser", url: "/backend/index/filebrowser"} 0033 ] 0034 } 0035 }, 0036 { 0037 text: "Products", 0038 submenu: { 0039 id: "projects", 0040 itemdata: [ 0041 {text: "Categories", url: "/backend/categories"}, 0042 {text: "Claims", url: "/backend/claim"} 0043 ] 0044 } 0045 }, 0046 { 0047 text: "Comments", 0048 submenu: { 0049 id: "comments", 0050 itemdata: [ 0051 {text: "Comments", url: "/backend/comments"} 0052 ] 0053 } 0054 }, 0055 { 0056 text: "Reports", 0057 submenu: { 0058 id: "reports", 0059 itemdata: [ 0060 {text: "Comments", url: "/backend/reportcomments"}, 0061 {text: "Products", url: "/backend/reportproducts"} 0062 ] 0063 } 0064 }, 0065 { 0066 text: "Tags", 0067 submenu: { 0068 id: "tags", 0069 itemdata: [ 0070 {text: "Manage", url: "/backend/tags"} 0071 ] 0072 } 0073 }, 0074 { 0075 text: "Stores", 0076 submenu: { 0077 id: "stores", 0078 itemdata: [ 0079 {text: "Config", url: "/backend/store"}, 0080 {text: "Categories", url: "/backend/storecategories"}, 0081 {text: "Init Cache", url: "/backend/store/initcache"} 0082 ] 0083 } 0084 }, 0085 { 0086 text: "Operating Systems", 0087 submenu: { 0088 id: "operatingsystem", 0089 itemdata: [ 0090 {text: "Config", url: "/backend/operatingsystem"} 0091 ] 0092 } 0093 }, 0094 { 0095 text: "Account", 0096 submenu: { 0097 id: "account", 0098 itemdata: [ 0099 {text: "logout", url: "/logout"}, 0100 {text: "frontend", url: "/"} 0101 ] 0102 } 0103 } 0104 0105 0106 ]; 0107 0108 0109 $(document).ready(function () { 0110 0111 $("body").addClass("yui-skin-sam"); 0112 0113 var oMenuBar = new YAHOO.widget.MenuBar("ocsbackendnavigation", { 0114 lazyload: true, 0115 itemdata: aItemData 0116 }); 0117 0118 oMenuBar.render(document.body); 0119 0120 // Add a "show" event listener for each submenu. 0121 0122 function onSubmenuShow() { 0123 0124 var oIFrame, 0125 oElement, 0126 nOffsetWidth; 0127 0128 0129 // Keep the left-most submenu against the left edge of the browser viewport 0130 0131 if (this.id == "allgemein") { 0132 0133 YAHOO.util.Dom.setX(this.element, 0); 0134 0135 oIFrame = this.iframe; 0136 0137 0138 if (oIFrame) { 0139 0140 YAHOO.util.Dom.setX(oIFrame, 0); 0141 0142 } 0143 0144 this.cfg.setProperty("x", 0, true); 0145 0146 } 0147 0148 0149 /* 0150 Need to set the width for submenus of submenus in IE to prevent the mouseout 0151 event from firing prematurely when the user mouses off of a MenuItem's 0152 text node. 0153 */ 0154 0155 if ((this.id == "filemenu" || this.id == "editmenu") && YAHOO.env.ua.ie) { 0156 0157 oElement = this.element; 0158 nOffsetWidth = oElement.offsetWidth; 0159 0160 /* 0161 Measuring the difference of the offsetWidth before and after 0162 setting the "width" style attribute allows us to compute the 0163 about of padding and borders applied to the element, which in 0164 turn allows us to set the "width" property correctly. 0165 */ 0166 0167 oElement.style.width = nOffsetWidth + "px"; 0168 oElement.style.width = (nOffsetWidth - (oElement.offsetWidth - nOffsetWidth)) + "px"; 0169 0170 } 0171 0172 } 0173 0174 0175 // Subscribe to the "show" event for each submenu 0176 0177 oMenuBar.subscribe("show", onSubmenuShow); 0178 });