feat: add secure Pi-hole DNS management
Container-Image veröffentlichen / container (push) Has been cancelled
Container-Image veröffentlichen / container (push) Has been cancelled
This commit is contained in:
1 parent
1a6b4d0939
commit
1c32ca0671
18 files changed
+2159
-34
No files matched your search
@@ -179,6 +179,25 @@
|
||||
});
|
||||
}
|
||||
|
||||
for (const form of document.querySelectorAll('[data-dirty-form]')) {
|
||||
const submit = form.querySelector('[data-dirty-submit]');
|
||||
if (!submit) continue;
|
||||
const state = () => new URLSearchParams(new FormData(form)).toString();
|
||||
const initialState = state();
|
||||
const syncDirtyState = () => {
|
||||
const dirty = state() !== initialState;
|
||||
submit.disabled = !dirty;
|
||||
submit.setAttribute('aria-disabled', String(!dirty));
|
||||
};
|
||||
form.addEventListener('input', syncDirtyState);
|
||||
form.addEventListener('change', syncDirtyState);
|
||||
form.addEventListener('submit', (event) => {
|
||||
syncDirtyState();
|
||||
if (submit.disabled) event.preventDefault();
|
||||
});
|
||||
syncDirtyState();
|
||||
}
|
||||
|
||||
const copyButtons = document.querySelectorAll('[data-copy-target]');
|
||||
for (const button of copyButtons) {
|
||||
button.addEventListener('click', async () => {
|
||||
|
||||
Reference in new issue
Block a user