mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-04-29 18:25:58 +00:00
UI groundwork for conditions display #92
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
<p>This software is dedicated to the memory of Tom G1PJB, SK, a friend and colleague who sadly passed away around the time I started writing it in Autumn 2025. I was looking forward to showing it to you when it was done.</p>
|
||||
</div>
|
||||
|
||||
<script src="/js/common.js?v=1774694366"></script>
|
||||
<script src="/js/common.js?v=1774695038"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-about").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -69,8 +69,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/js/common.js?v=1774694366"></script>
|
||||
<script src="/js/add-spot.js?v=1774694366"></script>
|
||||
<script src="/js/common.js?v=1774695038"></script>
|
||||
<script src="/js/add-spot.js?v=1774695038"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-add-spot").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -50,14 +50,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="conditions-area" class="appearing-panel card mb-3">
|
||||
{% module Template("widgets/conditions-area-header.html", web_ui_options=web_ui_options) %}
|
||||
</div>
|
||||
|
||||
<div id="table-container">
|
||||
<table id="table" class="table"><thead><tr class="table-primary"></tr></thead><tbody></tbody></table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/js/common.js?v=1774694367"></script>
|
||||
<script src="/js/alerts.js?v=1774694367"></script>
|
||||
<script src="/js/common.js?v=1774695038"></script>
|
||||
<script src="/js/alerts.js?v=1774695038"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-alerts").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -55,6 +55,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="conditions-area" class="appearing-panel card mb-3">
|
||||
{% module Template("widgets/conditions-area-header.html", web_ui_options=web_ui_options) %}
|
||||
</div>
|
||||
|
||||
<div id="bands-container"></div>
|
||||
|
||||
</div>
|
||||
@@ -62,9 +66,9 @@
|
||||
<script>
|
||||
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
|
||||
</script>
|
||||
<script src="/js/common.js?v=1774694366"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774694366"></script>
|
||||
<script src="/js/bands.js?v=1774694366"></script>
|
||||
<script src="/js/common.js?v=1774695038"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774695038"></script>
|
||||
<script src="/js/bands.js?v=1774695038"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-bands").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -46,10 +46,10 @@
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/tinycolor2@1.6.0/cjs/tinycolor.min.js"></script>
|
||||
|
||||
<script src="https://misc.ianrenton.com/jsutils/utils.js?v=1774694366"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/storage.js?v=1774694366"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/ui-ham.js?v=1774694366"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/geo.js?v=1774694366"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/utils.js?v=1774695038"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/storage.js?v=1774695038"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/ui-ham.js?v=1774695038"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/geo.js?v=1774695038"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -56,6 +56,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="conditions-area" class="appearing-panel card mb-3">
|
||||
{% module Template("widgets/conditions-area-header.html", web_ui_options=web_ui_options) %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -70,9 +74,9 @@
|
||||
<script>
|
||||
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
|
||||
</script>
|
||||
<script src="/js/common.js?v=1774694367"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774694367"></script>
|
||||
<script src="/js/map.js?v=1774694367"></script>
|
||||
<script src="/js/common.js?v=1774695038"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774695038"></script>
|
||||
<script src="/js/map.js?v=1774695038"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-map").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -78,6 +78,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="conditions-area" class="appearing-panel card mb-3">
|
||||
{% module Template("widgets/conditions-area-header.html", web_ui_options=web_ui_options) %}
|
||||
</div>
|
||||
|
||||
<div id="table-container">
|
||||
<table id="table" class="table"><thead><tr class="table-primary"></tr></thead><tbody></tbody></table>
|
||||
</div>
|
||||
@@ -87,9 +91,9 @@
|
||||
<script>
|
||||
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
|
||||
</script>
|
||||
<script src="/js/common.js?v=1774694366"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774694366"></script>
|
||||
<script src="/js/spots.js?v=1774694366"></script>
|
||||
<script src="/js/common.js?v=1774695038"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774695038"></script>
|
||||
<script src="/js/spots.js?v=1774695038"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-spots").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
<div id="status-container" class="row row-cols-1 row-cols-md-4 g-4 mt-4"></div>
|
||||
|
||||
<script src="/js/common.js?v=1774694366"></script>
|
||||
<script src="/js/status.js?v=1774694366"></script>
|
||||
<script src="/js/common.js?v=1774695038"></script>
|
||||
<script src="/js/status.js?v=1774695038"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-status").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
10
templates/widgets/conditions-area-header.html
Normal file
10
templates/widgets/conditions-area-header.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-auto me-auto">
|
||||
Conditions
|
||||
</div>
|
||||
<div class="col-auto d-inline-flex">
|
||||
<button id="close-conditions-button" type="button" class="btn-close btn-close-white" aria-label="Close" onclick="closeConditionsPanel();"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -206,6 +206,13 @@ tr.new td {
|
||||
}
|
||||
|
||||
|
||||
/* TABLE */
|
||||
#table-container {
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
/* MAP */
|
||||
div#map {
|
||||
width: auto;
|
||||
|
||||
@@ -306,33 +306,6 @@ function filtersUpdated() {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
// Startup
|
||||
$(document).ready(function() {
|
||||
// Call loadOptions(), this will then trigger loading alerts and setting up timers.
|
||||
|
||||
@@ -265,33 +265,6 @@ function displayUpdated() {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
// React to toggling/closing panels
|
||||
function toggleFiltersPanel() {
|
||||
// If we are going to show 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 show the display panel, 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();
|
||||
}
|
||||
|
||||
// Startup
|
||||
$(document).ready(function() {
|
||||
// Call loadOptions(), this will then trigger loading spots and setting up timers.
|
||||
|
||||
@@ -183,6 +183,44 @@ function listenForOSThemeChange() {
|
||||
});
|
||||
}
|
||||
|
||||
// Panel toggle functions.
|
||||
// PANELS is the single registry of all collapsible panels. To add a new panel, add an entry here
|
||||
// and provide named wrappers below. The toggle logic will automatically handle hiding other panels.
|
||||
const PANELS = [
|
||||
{ area: "#filters-area", button: "#filters-button" },
|
||||
{ area: "#display-area", button: "#display-button" },
|
||||
{ area: "#conditions-area", button: "#conditions-button" },
|
||||
];
|
||||
|
||||
// Toggle a panel open or closed. If opening, all other visible panels are closed first.
|
||||
// areaId is the jQuery selector for the panel's content area, e.g. "#filters-area".
|
||||
function togglePanel(areaId) {
|
||||
if (!$(areaId).is(":visible")) {
|
||||
PANELS.forEach(p => {
|
||||
if (p.area !== areaId && $(p.area).is(":visible")) {
|
||||
$(p.area).hide();
|
||||
$(p.button).button("toggle");
|
||||
}
|
||||
});
|
||||
}
|
||||
$(areaId).toggle();
|
||||
}
|
||||
|
||||
// Close a panel and deactivate its toggle button.
|
||||
function closePanel(areaId) {
|
||||
const panel = PANELS.find(p => p.area === areaId);
|
||||
if (panel) { $(panel.button).button("toggle"); }
|
||||
$(areaId).hide();
|
||||
}
|
||||
|
||||
function toggleFiltersPanel() { togglePanel("#filters-area"); }
|
||||
function closeFiltersPanel() { closePanel("#filters-area"); }
|
||||
function toggleDisplayPanel() { togglePanel("#display-area"); }
|
||||
function closeDisplayPanel() { closePanel("#display-area"); }
|
||||
function toggleConditionsPanel() { togglePanel("#conditions-area"); }
|
||||
function closeConditionsPanel() { closePanel("#conditions-area"); }
|
||||
|
||||
|
||||
// Startup
|
||||
$(document).ready(function() {
|
||||
usePreferredTheme();
|
||||
|
||||
@@ -196,33 +196,6 @@ function displayUpdated() {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
// React to toggling/closing panels
|
||||
function toggleFiltersPanel() {
|
||||
// If we are going to show 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 show the display panel, 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();
|
||||
}
|
||||
|
||||
// Set up the map
|
||||
function setUpMap() {
|
||||
// Create map
|
||||
|
||||
@@ -462,33 +462,6 @@ function userGridUpdated() {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
// React to toggling/closing panels
|
||||
function toggleFiltersPanel() {
|
||||
// If we are going to show the filters panel, hide the display and add spot panels
|
||||
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 show the display panel, hide the filters and add spot panels
|
||||
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.
|
||||
function displayIntroBox() {
|
||||
if (localStorage.getItem("intro-box-dismissed") == null) {
|
||||
|
||||
Reference in New Issue
Block a user