70839c5d826326ead647a804607b02b44e04ad18
[oweals/luci.git] / modules / luci-base / luasrc / view / header.htm
1 <%#
2  Copyright 2008 Steven Barth <steven@midlink.org>
3  Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
4  Licensed to the public under the Apache License 2.0.
5 -%>
6
7 <%
8         if not luci.dispatcher.context.template_header_sent then
9                 include("themes/" .. theme .. "/header")
10                 luci.dispatcher.context.template_header_sent = true
11         end
12 %>
13
14 <script type="text/javascript" src="<%=resource%>/promis.min.js"></script>
15 <script type="text/javascript" src="<%=resource%>/luci.js"></script>
16 <script type="text/javascript">
17         L = new LuCI(<%= luci.http.write_json({
18                 token       = token,
19                 resource    = resource,
20                 scriptname  = luci.http.getenv("SCRIPT_NAME"),
21                 pathinfo    = luci.http.getenv("PATH_INFO"),
22                 requestpath = luci.dispatcher.context.requestpath,
23                 pollinterval    = luci.config.main.pollinterval or 5
24         }) %>);
25 </script>