mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
frontend linting
This commit is contained in:
@@ -14,38 +14,38 @@
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {init} from 'mcaptcha-glue';
|
||||
import {init} from "mcaptcha-glue";
|
||||
|
||||
import VIEWS from '../../../views/v1/routes';
|
||||
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 createError from '../../../components/error/index';
|
||||
import isBlankString from "../../../utils/isBlankString";
|
||||
import genJsonPayload from "../../../utils/genJsonPayload";
|
||||
import getFormUrl from "../../../utils/getFormUrl";
|
||||
import registerShowPassword from "../../../components/showPassword";
|
||||
import createError from "../../../components/error/index";
|
||||
|
||||
//import '../forms.scss';
|
||||
|
||||
export const getPassword = () => {
|
||||
const passwordElement = <HTMLInputElement>document.getElementById('password');
|
||||
export const getPassword = (): string | null => {
|
||||
const passwordElement = <HTMLInputElement>document.getElementById("password");
|
||||
if (passwordElement === null) {
|
||||
console.debug('Password is null');
|
||||
console.debug("Password is null");
|
||||
return;
|
||||
}
|
||||
|
||||
return passwordElement.value;
|
||||
};
|
||||
|
||||
const login = async (e: Event) => {
|
||||
const login = async (e: Event): Promise<void> => {
|
||||
e.preventDefault();
|
||||
const loginElement = <HTMLInputElement>document.getElementById('login');
|
||||
const loginElement = <HTMLInputElement>document.getElementById("login");
|
||||
if (loginElement === null) {
|
||||
console.debug('login element element is null');
|
||||
console.debug("login element element is null");
|
||||
return;
|
||||
}
|
||||
|
||||
const login = loginElement.value;
|
||||
isBlankString(login, 'username', e);
|
||||
isBlankString(login, "username", e);
|
||||
|
||||
const password = getPassword();
|
||||
|
||||
@@ -65,9 +65,9 @@ const login = async (e: Event) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const index = () => {
|
||||
const form = <HTMLFontElement>document.getElementById('form');
|
||||
form.addEventListener('submit', login, true);
|
||||
export const index = (): void => {
|
||||
const form = <HTMLFontElement>document.getElementById("form");
|
||||
form.addEventListener("submit", login, true);
|
||||
registerShowPassword();
|
||||
init();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user