Compare commits
No commits in common. "effe5acddfbb7af8a70faf2e505484d36a374e4a" and "ccd4ffa48c2aedb1c8dd789cc502508b3044aba3" have entirely different histories.
effe5acddf
...
ccd4ffa48c
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -1,5 +1,4 @@
|
||||||
*.js text eol=lf
|
*.js text eol=lf
|
||||||
*.mjs text eol=lf
|
|
||||||
*.ejs text eol=lf
|
*.ejs text eol=lf
|
||||||
*.html text eol=lf
|
*.html text eol=lf
|
||||||
*.json text eol=lf
|
*.json text eol=lf
|
||||||
|
|
2
dist/index.html
vendored
2
dist/index.html
vendored
File diff suppressed because one or more lines are too long
22
dist/resources/vendor.min.js
vendored
22
dist/resources/vendor.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/resources/ws.min.css
vendored
2
dist/resources/ws.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/resources/ws.min.js
vendored
2
dist/resources/ws.min.js
vendored
File diff suppressed because one or more lines are too long
1039
package-lock.json
generated
1039
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "5.9.12",
|
"version": "5.9.11",
|
||||||
"description": "Welcome to the WeatherStar 4000+ project page!",
|
"description": "Welcome to the WeatherStar 4000+ project page!",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"build:css": "sass --style=compressed ./server/styles/scss/main.scss ./server/styles/main.css",
|
"build:css": "sass ./server/styles/scss/style.scss ./server/styles/compiled.css",
|
||||||
"lint": "eslint ./server/scripts/**/*.mjs",
|
"lint": "eslint ./server/scripts/**/*.mjs",
|
||||||
"lint:fix": "eslint --fix ./server/scripts/**/*.mjs"
|
"lint:fix": "eslint --fix ./server/scripts/**/*.mjs"
|
||||||
},
|
},
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
"eslint": "^8.21.0",
|
"eslint": "^8.21.0",
|
||||||
"eslint-config-airbnb-base": "^15.0.0",
|
"eslint-config-airbnb-base": "^15.0.0",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-sonarjs": "^0.21.0",
|
"eslint-plugin-sonarjs": "^0.19.0",
|
||||||
"eslint-plugin-unicorn": "^46.0.0",
|
"eslint-plugin-unicorn": "^46.0.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
|
|
|
@ -186,15 +186,14 @@ const parseData = (data) => {
|
||||||
|
|
||||||
// convert to us units
|
// convert to us units
|
||||||
data.Temperature = celsiusToFahrenheit(data.Temperature);
|
data.Temperature = celsiusToFahrenheit(data.Temperature);
|
||||||
// HACK
|
data.TemperatureUnit = 'F';
|
||||||
// data.TemperatureUnit = 'F';
|
|
||||||
data.DewPoint = celsiusToFahrenheit(data.DewPoint);
|
data.DewPoint = celsiusToFahrenheit(data.DewPoint);
|
||||||
data.Ceiling = Math.round(metersToFeet(data.Ceiling) / 100) * 100;
|
data.Ceiling = Math.round(metersToFeet(data.Ceiling) / 100) * 100;
|
||||||
// data.CeilingUnit = 'ft.';
|
data.CeilingUnit = 'ft.';
|
||||||
data.Visibility = kilometersToMiles(observations.visibility.value / 1000);
|
data.Visibility = kilometersToMiles(observations.visibility.value / 1000);
|
||||||
// data.VisibilityUnit = ' mi.';
|
data.VisibilityUnit = ' mi.';
|
||||||
data.WindSpeed = kphToMph(data.WindSpeed);
|
data.WindSpeed = kphToMph(data.WindSpeed);
|
||||||
// data.WindUnit = 'MPH';
|
data.WindUnit = 'MPH';
|
||||||
data.Pressure = pascalToInHg(data.Pressure).toFixed(2);
|
data.Pressure = pascalToInHg(data.Pressure).toFixed(2);
|
||||||
data.HeatIndex = celsiusToFahrenheit(data.HeatIndex);
|
data.HeatIndex = celsiusToFahrenheit(data.HeatIndex);
|
||||||
data.WindChill = celsiusToFahrenheit(data.WindChill);
|
data.WindChill = celsiusToFahrenheit(data.WindChill);
|
||||||
|
|
|
@ -26,7 +26,7 @@ class ExtendedForecast extends WeatherDisplay {
|
||||||
try {
|
try {
|
||||||
forecast = await json(weatherParameters.forecast, {
|
forecast = await json(weatherParameters.forecast, {
|
||||||
data: {
|
data: {
|
||||||
units: 'si',
|
units: 'us',
|
||||||
},
|
},
|
||||||
retryCount: 3,
|
retryCount: 3,
|
||||||
stillWaiting: () => this.stillWaiting(),
|
stillWaiting: () => this.stillWaiting(),
|
||||||
|
|
|
@ -64,9 +64,8 @@ class LatestObservations extends WeatherDisplay {
|
||||||
// sort array by station name
|
// sort array by station name
|
||||||
const sortedConditions = conditions.sort((a, b) => ((a.Name < b.Name) ? -1 : 1));
|
const sortedConditions = conditions.sort((a, b) => ((a.Name < b.Name) ? -1 : 1));
|
||||||
|
|
||||||
//this.elem.querySelector('.column-headers .temp.english').classList.add('show');
|
this.elem.querySelector('.column-headers .temp.english').classList.add('show');
|
||||||
//this.elem.querySelector('.column-headers .temp.metric').classList.remove('show');
|
this.elem.querySelector('.column-headers .temp.metric').classList.remove('show');
|
||||||
this.elem.querySelector('.column-headers .temp.metric').classList.add('show');
|
|
||||||
|
|
||||||
const lines = sortedConditions.map((condition) => {
|
const lines = sortedConditions.map((condition) => {
|
||||||
const windDirection = directionToNSEW(condition.windDirection.value);
|
const windDirection = directionToNSEW(condition.windDirection.value);
|
||||||
|
|
|
@ -44,7 +44,7 @@ class LocalForecast extends WeatherDisplay {
|
||||||
forecastsElem.append(...templates);
|
forecastsElem.append(...templates);
|
||||||
|
|
||||||
// increase each forecast height to a multiple of container height
|
// increase each forecast height to a multiple of container height
|
||||||
this.pageHeight = forecastsElem.parentNode.scrollHeight;
|
this.pageHeight = forecastsElem.parentNode.getBoundingClientRect().height;
|
||||||
templates.forEach((forecast) => {
|
templates.forEach((forecast) => {
|
||||||
const newHeight = Math.ceil(forecast.scrollHeight / this.pageHeight) * this.pageHeight;
|
const newHeight = Math.ceil(forecast.scrollHeight / this.pageHeight) * this.pageHeight;
|
||||||
forecast.style.height = `${newHeight}px`;
|
forecast.style.height = `${newHeight}px`;
|
||||||
|
@ -61,7 +61,7 @@ class LocalForecast extends WeatherDisplay {
|
||||||
try {
|
try {
|
||||||
return await json(weatherParameters.forecast, {
|
return await json(weatherParameters.forecast, {
|
||||||
data: {
|
data: {
|
||||||
units: 'si',
|
units: 'us',
|
||||||
},
|
},
|
||||||
retryCount: 3,
|
retryCount: 3,
|
||||||
stillWaiting: () => this.stillWaiting(),
|
stillWaiting: () => this.stillWaiting(),
|
||||||
|
|
|
@ -80,7 +80,7 @@ class RegionalForecast extends WeatherDisplay {
|
||||||
// start off the observation task
|
// start off the observation task
|
||||||
const observationPromise = utils.getRegionalObservation(point, city);
|
const observationPromise = utils.getRegionalObservation(point, city);
|
||||||
|
|
||||||
const forecast = await json(`https://api.weather.gov/gridpoints/${point.wfo}/${point.x},${point.y}/forecast?units=si`);
|
const forecast = await json(`https://api.weather.gov/gridpoints/${point.wfo}/${point.x},${point.y}/forecast`);
|
||||||
|
|
||||||
// get XY on map for city
|
// get XY on map for city
|
||||||
const cityXY = utils.getXYForCity(city, minMaxLatLon.maxLat, minMaxLatLon.minLon, weatherParameters.state);
|
const cityXY = utils.getXYForCity(city, minMaxLatLon.maxLat, minMaxLatLon.minLon, weatherParameters.state);
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
const round2 = (value, decimals) => Math.trunc(value * 10 ** decimals) / 10 ** decimals;
|
const round2 = (value, decimals) => Math.trunc(value * 10 ** decimals) / 10 ** decimals;
|
||||||
|
|
||||||
const kphToMph = (Kph) => Math.round(Kph / 1.609_34);
|
const kphToMph = (Kph) => Math.round(Kph / 1.609_34);
|
||||||
// HACK!
|
const celsiusToFahrenheit = (Celsius) => Math.round((Celsius * 9) / 5 + 32);
|
||||||
const celsiusToFahrenheit = (Celsius) => Celsius; // Math.round((Celsius * 9) / 5 + 32);
|
const kilometersToMiles = (Kilometers) => Math.round(Kilometers / 1.609_34);
|
||||||
const kilometersToMiles = (Kilometers) => Kilometers; // Math.round(Kilometers / 1.609_34);
|
const metersToFeet = (Meters) => Math.round(Meters / 0.3048);
|
||||||
const metersToFeet = (Meters) => Meters; // Math.round(Meters / 0.3048);
|
|
||||||
const pascalToInHg = (Pascal) => round2(Pascal * 0.000_295_3, 2);
|
const pascalToInHg = (Pascal) => round2(Pascal * 0.000_295_3, 2);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|
|
@ -25,7 +25,7 @@ class WeatherDisplay {
|
||||||
this.timing = {
|
this.timing = {
|
||||||
totalScreens: 1,
|
totalScreens: 1,
|
||||||
baseDelay: 9000, // 5 seconds
|
baseDelay: 9000, // 5 seconds
|
||||||
delay: 2, // 1*1second = 1 second total display time
|
delay: 1, // 1*1second = 1 second total display time
|
||||||
};
|
};
|
||||||
this.navBaseCount = 0;
|
this.navBaseCount = 0;
|
||||||
this.screenIndex = -1; // special starting condition
|
this.screenIndex = -1; // special starting condition
|
||||||
|
|
1923
server/scripts/vendor/auto/jquery.js
vendored
1923
server/scripts/vendor/auto/jquery.js
vendored
File diff suppressed because it is too large
Load diff
2
server/scripts/vendor/auto/luxon.js.map
vendored
2
server/scripts/vendor/auto/luxon.js.map
vendored
File diff suppressed because one or more lines are too long
2831
server/scripts/vendor/auto/luxon.mjs
vendored
2831
server/scripts/vendor/auto/luxon.mjs
vendored
File diff suppressed because it is too large
Load diff
12
server/scripts/vendor/auto/swiped-events.js
vendored
12
server/scripts/vendor/auto/swiped-events.js
vendored
|
@ -46,20 +46,12 @@
|
||||||
// if the user released on a different target, cancel!
|
// if the user released on a different target, cancel!
|
||||||
if (startEl !== e.target) return;
|
if (startEl !== e.target) return;
|
||||||
|
|
||||||
var swipeThreshold = parseInt(getNearestAttribute(startEl, 'data-swipe-threshold', '20'), 10); // default 20 units
|
var swipeThreshold = parseInt(getNearestAttribute(startEl, 'data-swipe-threshold', '20'), 10); // default 20px
|
||||||
var swipeUnit = getNearestAttribute(startEl, 'data-swipe-unit', 'px'); // default px
|
|
||||||
var swipeTimeout = parseInt(getNearestAttribute(startEl, 'data-swipe-timeout', '500'), 10); // default 500ms
|
var swipeTimeout = parseInt(getNearestAttribute(startEl, 'data-swipe-timeout', '500'), 10); // default 500ms
|
||||||
var timeDiff = Date.now() - timeDown;
|
var timeDiff = Date.now() - timeDown;
|
||||||
var eventType = '';
|
var eventType = '';
|
||||||
var changedTouches = e.changedTouches || e.touches || [];
|
var changedTouches = e.changedTouches || e.touches || [];
|
||||||
|
|
||||||
if (swipeUnit === 'vh') {
|
|
||||||
swipeThreshold = Math.round((swipeThreshold / 100) * document.documentElement.clientHeight); // get percentage of viewport height in pixels
|
|
||||||
}
|
|
||||||
if (swipeUnit === 'vw') {
|
|
||||||
swipeThreshold = Math.round((swipeThreshold / 100) * document.documentElement.clientWidth); // get percentage of viewport height in pixels
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Math.abs(xDiff) > Math.abs(yDiff)) { // most significant
|
if (Math.abs(xDiff) > Math.abs(yDiff)) { // most significant
|
||||||
if (Math.abs(xDiff) > swipeThreshold && timeDiff < swipeTimeout) {
|
if (Math.abs(xDiff) > swipeThreshold && timeDiff < swipeTimeout) {
|
||||||
if (xDiff > 0) {
|
if (xDiff > 0) {
|
||||||
|
@ -147,7 +139,7 @@
|
||||||
*/
|
*/
|
||||||
function getNearestAttribute(el, attributeName, defaultValue) {
|
function getNearestAttribute(el, attributeName, defaultValue) {
|
||||||
|
|
||||||
// walk up the dom tree looking for attributeName
|
// walk up the dom tree looking for data-action and data-trigger
|
||||||
while (el && el !== document.documentElement) {
|
while (el && el !== document.documentElement) {
|
||||||
|
|
||||||
var attributeValue = el.getAttribute(attributeName);
|
var attributeValue = el.getAttribute(attributeName);
|
||||||
|
|
|
@ -1,57 +1,56 @@
|
||||||
{
|
{
|
||||||
"folders": [
|
"folders": [
|
||||||
{
|
{
|
||||||
"path": "."
|
"path": "."
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"**/*.code-search": true,
|
"**/*.code-search": true,
|
||||||
"**/*.css": true,
|
"**/*.css": true,
|
||||||
"**/*.min.js": true,
|
"**/*.min.js": true,
|
||||||
"**/bower_components": true,
|
"**/bower_components": true,
|
||||||
"**/node_modules": true,
|
"**/node_modules": true,
|
||||||
"**/vendor": true,
|
"**/vendor": true,
|
||||||
"dist/**": true
|
"dist/**": true
|
||||||
},
|
},
|
||||||
"cSpell.enabled": true,
|
"cSpell.enabled": true,
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"'storm",
|
"'storm",
|
||||||
"arcgis",
|
"arcgis",
|
||||||
"Battaglia",
|
"Battaglia",
|
||||||
"devbridge",
|
"devbridge",
|
||||||
"gifs",
|
"gifs",
|
||||||
"ltrim",
|
"ltrim",
|
||||||
"Noaa",
|
"Noaa",
|
||||||
"nosleep",
|
"nosleep",
|
||||||
"Pngs",
|
"Pngs",
|
||||||
"PRECIP",
|
"PRECIP",
|
||||||
"rtrim",
|
"rtrim",
|
||||||
"sonarjs",
|
"sonarjs",
|
||||||
"T",
|
"T",
|
||||||
"T'storm",
|
"T'storm",
|
||||||
"uscomp",
|
"uscomp",
|
||||||
"Visib",
|
"Visib",
|
||||||
"Waukegan"
|
"Waukegan"
|
||||||
],
|
],
|
||||||
"cSpell.ignorePaths": [
|
"cSpell.ignorePaths": [
|
||||||
"**/package-lock.json",
|
"**/package-lock.json",
|
||||||
"**/node_modules/**",
|
"**/node_modules/**",
|
||||||
"**/vscode-extension/**",
|
"**/vscode-extension/**",
|
||||||
"**/.git/objects/**",
|
"**/.git/objects/**",
|
||||||
".vscode",
|
".vscode",
|
||||||
".vscode-insiders",
|
".vscode-insiders",
|
||||||
"**/vendor/auto/**",
|
"**/vendor/auto/**",
|
||||||
"**/twc3.js",
|
"**/twc3.js",
|
||||||
],
|
],
|
||||||
"editor.tabSize": 2,
|
"editor.tabSize": 2,
|
||||||
"emmet.includeLanguages": {
|
"emmet.includeLanguages": {
|
||||||
"ejs": "html",
|
"ejs": "html",
|
||||||
},
|
},
|
||||||
"[html]": {
|
"[html]": {
|
||||||
"editor.defaultFormatter": "j69.ejs-beautify"
|
"editor.defaultFormatter": "j69.ejs-beautify"
|
||||||
},
|
},
|
||||||
"files.exclude": {},
|
"files.exclude": {},
|
||||||
"files.eol": "\n",
|
},
|
||||||
},
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue