From: Scott Angel Date: Thu, 23 Mar 2023 21:27:05 +0000 (-0500) Subject: LP1977554 - Add Password visibility toggle on login screens X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=12f88af6893e3e66a55c4bc66e432e1689b71151;p=working%2FEvergreen.git LP1977554 - Add Password visibility toggle on login screens Changed the tags to
- - + +
diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/login/login_modal.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/login/login_modal.tt2 index 9268aa3a48..83605ed186 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/login/login_modal.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/login/login_modal.tt2 @@ -46,8 +46,13 @@
- - + + + +
diff --git a/Open-ILS/src/templates/opac/parts/js.tt2 b/Open-ILS/src/templates/opac/parts/js.tt2 index 9aae9d9cdd..33df990f3c 100644 --- a/Open-ILS/src/templates/opac/parts/js.tt2 +++ b/Open-ILS/src/templates/opac/parts/js.tt2 @@ -49,8 +49,14 @@ let checkbox = document.getElementById('password_visibility_checkbox'); let input = document.getElementById('password_field'); checkbox.addEventListener('change', () => { - if(checkbox.checked) input.type = 'text'; - else input.type = 'password'; + if(checkbox.checked){ + input.type = 'text'; + input.setAttribute('aria-description', 'Your password is visible!'); + } + else { + input.type = 'password'; + input.setAttribute('aria-description', 'Your password is not visible.'); + } input.focus(); }); // If the form is submitted revert the password field to a password input diff --git a/Open-ILS/src/templates/opac/parts/login/form.tt2 b/Open-ILS/src/templates/opac/parts/login/form.tt2 index ddb9a764ad..62acac177b 100644 --- a/Open-ILS/src/templates/opac/parts/login/form.tt2 +++ b/Open-ILS/src/templates/opac/parts/login/form.tt2 @@ -57,7 +57,9 @@
- +
diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2 index 72bac37913..a92e80b918 100644 --- a/Open-ILS/src/templates/staff/css/style.css.tt2 +++ b/Open-ILS/src/templates/staff/css/style.css.tt2 @@ -194,7 +194,9 @@ table.list tr.selected td { /* deprecated? */ .currency-input { width: 8em; } - +#show_password { + border: none; +} /* barcode inputs are everywhere. Let's have a consistent style. */ .barcode { width: 16em !important; } diff --git a/Open-ILS/src/templates/staff/t_login.tt2 b/Open-ILS/src/templates/staff/t_login.tt2 index a4f77d9669..19edb73b39 100644 --- a/Open-ILS/src/templates/staff/t_login.tt2 +++ b/Open-ILS/src/templates/staff/t_login.tt2 @@ -26,8 +26,11 @@
- + placeholder="Password" autocapitalize="none" spellcheck="false" autocomplete="false" aria-description="Your password is not visible." + ng-model="args.password"/> + + +
@@ -76,7 +79,17 @@ let input = document.getElementById('login-password'); let icon = btn.querySelector('i'); btn.addEventListener('click', () => { - input.type == 'password' ? [input.type = 'text', icon.setAttribute('class', 'glyphicon glyphicon-eye-open')] : [input.type = 'password', icon.setAttribute('class', 'glyphicon glyphicon-eye-close')]; + if(input.type == 'password'){ + input.type = 'text'; + icon.setAttribute('class', 'glyphicon glyphicon-eye-open'); + btn.setAttribute('aria-checked', 'true'); + input.setAttribute('aria-description', 'Your password is visible!'); + }else { + input.type = 'password'; + icon.setAttribute('class', 'glyphicon glyphicon-eye-close'); + btn.setAttribute('aria-checked', 'false'); + input.setAttribute('aria-description', 'Your password is not visible.'); + } input.focus(); }); $('#login_form').submit(()=>{