aboutsummaryrefslogtreecommitdiff
path: root/srs-anywhere-network.js
diff options
context:
space:
mode:
authorJakob L. Kreuze2026-10-16 12:52:40 -0400
committerJakob L. Kreuze2026-10-16 12:52:40 -0400
commit319cc47ae6abafd2458cf9a014b791f14419d7ea (patch)
tree8518a9d31e34fc0819bd6b083e1d73887eb5e4e5 /srs-anywhere-network.js
parent00b5b3541c3b960b7a2f5ff69b5cc7e9a4582496 (diff)
Implement runtime-configurable features
In particular these things can now be enabled or disabled depending on the user's requirements: - A netbanner (previously implemented, later removed, hard-coded into fork) - Interactions with a scheduler server (previously implemented in branch cgi-storage)
Diffstat (limited to 'srs-anywhere-network.js')
-rw-r--r--srs-anywhere-network.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/srs-anywhere-network.js b/srs-anywhere-network.js
index 8fe925b..8d972cc 100644
--- a/srs-anywhere-network.js
+++ b/srs-anywhere-network.js
@@ -1,4 +1,4 @@
-/* Copyright © 2025 Jakob L. Kreuze
+/* Copyright © 2025 - 2026 Jakob L. Kreuze
This file is part of SRS Anywhere.
@@ -15,7 +15,21 @@
You should have received a copy of the GNU Affero General Public
License along with SRS Anywhere. If not, see <https://www.gnu.org/licenses/>. */
-window.addEventListener("load", () => {
+function enableInputs() {
+ const target = document.querySelector('#cards-input');
+ const el1 = document.createElement('input');
+ el1.type = "text";
+ el1.id = "network-password";
+ const el2 = document.createElement('button');
+ el2.id = "open-network";
+ el2.innerText = "Go!";
+ const el3 = document.createElement('br');
+ target.before(el1, el2, el3);
+}
+
+function enableNetworkFeatures() {
+ enableInputs();
+
const passwordField = document.getElementById('network-password');
const urlParams = new URLSearchParams(window.location.search);
@@ -47,6 +61,12 @@ window.addEventListener("load", () => {
};
xhr.send();
});
+}
+
+window.addEventListener("load", () => {
+ if (SRS_ANYWHERE_CONFIG.network) {
+ enableNetworkFeatures();
+ }
});
const downloadJSONOld = downloadJSON;

© 2015 - 2026 Jakob L. Kreuze