treewide: always include cbi.js
authorJo-Philipp Wich <jo@mein.io>
Sat, 7 Jul 2018 13:12:47 +0000 (15:12 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 9 Jul 2018 09:51:43 +0000 (11:51 +0200)
Include cbi.js in the main header template like it is done for xhr.js and
remove the page specific includes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
42 files changed:
applications/luci-app-adblock/luasrc/view/adblock/query.htm
applications/luci-app-asterisk/luasrc/view/asterisk/dialplans.htm
applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm
applications/luci-app-commands/luasrc/view/commands.htm
applications/luci-app-cshark/luasrc/view/cshark.htm
applications/luci-app-freifunk-diagnostics/luasrc/view/freifunk/diagnostics.htm
applications/luci-app-lxc/luasrc/view/lxc.htm
applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm
applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm
applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm
applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm
applications/luci-app-nlbwmon/luasrc/view/nlbw/backup.htm
applications/luci-app-nlbwmon/luasrc/view/nlbw/display.htm
applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm
applications/luci-app-olsr/luasrc/view/status-olsr/hna.htm
applications/luci-app-olsr/luasrc/view/status-olsr/neighbors.htm
applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm
applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm
applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm
applications/luci-app-splash/luasrc/view/admin_status/splash.htm
applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm
applications/luci-app-travelmate/luasrc/view/travelmate/wifi_scan.htm
applications/luci-app-wireguard/luasrc/view/wireguard.htm
modules/luci-base/luasrc/view/cbi/apply_widget.htm
modules/luci-base/luasrc/view/cbi/header.htm
modules/luci-base/luasrc/view/cbi/simpleform.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/bandwidth.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/connections.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/load.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/routes.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/wireless.htm
modules/luci-mod-admin-full/luasrc/view/admin_system/packages.htm
modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm
themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm
themes/luci-theme-freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm
themes/luci-theme-material/luasrc/view/themes/material/header.htm
themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm

index 8bbed3a53ee93db7063c1715ae72d9c1436cda61..72dc16b1d84852586e34eb94d7953fa11eac3853 100644 (file)
@@ -5,7 +5,6 @@ This is free software, licensed under the Apache License, Version 2.0
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">
 //<![CDATA[
        var stxhr = new XHR();
index fb40335f9967eafb6144628f199a16feadbabbda..1c58b0a02caa26fde48183c9182ea73baf0ae8bd 100644 (file)
@@ -58,7 +58,6 @@
 
 <form method="post" action="<%=url('admin/asterisk/dialplans')%>" enctype="multipart/form-data">
        <div>
-               <script type="text/javascript" src="/luci-static/resources/cbi.js"></script>
                <input type="hidden" name="cbi.submit" value="1" />
                <input type="submit" value="Save" class="hidden" />
        </div>
index e48da608a672cbdaa25fca27fae09392da5a848c..66a06b20f74825d13753d39a264e9b863ed0bd9f 100644 (file)
@@ -49,7 +49,6 @@
 
 <form method="post" action="<%=url('admin/asterisk/dialplans/zones')%>" enctype="multipart/form-data">
        <div>
-               <script type="text/javascript" src="/luci-static/resources/cbi.js"></script>
                <input type="hidden" name="cbi.submit" value="1" />
                <input type="submit" value="Save" class="hidden" />
        </div>
index 4285f25cb20dd17c1d52139c6639bee36dc7d5a0..d60a97c5b76fa8f587595fb2e1a7bb173b8645c4 100644 (file)
@@ -34,7 +34,6 @@
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        var stxhr = new XHR();
 
index bc67f806c46f45792151ee4115c097c56929ca16..b71c7fb6ce99a25518f7b0d1ea871ef4e95bcd44 100644 (file)
@@ -82,7 +82,6 @@ $Id$
 
 <hr/>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
 
        var capture_running = 0;
index eac1ecdcf547bc243f2a7c7f6d0ba5f5219c3983..e4cd969d2e7dd7493d8d9ca071a8873d95a78451 100644 (file)
@@ -11,7 +11,6 @@ local has_ping6 = fs.access("/bin/ping6") or fs.access("/usr/bin/ping6")
 local has_traceroute6 = fs.access("/usr/bin/traceroute6")
 %>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        var stxhr = new XHR();
 
index 47cc1a5f3f7a2bb4ceae2a3ca34bcc047cd1ea12..55cb23fbd69dac9b19014d3c9cff9f85075a5e79 100644 (file)
@@ -64,7 +64,6 @@ local target = nx.uname().machine
 
 <hr />
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">
 //<![CDATA[
        window.img    = { "red" : "<%=resource%>/cbi/red.gif", "green" : "<%=resource%>/cbi/green.gif", "purple" : "<%=resource%>/cbi/purple.gif" };
index bcc23beb315eabe55b87330b7ee236206a8f95ed..12700c4a36d71fef5ffaac09de8831d1269b473a 100644 (file)
@@ -13,7 +13,6 @@
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/troubleshooting")%>"><%:Troubleshooting%></a></li>
 </ul>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "detailed_status")%>', null,
                function(x)
