luci-app-commands: use <button> elements
authorJo-Philipp Wich <jo@mein.io>
Fri, 9 Apr 2021 12:27:00 +0000 (14:27 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 9 Apr 2021 12:31:06 +0000 (14:31 +0200)
Use <button> instead of <input type=button> elements to fix compatibility
with OpenWrt 2020 theme.

Ref: https://github.com/openwrt/luci/issues/4972
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f117b7f1ec3b582aeed524093afc06dd5eb15127)

applications/luci-app-commands/luasrc/view/commands.htm

index 28b7701faffca5df37099f2ac8840419b85b4348..ff82eac47a3d2b6bb7fab9fbb5842a41838f5226 100644 (file)
                {
                        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(
                                                <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('<%=command['.name']%>')"><%:Run%></button>
+                                               <button class="cbi-button cbi-button-download" onclick="command_download('<%=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('<%=command['.name']%>')"><%:Link%></button>
                                                <% end %>
                                        </div>
                                </div>