git repos / PlatformFolders

blame: html/doxygen/4.0.0/menu.js

normal view · raw

3af4e794 Poul Sander 2021-07-07 21:02 1
/*
3af4e794 Poul Sander 2021-07-07 21:02 2
 @licstart  The following is the entire license notice for the JavaScript code in this file.
3af4e794 Poul Sander 2021-07-07 21:02 3
3af4e794 Poul Sander 2021-07-07 21:02 4
 The MIT License (MIT)
3af4e794 Poul Sander 2021-07-07 21:02 5
3af4e794 Poul Sander 2021-07-07 21:02 6
 Copyright (C) 1997-2020 by Dimitri van Heesch
3af4e794 Poul Sander 2021-07-07 21:02 7
3af4e794 Poul Sander 2021-07-07 21:02 8
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software
3af4e794 Poul Sander 2021-07-07 21:02 9
 and associated documentation files (the "Software"), to deal in the Software without restriction,
3af4e794 Poul Sander 2021-07-07 21:02 10
 including without limitation the rights to use, copy, modify, merge, publish, distribute,
3af4e794 Poul Sander 2021-07-07 21:02 11
 sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
3af4e794 Poul Sander 2021-07-07 21:02 12
 furnished to do so, subject to the following conditions:
3af4e794 Poul Sander 2021-07-07 21:02 13
3af4e794 Poul Sander 2021-07-07 21:02 14
 The above copyright notice and this permission notice shall be included in all copies or
3af4e794 Poul Sander 2021-07-07 21:02 15
 substantial portions of the Software.
3af4e794 Poul Sander 2021-07-07 21:02 16
3af4e794 Poul Sander 2021-07-07 21:02 17
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
3af4e794 Poul Sander 2021-07-07 21:02 18
 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3af4e794 Poul Sander 2021-07-07 21:02 19
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
3af4e794 Poul Sander 2021-07-07 21:02 20
 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3af4e794 Poul Sander 2021-07-07 21:02 21
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3af4e794 Poul Sander 2021-07-07 21:02 22
3af4e794 Poul Sander 2021-07-07 21:02 23
 @licend  The above is the entire license notice for the JavaScript code in this file
3af4e794 Poul Sander 2021-07-07 21:02 24
 */
7e54d64b sago007 2018-06-24 15:21 25
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
7e54d64b sago007 2018-06-24 15:21 26
  function makeTree(data,relPath) {
7e54d64b sago007 2018-06-24 15:21 27
    var result='';
7e54d64b sago007 2018-06-24 15:21 28
    if ('children' in data) {
7e54d64b sago007 2018-06-24 15:21 29
      result+='<ul>';
7e54d64b sago007 2018-06-24 15:21 30
      for (var i in data.children) {
7e54d64b sago007 2018-06-24 15:21 31
        result+='<li><a href="'+relPath+data.children[i].url+'">'+
7e54d64b sago007 2018-06-24 15:21 32
                                data.children[i].text+'</a>'+
7e54d64b sago007 2018-06-24 15:21 33
                                makeTree(data.children[i],relPath)+'</li>';
7e54d64b sago007 2018-06-24 15:21 34
      }
7e54d64b sago007 2018-06-24 15:21 35
      result+='</ul>';
7e54d64b sago007 2018-06-24 15:21 36
    }
7e54d64b sago007 2018-06-24 15:21 37
    return result;
7e54d64b sago007 2018-06-24 15:21 38
  }
7e54d64b sago007 2018-06-24 15:21 39
7e54d64b sago007 2018-06-24 15:21 40
  $('#main-nav').append(makeTree(menudata,relPath));
7e54d64b sago007 2018-06-24 15:21 41
  $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
7e54d64b sago007 2018-06-24 15:21 42
  if (searchEnabled) {
7e54d64b sago007 2018-06-24 15:21 43
    if (serverSide) {
3af4e794 Poul Sander 2021-07-07 21:02 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>');
7e54d64b sago007 2018-06-24 15:21 45
    } else {
3af4e794 Poul Sander 2021-07-07 21:02 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>');
7e54d64b sago007 2018-06-24 15:21 47
    }
7e54d64b sago007 2018-06-24 15:21 48
  }
7e54d64b sago007 2018-06-24 15:21 49
  $('#main-menu').smartmenus();
7e54d64b sago007 2018-06-24 15:21 50
}
3af4e794 Poul Sander 2021-07-07 21:02 51
/* @license-end */
1970-01-01 00:00 52