index 22f4734ddd25216b39bbda3dee7932c7fb32451f..454adcc1cdaa56f6923aadeb02f3130985ba369c 100644 (file)
@@ -25,7 +25,6 @@
        )
 %>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        var stxhr = new XHR();
 
index 4518bd658847097ce02d9accb6baf3252599cc04..962cde521d7d38a74ac58f59e5c70737f02c380e 100644 (file)
@@ -13,7 +13,6 @@
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/troubleshooting")%>"><%:Troubleshooting%></a></li>
 </ul>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 
 <div class="cbi-map">
        <%+mwan/overview_status_interface%>
index f60e0da0aabcc185fde9f17158ccbe1b9f4d7b18..a20516bd2a5a02b8704697daf55957b29285f229 100644 (file)
@@ -13,7 +13,6 @@
        <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/troubleshooting")%>"><%:Troubleshooting%></a></li>
 </ul>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "troubleshooting_display")%>', null,
                function(x)
index ea2e0f05cf05c45d4f442a25c8b6e6348ebcf874..8a35f97ac916178942d74b8c8dddcd6f3ed6b4fe 100644 (file)
@@ -5,7 +5,6 @@
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 
 <h2 name="content"><%:Netlink Bandwidth Monitor - Backup / Restore %></h2>
 
index 932c8849a7afcc6cd78cc66dae95cbf6508fe2be..616bcc52a124f5231de98e870603fc9bf3918340 100644 (file)
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript" src="<%=resource%>/nlbw.chart.min.js"></script>
 <script type="text/javascript">//<![CDATA[
 
