git repos / PlatformFolders

blame: html/doxygen/4.1.0/menu.js

normal view · raw

9e6bb466 Poul Sander 2021-08-08 15:42 1
/*
9e6bb466 Poul Sander 2021-08-08 15:42 2
 @licstart  The following is the entire license notice for the
9e6bb466 Poul Sander 2021-08-08 15:42 3
 JavaScript code in this file.
9e6bb466 Poul Sander 2021-08-08 15:42 4
9e6bb466 Poul Sander 2021-08-08 15:42 5
 Copyright (C) 1997-2017 by Dimitri van Heesch
9e6bb466 Poul Sander 2021-08-08 15:42 6
9e6bb466 Poul Sander 2021-08-08 15:42 7
 This program is free software; you can redistribute it and/or modify
9e6bb466 Poul Sander 2021-08-08 15:42 8
 it under the terms of the GNU General Public License as published by
9e6bb466 Poul Sander 2021-08-08 15:42 9
 the Free Software Foundation; either version 2 of the License, or
9e6bb466 Poul Sander 2021-08-08 15:42 10
 (at your option) any later version.
9e6bb466 Poul Sander 2021-08-08 15:42 11
9e6bb466 Poul Sander 2021-08-08 15:42 12
 This program is distributed in the hope that it will be useful,
9e6bb466 Poul Sander 2021-08-08 15:42 13
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9e6bb466 Poul Sander 2021-08-08 15:42 14
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9e6bb466 Poul Sander 2021-08-08 15:42 15
 GNU General Public License for more details.
9e6bb466 Poul Sander 2021-08-08 15:42 16
9e6bb466 Poul Sander 2021-08-08 15:42 17
 You should have received a copy of the GNU General Public License along
9e6bb466 Poul Sander 2021-08-08 15:42 18
 with this program; if not, write to the Free Software Foundation, Inc.,
9e6bb466 Poul Sander 2021-08-08 15:42 19
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
9e6bb466 Poul Sander 2021-08-08 15:42 20
9e6bb466 Poul Sander 2021-08-08 15:42 21
 @licend  The above is the entire license notice
9e6bb466 Poul Sander 2021-08-08 15:42 22
 for the JavaScript code in this file
9e6bb466 Poul Sander 2021-08-08 15:42 23
 */
9e6bb466 Poul Sander 2021-08-08 15:42 24
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
9e6bb466 Poul Sander 2021-08-08 15:42 25
  function makeTree(data,relPath) {
9e6bb466 Poul Sander 2021-08-08 15:42 26
    var result='';
9e6bb466 Poul Sander 2021-08-08 15:42 27
    if ('children' in data) {
9e6bb466 Poul Sander 2021-08-08 15:42 28
      result+='<ul>';
9e6bb466 Poul Sander 2021-08-08 15:42 29
      for (var i in data.children) {
9e6bb466 Poul Sander 2021-08-08 15:42 30
        result+='<li><a href="'+relPath+data.children[i].url+'">'+
9e6bb466 Poul Sander 2021-08-08 15:42 31
                                data.children[i].text+'</a>'+
9e6bb466 Poul Sander 2021-08-08 15:42 32
                                makeTree(data.children[i],relPath)+'</li>';
9e6bb466 Poul Sander 2021-08-08 15:42 33
      }
9e6bb466 Poul Sander 2021-08-08 15:42 34
      result+='</ul>';
9e6bb466 Poul Sander 2021-08-08 15:42 35
    }
9e6bb466 Poul Sander 2021-08-08 15:42 36
    return result;
9e6bb466 Poul Sander 2021-08-08 15:42 37
  }
9e6bb466 Poul Sander 2021-08-08 15:42 38
9e6bb466 Poul Sander 2021-08-08 15:42 39
  $('#main-nav').append(makeTree(menudata,relPath));
9e6bb466 Poul Sander 2021-08-08 15:42 40
  $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
9e6bb466 Poul Sander 2021-08-08 15:42 41
  if (searchEnabled) {
9e6bb466 Poul Sander 2021-08-08 15:42 42
    if (serverSide) {
9e6bb466 Poul Sander 2021-08-08 15:42 43
      $('#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.png" 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>');
9e6bb466 Poul Sander 2021-08-08 15:42 44
    } else {
9e6bb466 Poul Sander 2021-08-08 15:42 45
      $('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><span class="left"><img id="MSearchSelect" src="'+relPath+'search/mag_sel.png" 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.png" alt=""/></a></span></div></li>');
9e6bb466 Poul Sander 2021-08-08 15:42 46
    }
9e6bb466 Poul Sander 2021-08-08 15:42 47
  }
9e6bb466 Poul Sander 2021-08-08 15:42 48
  $('#main-menu').smartmenus();
9e6bb466 Poul Sander 2021-08-08 15:42 49
}
9e6bb466 Poul Sander 2021-08-08 15:42 50
/* @license-end */
1970-01-01 00:00 51