Blame templates/html/menu.js

Packit Service 50c9f2
/*
Packit Service 50c9f2
 @licstart  The following is the entire license notice for the
Packit Service 50c9f2
 JavaScript code in this file.
Packit Service 50c9f2
Packit Service 50c9f2
 Copyright (C) 1997-2017 by Dimitri van Heesch
Packit Service 50c9f2
Packit Service 50c9f2
 This program is free software; you can redistribute it and/or modify
Packit Service 50c9f2
 it under the terms of the GNU General Public License as published by
Packit Service 50c9f2
 the Free Software Foundation; either version 2 of the License, or
Packit Service 50c9f2
 (at your option) any later version.
Packit Service 50c9f2
Packit Service 50c9f2
 This program is distributed in the hope that it will be useful,
Packit Service 50c9f2
 but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 50c9f2
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 50c9f2
 GNU General Public License for more details.
Packit Service 50c9f2
Packit Service 50c9f2
 You should have received a copy of the GNU General Public License along
Packit Service 50c9f2
 with this program; if not, write to the Free Software Foundation, Inc.,
Packit Service 50c9f2
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Packit Service 50c9f2
Packit Service 50c9f2
 @licend  The above is the entire license notice
Packit Service 50c9f2
 for the JavaScript code in this file
Packit Service 50c9f2
 */
Packit Service 50c9f2
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
Packit Service 50c9f2
  function makeTree(data,relPath) {
Packit Service 50c9f2
    var result='';
Packit Service 50c9f2
    if ('children' in data) {
Packit Service 50c9f2
      result+='
    ';
Packit Service 50c9f2
      for (var i in data.children) {
Packit Service 50c9f2
        result+='
  • '+
  • Packit Service 50c9f2
                                    data.children[i].text+''+
    Packit Service 50c9f2
                                    makeTree(data.children[i],relPath)+'';
    Packit Service 50c9f2
          }
    Packit Service 50c9f2
          result+='';
    Packit Service 50c9f2
        }
    Packit Service 50c9f2
        return result;
    Packit Service 50c9f2
      }
    Packit Service 50c9f2
    Packit Service 50c9f2
      $('#main-nav').append(makeTree(menudata,relPath));
    Packit Service 50c9f2
      $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
    Packit Service 50c9f2
      if (searchEnabled) {
    Packit Service 50c9f2
        if (serverSide) {
    Packit Service 50c9f2
          $('#main-menu').append('
  • <form id="FSearchBox" action="'+searchPage+'" method="get"><input type="text" id="MSearchField" name="query" value="'+search+'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"></form>
  • ');
    Packit Service 50c9f2
        } else {
    Packit Service 50c9f2
          $('#main-menu').append('
  • <input type="text" id="MSearchField" value="'+search+'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/>
  • ');
    Packit Service 50c9f2
        }
    Packit Service 50c9f2
      }
    Packit Service 50c9f2
      $('#main-menu').smartmenus();
    Packit Service 50c9f2
    }
    Packit Service 50c9f2
    /* @license-end */