rozbicie na moduły, poprawki i komendy cli
This commit is contained in:
1 parent
c5295fa49c
commit
bbfb3e0887
48 files changed
+2125
-1676
No files matched your search
@@ -0,0 +1,37 @@
|
||||
(function () {
|
||||
const form = document.querySelector('form.needs-validation');
|
||||
form.addEventListener('submit', function (e) {
|
||||
if (!form.checkValidity()) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
const pw1 = document.getElementById("haslo");
|
||||
const pw2 = document.getElementById('password2');
|
||||
if (pw1.value !== pw2.value) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
pw2.setCustomValidity("Hasła muszą być identyczne.");
|
||||
pw2.reportValidity();
|
||||
} else {
|
||||
pw2.setCustomValidity("");
|
||||
}
|
||||
form.classList.add('was-validated');
|
||||
}, false);
|
||||
})();
|
||||
|
||||
const pw = document.getElementById("haslo");
|
||||
const toggle = document.getElementById('togglePw');
|
||||
toggle.addEventListener('click', () => {
|
||||
const isText = pw.type === 'text';
|
||||
pw.type = isText ? "haslo" : 'text';
|
||||
toggle.textContent = isText ? 'Pokaż' : 'Ukryj';
|
||||
pw.focus();
|
||||
});
|
||||
|
||||
const caps = document.getElementById('capsWarning');
|
||||
function handleCaps(e) {
|
||||
const capsOn = e.getModifierState && e.getModifierState('CapsLock');
|
||||
caps.style.display = capsOn ? 'inline' : 'none';
|
||||
}
|
||||
pw.addEventListener('keyup', handleCaps);
|
||||
pw.addEventListener('keydown', handleCaps);
|
||||
Reference in new issue
Block a user