mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
Shows caps lock warning icon on login screen now
This commit is contained in:
@@ -33,7 +33,13 @@ echo $settingPW ? "Setup" : "Login";
|
||||
<?php
|
||||
if ($ICEcoder["multiUser"]) {echo '<input type="text" name="username" class="password"><br><br>';};
|
||||
?>
|
||||
<input type="password" name="password" class="password" id="password"<?php if ($settingPW) {?> onkeyup="pwStrength(this.value)" onchange="pwStrength(this.value)" onpaste="pwStrength(this.value)"<?php } ?>><br>
|
||||
<input type="password" name="password" class="password" id="password"<?php
|
||||
if ($settingPW) {
|
||||
?> onkeyup="checkCase(event); pwStrength(this.value)" onchange="pwStrength(this.value)" onpaste="pwStrength(this.value)"<?php
|
||||
} else {
|
||||
?> onkeyup="checkCase(event)"<?php
|
||||
}
|
||||
?>><div class="icon" style="display: none" id="capsLockDisplay" title="Caps lock on"><?php echo file_get_contents("../assets/images/icons/alert-triangle.svg");?></div><br>
|
||||
<?php
|
||||
if ($settingPW) {
|
||||
echo '<div id="pwReqs">'.
|
||||
@@ -106,8 +112,19 @@ const pwStrength = function(pw) {
|
||||
return (true === chars && true === upper && true === lower && true === num && true === special);
|
||||
};
|
||||
|
||||
const checkCase = function(evt) {
|
||||
const key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
|
||||
|
||||
// Not caps lock key
|
||||
if (20 !== key) {
|
||||
get("capsLockDisplay").style.display = true === evt.getModifierState("CapsLock")
|
||||
? "inline-block"
|
||||
: "none";
|
||||
}
|
||||
};
|
||||
|
||||
// Check if we can submit, else shake requirements
|
||||
var checkCanSubmit = function() {
|
||||
const checkCanSubmit = function() {
|
||||
// Password isn't strong enough, shake requirements
|
||||
if(false === pwStrength(get("password").value)) {
|
||||
var posArray = [6, -6, 3, -3, 0];
|
||||
|
||||
Reference in New Issue
Block a user