mirror of https://github.com/sualko/cloud_bbb
feat: add a checkbox to toggle password visibility
This commit adds the ability to toggle the password visibility for the password input for guests in password-protected bbb rooms.pull/277/head
parent
d023ffa331
commit
80933d83ca
|
@ -23,9 +23,11 @@
|
||||||
required minlength="3" autofocus />
|
required minlength="3" autofocus />
|
||||||
<?php if (isset($_['passwordRequired']) && $_['passwordRequired']): ?>
|
<?php if (isset($_['passwordRequired']) && $_['passwordRequired']): ?>
|
||||||
<label for="password" class="infield"><?php p($l->t('Password')); ?></label>
|
<label for="password" class="infield"><?php p($l->t('Password')); ?></label>
|
||||||
<input type="text" name="password" id="password" class="bbb-input"
|
<input type="password" name="password" id="password" class="bbb-input"
|
||||||
placeholder="<?php p($l->t('Password')); ?>" value=""
|
placeholder="<?php p($l->t('Password')); ?>" value=""
|
||||||
required minlength="8" />
|
required minlength="8" />
|
||||||
|
<input type="checkbox" name="password-visibility-toggle" id="password-visibility" class="checkbox" value=""/>
|
||||||
|
<label for="password-visibility"><?php p($l->t('Show Password')); ?></label>
|
||||||
<button class="primary"><?php p($l->t('Join')); ?>
|
<button class="primary"><?php p($l->t('Join')); ?>
|
||||||
<div class="submit-icon icon-confirm-white"></div></button>
|
<div class="submit-icon icon-confirm-white"></div></button>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
|
|
19
ts/join.ts
19
ts/join.ts
|
@ -1 +1,20 @@
|
||||||
import './join.scss';
|
import './join.scss';
|
||||||
|
|
||||||
|
|
||||||
|
$(() => {
|
||||||
|
$<HTMLInputElement>('#password-visibility').on('change', function (ev) {
|
||||||
|
ev.preventDefault();
|
||||||
|
|
||||||
|
console.log(`checkbox ${ev.target.name} changed to ${ev.target.checked}`);
|
||||||
|
|
||||||
|
const passwordField = document.querySelector("#password") as HTMLInputElement | null;
|
||||||
|
|
||||||
|
if (passwordField != null) {
|
||||||
|
if (passwordField.type === "password") {
|
||||||
|
passwordField.type = "text";
|
||||||
|
} else {
|
||||||
|
passwordField.type = "password";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue