Rename Sig/Source column in Spot view to Type. Closes #52

This commit is contained in:
Ian Renton
2025-10-19 14:19:11 +01:00
parent bf0b52d1d8
commit 64f8b7d3b7
2 changed files with 13 additions and 13 deletions

View File

@@ -154,8 +154,8 @@
<label class="form-check-label" for="tableShowBearing">Bearing</label> <label class="form-check-label" for="tableShowBearing">Bearing</label>
</div> </div>
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input class="form-check-input storeable-checkbox" type="checkbox" id="tableShowSource" value="tableShowSource" oninput="columnsUpdated();" checked> <input class="form-check-input storeable-checkbox" type="checkbox" id="tableShowType" value="tableShowType" oninput="columnsUpdated();" checked>
<label class="form-check-label" for="tableShowSource">Source</label> <label class="form-check-label" for="tableShowType">Type</label>
</div> </div>
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input class="form-check-input storeable-checkbox" type="checkbox" id="tableShowRef" value="tableShowRef" oninput="columnsUpdated();" checked> <input class="form-check-input storeable-checkbox" type="checkbox" id="tableShowRef" value="tableShowRef" oninput="columnsUpdated();" checked>

View File

@@ -38,7 +38,7 @@ function updateTable() {
var showMode = $("#tableShowMode")[0].checked; var showMode = $("#tableShowMode")[0].checked;
var showComment = $("#tableShowComment")[0].checked; var showComment = $("#tableShowComment")[0].checked;
var showBearing = $("#tableShowBearing")[0].checked && userPos != null; var showBearing = $("#tableShowBearing")[0].checked && userPos != null;
var showSource = $("#tableShowSource")[0].checked; var showType = $("#tableShowType")[0].checked;
var showRef = $("#tableShowRef")[0].checked; var showRef = $("#tableShowRef")[0].checked;
var showDE = $("#tableShowDE")[0].checked; var showDE = $("#tableShowDE")[0].checked;
@@ -62,8 +62,8 @@ function updateTable() {
if (showBearing) { if (showBearing) {
table.find('thead tr').append(`<th class='hideonmobile'>Bearing</th>`); table.find('thead tr').append(`<th class='hideonmobile'>Bearing</th>`);
} }
if (showSource) { if (showType) {
table.find('thead tr').append(`<th class='hideonmobile'>Source</th>`); table.find('thead tr').append(`<th class='hideonmobile'>Type</th>`);
} }
if (showRef) { if (showRef) {
table.find('thead tr').append(`<th class='hideonmobile'>Ref.</th>`); table.find('thead tr').append(`<th class='hideonmobile'>Ref.</th>`);
@@ -140,10 +140,10 @@ function updateTable() {
} }
} }
// Sig or fallback to source // Format "type" (Sig or fallback to source)
var sigSourceText = s["source"]; var typeText = s["source"];
if (s["sig"]) { if (s["sig"]) {
sigSourceText = s["sig"]; typeText = s["sig"];
} }
// Format sig_refs // Format sig_refs
@@ -205,8 +205,8 @@ function updateTable() {
if (showBearing) { if (showBearing) {
$tr.append(`<td class='nowrap hideonmobile'>${bearingText}</td>`); $tr.append(`<td class='nowrap hideonmobile'>${bearingText}</td>`);
} }
if (showSource) { if (showType) {
$tr.append(`<td class='nowrap hideonmobile'><span class='icon-wrapper'><i class='fa-solid fa-${s["icon"]}'></i></span> ${sigSourceText}</td>`); $tr.append(`<td class='nowrap hideonmobile'><span class='icon-wrapper'><i class='fa-solid fa-${s["icon"]}'></i></span> ${typeText}</td>`);
} }
if (showRef) { if (showRef) {
$tr.append(`<td class='hideonmobile'><span ${sig_refs_title_string}>${sig_refs}</span></td>`); $tr.append(`<td class='hideonmobile'><span ${sig_refs_title_string}>${sig_refs}</span></td>`);
@@ -216,14 +216,14 @@ function updateTable() {
} }
table.find('tbody').append($tr); table.find('tbody').append($tr);
// Second row for mobile view only, containing source, ref & comment // Second row for mobile view only, containing type, ref & comment
$tr2 = $("<tr class='hidenotonmobile'>"); $tr2 = $("<tr class='hidenotonmobile'>");
if (s["qrt"] == true) { if (s["qrt"] == true) {
$tr2.addClass("table-faded"); $tr2.addClass("table-faded");
} }
$td2 = $("<td colspan='100'>"); $td2 = $("<td colspan='100'>");
if (showSource) { if (showType) {
$td2.append(`<span class='icon-wrapper'><i class='fa-solid fa-${s["icon"]}'></i></span> ${sigSourceText} `); $td2.append(`<span class='icon-wrapper'><i class='fa-solid fa-${s["icon"]}'></i></span> ${typeText} `);
} }
if (showRef) { if (showRef) {
$td2.append(`${sig_refs} `); $td2.append(`${sig_refs} `);