1 // Copyright (c) 2018 Maen Artimy
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
16 var path = window.location.pathname;
17 var url = window.location.href;
19 var menu = '<div class="menuitem"> \
20 <a href="index.html">Home</a> \
21 <a href="flows.html">Flows</a> \
22 <a href="groups.html">Groups</a> \
23 <a href="meters.html">Meters</a> \
24 <a href="flowform.html">Flow Control</a> \
25 <a href="groupform.html">Group Control</a> \
26 <a href="meterform.html">Meter Control</a> \
27 <a href="topology.html">Topology</a> \
28 <a href="messages.html">Messages</a> \
29 <a href="config.html">Configuration</a> \
30 <a href="about.html">About</a> \
33 /* <div class="topmenu"> \
34 <a href="#home">Flow Control</a> \
36 <a href="flowform.html">Flow Entry</a> \
37 <a href="flowupload.html">Flow Upload</a> \
41 //var logo = '<div class="logowrapper"></div>';
43 var hashtag = url.lastIndexOf('#')
44 var slash = url.lastIndexOf('/') + 1
45 var filename = hashtag < 0 ? url.substring(slash) : url.substring(slash, hashtag);
47 $('#menu').html(menu);
48 var $link = $('a[href="' + filename + '"]');
49 $link.addClass("active");
50 $link.parent().show();
52 $(".topmenu").click(function() {
53 //$("#myLinks").show();
54 $("#myLinks").animate({height: "toggle"}, 120);