Merge pull request #1100 from Ghalid/patch-1

Disable text correction features, change types to make input fields easier to type in (especially for mobile devices)
This commit is contained in:
DL6ER
2020-04-07 13:59:44 +02:00
committed by GitHub
14 changed files with 67 additions and 24 deletions

View File

@@ -30,11 +30,11 @@
<div class="row">
<div class="col-md-6">
<label for="ex1">Name:</label>
<input id="domain" type="text" class="form-control" placeholder="Add a domain (example.com or sub.example.com)">
<input id="domain" type="url" class="form-control" placeholder="Add a domain (example.com or sub.example.com)" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off">
</div>
<div class="col-md-6">
<label for="ex2">Description:</label>
<input id="ip" type="text" class="form-control" placeholder="Associated IP address">
<input id="ip" type="text" class="form-control" placeholder="Associated IP address" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off">
</div>
</div>
</div>

View File

@@ -28,7 +28,7 @@
<div class="row">
<div class="col-md-6">
<label for="ex1">Address:</label>
<input id="new_address" type="text" class="form-control" placeholder="http://..., https://..., file://...">
<input id="new_address" type="url" class="form-control" placeholder="http://..., https://..., file://..." autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off">
</div>
<div class="col-md-6">
<label for="ex2">Comment:</label>

View File

@@ -34,7 +34,7 @@
</div>
<div class="col-md-6">
<label for="ex2">Custom client:</label>
<input id="ip-custom" type="text" class="form-control" disabled placeholder="Client IP address (IPv4 or IPv6, optional)">
<input id="ip-custom" type="text" class="form-control" disabled placeholder="Client IP address (IPv4 or IPv6, optional)" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off">
</div>
</div>
</div>

View File

@@ -28,7 +28,7 @@
<div class="row">
<div class="col-md-6">
<label for="ex1">Domain:</label>
<input id="new_domain" type="text" class="form-control" placeholder="Domain to be added">
<input id="new_domain" type="url" class="form-control" placeholder="Domain to be added" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off">
</div>
<div class="col-md-2">
<label for="ex2">Type:</label>

View File

@@ -37,7 +37,7 @@ else
<div class="row">
<div class="col-md-6">
<label for="ex1">Domain:</label>
<input id="domain" type="text" class="form-control" placeholder="Add a domain (example.com)">
<input id="domain" type="url" class="form-control" placeholder="Add a domain (example.com)" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off">
</div>
<div class="col-md-6">
<label for="ex2">Comment:</label>

View File

@@ -13,7 +13,7 @@
</div>
<!-- Domain Input -->
<div class="form-group input-group">
<input id="domain" type="text" class="form-control" placeholder="Domain to look for (example.com or sub.example.com)">
<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>

View File

@@ -62,6 +62,12 @@ $(document).ready(function() {
$(".deleteCustomDNS").on("click", deleteCustomDNS);
}
});
// Disable autocorrect in the search box
var input = document.querySelector("input[type=search]");
input.setAttribute("autocomplete", "off");
input.setAttribute("autocorrect", "off");
input.setAttribute("autocapitalize", "off");
input.setAttribute("spellcheck", false);
});
function addCustomDNS() {

View File

@@ -96,6 +96,12 @@ $(document).ready(function() {
$("#ip-custom").val("");
$("#ip-custom").prop("disabled", $("#select option:selected").val() !== "custom");
});
// Disable autocorrect in the search box
var input = document.querySelector("input[type=search]");
input.setAttribute("autocomplete", "off");
input.setAttribute("autocorrect", "off");
input.setAttribute("autocapitalize", "off");
input.setAttribute("spellcheck", false);
});
function initTable() {

View File

@@ -125,6 +125,12 @@ $(document).ready(function() {
$("#ip-custom").val("");
$("#ip-custom").prop("disabled", $("#select option:selected").val() !== "custom");
});
// Disable autocorrect in the search box
var input = document.querySelector("input[type=search]");
input.setAttribute("autocomplete", "off");
input.setAttribute("autocorrect", "off");
input.setAttribute("autocapitalize", "off");
input.setAttribute("spellcheck", false);
});
function initTable() {

View File

@@ -96,6 +96,12 @@ $(document).ready(function() {
$("#ip-custom").val("");
$("#ip-custom").prop("disabled", $("#select option:selected").val() !== "custom");
});
// Disable autocorrect in the search box
var input = document.querySelector("input[type=search]");
input.setAttribute("autocomplete", "off");
input.setAttribute("autocorrect", "off");
input.setAttribute("autocapitalize", "off");
input.setAttribute("spellcheck", false);
});
function initTable() {

View File

@@ -190,4 +190,10 @@ $(document).ready(function() {
}
]
});
// Disable autocorrect in the search box
var input = document.querySelector("input[type=search]");
input.setAttribute("autocomplete", "off");
input.setAttribute("autocorrect", "off");
input.setAttribute("autocapitalize", "off");
input.setAttribute("spellcheck", false);
});

View File

@@ -439,4 +439,10 @@ $(document).ready(function() {
tableApi.search("").draw();
$("#resetButton").hide();
});
// Disable autocorrect in the search box
var input = document.querySelector("input[type=search]");
input.setAttribute("autocomplete", "off");
input.setAttribute("autocorrect", "off");
input.setAttribute("autocapitalize", "off");
input.setAttribute("spellcheck", false);
});

View File

@@ -258,4 +258,11 @@ $(document).ready(function() {
alInfo.hide();
});
}
// Disable autocorrect in the search box
var input = document.querySelector("input[type=search]");
input.setAttribute("autocomplete", "off");
input.setAttribute("autocorrect", "off");
input.setAttribute("autocapitalize", "off");
input.setAttribute("spellcheck", false);
});

