mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 18:15:39 +00:00
frontend restructured
This commit is contained in:
21
frontend/templates/index.js
Normal file
21
frontend/templates/index.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import './auth/forms.scss';
|
||||
|
||||
import signin from './auth/login';
|
||||
import registerUser from './auth/register';
|
||||
import {run as runPanel} from './panel/index';
|
||||
import {checkUsernameEventHandler} from './auth/register/userExists';
|
||||
|
||||
if (window.location.pathname == '/') {
|
||||
let form = document.getElementById('form');
|
||||
form.addEventListener('submit', signin, true);
|
||||
} else if (window.location.pathname == '/signup') {
|
||||
let form = document.getElementById('form');
|
||||
form.addEventListener('submit', registerUser, true);
|
||||
let username = document.getElementById('username');
|
||||
username.addEventListener('input', checkUsernameEventHandler, false);
|
||||
} else if (window.location.pathname.includes('panel')) {
|
||||
runPanel();
|
||||
} else {
|
||||
}
|
||||
|
||||
//export default signin;
|
||||
Reference in New Issue
Block a user