shun-iwasawa 82a8f5
/*
shun-iwasawa 82a8f5
 @licstart  The following is the entire license notice for the JavaScript code in this file.
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
 The MIT License (MIT)
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
 Copyright (C) 1997-2020 by Dimitri van Heesch
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software
shun-iwasawa 82a8f5
 and associated documentation files (the "Software"), to deal in the Software without restriction,
shun-iwasawa 82a8f5
 including without limitation the rights to use, copy, modify, merge, publish, distribute,
shun-iwasawa 82a8f5
 sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
shun-iwasawa 82a8f5
 furnished to do so, subject to the following conditions:
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
 The above copyright notice and this permission notice shall be included in all copies or
shun-iwasawa 82a8f5
 substantial portions of the Software.
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
shun-iwasawa 82a8f5
 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
shun-iwasawa 82a8f5
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
shun-iwasawa 82a8f5
 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
shun-iwasawa 82a8f5
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
 @licend  The above is the entire license notice for the JavaScript code in this file
shun-iwasawa 82a8f5
 */
shun-iwasawa 82a8f5
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
shun-iwasawa 82a8f5
  function makeTree(data,relPath) {
shun-iwasawa 82a8f5
    var result='';
shun-iwasawa 82a8f5
    if ('children' in data) {
shun-iwasawa 82a8f5
      result+='
    ';
shun-iwasawa 82a8f5
      for (var i in data.children) {
shun-iwasawa 82a8f5
        result+='
  • '+
  • shun-iwasawa 82a8f5
                                    data.children[i].text+''+
    shun-iwasawa 82a8f5
                                    makeTree(data.children[i],relPath)+'';
    shun-iwasawa 82a8f5
          }
    shun-iwasawa 82a8f5
          result+='';
    shun-iwasawa 82a8f5
        }
    shun-iwasawa 82a8f5
        return result;
    shun-iwasawa 82a8f5
      }
    shun-iwasawa 82a8f5
    shun-iwasawa 82a8f5
      $('#main-nav').append(makeTree(menudata,relPath));
    shun-iwasawa 82a8f5
      $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
    shun-iwasawa 82a8f5
      if (searchEnabled) {
    shun-iwasawa 82a8f5
        if (serverSide) {
    shun-iwasawa 82a8f5
          $('#main-menu').append('
  • <form action="'+relPath+searchPage+'" id="FSearchBox" method="get"><input accesskey="S" id="MSearchField" name="query" onblur="searchBox.OnSearchFieldFocus(false)" onfocus="searchBox.OnSearchFieldFocus(true)" size="20" type="text" value="'+search+'"></form>
  • ');
    shun-iwasawa 82a8f5
        } else {
    shun-iwasawa 82a8f5
          $('#main-menu').append('
  • <input accesskey="S" id="MSearchField" onblur="searchBox.OnSearchFieldFocus(false)" onfocus="searchBox.OnSearchFieldFocus(true)" onkeyup="searchBox.OnSearchFieldChange(event)" type="text" value="'+search+'">
  • ');
    shun-iwasawa 82a8f5
        }
    shun-iwasawa 82a8f5
      }
    shun-iwasawa 82a8f5
      $('#main-menu').smartmenus();
    shun-iwasawa 82a8f5
    }
    shun-iwasawa 82a8f5
    /* @license-end */