luci-base: introduce common JavaScript api
authorJo-Philipp Wich <jo@mein.io>
Wed, 21 Nov 2018 17:44:59 +0000 (18:44 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 22 Nov 2018 11:49:14 +0000 (12:49 +0100)
commit706c6836e40046ca82efc3355fc018fd37654d88
tree95fcf2aeb5ffd0cd9773e03e7007f1960fa82199
parent17690f2d73b640cf4bbf082fe96f5b3075a040fe
luci-base: introduce common JavaScript api

Introduce a new script file luci.js which is included by default and
intended to be the common location of functions currently scattered
in cbi.js and xhr.js.

The luci.js file provides a LuCI() class which - among other things -
implements helpers to construct URL paths and making HTTP requests.

A singleton instance of the class is instantiated as window.L upon
load and preset with the necessary environment information.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/luci.js [new file with mode: 0644]
modules/luci-base/luasrc/view/header.htm