From: Jo-Philipp Wich Date: Wed, 7 Oct 2015 17:07:36 +0000 (+0200) Subject: Globally replace luci.dispatcher.build_url(...) with url(...) invocations X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=281d2f617899a0c3a171a66c6a3a14e834aa000c;p=oweals%2Fluci.git Globally replace luci.dispatcher.build_url(...) with url(...) invocations Also concat multiple string arguments into one while we're at it. Signed-off-by: Jo-Philipp Wich --- diff --git a/applications/luci-app-ahcp/luasrc/view/ahcp_status.htm b/applications/luci-app-ahcp/luasrc/view/ahcp_status.htm index 88796cb1c..946828953 100644 --- a/applications/luci-app-ahcp/luasrc/view/ahcp_status.htm +++ b/applications/luci-app-ahcp/luasrc/view/ahcp_status.htm @@ -1,5 +1,5 @@ @@ -68,9 +68,9 @@
Here you can manage your dial plans which are used to route outgoing calls from your local extensions.

Related tasks:
- Manage dialzones | - Manage voicemail boxes | - Manage meetme rooms + Manage dialzones | + Manage voicemail boxes | + Manage meetme rooms
@@ -85,7 +85,7 @@ Dialplan <%=plan.name%> - + Remove this dialplan @@ -109,10 +109,10 @@

- + Edit dialzone - + Remove from this dialplan @@ -134,10 +134,10 @@

- + Manage mailboxes ... - + Remove from this dialplan @@ -157,10 +157,10 @@

- + Manage conferences ... - + Remove from this dialplan diff --git a/applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm b/applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm index c867bc186..ffdbbcf35 100644 --- a/applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm +++ b/applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm @@ -47,7 +47,7 @@ %> -
" enctype="multipart/form-data"> +
@@ -57,7 +57,7 @@

Dial Zone Management

- " class="cbi-title-ref">Back to dialplan overview

+ " class="cbi-title-ref">Back to dialplan overview

