Added show password button (#841)

This commit is contained in:
Roman Kelesidis 2023-07-24 00:12:36 +07:00 committed by GitHub
commit 0322199874
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 2 deletions

View file

@ -25,6 +25,7 @@ $lang['POSTS_SHORT'] = 'Posts';
$lang['POSTED'] = 'Posted';
$lang['USERNAME'] = 'Username';
$lang['PASSWORD'] = 'Password';
$lang['PASSWORD_SHOW_BTN'] = 'Show password';
$lang['EMAIL'] = 'Email';
$lang['PM'] = 'PM';
$lang['AUTHOR'] = 'Author';

View file

@ -26,7 +26,7 @@
</tr>
<tr>
<td align="right">{L_PASSWORD}:</td>
<td><input type="password" class="post" name="login_password" value="{LOGIN_PASSWORD}" tabindex="102" size="25" maxlength="32" /></td>
<td><input type="password" class="post show_pass_input" name="login_password" value="{LOGIN_PASSWORD}" tabindex="102" size="25" maxlength="32" />&nbsp;<label><input type="checkbox" class="password_show_checkbox">&nbsp;{L_PASSWORD_SHOW_BTN}</label></td>
</tr>
<!-- IF CAPTCHA_HTML -->
<tr>

View file

@ -66,6 +66,16 @@
<script type="text/javascript">new ClipboardJS('.copyElement');</script>
<script type="text/javascript">
$('body').on('click', '.password_show_checkbox', function () {
if ($(this).is(':checked')) {
$('input.show_pass_input').attr('type', 'text');
} else {
$('input.show_pass_input').attr('type', 'password');
}
});
</script>
<!-- IF ONLOAD_FOCUS_ID -->
<script type="text/javascript">
$p('{ONLOAD_FOCUS_ID}').focus();

View file

@ -73,7 +73,7 @@ document.write('<input type="hidden" name="user_timezone" value="'+tz+'" />');
<!-- IF EDIT_PROFILE and not ADM_EDIT -->
<tr>
<td class="prof-title">{L_CURRENT_PASSWORD}: * <br /><h6>{L_CONFIRM_PASSWORD_EXPLAIN}</h6></td>
<td><input type="password" name="cur_pass" size="35" maxlength="32" value="" /></td>
<td><input class="show_pass_input" type="password" name="cur_pass" size="35" maxlength="32" value="" />&nbsp;<label><input type="checkbox" class="password_show_checkbox">&nbsp;{L_PASSWORD_SHOW_BTN}</label></td>
</tr>
<!-- ENDIF -->
<tr>