show password component

This commit is contained in:
realaravinth
2021-05-14 16:33:18 +05:30
parent bb6cc840ea
commit 6b740a980b
13 changed files with 285 additions and 7 deletions

View File

@@ -36,7 +36,8 @@
id="password"
required
/>
</label>
<. include!("../../components/showPassword/index.html"); .>
</label>
<input type="submit" class="sitekey-form__submit" value="Sign in" />
</form>

View File

@@ -20,6 +20,7 @@ import VIEWS from '../../../views/v1/routes';
import isBlankString from '../../../utils/isBlankString';
import genJsonPayload from '../../../utils/genJsonPayload';
import getFormUrl from '../../../utils/getFormUrl';
import registerShowPassword from '../../../components/showPassword';
//import '../forms.scss';
@@ -62,4 +63,5 @@ const login = async (e: Event) => {
export const index = () => {
const form = <HTMLFontElement>document.getElementById('form');
form.addEventListener('submit', login, true);
registerShowPassword();
};

View File

@@ -13,7 +13,7 @@
action="<.= crate::V1_API_ROUTES.auth.register .>"
class="sitekey-form" id="form">
<h1 class="form__title">
Join mCaptcah
Join mCaptcha
</h1>
<label class="sitekey-form__label" for="username"
@@ -50,6 +50,8 @@
id="password"
required
/>
<. include!("../../components/showPassword/index.html"); .>
</label>
<label for="password" class="sitekey-form__label"
@@ -62,6 +64,7 @@
id="password-check"
required
/>
<. include!("../../components/showPassword/index.html"); .>
</label>
<input type="submit" class="sitekey-form__submit" value="Sign up" />
</form>

View File

@@ -23,6 +23,7 @@ import genJsonPayload from '../../../utils/genJsonPayload';
import userExists from './userExists';
import emailExists from './emailExists';
import getFormUrl from '../../../utils/getFormUrl';
import registerShowPassword from '../../../components/showPassword';
//import '../forms.scss';
@@ -51,7 +52,7 @@ const registerUser = async (e: Event) => {
return;
}
let email: string|null = emailElement.value;
let email: string | null = emailElement.value;
if (!email.replace(/\s/g, '').length) {
email = null;
} else {
@@ -83,4 +84,5 @@ export const index = () => {
const form = <HTMLFontElement>document.getElementById('form');
form.addEventListener('submit', registerUser, true);
usernameElement.addEventListener('input', userExists, false);
registerShowPassword();
};