cleanup
This commit is contained in:
parent
d0382e0de1
commit
5edf5cc947
|
@ -23,7 +23,7 @@ const categories = [
|
||||||
'Airport', 'Ferry', 'Marina', 'Pier', 'Port', 'Resort', // POI/Travel
|
'Airport', 'Ferry', 'Marina', 'Pier', 'Port', 'Resort', // POI/Travel
|
||||||
'Postal', 'Populated Place',
|
'Postal', 'Populated Place',
|
||||||
];
|
];
|
||||||
const cats = categories.join(',');
|
const category = categories.join(',');
|
||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
document.getElementById('txtAddress').addEventListener('focus', (e) => {
|
document.getElementById('txtAddress').addEventListener('focus', (e) => {
|
||||||
|
@ -54,7 +54,7 @@ const init = () => {
|
||||||
params: {
|
params: {
|
||||||
f: 'json',
|
f: 'json',
|
||||||
countryCode: 'USA', // 'USA,PRI,VIR,GUM,ASM',
|
countryCode: 'USA', // 'USA,PRI,VIR,GUM,ASM',
|
||||||
category: cats,
|
category,
|
||||||
maxSuggestions: 10,
|
maxSuggestions: 10,
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
|
|
@ -99,9 +99,11 @@ class HourlyGraph extends WeatherDisplay {
|
||||||
});
|
});
|
||||||
|
|
||||||
// temperature axis labels
|
// temperature axis labels
|
||||||
this.elem.querySelector('.y-axis .l-1').innerHTML = maxTemp;
|
// limited to 3 characters, sacraficing degree character
|
||||||
this.elem.querySelector('.y-axis .l-2').innerHTML = midTemp;
|
const degree = String.fromCharCode(176);
|
||||||
this.elem.querySelector('.y-axis .l-3').innerHTML = minTemp;
|
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
|
// set the image source
|
||||||
this.image.src = canvas.toDataURL();
|
this.image.src = canvas.toDataURL();
|
||||||
|
|
|
@ -23,6 +23,7 @@ let AutoRefreshCountMs = 0;
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
// set up resize handler
|
// set up resize handler
|
||||||
window.addEventListener('resize', resize);
|
window.addEventListener('resize', resize);
|
||||||
|
resize();
|
||||||
|
|
||||||
// auto refresh
|
// auto refresh
|
||||||
const TwcAutoRefresh = localStorage.getItem('TwcAutoRefresh');
|
const TwcAutoRefresh = localStorage.getItem('TwcAutoRefresh');
|
||||||
|
|
Loading…
Reference in a new issue