Move Display-like settings into Display panel, add input for grid locator and (not yet implemented) toggles for columns. #19

This commit is contained in:
Ian Renton
2025-10-12 10:06:09 +01:00
parent 3500ec7e03
commit b61f08768c
8 changed files with 260 additions and 68 deletions

View File

@@ -32,7 +32,7 @@ function buildQueryString() {
// Update the spots table
function updateTable() {
// Use local time instead of UTC?
var useLocalTime = $("#useLocalTime")[0].checked;
var useLocalTime = $("#timeZone")[0].value == "local";
// Populate table with headers
let table = $('<table class="table table-striped-custom table-hover">').append('<thead><tr class="table-primary"></tr></thead><tbody></tbody>');
@@ -211,7 +211,7 @@ function generateBandsMultiToggleFilterCard(band_options) {
let $card = $("<div class='card'>");
let $card_body = $("<div class='card-body'>");
$card_body.append(`<h5 class='card-title'>Bands</h5>`);
$p = $("<p class='card-text filter-card-text'>");
$p = $("<p class='card-text spothole-card-text'>");
// Create a button for each option
band_options.forEach(o => {
// CSS doesn't like IDs with decimal points in, so we need to replace that in the same way as when we originally
@@ -234,15 +234,31 @@ function filtersUpdated() {
saveSettings();
}
// Set up UI element event listeners, after the document is ready
function setUpEventListeners() {
$("#filters-button").click(function() {
$("#filters-area").toggle();
});
$("#close-filters-button").click(function() {
$("#filters-button").button("toggle");
// React to toggling/closing panels
function toggleFiltersPanel() {
// If we are going to display the filters panel, hide the display panel
if (!$("#filters-area").is(":visible") && $("#display-area").is(":visible")) {
$("#display-area").hide();
$("#display-button").button("toggle");
}
$("#filters-area").toggle();
}
function closeFiltersPanel() {
$("#filters-button").button("toggle");
$("#filters-area").hide();
}
function toggleDisplayPanel() {
// If we are going to display status, load the data for the status panel, and hide the filters panel
if (!$("#display-area").is(":visible") && $("#filters-area").is(":visible")) {
$("#filters-area").hide();
});
$("#filters-button").button("toggle");
}
$("#display-area").toggle();
}
function closeDisplayPanel() {
$("#display-button").button("toggle");
$("#display-area").hide();
}
// Display the intro box, unless the user has already dismissed it once.
@@ -261,8 +277,6 @@ $(document).ready(function() {
loadOptions();
// Update the refresh timing display every second
setInterval(updateRefreshDisplay, 1000);
// Set up event listeners
setUpEventListeners();
// Display intro box
displayIntroBox();
});