mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Now that SIGs are rebranded as Activities, we can merge DXpedition and Contest into that without it being too weird, and get rid of AlertType #147
This commit is contained in:
+14
-24
@@ -54,7 +54,7 @@ function updateTable() {
|
||||
const showDX = $("#tableShowDX")[0].checked;
|
||||
const showFreqsModes = $("#tableShowFreqsModes")[0].checked;
|
||||
const showComment = $("#tableShowComment")[0].checked;
|
||||
const showType = $("#tableShowType")[0].checked;
|
||||
const showActivity = $("#tableShowActivity")[0].checked;
|
||||
const showRef = $("#tableShowRef")[0].checked;
|
||||
|
||||
// Populate table with headers
|
||||
@@ -75,11 +75,11 @@ function updateTable() {
|
||||
if (showComment) {
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Comment</th>`);
|
||||
}
|
||||
if (showType) {
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Type</th>`);
|
||||
if (showActivity) {
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Activity</th>`);
|
||||
}
|
||||
if (showRef) {
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Ref.</th>`);
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Reference</th>`);
|
||||
}
|
||||
|
||||
table.find('tbody').empty();
|
||||
@@ -151,7 +151,7 @@ function addAlertRowsToTable(tbody, alerts) {
|
||||
const showDX = $("#tableShowDX")[0].checked;
|
||||
const showFreqsModes = $("#tableShowFreqsModes")[0].checked;
|
||||
const showComment = $("#tableShowComment")[0].checked;
|
||||
const showType = $("#tableShowType")[0].checked;
|
||||
const showActivity = $("#tableShowActivity")[0].checked;
|
||||
const showRef = $("#tableShowRef")[0].checked;
|
||||
|
||||
// Get times for the alert, and convert to local time if necessary.
|
||||
@@ -210,14 +210,14 @@ function addAlertRowsToTable(tbody, alerts) {
|
||||
if (a["dx_calls"] != null) {
|
||||
dx_calls_html = a["dx_calls"].map(call => `<a class='dx-link' href='https://qrz.com/db/${call}' target='_new'>${call}</a>`).join(", ");
|
||||
}
|
||||
if (dx_calls_html === "" && a["alert_type"] === "CONTEST") {
|
||||
if (dx_calls_html === "" && a["sig"] === "Contest") {
|
||||
// Contest = true and no DX callsigns, so display "Contest"
|
||||
dx_calls_html = "Contest"
|
||||
}
|
||||
|
||||
// Format DXpedition country
|
||||
let dx_country_html = "";
|
||||
if (a["alert_type"] === "DXPEDITION" && a["dx_country"] != null && a["dx_country"] !== "") {
|
||||
if (a["sig"] === "DXpedition" && a["dx_country"] != null && a["dx_country"] !== "") {
|
||||
dx_country_html = `<br/>${a["dx_country"]}`;
|
||||
}
|
||||
|
||||
@@ -250,20 +250,10 @@ function addAlertRowsToTable(tbody, alerts) {
|
||||
}
|
||||
|
||||
|
||||
// Type, activity or fallback to source
|
||||
let activityTypeText = a["source"];
|
||||
if (a["alert_type"] === "CONTEST") {
|
||||
activityTypeText = "Contest";
|
||||
} else if (a["alert_type"] === "DXPEDITION") {
|
||||
activityTypeText = "DXpedition";
|
||||
} else if (a["alert_type"] === "SATELLITE") {
|
||||
activityTypeText = "Satellite";
|
||||
} else if (a["alert_type"] === "XOTA") {
|
||||
if (a["sig"]) {
|
||||
activityTypeText = a["sig"];
|
||||
} else {
|
||||
activityTypeText = "xOTA";
|
||||
}
|
||||
// Activity or fallback to "General DX"
|
||||
let activityText = "General DX";
|
||||
if (a["sig"]) {
|
||||
activityText = a["sig"];
|
||||
}
|
||||
|
||||
// Format activity refs
|
||||
@@ -296,8 +286,8 @@ function addAlertRowsToTable(tbody, alerts) {
|
||||
if (showComment) {
|
||||
$tr.append(`<td class='hideonmobile'>${commentText}</td>`);
|
||||
}
|
||||
if (showType) {
|
||||
$tr.append(`<td class='nowrap hideonmobile'><span class='icon-wrapper'><i class='fa-solid ${a["icon"]}'></i></span> ${activityTypeText}</td>`);
|
||||
if (showActivity) {
|
||||
$tr.append(`<td class='nowrap hideonmobile'><span class='icon-wrapper'><i class='fa-solid ${a["icon"]}'></i></span> ${activityText}</td>`);
|
||||
}
|
||||
if (showRef) {
|
||||
$tr.append(`<td class='hideonmobile'>${activityRefs}</td>`);
|
||||
@@ -314,7 +304,7 @@ function addAlertRowsToTable(tbody, alerts) {
|
||||
}
|
||||
|
||||
const $td2 = $("<td colspan='100'>");
|
||||
if (showType) {
|
||||
if (showActivity) {
|
||||
$td2.append(`<span class='icon-wrapper'><i class='fa-solid ${a["icon"]}'></i></span> `);
|
||||
}
|
||||
if (showRef) {
|
||||
|
||||
Reference in New Issue
Block a user