JS-Menu is aother single-page application (SPA). It is installed when Admin Console is installed and depends on Admin Console for management, but from the point of view of a non-administrative user it is a standalone application.
The js-menu application consists of an index.html and menu.json file nominally in the home of the webroot (/library/www/html/home). Index.html loads menu.json along with javascript, css, and other support files in /library/www/html/js-menu and dynamically renders the home page. Menu.json contains a list of the items that should appear on the home page menu, each of which corresponds to a 'menu definition', a json file stored in /library/www/html/js-menu/menu-files/menu-defs/. Menu-def.json files contain the parameters that define the content the menu item will link to as well as a title, description, and other parameters for describing the content.
Most of this work is performed by /library/www/html/js-menu/menu-files/js/js-menu.js. The application itself is not large, but it does one thing that requires some explanation, broad use of asynchronous requests for json files.
The process of drawing the menu consists in first drawing a scaffold, a list of <div>
s on the page and then issuing asynchronous jquery ajax calls with callbacks that draw the individual menu items on the scaffold as results come in. There can also be nested async calls to a raw html file associated with the menu item.
In addition to the list of menu items to appear menu.json holds other parameters that determine the amount of verbosity, fonts, and controls for desktop and mobile browsers.
There is a great deal of information on the internals of the menuing system in https://github.com/iiab/iiab-admin-console/blob/master/roles/console/files/help/ContentMenus.rst.
There are also a few php files in /library/www/html/js-menu/menu-files/services/ that add functionality to the menu, such as powering off the server and setting the time.
Menu defs are actually stored in a separate github repo, https://github.com/iiab-share/js-menu-files.
These files are maintained and committed by functionality within the Admin Console.
In the upper left of the header is a vertical ellipsis that leads to several mostly hidden and seldom used pieces of functionality. The first is a language selector. If the menu contains content in multiple languages the user can select to filter and only show one or more of these languages.
The second icon makes the output less verbose. This is aimed at users who have become familiar with the content an no longer need full descriptions to decide what content to visit.
The third icon leads to a feedback form which will store comments in a local database.
Choices made in the first two cases are particular to the user, or at least the device on which the user is operating.
This document was last maintained on December 29, 2022.