| d359b830 |
Poul Sander |
2022-02-06 17:49 |
1 |
/* |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
2 |
@licstart The following is the entire license notice for the JavaScript code in this file. |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
3 |
|
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
4 |
The MIT License (MIT) |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
5 |
|
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
6 |
Copyright (C) 1997-2020 by Dimitri van Heesch |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
7 |
|
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
8 |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
9 |
and associated documentation files (the "Software"), to deal in the Software without restriction, |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
10 |
including without limitation the rights to use, copy, modify, merge, publish, distribute, |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
11 |
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
12 |
furnished to do so, subject to the following conditions: |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
13 |
|
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
14 |
The above copyright notice and this permission notice shall be included in all copies or |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
15 |
substantial portions of the Software. |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
16 |
|
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
17 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
18 |
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
19 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
20 |
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
21 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
22 |
|
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
23 |
@licend The above is the entire license notice for the JavaScript code in this file |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
24 |
*/ |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
25 |
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
26 |
function makeTree(data,relPath) { |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
27 |
var result=''; |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
28 |
if ('children' in data) { |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
29 |
result+='<ul>'; |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
30 |
for (var i in data.children) { |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
31 |
result+='<li><a href="'+relPath+data.children[i].url+'">'+ |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
32 |
data.children[i].text+'</a>'+ |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
33 |
makeTree(data.children[i],relPath)+'</li>'; |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
34 |
} |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
35 |
result+='</ul>'; |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
36 |
} |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
37 |
return result; |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
38 |
} |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
39 |
|
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
40 |
$('#main-nav').append(makeTree(menudata,relPath)); |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
41 |
$('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
42 |
if (searchEnabled) { |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
43 |
if (serverSide) { |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
44 |
$('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><div class="left"><form id="FSearchBox" action="'+relPath+searchPage+'" method="get"><img id="MSearchSelect" src="'+relPath+'search/mag.svg" alt=""/><input type="text" id="MSearchField" name="query" value="'+search+'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"></form></div><div class="right"></div></div></li>'); |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
45 |
} else { |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
46 |
$('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><span class="left"><img id="MSearchSelect" src="'+relPath+'search/mag_sel.svg" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/><input type="text" id="MSearchField" value="'+search+'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/></span><span class="right"><a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="'+relPath+'search/close.svg" alt=""/></a></span></div></li>'); |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
47 |
} |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
48 |
} |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
49 |
$('#main-menu').smartmenus(); |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
50 |
} |
| d359b830 |
Poul Sander |
2022-02-06 17:49 |
51 |
/* @license-end */ |
|
|
1970-01-01 00:00 |
52 |
|