commit 1b2c102adc302382e7c4ffb36be249e5741f638c
parent cfd0b611d9b4ab8fe2522677949138bd7d78bc8a
Author: breadcat <breadcat@users.noreply.github.com>
Date: Thu, 30 Jul 2026 11:31:37 +0100
appendHidden to common.js too
Diffstat:
3 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/static/admin-sed-rules.js b/static/admin-sed-rules.js
@@ -105,12 +105,3 @@ function setupSedRulesForm() {
});
});
}
-
-function appendHidden(form, name, value) {
- const input = document.createElement('input');
- input.type = 'hidden';
- input.name = name;
- input.value = value;
- input.dataset.generated = '1';
- form.appendChild(input);
-}
diff --git a/static/admin-tag-alias.js b/static/admin-tag-alias.js
@@ -130,14 +130,5 @@ document.getElementById('aliases-form').addEventListener('submit', function () {
});
});
-function appendHidden(form, name, value) {
- const input = document.createElement('input');
- input.type = 'hidden';
- input.name = name;
- input.value = value;
- input.dataset.generated = '1';
- form.appendChild(input);
-}
-
// initialise
document.addEventListener('DOMContentLoaded', renderAliasGroups);
diff --git a/static/common.js b/static/common.js
@@ -3,3 +3,13 @@ function escapeHtml(text) {
div.textContent = text;
return div.innerHTML;
}
+
+// Appends a hidden input to a form
+function appendHidden(form, name, value) {
+ const input = document.createElement('input');
+ input.type = 'hidden';
+ input.name = name;
+ input.value = value;
+ input.dataset.generated = '1';
+ form.appendChild(input);
+}