diff --git a/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/sme-password.js b/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/sme-password.js index bbf7479..7ec14b0 100644 --- a/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/sme-password.js +++ b/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/sme-password.js @@ -5,9 +5,78 @@ $(document).ready(function () { let pass = togglePassword; if (pass) { - togglePassword.addEventListener("click", function () { - // toggle the type attribute + togglePassword.addEventListener("click", function () { + // toggle the type attribute + const type = password.getAttribute("type") === "password" ? "text" : "password"; + password.setAttribute("type", type); + // toggle the eye icon + if (type === "text") { + $(this).removeClass("bi-eye"); + $(this).addClass("bi-eye-slash"); + } else { + $(this).removeClass("bi-eye-slash"); + $(this).addClass("bi-eye"); + } + }); + } +}); + +$(document).ready(function () { + + // Get the fields + const toggle = document.querySelector("#togglePasswords"); + const passwords = document.querySelectorAll('[type="password"]'); + + + // listen for click events on the toggle + toggle.addEventListener("click", function () { + // loop through each password field + for (let password of passwords) { + // if toggle is checked, change type to "text" + // otherwise, change it back to "password" + if (toggle.checked) { + password.type = "text"; + } else { + password.type = "password"; + } + } + }); + +}); + +$(document).ready(function () { + // For each password input + $('.sme-password').each(function () { + // Create a new container + //alert("sme-password"); + //var $inputContainer = $('
'); + + // Move the input into the new container + //$(this).wrap($inputContainer); + + // Create the toggle image + //var $togglePassword = $('- %= dumper $c->current_route - %= dumper $pwd_datas -
+ % if (config->{debug} == 0) { ++ <%= dumper $c->current_route %> + <%= dumper $pwd_datas %> +% }
- %= l 'pwd_YOUR_ACCOUNT' - | -- %=l 'USER_NAME' - | -
---|---|
<%= $pwd_datas->{Account} %> | -<%= $pwd_datas->{name} %>Not in pwd_datas-> name ? :-( | -