From 403bbda0be893fac65058424aedf5da5d0f17c5c Mon Sep 17 00:00:00 2001 From: Mattk70 Date: Wed, 18 Oct 2023 18:47:42 +0100 Subject: [PATCH] Improved display of verified records. Added filter icon to Results table headers --- css/style.css | 1 + index.html | 10 +++------- js/ui.js | 24 ++++++++++++++++++++++-- main.js | 2 +- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/css/style.css b/css/style.css index 317074ef..56bd7869 100644 --- a/css/style.css +++ b/css/style.css @@ -50,6 +50,7 @@ body { -webkit-font-smoothing: antialiased; } + .material-icons { font-family: 'Material Icons'; font-weight: normal; diff --git a/index.html b/index.html index cf85fdd2..0a8f58ed 100644 --- a/index.html +++ b/index.html @@ -930,16 +930,12 @@ - - - - + + + - - - diff --git a/js/ui.js b/js/ui.js index 87972469..14d343d2 100644 --- a/js/ui.js +++ b/js/ui.js @@ -2557,6 +2557,11 @@ const updateSummary = ({ summary = [], filterSpecies = '' }) => { const old_summary = document.getElementById('summaryTable'); const buffer = old_summary.cloneNode(); buffer.innerHTML = summaryHTML; + // Make the star icon look good on black + const starIcons = buffer.getElementsByClassName('material-icons-two-tone'); + [...starIcons].forEach(icon =>{ + icon.classList.add('text-bg-light', 'rounded-5') + }) old_summary.replaceWith(buffer); const currentFilter = document.querySelector('#speciesFilter tr.text-warning'); if (currentFilter) { @@ -2812,7 +2817,6 @@ async function renderResult({ const activeTable = active ? 'table-active' : ''; const labelHTML = label ? tags[label] : ''; const hide = selection ? 'd-none' : ''; - const countIcon = count > 1 ? `${count}` : ''; const XC_type = cname.indexOf('(song)') !== -1 ? "song" : "nocturnal flight call"; tr += ` @@ -2860,6 +2864,7 @@ const updateResultTable = (row, isFromDB, isSelection) => { table.lastElementChild ? table.lastElementChild.insertAdjacentHTML('afterend', row) : table.innerHTML = row; } + //showSortIcon() }; const isExplore = () => { @@ -3000,7 +3005,7 @@ const iconDict = { low: '--%', medium: '--%', high: '--%', - confirmed: 'star', + confirmed: 'verified', } @@ -3222,9 +3227,24 @@ timeSort.forEach(el => { }); }) +function showSortIcon() { + const timeHeadings = document.getElementsByClassName('time-sort-icon'); + const speciesHeadings = document.getElementsByClassName('species-sort-icon'); + + const sortOrderIncludesDesc = STATE.sortOrder.includes('DESC'); + + [...timeHeadings].forEach(heading => { + heading.classList.toggle('d-none', sortOrderIncludesDesc); + }); + + [...speciesHeadings].forEach(heading => { + heading.classList.toggle('d-none', !sortOrderIncludesDesc); + }); +} const setSortOrder = (order) => { STATE.sortOrder = order; + showSortIcon() worker.postMessage({ action: 'update-state', sortOrder: order }) worker.postMessage({ action: 'filter', diff --git a/main.js b/main.js index 6bf527f0..0e8b3356 100644 --- a/main.js +++ b/main.js @@ -59,7 +59,7 @@ autoUpdater.on('update-not-available', function (info) { }); autoUpdater.on('error', function (err) { - logUpdateStatus('Error in auto-updater.'); + logUpdateStatus('Error in auto-updater:' + err); }); autoUpdater.on('download-progress', function (progressObj) {
TimePositionSpeciessort Timesort Positionsort Species Calls Label Notes