View File

@@ -291,7 +291,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<div class="form-group row">
<div class="col-xs-6">
<label for="newuserlists">Domain:</label>
<input name="newuserlists" type="text" class="form-control" placeholder="Enter a URL to add a new blocklist">
<input name="newuserlists" type="url" class="form-control" placeholder="Enter a URL to add a new blocklist" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off">
</div>
<div class="col-xs-6">
<label for="newusercomment">Comment:</label>
@@ -412,7 +412,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">From</div>
<input type="text" class="form-control DHCPgroup" name="from"
<input type="text" class="form-control DHCPgroup" name="from" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"
value="<?php echo $DHCPstart; ?>"
<?php if (!$DHCP){ ?>disabled<?php } ?>>
</div>
@@ -422,7 +422,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">To</div>
<input type="text" class="form-control DHCPgroup" name="to"
<input type="text" class="form-control DHCPgroup" name="to" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"
value="<?php echo $DHCPend; ?>"
<?php if (!$DHCP){ ?>disabled<?php } ?>>
</div>
@@ -435,7 +435,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">Router</div>
<input type="text" class="form-control DHCPgroup" name="router"
<input type="text" class="form-control DHCPgroup" name="router" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"
value="<?php echo $DHCProuter; ?>"
<?php if (!$DHCP){ ?>disabled<?php } ?>>
</div>
@@ -471,7 +471,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">Lease time in hours</div>
<input type="text" class="form-control DHCPgroup"
<input type="number" class="form-control DHCPgroup"
name="leasetime"
id="leasetime" value="<?php echo $DHCPleasetime; ?>"
data-mask <?php if (!$DHCP){ ?>disabled<?php } ?>>
@@ -636,9 +636,9 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
</tbody>
<tfoot style="display: table-row-group">
<tr>
<td><input type="text" name="AddMAC"></td>
<td><input type="text" name="AddIP"></td>
<td><input type="text" name="AddHostname" value=""></td>
<td><input type="text" name="AddMAC" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"></td>
<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">
<span class="fas fa-plus"></span>
@@ -742,7 +742,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<input type="checkbox" name="custom1" value="Customv4"
<?php if (isset($custom1)){ ?>checked<?php } ?>>
</div>
<input type="text" name="custom1val" class="form-control"
<input type="text" name="custom1val" class="form-control" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"
<?php if (isset($custom1)){ ?>value="<?php echo $custom1; ?>"<?php } ?>>
</div>
<label>Custom 2 (IPv4)</label>
@@ -751,7 +751,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<input type="checkbox" name="custom2" value="Customv4"
<?php if (isset($custom2)){ ?>checked<?php } ?>>
</div>
<input type="text" name="custom2val" class="form-control"
<input type="text" name="custom2val" class="form-control" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"
<?php if (isset($custom2)){ ?>value="<?php echo $custom2; ?>"<?php } ?>>
</div>
</div>
@@ -764,7 +764,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<input type="checkbox" name="custom3" value="Customv6"
<?php if (isset($custom3)){ ?>checked<?php } ?>>
</div>
<input type="text" name="custom3val" class="form-control"
<input type="text" name="custom3val" class="form-control" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"
<?php if (isset($custom3)){ ?>value="<?php echo $custom3; ?>"<?php } ?>>
</div>
<label>Custom 4 (IPv6)</label>
@@ -773,7 +773,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<input type="checkbox" name="custom4" value="Customv6"
<?php if (isset($custom4)){ ?>checked<?php } ?>>
</div>
<input type="text" name="custom4val" class="form-control"
<input type="text" name="custom4val" class="form-control" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"
<?php if (isset($custom4)){ ?>value="<?php echo $custom4; ?>"<?php } ?>>
</div>
</div>
@@ -889,10 +889,10 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<tr>
<div class="input-group">
<td>
<input type="text" name="conditionalForwardingIP" class="form-control"
<input type="text" name="conditionalForwardingIP" class="form-control" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"
<?php if(isset($conditionalForwardingIP)){ ?>value="<?php echo $conditionalForwardingIP; ?>"<?php } ?>>
</td>
<td><input type="text" name="conditionalForwardingDomain" class="form-control" data-mask
<td><input type="text" name="conditionalForwardingDomain" class="form-control" data-mask autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"
<?php if(isset($conditionalForwardingDomain)){ ?>value="<?php echo $conditionalForwardingDomain; ?>"<?php } ?>>
</td>
</div>
@@ -946,7 +946,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<div class="col-xs-12 col-sm-6 col-md-12 col-lg-6">
<div class="form-group">
<label>Top Domains / Top Advertisers</label>
<textarea name="domains" class="form-control" placeholder="Enter one domain per line"
<textarea name="domains" class="form-control" placeholder="Enter one domain per line" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"
rows="4"><?php foreach ($excludedDomains as $domain) {
echo $domain . "\n"; }
?></textarea>
@@ -955,7 +955,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<div class="col-xs-12 col-sm-6 col-md-12 col-lg-6">
<div class="form-group">
<label>Top Clients</label>
<textarea name="clients" class="form-control" placeholder="Enter one IP address or host name per line"
<textarea name="clients" class="form-control" placeholder="Enter one IP address or host name per line" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off"
rows="4"><?php foreach ($excludedClients as $client) {
echo $client . "\n"; }
?></textarea>
@@ -1027,7 +1027,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
<h4>Administrator Email Address</h4>
<div class="form-group">
<div class="input-group">
<input type="text" class="form-control" name="adminemail"
<input type="email" class="form-control" name="adminemail"
value="<?php echo htmlspecialchars($adminemail); ?>">
</div>
</div>