site-zkmr-calculator/mirzaev/zkmr/calculator/system/public/js/auth.js

38 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
function remember_switch(target) {
if (target.classList.contains('fa-unlock')) {
// Найден "открытый замок"
// Перезапись на "закрытый замок"
target.classList.remove('fa-unlock');
target.classList.add('fa-lock');
// Изменение отправляемого значения
document.querySelector('input[name=' + target.getAttribute('for') + ']').checked = true;
} else {
// Не найден "открытый замок", подразумевается, что найден "закрытый замок"
// Перезапись на "открытый замок"
target.classList.remove('fa-lock');
target.classList.add('fa-unlock');
// Изменение отправляемого значения
document.querySelector('input[name=' + target.getAttribute('for') + ']').checked = false;
}
}
function authentication(form) {
// Инициализация адреса отправки формы
form.action = '/account/authentication';
return true;
}
function registration(form) {
// Инициализация адреса отправки формы
form.action = '/account/registration';
return true;
}