49
5. Application development
Available libraries/frameworks
• jQuery v2 (http://jquery.com/)
• Bootstrap v3 (http://getbootstrap.com)
• Font Awesome v4 (http://fontawesome.io)
Bootstrap comes without Glyphicons, use Font Awesome instead.
Base directory structure
• /data apps and widgets are stored here, accessible at http://IP/apps/data/
• /libs Lua library storage, loaded via require('custom.lib') where lib is library name.
• /user allows storing user files and LP scripts, accessible at http://IP/user/
App / Widget structure
Application name (ID) must be unique and can only contain alphanumeric characters, hyphens
and underscores. Maximum name length is 64 characters.
Directory structure
• index.lp or index.html required for apps, unless url is specified, clicking app icon will
open app directory in the same window. Applications must provide a Back button so
user can return to starting page
• icon.svg or icon.png required for apps, contains application icon, SVG is
recommended
• widget.lp or widget.js required for widgets, can contain JavaScript + Lua code or
pure JavaScript source which displays widget contents
• title optional for apps, text file with title that is shown beneath the icon
• url optional for apps, text file with URL that should be open when icon is clicked
• style.css optional for widget, contains custom CSS stylesheet for given widget
• config.lp or config.html optional configuration file, see description below
In widget mode icon element ID is the same as widget name, all other HTML element IDs must
be prefixed with unique application name to minimize collisions between different applications.
The same rule applies to CSS selectors.
setWidgetSize(cols,