[fix](trx): ignore FTx farewell pseudo-locators and narrow split slider

This commit is contained in:
2026-03-05 19:24:54 +01:00
parent 05e72e21e8
commit 49f44e84a0
4 changed files with 34 additions and 8 deletions
@@ -130,7 +130,7 @@ function renderFt8Message(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)) {
if (isMaidenheadGridToken(grid)) {
out += `<span class="ft8-locator">${grid}</span>`;
} else {
out += escapeHtml(token);
@@ -154,7 +154,7 @@ function extractAllGrids(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) && !seen.has(grid)) {
if (isMaidenheadGridToken(grid) && !seen.has(grid)) {
seen.add(grid);
out.push(grid);
}
@@ -172,12 +172,22 @@ function extractLikelyCallsign(message) {
if (!token) continue;
if (token.length < 3 || token.length > 12) continue;
if (token === "CQ" || token === "DE" || token === "QRZ" || token === "DX") continue;
if (/^[A-R]{2}\d{2}(?:[A-X]{2})?$/.test(token)) continue;
if (isMaidenheadGridToken(token)) continue;
if (/^[A-Z0-9/]{1,5}\d[A-Z0-9/]{1,6}$/.test(token)) return token;
}
return null;
}
function isFtxFarewellToken(token) {
const normalized = String(token || "").trim().toUpperCase();
return normalized === "RR73" || normalized === "73" || normalized === "RR";
}
function isMaidenheadGridToken(token) {
const normalized = String(token || "").trim().toUpperCase();
return /^[A-R]{2}\d{2}(?:[A-X]{2})?$/.test(normalized) && !isFtxFarewellToken(normalized);
}
function escapeHtml(input) {
return input
.replaceAll("&", "&amp;")
@@ -86,7 +86,7 @@ function extractAllGrids(message) {
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)) {
if (isMaidenheadGridToken(token) && !seen.has(token)) {
seen.add(token);
out.push(token);
}
@@ -100,12 +100,22 @@ function extractLikelyCallsign(message) {
if (!token) continue;
if (token.length < 3 || token.length > 12) continue;
if (token === "CQ" || token === "DE" || token === "QRZ" || token === "DX") continue;
if (/^[A-R]{2}\d{2}(?:[A-X]{2})?$/.test(token)) continue;
if (isMaidenheadGridToken(token)) continue;
if (/^[A-Z0-9/]{1,5}\d[A-Z0-9/]{1,6}$/.test(token)) return token;
}
return null;
}
function isFtxFarewellToken(token) {
const normalized = String(token || "").trim().toUpperCase();
return normalized === "RR73" || normalized === "73" || normalized === "RR";
}
function isMaidenheadGridToken(token) {
const normalized = String(token || "").trim().toUpperCase();
return /^[A-R]{2}\d{2}(?:[A-X]{2})?$/.test(normalized) && !isFtxFarewellToken(normalized);
}
function applyWsprFilterToRow(row) {
if (!wsprFilterText) {
row.style.display = "";