diff --git a/js/ui.js b/js/ui.js index e5eda2df..c41b52ec 100644 --- a/js/ui.js +++ b/js/ui.js @@ -159,7 +159,7 @@ let fileList = [], analyseList = []; let fileStart, bufferStartTime, fileEnd; -// set up some DOM element hamdles +// set up some DOM element handles const bodyElement = document.body; const DOM = { @@ -1616,7 +1616,7 @@ function primaryLabelInterval(pxPerSec) { * * Secondary labels are drawn after primary labels, so if * you want to have labels every 10 seconds and another color labels -* every 60 seconds, the 60 second labels should be the secondaries. +* every 60 seconds, the 60 second labels should be the secondary. * * Note that if you override the default function, you'll almost * certainly want to override formatTimeCallback, primaryLabelInterval @@ -1985,7 +1985,7 @@ const setUpWorkerMessaging = () => { } break; } - case "summary-complate": {onSummaryComplete(args); + case "summary-complete": {onSummaryComplete(args); break; } case "new-result": {renderResult(args); @@ -2276,7 +2276,7 @@ function onChartData(args) { labels: dateLabels, datasets: Object.entries(results).map(([year, data]) => ({ label: year, - //shift data to midday - midday rahter than nidnight to midnight if hourly chart and filter not set + //shift data to midday - midday rather than nidnight to midnight if hourly chart and filter not set data: aggregation !== 'Hour' ? data : data.slice(12).join(data.slice(0, 12)), //backgroundColor: 'rgba(255, 0, 64, 0.5)', borderWidth: 1, @@ -2689,7 +2689,7 @@ function onChartData(args) { SNRSlider.disabled = false; config.filters.SNR = parseFloat(SNRSlider.value); if (config.filters.SNR) { - DOM.contextAware.disabed = true; + DOM.contextAware.disabled = true; config.detect.contextAware = false; contextAwareIconDisplay(); } @@ -4240,7 +4240,7 @@ function centreSpec(){ filterPanelThresholdDisplay.addEventListener('click', (e) => { e.stopPropagation(); - filterPanelRangeInput.autofucus = true + filterPanelRangeInput.autofocus = true confidenceSliderDisplay.classList.toggle('d-none'); }) @@ -4322,10 +4322,10 @@ function centreSpec(){ SNRThreshold.textContent = SNRSlider.value; }); - const colorMapThreshhold = document.getElementById('color-threshold'); + const colorMapThreshold = document.getElementById('color-threshold'); const colorMapSlider = document.getElementById('color-threshold-slider'); colorMapSlider.addEventListener('input', () => { - colorMapThreshhold.textContent = colorMapSlider.value; + colorMapThreshold.textContent = colorMapSlider.value; }); const handleHPchange = () => { @@ -5254,7 +5254,7 @@ async function readLabels(labelFile, updating){ } alert(` - There's a new version of Chirpity available! Check the website for more information`, + There's a new version of Chirpity available! Check the website for more information`, 'warning') } config.lastUpdateCheck = latestCheck; diff --git a/js/worker.js b/js/worker.js index 200d791c..9cf152b2 100644 --- a/js/worker.js +++ b/js/worker.js @@ -372,7 +372,7 @@ async function handleMessage(e) { let {model, batchSize, threads, backend, list} = args; const t0 = Date.now(); STATE.detect.backend = backend; - LIST_WORKER = await spawnListWorker(); // this can change the backend if tfjs-node isn't avaialble + LIST_WORKER = await spawnListWorker(); // this can change the backend if tfjs-node isn't available DEBUG && console.log('List worker took', Date.now() - t0, 'ms to load'); await onLaunch({model: model, batchSize: batchSize, threads: threads, backend: STATE.detect.backend, list: list}); break; @@ -498,7 +498,7 @@ async function handleMessage(e) { STATE.list = args.list; STATE.customList = args.list === 'custom' ? args.customList : STATE.customList; const {lat, lon, week} = STATE; - // Clear the LIST_CACHE & STATE.included kesy to force list regeneration + // Clear the LIST_CACHE & STATE.included keys to force list regeneration LIST_CACHE = {}; //[`${lat}-${lon}-${week}-${STATE.model}-${STATE.list}`]; delete STATE.included?.[STATE.model]?.[STATE.list]; LIST_WORKER && await setIncludedIDs(lat, lon, week ) @@ -806,7 +806,7 @@ const prepResultsStatement = (species, noLimit, included, offset, topRankin) => const range = STATE.selection?.start ? STATE.selection : STATE.mode === 'explore' ? STATE.explore.range : false; - // If you're using the memory db, you're either anlaysing one, or all of the files + // If you're using the memory db, you're either analysing one, or all of the files const [SQLtext, fileParams] = getFileSQLAndParams(range); resultStatement += SQLtext, params.push(...fileParams); @@ -874,7 +874,7 @@ async function onAnalyse({ // Now we've asked for a new analysis, clear the aborted flag aborted = false; //STATE.incrementor = 1; predictionStart = new Date(); - // Set the appropraite selection range if this is a selection analysis + // Set the appropriate selection range if this is a selection analysis STATE.update({ selection: end ? getSelectionRange(filesInScope[0], start, end) : undefined }); DEBUG && console.log(`Worker received message: ${filesInScope}, ${STATE.detect.confidence}, start: ${start}, end: ${end}`); @@ -931,7 +931,7 @@ async function onAnalyse({ } else { await onChangeMode('archive'); FILE_QUEUE.forEach(file => UI.postMessage({ event: 'update-audio-duration', value: METADATA[file].duration })); - // Wierdness with promise all - list worker called 2x and no results returned + // Weirdness with promise all - list worker called 2x and no results returned //await Promise.all([getResults(), getSummary()] ); await getResults(); await getSummary(); @@ -1636,7 +1636,7 @@ function isDuringDaylight(datetime, lat, lon) { async function feedChunksToModel(channelData, chunkStart, file, end, worker) { predictionsRequested[file]++; if (worker === undefined) { - // pick a worker - this method is faster than looking for avialable workers + // pick a worker - this method is faster than looking for available workers worker = ++workerInstance >= NUM_WORKERS ? 0 : workerInstance } const objData = { @@ -2305,7 +2305,7 @@ const parsePredictions = async (response) => { let SEEN_MODEL_READY = false; async function parseMessage(e) { const response = e.data; - // Update this worker's avaialability + // Update this worker's availability predictWorkers[response.worker].isAvailable = true; switch (response['message']) { @@ -2507,7 +2507,7 @@ const getSummary = async ({ t0 = Date.now(); const summary = await STATE.db.allAsync(sql, ...params); - const event = interim ? 'update-summary' : 'summary-complate'; + const event = interim ? 'update-summary' : 'summary-complete'; UI.postMessage({ event: event, summary: summary, @@ -3398,7 +3398,7 @@ const onFileDelete = async (fileName) => { } else { UI.postMessage({ event: 'generate-alert', message: `${fileName} - was not found in the Archve databasse.` + was not found in the Archive database.` }); } } @@ -3424,7 +3424,7 @@ async function onUpdateLocale(locale, labels, refreshResults){ const existingCname = cname; const existingCnameMatch = existingCname.match(/\(([^)]+)\)$/); // Regex to match word(s) within brackets at the end of the string const newCnameMatch = newCname.match(/\(([^)]+)\)$/); - // Do we have a spcific call type to match? + // Do we have a specific call type to match? if (newCnameMatch){ // then only update the database where existing and new call types match if (newCnameMatch[0] === existingCnameMatch[0]){