summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-commands/luasrc/view
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-commands/luasrc/view')
-rw-r--r--applications/luci-app-commands/luasrc/view/commands.htm22
1 files changed, 14 insertions, 8 deletions
diff --git a/applications/luci-app-commands/luasrc/view/commands.htm b/applications/luci-app-commands/luasrc/view/commands.htm
index 28b7701faf..634090e7d7 100644
--- a/applications/luci-app-commands/luasrc/view/commands.htm
+++ b/applications/luci-app-commands/luasrc/view/commands.htm
@@ -37,7 +37,7 @@
<script type="text/javascript">//<![CDATA[
var stxhr = new XHR();
- function command_run(id)
+ function command_run(ev, id)
{
var args;
var field = document.getElementById(id);
@@ -83,9 +83,11 @@
}
);
}
+
+ ev.preventDefault();
}
- function command_download(id)
+ function command_download(ev, id)
{
var args;
var field = document.getElementById(id);
@@ -93,9 +95,11 @@
args = encodeURIComponent(field.value);
location.href = '<%=url('admin/system/commands/download')%>/' + id + (args ? '/' + args : '');
+
+ ev.preventDefault();
}
- function command_link(id)
+ function command_link(ev, id)
{
var legend = document.getElementById('command-rc-legend');
var output = document.getElementById('command-rc-output');
@@ -109,10 +113,10 @@
{
var prefix = location.protocol + '//' + location.host + '<%=url('command')%>/';
var suffix = (args ? '/' + args : '');
-
+
var link = prefix + id + suffix;
var link_nodownload = prefix + id + "s" + suffix;
-
+
legend.style.display = 'none';
output.parentNode.style.display = 'block';
output.innerHTML = String.format(
@@ -122,6 +126,8 @@
location.hash = '#output';
}
+
+ ev.preventDefault();
}
//]]></script>
@@ -156,10 +162,10 @@
<p><%:Arguments:%> <input type="text" id="<%=command['.name']%>" /></p>
<% end %>
<div>
- <input type="button" value="<%:Run%>" class="cbi-button cbi-button-apply" onclick="command_run('<%=command['.name']%>')" />
- <input type="button" value="<%:Download%>" class="cbi-button cbi-button-download" onclick="command_download('<%=command['.name']%>')" />
+ <button class="cbi-button cbi-button-apply" onclick="command_run(event, '<%=command['.name']%>')"><%:Run%></button>
+ <button class="cbi-button cbi-button-download" onclick="command_download(event, '<%=command['.name']%>')"><%:Download%></button>
<% if command.public == "1" then %>
- <input type="button" value="<%:Link%>" class="cbi-button cbi-button-link" onclick="command_link('<%=command['.name']%>')" />
+ <button class="cbi-button cbi-button-link" onclick="command_link(event, '<%=command['.name']%>')"><%:Link%></button>
<% end %>
</div>
</div>