Skip to content

Commit

Permalink
moved spec tooltiup handler setup to initWavesurfer
Browse files Browse the repository at this point in the history
Changed "Bugs" modal to link to community invite
changed worker warning messages from error.message (which is undefined) to error
optimised 'location.png' image, added whatsapp image
  • Loading branch information
Mattk70 committed Apr 26, 2024
1 parent 8649ad2 commit 7f24613
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 33 deletions.
17 changes: 8 additions & 9 deletions Help/bugs.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bug Reports</title>
<title>Chirpity Community</title>
</head>
<body>

<h4>Have you hit on a problem, or perhaps you have a suggestion?</h4>

If you have, then I'd be happy to hear about it. I keep track of issues and suggestions on Github.

<p>Take a look at what others have been reporting, if you think you have a similar problem or suggestion, add a comment to the thread.</p>

<p> If, on the other hand, you think you've got something new, go on and report an <a href="https://github.com/Mattk70/Chirpity-Electron/issues" target="_blank">issue</a> or start a <a href="https://github.com/Mattk70/Chirpity-Electron/discussions/" target="_blank">discussion</a> - I'll get back to you as soon as I can. </p>
I can't promise I'll make everything right, but I probably won't fix what I don't know about &#x00AF;\\_(ツ)_/&#x00AF;<p>Meanwhile, I hope you find Chirpity useful, and happy birding!</p>
<h4>Would you like help?</h4>
<p>
There is a WhatsApp community for Chirpity Users. You can can share issues, suggest new features and discuss species IDs using the group chats there.
If you would like to join the community just press this button to be taken to the WhatsApp invite page: </p>
<p class="w-100 d-flex justify-content-center">
<a class="btn btn-dark" id="join-whatsapp" href="https://chat.whatsapp.com/FxScbbYNc6SCiTqm3rVL6a" target="_blank"><img src="img/whatsapp.png"> Join the Chirpity WhatsApp community</a>
</p>

</body>
</html>
Binary file modified img/location.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/whatsapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ <h5>Saved Records</h5>
</li>
<li>
<a class="dropdown-item" id="bugs" href="#">
<span class="material-symbols-outlined">bug_report</span> Issues, queries or bugs?
<span class="material-symbols-outlined">campaign</span> Join the community?
</a>
</li>
<div class="dropdown-divider"></div>
Expand Down
34 changes: 17 additions & 17 deletions js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,22 @@ const initWavesurfer = ({
updateElementCache();
// Resize canvas of spec and labels
adjustSpecDims(false);
// remove the tooltip
const oldTip = document.getElementById('tooltip')
oldTip && oldTip.parentNode.removeChild(oldTip);

const tooltip = document.createElement('div');
tooltip.id = 'tooltip';
document.body.appendChild(tooltip);
waveElement.removeEventListener('mousemove', specTooltip);
waveElement.removeEventListener('mouseout', hideTooltip)

//const toolTipListener = debounce(specTooltip, 10)
// Show tooltip on mousemove event
waveElement.addEventListener('mousemove', specTooltip);

// Hide tooltip on mouseout event
waveElement.addEventListener('mouseout', hideTooltip)
}

function updateElementCache() {
Expand Down Expand Up @@ -2328,22 +2344,6 @@ function onChartData(args) {
colorMap: colors
})).initPlugin('spectrogram')
updateElementCache();
// remove the tooltip
const oldTip = document.getElementById('tooltip')
oldTip && oldTip.parentNode.removeChild(oldTip);

const tooltip = document.createElement('div');
tooltip.id = 'tooltip';
document.body.appendChild(tooltip);
waveElement.removeEventListener('mousemove', specTooltip);
waveElement.removeEventListener('mouseout', hideTooltip)

//const toolTipListener = debounce(specTooltip, 10)
// Show tooltip on mousemove event
waveElement.addEventListener('mousemove', specTooltip);

// Hide tooltip on mouseout event
waveElement.addEventListener('mouseout', hideTooltip)
}

function hideTooltip() {
Expand Down Expand Up @@ -4211,7 +4211,7 @@ DOM.gain.addEventListener('input', () => {
case 'keyboardHelp': { (async () => await populateHelpModal('Help/keyboard.html', 'Keyboard shortcuts'))(); break }
case 'settingsHelp': { (async () => await populateHelpModal('Help/settings.html', 'Settings Help'))(); break }
case 'usage': { (async () => await populateHelpModal('Help/usage.html', 'Usage Guide'))(); break }
case 'bugs': { (async () => await populateHelpModal('Help/bugs.html', 'Issues, queries or bugs'))(); break }
case 'bugs': { (async () => await populateHelpModal('Help/bugs.html', 'Join the Chirpity Users community'))(); break }
case 'species': { worker.postMessage({action: 'get-valid-species', file: currentFile}); break }
case 'startTour': { prepTour(); break }
case 'eBird': { (async () => await populateHelpModal('Help/ebird.html', 'eBird Record FAQ'))(); break }
Expand Down
11 changes: 6 additions & 5 deletions js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ const setMetadata = async ({ file, proxy = file, source_file = file }) => {
metadata[file].fileStart = fileStart;
return resolve(metadata[file]);
}
}).catch(error => console.warn(error.message))
}).catch(error => console.warn(error))
}

function setupCtx(audio, rate, destination, file) {
Expand Down Expand Up @@ -1401,6 +1401,7 @@ const getPredictBuffers = async ({
}

});

STREAM.on('error', err => {
console.log('stream error: ', err);
err.code === 'ENOENT' && notifyMissingFile(file);
Expand Down Expand Up @@ -2238,11 +2239,11 @@ async function processNextFile({
} = {}) {
if (FILE_QUEUE.length) {
let file = FILE_QUEUE.shift()
const found = await getWorkingFile(file).catch( (error) => console.warn('Error in getWorkingFile', error.message));
const found = await getWorkingFile(file).catch( (error) => console.warn('Error in getWorkingFile', error));
if (found) {
if (end) {}
let boundaries = [];
if (!start) boundaries = await setStartEnd(file).catch( (error) => console.warn('Error in setStartEnd', error.message));
if (!start) boundaries = await setStartEnd(file).catch( (error) => console.warn('Error in setStartEnd', error));
else boundaries.push({ start: start, end: end });
for (let i = 0; i < boundaries.length; i++) {
const { start, end } = boundaries[i];
Expand All @@ -2257,7 +2258,7 @@ async function processNextFile({
});

DEBUG && console.log('Recursion: start = end')
await processNextFile(arguments[0]).catch( (error) => console.warn('Error in processNextFile call', error.message));
await processNextFile(arguments[0]).catch( (error) => console.warn('Error in processNextFile call', error));

} else {
if (!sumObjectValues(predictionsReceived)) {
Expand All @@ -2274,7 +2275,7 @@ async function processNextFile({
}
} else {
DEBUG && console.log('Recursion: file not found')
await processNextFile(arguments[0]).catch( (error) => console.warn('Error in recursive processNextFile call', error.message));
await processNextFile(arguments[0]).catch( (error) => console.warn('Error in recursive processNextFile call', error));
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chirpity",
"version": "1.8.1",
"version": "1.8.2",
"description": "Chirpity Nocmig",
"main": "main.js",
"scripts": {
Expand Down Expand Up @@ -132,6 +132,7 @@
"publish": [
"github"
],
"target": ["nsis", "portable"],
"verifyUpdateCodeSignature": false,
"asar": true,
"icon": "./img/icon/icon.png"
Expand Down

0 comments on commit 7f24613

Please sign in to comment.