From 5edf5cc94714f64accd06c204fcfac1c5782006d Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Thu, 8 Dec 2022 15:05:51 -0600 Subject: [PATCH] cleanup --- server/scripts/index.mjs | 4 ++-- server/scripts/modules/hourly-graph.mjs | 8 +++++--- server/scripts/modules/navigation.mjs | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/server/scripts/index.mjs b/server/scripts/index.mjs index c351024..6d907df 100644 --- a/server/scripts/index.mjs +++ b/server/scripts/index.mjs @@ -23,7 +23,7 @@ const categories = [ 'Airport', 'Ferry', 'Marina', 'Pier', 'Port', 'Resort', // POI/Travel 'Postal', 'Populated Place', ]; -const cats = categories.join(','); +const category = categories.join(','); const init = () => { document.getElementById('txtAddress').addEventListener('focus', (e) => { @@ -54,7 +54,7 @@ const init = () => { params: { f: 'json', countryCode: 'USA', // 'USA,PRI,VIR,GUM,ASM', - category: cats, + category, maxSuggestions: 10, }, dataType: 'json', diff --git a/server/scripts/modules/hourly-graph.mjs b/server/scripts/modules/hourly-graph.mjs index c26d993..2bee614 100644 --- a/server/scripts/modules/hourly-graph.mjs +++ b/server/scripts/modules/hourly-graph.mjs @@ -99,9 +99,11 @@ class HourlyGraph extends WeatherDisplay { }); // temperature axis labels - this.elem.querySelector('.y-axis .l-1').innerHTML = maxTemp; - this.elem.querySelector('.y-axis .l-2').innerHTML = midTemp; - this.elem.querySelector('.y-axis .l-3').innerHTML = minTemp; + // limited to 3 characters, sacraficing degree character + const degree = String.fromCharCode(176); + this.elem.querySelector('.y-axis .l-1').innerHTML = (maxTemp + degree).substring(0, 3); + this.elem.querySelector('.y-axis .l-2').innerHTML = (midTemp + degree).substring(0, 3); + this.elem.querySelector('.y-axis .l-3').innerHTML = (minTemp + degree).substring(0, 3); // set the image source this.image.src = canvas.toDataURL(); diff --git a/server/scripts/modules/navigation.mjs b/server/scripts/modules/navigation.mjs index 68f3e8c..0d37ab5 100644 --- a/server/scripts/modules/navigation.mjs +++ b/server/scripts/modules/navigation.mjs @@ -23,6 +23,7 @@ let AutoRefreshCountMs = 0; const init = async () => { // set up resize handler window.addEventListener('resize', resize); + resize(); // auto refresh const TwcAutoRefresh = localStorage.getItem('TwcAutoRefresh');