table on topology views add and start router controller
[VSoRC/.git] / js / topology / mainmenu.js
1 // Copyright (c) 2018 Maen Artimy
2 // 
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
6 // 
7 //   http://www.apache.org/licenses/LICENSE-2.0
8 //
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.
14
15 $(function () {
16   var path = window.location.pathname;
17   var url  = window.location.href;
18
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> \
31   </div>'
32
33 /*  <div class="topmenu"> \
34   <a href="#home">Flow Control</a> \
35   <div id="myLinks"> \
36     <a href="flowform.html">Flow Entry</a> \
37     <a href="flowupload.html">Flow Upload</a> \
38   </div> \
39 </div> \*/
40
41   //var logo = '<div class="logowrapper"></div>';
42
43   var hashtag = url.lastIndexOf('#')
44   var slash = url.lastIndexOf('/') + 1
45   var filename = hashtag < 0 ? url.substring(slash) : url.substring(slash, hashtag);
46
47   $('#menu').html(menu);
48   var $link = $('a[href="' + filename + '"]');
49   $link.addClass("active");
50   $link.parent().show();
51
52   $(".topmenu").click(function() {
53     //$("#myLinks").show();
54     $("#myLinks").animate({height: "toggle"}, 120);
55   })
56
57
58 });