Changeset 3353046
- Timestamp:
- 08/30/2025 09:49:53 AM (6 months ago)
- Location:
- author-kit
- Files:
-
- 4 edited
-
tags/1.0.16/admin/assets/js/author-kit-user.js (modified) (2 diffs)
-
tags/1.0.16/admin/views/author-kit-user.php (modified) (1 diff)
-
trunk/admin/assets/js/author-kit-user.js (modified) (2 diffs)
-
trunk/admin/views/author-kit-user.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
author-kit/tags/1.0.16/admin/assets/js/author-kit-user.js
r3326187 r3353046 14 14 author_kit_add_or_edit_user(); 15 15 display_name_on_fields_change(); 16 togglePassword(); 16 17 17 18 … … 74 75 } 75 76 }); 77 } 78 79 // Function to toggle password visibility 80 function togglePassword() { 81 // Get the password input field 82 const passwordField = document.getElementById("password"); 83 // Get the eye icon element 84 const toggleIcon = document.querySelector(".toggle-password"); 85 86 toggleIcon.addEventListener("click", function () { 87 88 // If input is currently of type "password", change it to "text" 89 if (passwordField.type === "password") { 90 passwordField.type = "text"; // Show the password 91 toggleIcon.innerHTML = '<i class="fa-solid fa-eye-slash"></i>'; // Change icon to "hide" state 92 } else { 93 passwordField.type = "password"; // Hide the password 94 toggleIcon.innerHTML = '<i class="fa-solid fa-eye"></i>'; // Change icon back to "show" state 95 } 96 }); 97 76 98 } 77 99 -
author-kit/tags/1.0.16/admin/views/author-kit-user.php
r3326187 r3353046 204 204 <span style="color: red;"><?php echo 'add-new' === $action_selected ? '*' : ''; ?></span> 205 205 </label> 206 <input type="password" id="password" <?php echo 'add-new' === $action_selected ? 'required' : ''; ?> minlength="8" pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$"> 206 <!-- Wrapper around the input so we can position the toggle icon inside it --> 207 <div class="password-wrapper" style="position: relative;"> 208 <!-- Password input field --> 209 <input 210 type="password" 211 id="password" 212 <?php echo 'add-new' === $action_selected ? 'required' : ''; ?> 213 minlength="8" 214 pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$" 215 style="padding-right: 35px;" 216 > 217 218 <!-- Toggle icon (eye). It's placed absolutely inside the input wrapper --> 219 <span 220 class="toggle-password" 221 style="position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; user-select: none;"> 222 <i class="fa-solid fa-eye"></i> 223 </span> 224 </div> 207 225 <div class="feedback error" id="password-error" style="display: none;"> 208 226 </div> -
author-kit/trunk/admin/assets/js/author-kit-user.js
r3315954 r3353046 14 14 author_kit_add_or_edit_user(); 15 15 display_name_on_fields_change(); 16 togglePassword(); 16 17 17 18 … … 74 75 } 75 76 }); 77 } 78 79 // Function to toggle password visibility 80 function togglePassword() { 81 // Get the password input field 82 const passwordField = document.getElementById("password"); 83 // Get the eye icon element 84 const toggleIcon = document.querySelector(".toggle-password"); 85 86 toggleIcon.addEventListener("click", function () { 87 88 // If input is currently of type "password", change it to "text" 89 if (passwordField.type === "password") { 90 passwordField.type = "text"; // Show the password 91 toggleIcon.innerHTML = '<i class="fa-solid fa-eye-slash"></i>'; // Change icon to "hide" state 92 } else { 93 passwordField.type = "password"; // Hide the password 94 toggleIcon.innerHTML = '<i class="fa-solid fa-eye"></i>'; // Change icon back to "show" state 95 } 96 }); 97 76 98 } 77 99 -
author-kit/trunk/admin/views/author-kit-user.php
r3315954 r3353046 204 204 <span style="color: red;"><?php echo 'add-new' === $action_selected ? '*' : ''; ?></span> 205 205 </label> 206 <input type="password" id="password" <?php echo 'add-new' === $action_selected ? 'required' : ''; ?> minlength="8" pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$"> 206 <!-- Wrapper around the input so we can position the toggle icon inside it --> 207 <div class="password-wrapper" style="position: relative;"> 208 <!-- Password input field --> 209 <input 210 type="password" 211 id="password" 212 <?php echo 'add-new' === $action_selected ? 'required' : ''; ?> 213 minlength="8" 214 pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$" 215 style="padding-right: 35px;" 216 > 217 218 <!-- Toggle icon (eye). It's placed absolutely inside the input wrapper --> 219 <span 220 class="toggle-password" 221 style="position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; user-select: none;"> 222 <i class="fa-solid fa-eye"></i> 223 </span> 224 </div> 207 225 <div class="feedback error" id="password-error" style="display: none;"> 208 226 </div>
Note: See TracChangeset
for help on using the changeset viewer.