Global autoformat

This commit is contained in:
Ian Renton
2026-06-19 21:36:11 +01:00
parent edb2641f76
commit 07d0d98f3d
65 changed files with 1250 additions and 844 deletions

View File

@@ -6,7 +6,7 @@ let rowCount = 0;
// Set up a listener to close the SSE connection nicely when we navigate away from the page, to prevent console errors
// and keep things nice and tidy for the server.
window.addEventListener('beforeunload', function() {
window.addEventListener('beforeunload', function () {
if (evtSource != null) {
evtSource.close();
}
@@ -20,7 +20,7 @@ function loadSpots() {
}
// Make the new query
$.getJSON('/api/v1/spots' + buildQueryString(false), function(jsonData) {
$.getJSON('/api/v1/spots' + buildQueryString(false), function (jsonData) {
// Store data
spots = jsonData;
// Update table
@@ -41,7 +41,7 @@ function startSSEConnection() {
}
evtSource = new EventSource('/api/v1/spots/stream' + buildQueryString(true));
evtSource.onmessage = function(event) {
evtSource.onmessage = function (event) {
// Get the new spot
const newSpot = JSON.parse(event.data);
// Awful fudge to ensure new incoming spots at the top of the list don't have timestamps that make them look
@@ -76,7 +76,7 @@ function startSSEConnection() {
}
};
evtSource.onerror = function() {
evtSource.onerror = function () {
if (evtSource != null) {
evtSource.close();
}
@@ -418,7 +418,7 @@ function createNewTableRowsForSpot(s, highlightNew) {
// Load server options. Once a successful callback is made from this, we then query spots and set up the timer to query
// spots repeatedly.
function loadOptions() {
$.getJSON('/api/v1/options', function(jsonData) {
$.getJSON('/api/v1/options', function (jsonData) {
// Store options
options = jsonData;
@@ -485,7 +485,7 @@ function displayIntroBox() {
if (localStorage.getItem("intro-box-dismissed") == null) {
$("#intro-box").show();
}
$("#intro-box-dismiss").click(function() {
$("#intro-box-dismiss").click(function () {
localStorage.setItem("intro-box-dismissed", true);
});
}
@@ -512,19 +512,19 @@ function clearWorked() {
}
// Startup
$(document).ready(function() {
$(document).ready(function () {
// Call loadOptions(), this will then trigger loading spots and setting up timers.
loadOptions();
// Display intro box
displayIntroBox();
// Set up run/pause toggles
$("#runButton").change(function() {
$("#runButton").change(function () {
// Need to start the SSE connection but also do a full re-query to catch up anything that we missed, so we
// might as well just call loadSpots again which will trigger it all
loadSpots();
});
$("#pauseButton").change(function() {
$("#pauseButton").change(function () {
// If we are pausing and have an open SSE connection, stop it
if (evtSource != null) {
evtSource.close();