mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-21 02:40:09 +00:00
Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/1927b3c2-7484-4876-b037-79d94f2ecb6a Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com>
28 lines
1010 B
JavaScript
28 lines
1010 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', (event) => {
|
|
let passwordField = event.target;
|
|
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();
|
|
});
|
|
});
|
|
});
|