Set up web UI using web_ui_options embedded directly into HTML, to avoid more complex JS load order faff #102

This commit is contained in:
Ian Renton
2026-01-30 22:24:12 +00:00
parent 2be1c5b3d3
commit 5230fa535f
13 changed files with 81 additions and 122 deletions

View File

@@ -285,17 +285,6 @@ function loadOptions() {
generateMultiToggleFilterCard("#dx-continent-options", "dx_continent", options["continents"]);
generateMultiToggleFilterCard("#source-options", "source", options["alert_sources"]);
// Populate the Display panel
options["web-ui-options"]["alert-count"].forEach(sc => $("#alerts-to-fetch").append($('<option>', {
value: sc,
text: sc
})));
$("#alerts-to-fetch").val(options["web-ui-options"]["alert-count-default"]);
if ($("#color-scheme option:selected").val() == "") {
$("#color-scheme").val(options["web-ui-options"]["default-color-scheme"]);
setColorScheme(options["web-ui-options"]["default-color-scheme"]);
}
// Load URL params. These may select things from the various filter & display options, so the function needs
// to be called after these are set up, but if the URL params ask for "embedded mode", this will suppress
// loading settings, so this needs to be called before that.
@@ -303,6 +292,7 @@ function loadOptions() {
// Load filters from settings storage
loadSettings();
setColorScheme($("#color-scheme option:selected").val());
// Load alerts and set up the timer
loadAlerts();