Bugzilla – Attachment 176905 Details for
Bug 34778
Add a 'Show password'/eye icon to toggle visibility of password when logging into OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34778: Remove the include file
Bug-34778-Remove-the-include-file.patch (text/plain), 5.81 KB, created by
Jonathan Druart
on 2025-01-22 11:52:06 UTC
(
hide
)
Description:
Bug 34778: Remove the include file
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-01-22 11:52:06 UTC
Size:
5.81 KB
patch
obsolete
>From 10f070fdfe4be51522ce81b7c69333565e2dd09d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 22 Jan 2025 12:50:40 +0100 >Subject: [PATCH] Bug 34778: Remove the include file > >--- > .../bootstrap/en/includes/masthead.inc | 1 - > .../en/includes/show-password-toggle.inc | 4 ---- > .../bootstrap/en/modules/opac-auth.tt | 1 - > .../bootstrap/en/modules/opac-main.tt | 1 - > .../bootstrap/js/show-password-toggle.js | 24 ++++++++++++++++++- > 5 files changed, 23 insertions(+), 8 deletions(-) > delete mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/show-password-toggle.inc > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index ae9e5e110b1..70713da7f0d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -441,7 +441,6 @@ > <div class="local-login"> > [% PROCESS login_label for="muserid" %]<input type="text" id="muserid" name="login_userid" autocomplete="off" /> > <label for="mpassword">Password:</label><input type="password" id="mpassword" name="login_password" autocomplete="off" /> >- [% INCLUDE 'show-password-toggle.inc' checkbox_id_suffix='modal' %] > <fieldset class="action"> > <input type="hidden" name="op" value="cud-login" /> > <input type="submit" class="btn btn-primary" value="Log in" /> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/show-password-toggle.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/show-password-toggle.inc >deleted file mode 100644 >index b7b804a5918..00000000000 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/show-password-toggle.inc >+++ /dev/null >@@ -1,4 +0,0 @@ >-<div class="show-password-toggle"> >- <input type="checkbox" class="show-password-toggle-checkbox" id="show-password-toggle-checkbox-[% checkbox_id_suffix | html %]"> >- <label class="show-password-toggle-label" for="show-password-toggle-checkbox-[% checkbox_id_suffix | html %]"> Show password</label> >-</div> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >index f3ed6992e8c..7499029831f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >@@ -249,7 +249,6 @@ > <label for="password">Password:</label> > <input class="form-control" type="password" size="25" id="password" name="login_password" autocomplete="off" /> > </div> >- [% INCLUDE 'show-password-toggle.inc' checkbox_id_suffix='auth' %] > <fieldset class="action"> > <input type="submit" value="Log in" class="btn btn-primary" /> > </fieldset> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >index c86c5a8da15..942fc365d7e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -204,7 +204,6 @@ > <input class="form-control" type="text" id="userid" name="login_userid" autocomplete="off" /> > <label for="password">Password:</label> > <input class="form-control" type="password" id="password" name="login_password" autocomplete="off" /> >- [% INCLUDE 'show-password-toggle.inc' checkbox_id_suffix='main' %] > <fieldset class="action"> > <input type="hidden" name="op" value="cud-login" /> > <input type="submit" value="Log in" class="btn btn-primary" /> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/show-password-toggle.js b/koha-tmpl/opac-tmpl/bootstrap/js/show-password-toggle.js >index 03a7f34c158..4c62d693d83 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/show-password-toggle.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/show-password-toggle.js >@@ -1,6 +1,28 @@ >+function create_show_password_toggle(loop_counter) { >+ const container = document.createElement('div'); >+ container.className = 'show-password-toggle'; >+ >+ const checkbox = document.createElement('input'); >+ checkbox.type = 'checkbox'; >+ checkbox.className = 'show-password-toggle-checkbox'; >+ checkbox.id = `show-password-toggle-checkbox-${loop_counter}`; >+ >+ const label = document.createElement('label'); >+ label.className = 'show-password-toggle-label'; >+ label.htmlFor = checkbox.id; >+ label.textContent = " " + __('Show password'); >+ >+ container.appendChild(checkbox); >+ container.appendChild(label); >+ >+ return container; >+} >+ > document.addEventListener("DOMContentLoaded", function() { > const local_logins = document.querySelectorAll('.local-login'); >- local_logins.forEach( (local_login) => { >+ local_logins.forEach( (local_login, i) => { >+ let show_password_toggle_node = create_show_password_toggle(i); >+ local_login.querySelector("input[type='password']").after(show_password_toggle_node); > const password_field = local_login.querySelector('#password,#mpassword'); > const toggle_box = local_login.querySelector('input.show-password-toggle-checkbox'); > if (password_field && toggle_box){ >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34778
:
173115
|
173310
|
174442
|
176485
|
176486
|
176501
|
176502
|
176505
|
176506
|
176703
|
176904
|
176905
|
176907
|
176908
|
176909
|
176910
|
176911
|
177272
|
177300
|
177301
|
177302
|
177303
|
177304
|
177305