Here you can manage your dial zones. The zones are used to route outgoing calls to the destination. Each zone groups multiple trunks and number matches to represent a logical destination. Zones can also be used to enforce certain dial restrictions on selected extensions. @@ -109,10 +109,10 @@ <%=rule.description or rule.name%> - + Edit entry - + Delete entry diff --git a/applications/luci-app-commands/luasrc/view/commands.htm b/applications/luci-app-commands/luasrc/view/commands.htm index e548757d6..73b9e6a2c 100644 --- a/applications/luci-app-commands/luasrc/view/commands.htm +++ b/applications/luci-app-commands/luasrc/view/commands.htm @@ -58,7 +58,7 @@ legend.parentNode.style.display = 'block'; legend.style.display = 'inline'; - stxhr.get('<%=luci.dispatcher.build_url("admin", "system", "commands", "run")%>/' + id + (args ? '/' + args : ''), null, + stxhr.get('<%=url('admin/system/commands/run')%>/' + id + (args ? '/' + args : ''), null, function(x, st) { if (st) @@ -93,7 +93,7 @@ if (field) args = encodeURIComponent(field.value); - location.href = '<%=luci.dispatcher.build_url("admin", "system", "commands", "download")%>/' + id + (args ? '/' + args : ''); + location.href = '<%=url('admin/system/commands/download')%>/' + id + (args ? '/' + args : ''); } function command_link(id) diff --git a/applications/luci-app-ddns/luasrc/view/ddns/detail_logview.htm b/applications/luci-app-ddns/luasrc/view/ddns/detail_logview.htm index 494b7435c..4dcb7bb6f 100644 --- a/applications/luci-app-ddns/luasrc/view/ddns/detail_logview.htm +++ b/applications/luci-app-ddns/luasrc/view/ddns/detail_logview.htm @@ -6,7 +6,7 @@ var txt = document.getElementById("cbid.ddns." + section + "._logview.txt"); // TextArea if ( !txt ) { return; } // security check - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "logview")%>/' + section, null, + XHR.get('<%=url('admin/services/ddns/logview')%>/' + section, null, function(x) { if (x.responseText == "_nodata_") txt.value = "<%:File not found or empty%>"; diff --git a/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm b/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm index ea8e4a1e3..546481222 100644 --- a/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm +++ b/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm @@ -136,7 +136,7 @@ // do start/stop var btnXHR = new XHR(); - btnXHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "startstop")%>/' + section + '/' + cbx.checked, null, + btnXHR.get('<%=url('admin/services/ddns/startstop')%>/' + section + '/' + cbx.checked, null, function(x, data) { if (x.responseText == "_uncommitted_") { // we need a trick to display Ampersand "&" in stead of "&" or "&" @@ -155,7 +155,7 @@ } // force to immediate show status on page load (not waiting for XHR.poll) - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null, + XHR.get('<%=url('admin/services/ddns/status')%>', null, function(x, data) { if (data) { _data2elements(data); } } @@ -164,7 +164,7 @@ // define only ONE XHR.poll in a page because if one is running it blocks the other one // optimum is to define on Map or Section Level from here you can reach all elements // we need update every 15 seconds only - XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null, + XHR.poll(15, '<%=url('admin/services/ddns/status')%>', null, function(x, data) { if (data) { _data2elements(data); } } diff --git a/applications/luci-app-ddns/luasrc/view/ddns/system_status.htm b/applications/luci-app-ddns/luasrc/view/ddns/system_status.htm index 4ca0abb0e..06dca48a9 100644 --- a/applications/luci-app-ddns/luasrc/view/ddns/system_status.htm +++ b/applications/luci-app-ddns/luasrc/view/ddns/system_status.htm @@ -111,13 +111,13 @@ } // force to immediate show status (not waiting for XHR.poll) - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null, + XHR.get('<%=url('admin/services/ddns/status')%>', null, function(x, data) { if (data) { _data2elements(x, data); } } ); - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null, + XHR.poll(5, '<%=url('admin/services/ddns/status')%>', null, function(x, data) { if (data) { _data2elements(x, data); } } @@ -126,7 +126,7 @@ //]]>
- <%:Dynamic DNS%> + <%:Dynamic DNS%> diff --git a/applications/luci-app-freifunk-diagnostics/luasrc/view/freifunk/diagnostics.htm b/applications/luci-app-freifunk-diagnostics/luasrc/view/freifunk/diagnostics.htm index ef3342e74..fe205d053 100644 --- a/applications/luci-app-freifunk-diagnostics/luasrc/view/freifunk/diagnostics.htm +++ b/applications/luci-app-freifunk-diagnostics/luasrc/view/freifunk/diagnostics.htm @@ -34,7 +34,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6") legend.parentNode.style.display = 'block'; legend.style.display = 'inline'; - stxhr.get('<%=luci.dispatcher.build_url("freifunk", "status")%>/diag_' + tool + protocol + '/' + addr, null, + stxhr.get('<%=url('freifunk/status')%>/diag_' + tool + protocol + '/' + addr, null, function(x) { if (x.responseText) diff --git a/applications/luci-app-freifunk-widgets/luasrc/view/freifunk/widgets/search/main.htm b/applications/luci-app-freifunk-widgets/luasrc/view/freifunk/widgets/search/main.htm index e319f15fb..f2e2fb906 100644 --- a/applications/luci-app-freifunk-widgets/luasrc/view/freifunk/widgets/search/main.htm +++ b/applications/luci-app-freifunk-widgets/luasrc/view/freifunk/widgets/search/main.htm @@ -33,7 +33,7 @@ end

<%=title%>

- +
<% local checked = " checked" diff --git a/applications/luci-app-ltqtapi/luasrc/view/telephony_status.htm b/applications/luci-app-ltqtapi/luasrc/view/telephony_status.htm index 234f90934..d861ef9fc 100644 --- a/applications/luci-app-ltqtapi/luasrc/view/telephony_status.htm +++ b/applications/luci-app-ltqtapi/luasrc/view/telephony_status.htm @@ -1,5 +1,5 @@ <%+cbi/valuefooter%> diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm index 8a6c90fc2..e06a88deb 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm @@ -34,7 +34,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6") legend.parentNode.style.display = 'block'; legend.style.display = 'inline'; - stxhr.get('<%=luci.dispatcher.build_url("admin", "network")%>/diag_' + tool + protocol + '/' + addr, null, + stxhr.get('<%=url('admin/network')%>/diag_' + tool + protocol + '/' + addr, null, function(x) { if (x.responseText) diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm index 1de349856..4cdf2df95 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm @@ -49,7 +49,7 @@ s.innerHTML = '<%:Waiting for changes to be applied...%>'; } - XHR.get('<%=luci.dispatcher.build_url("admin", "network")%>/iface_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, null, + XHR.get('<%=url('admin/network')%>/iface_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, null, function(x) { if (s) @@ -71,7 +71,7 @@ var wifidevs = <%=luci.http.write_json(netdevs)%>; var arptable = <%=luci.http.write_json(arpcache)%>; - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "iface_status", table.concat(ifaces, ","))%>', null, + XHR.poll(5, '<%=url('admin/network/iface_status', table.concat(ifaces, ","))%>', null, function(x, ifcs) { if (ifcs) @@ -178,14 +178,14 @@ d.innerHTML = String.format( '<%:Unsupported protocol type.%>
' + '<%:Install protocol extensions...%>', - '<%=luci.dispatcher.build_url("admin/system/packages")%>?query=luci-proto&display=available' + '<%=url("admin/system/packages")%>?query=luci-proto&display=available' ); } else if (d && !ifc.ifname) { d.innerHTML = String.format( '<%:Network without interfaces.%>
' + - '?tab.network.%s=physical"><%:Assign interfaces...%>', + '?tab.network.%s=physical"><%:Assign interfaces...%>', ifc.name, ifc.name ); } @@ -239,13 +239,13 @@
<% end %>
- '" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net[1]%>-ifc-edit" /> - '" title="<%:Delete this interface%>" value="<%:Delete%>" /> + '" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net[1]%>-ifc-edit" /> + '" title="<%:Delete this interface%>" value="<%:Delete%>" />
- '" /> + '" />
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm index 813638396..1ebdbfcfb 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm @@ -1,7 +1,7 @@ <%+cbi/valueheader%>