mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-22 07:30:23 +00:00
replaced CheckPSK dom level 1 events with level 2 event listener-driven implementation
This commit is contained in:
parent
611d953141
commit
26fbd78156
2 changed files with 14 additions and 1 deletions
13
js/custom.js
13
js/custom.js
|
@ -213,6 +213,19 @@ $(document).on("click", ".js-toggle-password", function(e) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on("keyup", ".js-validate-psk", function(e) {
|
||||||
|
var field = $(e.target);
|
||||||
|
var colors = field.data("colors").split(",");
|
||||||
|
var target = $(field.data("target"));
|
||||||
|
if (field.val().length < 8 || field.val().length > 63) {
|
||||||
|
field.css("backgroundColor", colors[0]);
|
||||||
|
target.attr("disabled", true);
|
||||||
|
} else {
|
||||||
|
field.css("backgroundColor", colors[1]);
|
||||||
|
target.attr("disabled", false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$(document)
|
$(document)
|
||||||
.ajaxSend(setCSRFTokenHeader)
|
.ajaxSend(setCSRFTokenHeader)
|
||||||
.ready(contentLoaded)
|
.ready(contentLoaded)
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
<?php if ($network['protocol'] === 'Open') { ?>
|
<?php if ($network['protocol'] === 'Open') { ?>
|
||||||
<input type="password" disabled class="form-control" aria-describedby="passphrase" name="passphrase<?php echo $index ?>" value="" />
|
<input type="password" disabled class="form-control" aria-describedby="passphrase" name="passphrase<?php echo $index ?>" value="" />
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<input type="password" class="form-control" aria-describedby="passphrase" name="passphrase<?php echo $index ?>" value="<?php echo $network['passphrase'] ?>" onKeyUp="CheckPSK(this, 'update<?php echo $index?>')" >
|
<input type="password" class="form-control js-validate-psk" aria-describedby="passphrase" name="passphrase<?php echo $index ?>" value="<?php echo $network['passphrase'] ?>" data-target="#update<?php echo $index ?>" data-colors="#ffd0d0,#d0ffd0">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-default js-toggle-password" type="button" data-target="[name=passphrase<?php echo $index ?>]" data-toggle-with="<?php echo _("Hide") ?>">Show</button>
|
<button class="btn btn-default js-toggle-password" type="button" data-target="[name=passphrase<?php echo $index ?>]" data-toggle-with="<?php echo _("Hide") ?>">Show</button>
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in a new issue