Skip to content

Commit

Permalink
Add type="button" to all buttons.
Browse files Browse the repository at this point in the history
The default is `type="submit"`.

Signed-off-by: XhmikosR <[email protected]>
  • Loading branch information
XhmikosR committed May 11, 2020
1 parent c2f3baf commit 43151d3
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<p><input type="checkbox" id="upload"> Upload debug log and provide token once finished</p>
<p>Once you click this button a debug log will be generated and can automatically be uploaded if we detect a working internet connection.</p>
<button class="btn btn-lg btn-primary btn-block" id="debugBtn">Generate debug log</button>
<button type="button" id="debugBtn" class="btn btn-lg btn-primary btn-block">Generate debug log</button>
<pre id="output" style="width: 100%; height: 100%;" hidden="true"></pre>

<script src="scripts/pi-hole/js/debug.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion dns_records.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</div>
</div>
<div class="box-footer clearfix">
<button id="btnAdd" class="btn btn-primary pull-right">Add</button>
<button type="button" id="btnAdd" class="btn btn-primary pull-right">Add</button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion gravity.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Success!
</div>

<button class="btn btn-lg btn-primary btn-block" id="gravityBtn">Update</button>
<button type="button" id="gravityBtn" class="btn btn-lg btn-primary btn-block">Update</button>
<pre id="output" style="width: 100%; height: 100%;" hidden="true"></pre>

<script src="scripts/pi-hole/js/gravity.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion groups-adlists.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</div>
<div class="box-footer clearfix">
<strong>Hint:</strong>&nbsp;Please run <code>pihole -g</code> or update your gravity list <a href="gravity.php">online</a> after modifying your adlists.
<button id="btnAdd" class="btn btn-primary pull-right">Add</button>
<button type="button" id="btnAdd" class="btn btn-primary pull-right">Add</button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion groups-clients.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>
</div>
<div class="box-footer clearfix">
<button id="btnAdd" class="btn btn-primary pull-right">Add</button>
<button type="button" id="btnAdd" class="btn btn-primary pull-right">Add</button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</div>
</div>
<div class="box-footer clearfix">
<button id="btnAdd" class="btn btn-primary pull-right">Add</button>
<button type="button" id="btnAdd" class="btn btn-primary pull-right">Add</button>
</div>
</div>
</div>
Expand Down
9 changes: 0 additions & 9 deletions queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,6 @@
<!-- Send PHP info to JS -->
<div id="token" hidden><?php echo $token ?></div>


<!--
<div class="row">
<div class="col-md-12">
<button class="btn btn-info margin-bottom pull-right">Refresh Data</button>
</div>
</div>
-->

<!-- Alert Modal -->
<div id="alertModal" class="modal fade" role="dialog" data-backdrop="static" data-keyboard="false">
<div class="vertical-alignment-helper">
Expand Down
4 changes: 2 additions & 2 deletions queryads.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<input id="domain" type="url" class="form-control" placeholder="Domain to look for (example.com or sub.example.com)" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off">
<input id="quiet" type="hidden" value="no">
<span class="input-group-btn">
<button id="btnSearch" class="btn btn-default" type="button">Search partial match</button>
<button id="btnSearchExact" class="btn btn-default" type="button">Search exact match</button>
<button type="button" id="btnSearch" class="btn btn-default">Search partial match</button>
<button type="button" id="btnSearchExact" class="btn btn-default">Search exact match</button>
</span>
</div>

