Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
custom:javascript:lib:ddlightbarmenu.js [2018/04/05 09:43] – created nightfox | custom:javascript:lib:ddlightbarmenu.js [2019/05/11 14:11] – Added information about the new menuTitle property, which can be used to specify a title to write in the top border nightfox | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | DDLightbarMenu.js is a loadable JavaScript file that provides a lightbar menu class for use in JavaScript scripts for Synchronet. | + | dd_lightbar_menu.js is a loadable JavaScript file that provides a lightbar menu class for use in JavaScript scripts for Synchronet. |
\\ | \\ | ||
The user can navigate the list using the up & down arrows, PageUp, PageDown, Home, and End keys. The enter key selects an item. The ESC key will exit the menu and return null. This menu library requires the use of an ANSI terminal. | The user can navigate the list using the up & down arrows, PageUp, PageDown, Home, and End keys. The enter key selects an item. The ESC key will exit the menu and return null. This menu library requires the use of an ANSI terminal. | ||
- | This script | + | dd_lightbar_menu.js |
**DDLightbarMenu methods** | **DDLightbarMenu methods** | ||
Line 46: | Line 46: | ||
| itemTextCharHighlightColor | The color of a highlighted non-space character in an item text (specified by having a & in the item text). | | itemTextCharHighlightColor | The color of a highlighted non-space character in an item text (specified by having a & in the item text). | ||
| borderColor | | borderColor | ||
+ | | menuTitle | ||
By default, the menu selection will wrap around to the beginning/ | By default, the menu selection will wrap around to the beginning/ | ||
Line 64: | Line 65: | ||
Example usage: | Example usage: | ||
- | load("DDLightbarMenu.js"); | + | load("dd_lightbar_menu.js"); |
// Create a menu at position 1, 3 with width 45 and height of 10 | // Create a menu at position 1, 3 with width 45 and height of 10 | ||
var lbMenu = new DDLightbarMenu(1, | var lbMenu = new DDLightbarMenu(1, | ||
Line 90: | Line 91: | ||
// long as it's not a space. | // long as it's not a space. | ||
lbMenu.Add(" | lbMenu.Add(" | ||
+ | | ||
+ | // To enable borders and set a title to display in the top border: | ||
+ | lbMenu.borderEnabled = true; | ||
+ | lbMenu.menuTitle = " | ||
To enable borders, set the borderEnabled property to true. Example: | To enable borders, set the borderEnabled property to true. Example: |