mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-28 06:20:14 +00:00
Signed-off-by: Zoey <zoey@z0ey.de> Signed-off-by: Simon L. <szaimen@e.mail.de> Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> Co-authored-by: Simon L. <szaimen@e.mail.de> Co-authored-by: Pablo Zmdl <pablo@nextcloud.com>
28 lines
1006 B
JavaScript
28 lines
1006 B
JavaScript
document.addEventListener("DOMContentLoaded", () => {
|
|
document.querySelectorAll('input[data-confirm]').forEach((element) => {
|
|
element.addEventListener('click', (event) => {
|
|
if (!confirm(element.dataset.confirm)) {
|
|
event.preventDefault();
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
document.querySelectorAll('input[data-input-show-password]').forEach((element) => {
|
|
element.addEventListener('input', (element) => {
|
|
let passwordField = element
|
|
if (passwordField.type === "password" && passwordField.value !== "") {
|
|
passwordField.type = "text";
|
|
} else if (passwordField.type === "text" && passwordField.value === "") {
|
|
passwordField.type = "password";
|
|
}
|
|
});
|
|
});
|
|
|
|
document.querySelectorAll('[data-stop-event-propagation="true"]').forEach((element) => {
|
|
element.addEventListener('click', (event) => {
|
|
event.stopPropagation();
|
|
});
|
|
});
|
|
});
|