Expand Down
14 changes: 11 additions & 3 deletions scripts/pi-hole/js/auditlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ function updateTopLists() {
url +
"</td> <td>" +
data.top_queries[domain] +
'</td> <td> <button type="button" class="btn btn-default btn-sm text-red"><i class="fa fa-ban"></i> Blacklist</button> <button class="btn btn-default btn-sm text-orange"><i class="fa fa-balance-scale"></i> Audit</button> </td> </tr> '
"</td> <td>" +
'<button type="button" class="btn btn-default btn-sm text-red"><i class="fa fa-ban"></i> Blacklist</button>' +
'<button type="button" class="btn btn-default btn-sm text-orange"><i class="fa fa-balance-scale"></i> Audit</button>' +
"</td> </tr> "
);
}
}
Expand All @@ -67,7 +70,9 @@ function updateTopLists() {
url +
"</td> <td>" +
data.top_ads[domain] +
'</td> <td> <button type="button" class="btn btn-default btn-sm text-orange"><i class="fa fa-balance-scale"></i> Audit</button> </td> </tr> '
"</td> <td>" +
'<button type="button" class="btn btn-default btn-sm text-orange"><i class="fa fa-balance-scale"></i> Audit</button>' +
"</td> </tr> "
);
} else {
url = '<a href="queries.php?domain=' + printdomain + '">' + printdomain + "</a>";
Expand All @@ -76,7 +81,10 @@ function updateTopLists() {
url +
"</td> <td>" +
data.top_ads[domain] +
'</td> <td> <button type="button" class="btn btn-default btn-sm text-green"><i class="fas fa-check"></i> Whitelist</button> <button class="btn btn-default btn-sm text-orange"><i class="fa fa-balance-scale"></i> Audit</button> </td> </tr> '
"</td> <td>" +
'<button type="button" class="btn btn-default btn-sm text-green"><i class="fas fa-check"></i> Whitelist</button>' +
'<button type="button" class="btn btn-default btn-sm text-orange"><i class="fa fa-balance-scale"></i> Audit</button>' +
"</td> </tr> "
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/js/customdns.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $(document).ready(function () {
targets: 2,
render: function (data, type, row) {
return (
'<button class="btn btn-danger btn-xs deleteCustomDNS" type="button" data-domain=\'' +
'<button type="button" class="btn btn-danger btn-xs deleteCustomDNS" data-domain=\'' +
row[0] +
"' data-ip='" +
row[1] +
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/js/groups-adlists.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function initTable() {
var ApplyBtn = "#btn_apply_" + data.id;

var button =
'<button class="btn btn-danger btn-xs" type="button" id="deleteAdlist_' +
'<button type="button" class="btn btn-danger btn-xs" id="deleteAdlist_' +
data.id +
'">' +
'<span class="far fa-trash-alt"></span>' +
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/js/groups-clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function initTable() {
var ApplyBtn = "#btn_apply_" + data.id;

var button =
'<button class="btn btn-danger btn-xs" type="button" id="deleteClient_' +
'<button type="button" class="btn btn-danger btn-xs" id="deleteClient_' +
data.id +
'">' +
'<span class="far fa-trash-alt"></span>' +
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/js/groups-domains.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function initTable() {
}

var button =
'<button class="btn btn-danger btn-xs" type="button" id="deleteDomain_' +
'<button type="button" class="btn btn-danger btn-xs" id="deleteDomain_' +
data.id +
'">' +
'<span class="far fa-trash-alt"></span>' +
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/js/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $(document).ready(function () {
$("td:eq(3)", row).empty();
if (data.id !== 0) {
var button =
'<button class="btn btn-danger btn-xs" type="button" id="deleteGroup_' +
'<button type="button" class="btn btn-danger btn-xs" id="deleteGroup_' +
data.id +
'">' +
'<span class="far fa-trash-alt"></span>' +
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/php/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button id="pihole-disable-custom" type="button" class="btn btn-primary" data-dismiss="modal">Submit</button>
<button type="button" id="pihole-disable-custom" class="btn btn-primary" data-dismiss="modal">Submit</button>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ function convertseconds($argument)
<td id="IP" data-order="<?php echo bin2hex(inet_pton($lease["IP"])); ?>"><?php echo $lease["IP"]; ?></td>
<td id="HOST"><?php echo $lease["host"]; ?></td>
<td>
<button class="btn btn-warning btn-xs" type="button" id="button" data-static="alert">
<button type="button" id="button" class="btn btn-warning btn-xs" data-static="alert">
<span class="fas fas fa-file-import"></span>
</button>
</td>
Expand Down Expand Up @@ -568,7 +568,7 @@ function convertseconds($argument)
<td data-order="<?php echo bin2hex(inet_pton($lease["IP"])); ?>"><?php echo $lease["IP"]; ?></td>
<td><?php echo $lease["host"]; ?></td>
<td><?php if (strlen($lease["hwaddr"]) > 0) { ?>
<button class="btn btn-danger btn-xs" type="submit" name="removestatic"
<button type="button" class="btn btn-danger btn-xs" name="removestatic"
value="<?php echo $lease["hwaddr"]; ?>">
<span class="far fa-trash-alt"></span>
</button>
Expand All @@ -583,7 +583,7 @@ function convertseconds($argument)
<td><input type="text" name="AddIP" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"></td>
<td><input type="text" name="AddHostname" value="" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"></td>
<td>
<button class="btn btn-success btn-xs" type="submit" name="addstatic">
<button type="submit" class="btn btn-success btn-xs" name="addstatic">
<span class="fas fa-plus"></span>
</button>
</td>
Expand Down

0 comments on commit 43151d3

Please sign in to comment.