[feat](trx-frontend-http): improve locator map plotting and themed filters

Refine map plotting and filter UX in HTTP frontend plugins.\n\n- support plotting multiple locator squares from FT8/WSPR messages\n- show locator lists in popup content as newline-separated entries\n- add WSPR map layer filter toggle and marker typing\n- style filter controls for strong dark/light mode contrast\n- keep themed behavior aligned with map and control updates\n\nCo-authored-by: OpenAI Codex <codex@openai.com>

Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
2026-02-13 02:11:31 +01:00
parent f637cf23d3
commit 4f35be539f
5 changed files with 95 additions and 22 deletions
@@ -70,7 +70,9 @@ function renderFt8Message(message) {
return out;
}
function extractFirstGrid(message) {
function extractAllGrids(message) {
const out = [];
const seen = new Set();
let i = 0;
while (i < message.length) {
if (isAlphaNum(message[i])) {
@@ -78,13 +80,16 @@ function extractFirstGrid(message) {
while (j < message.length && isAlphaNum(message[j])) j++;
const token = message.slice(i, j);
const grid = token.toUpperCase();
if (/^[A-R]{2}\d{2}(?:[A-X]{2})?$/.test(grid)) return grid;
if (/^[A-R]{2}\d{2}(?:[A-X]{2})?$/.test(grid) && !seen.has(grid)) {
seen.add(grid);
out.push(grid);
}
i = j;
} else {
i += 1;
}
}
return null;
return out;
}
function escapeHtml(input) {
@@ -149,9 +154,9 @@ document.getElementById("ft8-clear-btn").addEventListener("click", async () => {
// --- Server-side FT8 decode handler ---
window.onServerFt8 = function(msg) {
ft8Status.textContent = "Receiving";
const grid = extractFirstGrid(msg.message || "");
if (grid && window.ft8MapAddLocator) {
window.ft8MapAddLocator(msg.message, grid);
const grids = extractAllGrids((msg.message || "").toString());
if (grids.length > 0 && window.ft8MapAddLocator) {
window.ft8MapAddLocator(msg.message || "", grids);
}
addFt8Message({
ts_ms: msg.ts_ms,
@@ -54,6 +54,20 @@ function escapeWsprHtml(input) {
.replaceAll("\"", "&quot;");
}
function extractAllGrids(message) {
const out = [];
const seen = new Set();
const parts = message.toUpperCase().split(/[^A-Z0-9]+/);
for (const token of parts) {
if (!token) continue;
if (/^[A-R]{2}\d{2}(?:[A-X]{2})?$/.test(token) && !seen.has(token)) {
seen.add(token);
out.push(token);
}
}
return out;
}
function applyWsprFilterToRow(row) {
if (!wsprFilterText) {
row.style.display = "";
@@ -86,11 +100,16 @@ document.getElementById("wspr-clear-btn").addEventListener("click", async () =>
window.onServerWspr = function(msg) {
wsprStatus.textContent = "Receiving";
const raw = (msg.message || "").toString();
const grids = extractAllGrids(raw);
if (grids.length > 0 && window.ft8MapAddLocator) {
window.ft8MapAddLocator(raw, grids, "wspr");
}
addWsprMessage({
ts_ms: msg.ts_ms,
snr_db: msg.snr_db,
dt_s: msg.dt_s,
freq_hz: msg.freq_hz,
message: msg.message,
message: raw,
});
};