index 150ed87dadf44ab403de454fa721e00747691df7..94f01cb51c63f5c9bdac73ec8cb4afce1b1f56c6 100644 (file)
@@ -118,7 +118,6 @@ end
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
 
        XHR.poll(10 , '<%=REQUEST_URI%>', { status: 1 },
index 2dc4ce1730b1a851d0ced91aecc0664929f6c439..1c178f18103c017757af2cbb21013f67422d0fa7 100644 (file)
@@ -28,7 +28,6 @@ end
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
 XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
        function(x, info)
index ab09865865758f8dc37ee376af3a55f9700eeecc..29ea95694c3702d951c8d768698de5fbe389bb67 100644 (file)
@@ -48,7 +48,6 @@ end
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
 
        XHR.poll(10 , '<%=REQUEST_URI%>', { status: 1 }, 
index 832a27aed75d50cec447d27e1248f6cb85dbe6e2..f205edc16dbfed77ad54875b885c48635eace2e6 100644 (file)
@@ -45,7 +45,6 @@ end
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
 
 XHR.poll(10, '<%=REQUEST_URI%>/json', { },
index c75b94fceffed0251317dc96b5f326b858b197da..4b733524a5b9d05d40de02565ab9719428b40ae5 100644 (file)
@@ -34,7 +34,6 @@ end
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[  
 
 XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 },
index 7ca66816ae7723743df087ebd6c2dae9a411f4b8..9afd367d1fc6f7caabbc10e39bf3d020db32685d 100644 (file)
@@ -44,7 +44,6 @@ end
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
 XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
        function(x, info)
index aad330791d6bdaa9ff6f1ca212cfcb0a19abd3b0..cbb7f235fa8882527ba964ce763fcebf4234dc4a 100644 (file)
@@ -134,7 +134,6 @@ end
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
 
        XHR.poll(10 , '<%=REQUEST_URI%>', { status: 1 },
index ffacc2f6df488e1b37c82baefab86e5bbb23c74a..74542a9ca5953e6e2ed8612a749d4dcb688fbe11 100644 (file)
@@ -11,7 +11,6 @@ This is free software, licensed under the Apache License, Version 2.0
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 
 <div class="cbi-map">
 <div class="cbi-map-descr">
index 57efd97376fe68798236b085c8b1b4317fc9e597..8a417d69c299e566d6507afd5b0b60ac987882da 100644 (file)
@@ -39,7 +39,6 @@ This is free software, licensed under the Apache License, Version 2.0
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 
 <div class="cbi-map">
 <h2 name="content"><%:Wireless Scan%></h2>
index 64d9955296a7604360b7e660139422ee0ab2a135..cd08e9ed51864b68496be60b21095a1e8d0d31d2 100644 (file)
@@ -52,7 +52,6 @@
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
 
   function bytes_to_str(bytes) {
index e3090da656e342921f81f651cdaddfcf001a6acb..3d98085f86fd4948f5684dc6a2bc9689457aa85c 100644 (file)
@@ -47,7 +47,6 @@
        }
 </style>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        var xhr = new XHR(),
            uci_apply_auth = { sid: '<%=luci.dispatcher.context.authsession%>', token: '<%=token%>' },
index 9710bae8f4f10a768559dc89f6c3c571b67de66e..2cea0b9118319d5b446bd933b4095319a41f6a70 100644 (file)
@@ -1,7 +1,6 @@
 <%+header%>
 <form method="post" name="cbi" action="<%=REQUEST_URI%>" enctype="multipart/form-data" onreset="return cbi_validate_reset(this)" onsubmit="return cbi_validate_form(this, '<%:Some fields are invalid, cannot save values!%>')">
        <div>
-               <script type="text/javascript" src="<%=resource%>/cbi.js"<%=
                        attr("data-strings", luci.util.serialize_json({
                                label = {
                                        choose = translate('-- Please choose --'),
index c6000d22b344c3cb98d577fd780c63750cb6bc4a..5069e9f40708023db8d49f5aaaf4f6a4e0cbbc25 100644 (file)
@@ -1,7 +1,6 @@
 <% if not self.embedded then %>
 <form method="post" enctype="multipart/form-data" action="<%=REQUEST_URI%>">
        <div>
-               <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
                <input type="hidden" name="token" value="<%=token%>" />
                <input type="hidden" name="cbi.submit" value="1" />
        </div>
index 5607e59dfb6f8ffb377313989332a0cbc4fdddf9..d9217894fd5856473ad192e8260a67791818495e 100644 (file)
@@ -15,7 +15,6 @@ local ping_host = luci.config.diag and luci.config.diag.ping or "dev.openwrt.org
 local route_host = luci.config.diag and luci.config.diag.route or "dev.openwrt.org"
 %>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        var stxhr = new XHR();
 
index 473e2275ce4202df5e2758b860e6ea3fb95b181f..00ef8944c6d66ff3e363ebb1cae3f4065d532f56 100644 (file)
@@ -30,7 +30,6 @@
                end)
 -%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        function iface_shutdown(id, reconnect) {
                if (!reconnect && !confirm(<%=luci.http.write_json(translate('Really shutdown interface "%s"? You might lose access to this device if you are connected via this interface.'))%>.format(id)))
index b9602785f4ae45a30f7883efaa13acdcfde86aac..f3809ea9413e49d9269f4317e1c46ce2bbb7047b 100644 (file)
        </div>
 <% end %>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        var wifidevs = <%=luci.http.write_json(netdevs)%>;
 
index 50e51bad00a7c7052e79e19cb627b9e7d79c09dd..935e8d2b7260b827db601914eac2dd8237b242aa 100644 (file)
@@ -19,7 +19,6 @@
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        var bwxhr = new XHR();
 
index 152167424ba6b7affbb5870ac571768b80e1fca2..ea919a8d34b69708bc028d8266757067734cdc3e 100644 (file)
@@ -5,7 +5,6 @@
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        var bwxhr = new XHR();
 
index e99aa7c94bf9a3ac45eebebf398ea9a797ff467f..03155dbb62247d26272024fb9f66c3ddd1a63f1a 100644 (file)
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        function progressbar(v, m)
        {
index 5d544ca60b1cee25c24768deb98f107aeb55e40d..51e428e40e01a66402134c2bf0b60b3cab0e2467 100644 (file)
@@ -62,7 +62,6 @@
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <style type="text/css">
        span:target {
                color: blue;
index 8cd36a3084fd4dbbfc57493623ca528346d44027..d60d3c000380c9eeaa01deaeec3a45602ea8e157 100644 (file)
@@ -5,7 +5,6 @@
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        var bwxhr = new XHR();
 
index 9ed37939fe5be9fcd5096d2faec772c7e381ad11..74779f6ad88f483a7daa2daeaaef369f1fdc7630 100644 (file)
@@ -32,7 +32,6 @@
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 
 <div class="cbi-map" id="cbi-network">
        <h2 name="content"><%:Routes%></h2>
index a19a1235b91c4e12f28096c2ce51942c23014620..e188a9a4baf3eeb55e96b971ceba43079951c57c 100644 (file)
@@ -19,7 +19,6 @@
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript">//<![CDATA[
        var bwxhr = new XHR();
 
index ef13a91672e25b4cfa0c845c000167c870f09fec..1b959afc54845a283962a51e3c49a53d6c2ff1e7 100644 (file)
@@ -44,7 +44,6 @@ end
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 
 <h2 name="content"><%:Software%></h2>
 
index a56e4826a95d3672f1a29e2dbbf157cd6f73b82f..572f8585d17d878dc8353a4655ac3b2e82d42f30 100644 (file)
@@ -110,7 +110,6 @@ end
 
 <%+header%>
 
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 
 <script type="text/javascript">//<![CDATA[
         XHR.poll(<%=interval%> , '<%=REQUEST_URI%>', { status: 1 },
index aaacf56b844967807850090fcc509cd68b0fdfb4..6ad32efb47e2b1b0bb118e003fd1d263d5b2e68d 100644 (file)
                <% if css then %>
                        <style title="text/css"><%= css %></style>
                <% end -%>
+               <script src="<%=resource%>/cbi.js"></script>
                <script src="<%=resource%>/xhr.js"></script>
        </head>
 
index b6ed1f7134b0b8d649dfd61d8b77ff4a9531c0dd..4a1c7b64401501ebec5f7ab5222c7036dac36056 100644 (file)
@@ -81,6 +81,7 @@
 </style>
 <% end -%>
 <meta name="viewport" content="initial-scale=1.0" />
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript" src="<%=resource%>/xhr.js"></script>
 
 <title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(tostring(node.title)) or '')) %> - LuCI</title>
index b6341a2c35ae26ab0092f7ea9f6b1ca28faa74b9..f97db257510214e3058219c0d30170ca72058d36 100644 (file)
        <% if css then %>
                <style title="text/css"><%= css %></style>
        <% end -%>
+       <script src="<%=resource%>/cbi.js"></script>
        <script src="<%=resource%>/xhr.js"></script>
 </head>
 <body class="lang_<%=luci.i18n.context.lang%> <%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>">
index 773cf1f82eca017e0cd462b1ba423218a2677828..e77f9a4bfee1bb382a7b075cd4fa0f6f8c173e5a 100644 (file)
@@ -87,6 +87,9 @@
                local childs = disp.node_childs(node)
                if #childs > 0 then
                        if level > 2 then
+                               if level == 3 then
+                                       write('<div id="tabmenu">')
+                               end
                                write('<ul class="cbi-tabmenu">')
                        end
 
 
                        if level > 2 then
                                write('</ul>')
+                               if level == 3 then
+                                       write('</div>')
+                               end
                        end
 
                        if selected_node then
 <%= css %>
 </style>
 <% end -%>
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript" src="<%=resource%>/xhr.js"></script>
 <script type="text/javascript">//<![CDATA[
        document.addEventListener('DOMContentLoaded', function() {
        </div>
 
        <div id="maincontent">
-               <div id="tabmenu">
-                       <% if category then render_tabmenu(category, cattree) end %>
-               </div>
+               <% if category then render_tabmenu(category, cattree) end %>
 
                <noscript>
                        <div class="alert-message warning">