mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-22 11:39:30 -07:00
Compare commits
17 Commits
42f1f66117
...
beta-7.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfbe6b540c | ||
|
|
16ebea4f7f | ||
|
|
cc8bedec88 | ||
|
|
e37c58a0ab | ||
|
|
89bf5e3f31 | ||
|
|
36d25b4879 | ||
|
|
5adf74feee | ||
|
|
6298068f2a | ||
|
|
62fbe1787f | ||
|
|
994c9240b8 | ||
|
|
27d75ba62d | ||
|
|
63e089451d | ||
|
|
c07ebe8bdd | ||
|
|
a41b0da196 | ||
|
|
30887202c8 | ||
|
|
38d1455a4b | ||
|
|
30ec847ed5 |
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2025 Matt Walsh
|
Copyright (c) 2020-2026 Matt Walsh
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
18
README.md
18
README.md
@@ -139,8 +139,8 @@ services:
|
|||||||
# Following the "Sharing a Permalink" example below, here are a few environment variables defined. Visit that section for a
|
# Following the "Sharing a Permalink" example below, here are a few environment variables defined. Visit that section for a
|
||||||
# more complete list of configuration options.
|
# more complete list of configuration options.
|
||||||
- WSQS_latLonQuery=Orlando International Airport Orlando FL USA
|
- WSQS_latLonQuery=Orlando International Airport Orlando FL USA
|
||||||
- WSQS_hazards_checkbox=false
|
- WSQS_hazards=false
|
||||||
- WSQS_current_weather_checkbox=true
|
- WSQS_current_weather=true
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080 # change the first 8080 to meet your local network needs
|
- 8080:8080 # change the first 8080 to meet your local network needs
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -192,13 +192,13 @@ Selected displays, the forecast city and widescreen setting are sticky from one
|
|||||||
|
|
||||||
Your permalink will be very long. Here is an example for the Orlando International Airport:
|
Your permalink will be very long. Here is an example for the Orlando International Airport:
|
||||||
```
|
```
|
||||||
https://weatherstar.netbymatt.com/?hazards-checkbox=false¤t-weather-checkbox=true&latest-observations-checkbox=true&hourly-checkbox=false&hourly-graph-checkbox=true&travel-checkbox=false®ional-forecast-checkbox=true&local-forecast-checkbox=true&extended-forecast-checkbox=true&almanac-checkbox=false&spc-outlook-checkbox=true&radar-checkbox=true&settings-wide-checkbox=false&settings-kiosk-checkbox=false&settings-scanLines-checkbox=false&settings-speed-select=1.00&settings-units-select=us&latLonQuery=Orlando+International+Airport%2C+Orlando%2C+FL%2C+USA&latLon=%7B%22lat%22%3A28.431%2C%22lon%22%3A-81.3076%7D
|
https://weatherstar.netbymatt.com/?hazards=false¤t-weather=true&latest-observations=true&hourly=false&hourly-graph=true&travel=false®ional-forecast=true&local-forecast=true&extended-forecast=true&almanac=false&spc-outlook=true&radar=true&wide=false&kiosk=false&scanLines=false&speed-select=1.00&units-select=us&latLonQuery=Orlando+International+Airport%2C+Orlando%2C+FL%2C+USA&latLon=%7B%22lat%22%3A28.431%2C%22lon%22%3A-81.3076%7D
|
||||||
```
|
```
|
||||||
You can also build your own permalink. Any omitted settings will be filled with defaults. Here are a few examples:
|
You can also build your own permalink. Any omitted settings will be filled with defaults. Here are a few examples:
|
||||||
```
|
```
|
||||||
https://weatherstar.netbymatt.com/?latLonQuery=Orlando+International+Airport
|
https://weatherstar.netbymatt.com/?latLonQuery=Orlando+International+Airport
|
||||||
https://weatherstar.netbymatt.com/?kiosk=true
|
https://weatherstar.netbymatt.com/?kiosk=true
|
||||||
https://weatherstar.netbymatt.com/?settings-units-select=metric
|
https://weatherstar.netbymatt.com/?units-select=metric
|
||||||
```
|
```
|
||||||
|
|
||||||
### Kiosk mode
|
### Kiosk mode
|
||||||
@@ -213,7 +213,7 @@ When serving this via the built-in Express server, it's possible to define envir
|
|||||||
|
|
||||||
Environment variables can be added to the command line as usual, or via a .env file which is parsed with [dotenv](https://github.com/motdotla/dotenv). Both methods have the same effect.
|
Environment variables can be added to the command line as usual, or via a .env file which is parsed with [dotenv](https://github.com/motdotla/dotenv). Both methods have the same effect.
|
||||||
|
|
||||||
Environment variables that are to be added to the default query string are prefixed with `WSQS_` and then use the same key/value pairs generated by the [Permalink](#sharing-a-permalink-bookmarking) above, with the `- (dash)` character replaced by an `_ (underscore)`. For example, if you wanted to turn the travel forecast on, you would find `travel-checkbox=true` in the permalink, its matching environment variable becomes `WSQS_travel_checkbox=true`.
|
Environment variables that are to be added to the default query string are prefixed with `WSQS_` and then use the same key/value pairs generated by the [Permalink](#sharing-a-permalink-bookmarking) above, with the `- (dash)` character replaced by an `_ (underscore)`. For example, if you wanted to turn the travel forecast on, you would find `travel-checkbox=true` in the permalink, its matching environment variable becomes `WSQS_travel=true`.
|
||||||
|
|
||||||
When using the Docker container, these environment variables are read on container start-up to generate the static redirect HTML.
|
When using the Docker container, these environment variables are read on container start-up to generate the static redirect HTML.
|
||||||
|
|
||||||
@@ -221,7 +221,13 @@ When using the Docker container, these environment variables are read on contain
|
|||||||
|
|
||||||
**Speed:** Controls the playback speed multiplier of the displays, from "Very Fast" (1.5x) to "Very Slow" (0.5x) with "Normal" being 1x
|
**Speed:** Controls the playback speed multiplier of the displays, from "Very Fast" (1.5x) to "Very Slow" (0.5x) with "Normal" being 1x
|
||||||
|
|
||||||
**Widescreen:** Stretches the background to 16:9 to avoid "pillarboxing" on modern displays
|
**Display Mode:**
|
||||||
|
- Standard: Classic 4:3 display with the classic (not enhanced, below) screen layouts.
|
||||||
|
- Widescreen: Stretches the background to 16:9 to avoid "pillarboxing" on modern displays
|
||||||
|
- Widescreen Enhanced: Stretches as above, and makes use of the additional space to provide wider maps, more weather data and/or additional days in the forecast
|
||||||
|
- Portrait Enhanced: (in progress) Rotates the screen to a 16:9 portrait orientation and enhances the original displays by adjusting them to fit the new orientation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**Kiosk:** Immediately activates kiosk mode, which hides all settings. Exit by refreshing the page or using `Ctrl-K`. (Kiosk mode is similar to clicking the "Fullscreen" icon, but scales to the current browser viewport instead of activating the browser's actual "Fullscreen" mode.)
|
**Kiosk:** Immediately activates kiosk mode, which hides all settings. Exit by refreshing the page or using `Ctrl-K`. (Kiosk mode is similar to clicking the "Fullscreen" icon, but scales to the current browser viewport instead of activating the browser's actual "Fullscreen" mode.)
|
||||||
|
|
||||||
|
|||||||
@@ -8,18 +8,14 @@ import ejs from 'gulp-ejs';
|
|||||||
import rename from 'gulp-rename';
|
import rename from 'gulp-rename';
|
||||||
import htmlmin from 'gulp-html-minifier-terser';
|
import htmlmin from 'gulp-html-minifier-terser';
|
||||||
import { deleteAsync } from 'del';
|
import { deleteAsync } from 'del';
|
||||||
import s3Upload from 'gulp-s3-uploader';
|
|
||||||
import webpack from 'webpack-stream';
|
import webpack from 'webpack-stream';
|
||||||
import TerserPlugin from 'terser-webpack-plugin';
|
import TerserPlugin from 'terser-webpack-plugin';
|
||||||
import { readFile } from 'fs/promises';
|
import { readFile } from 'fs/promises';
|
||||||
import file from 'gulp-file';
|
import file from 'gulp-file';
|
||||||
import { CloudFrontClient, CreateInvalidationCommand } from '@aws-sdk/client-cloudfront';
|
|
||||||
import log from 'fancy-log';
|
|
||||||
import * as dartSass from 'sass';
|
import * as dartSass from 'sass';
|
||||||
import gulpSass from 'gulp-sass';
|
import gulpSass from 'gulp-sass';
|
||||||
import sourceMaps from 'gulp-sourcemaps';
|
import log from 'fancy-log';
|
||||||
import OVERRIDES from '../src/overrides.mjs';
|
import OVERRIDES from '../src/overrides.mjs';
|
||||||
import { DateTime } from 'luxon';
|
|
||||||
|
|
||||||
// get cloudfront
|
// get cloudfront
|
||||||
import reader from '../src/playlist-reader.mjs';
|
import reader from '../src/playlist-reader.mjs';
|
||||||
@@ -28,8 +24,6 @@ const sass = gulpSass(dartSass);
|
|||||||
|
|
||||||
const clean = () => deleteAsync(['./dist/**/*', '!./dist/readme.txt']);
|
const clean = () => deleteAsync(['./dist/**/*', '!./dist/readme.txt']);
|
||||||
|
|
||||||
const cloudfront = new CloudFrontClient({ region: 'us-east-1' });
|
|
||||||
|
|
||||||
const RESOURCES_PATH = './dist/resources';
|
const RESOURCES_PATH = './dist/resources';
|
||||||
|
|
||||||
// Data is now served as JSON files to avoid redundancy
|
// Data is now served as JSON files to avoid redundancy
|
||||||
@@ -37,12 +31,55 @@ const RESOURCES_PATH = './dist/resources';
|
|||||||
const webpackOptions = {
|
const webpackOptions = {
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
output: {
|
output: {
|
||||||
filename: 'ws.min.js',
|
filename: '[name].min.js',
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
roots: ['./'],
|
roots: ['./'],
|
||||||
},
|
},
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
|
entry: {
|
||||||
|
index: {
|
||||||
|
import: './server/scripts/index.mjs',
|
||||||
|
dependOn: 'shared',
|
||||||
|
},
|
||||||
|
displays: {
|
||||||
|
import: [
|
||||||
|
'./server/scripts/modules/hazards.mjs',
|
||||||
|
'./server/scripts/modules/currentweather.mjs',
|
||||||
|
'./server/scripts/modules/almanac.mjs',
|
||||||
|
'./server/scripts/modules/spc-outlook.mjs',
|
||||||
|
'./server/scripts/modules/extendedforecast.mjs',
|
||||||
|
'./server/scripts/modules/hourly.mjs',
|
||||||
|
'./server/scripts/modules/hourly-graph.mjs',
|
||||||
|
'./server/scripts/modules/latestobservations.mjs',
|
||||||
|
'./server/scripts/modules/localforecast.mjs',
|
||||||
|
'./server/scripts/modules/radar.mjs',
|
||||||
|
'./server/scripts/modules/regionalforecast.mjs',
|
||||||
|
'./server/scripts/modules/travelforecast.mjs',
|
||||||
|
],
|
||||||
|
dependOn: 'shared',
|
||||||
|
},
|
||||||
|
features: {
|
||||||
|
import: [
|
||||||
|
'./server/scripts/modules/custom-scroll-text.mjs',
|
||||||
|
'./server/scripts/modules/currentweatherscroll.mjs',
|
||||||
|
'./server/scripts/modules/media.mjs',
|
||||||
|
],
|
||||||
|
dependOn: 'shared',
|
||||||
|
},
|
||||||
|
shared: [
|
||||||
|
'./server/scripts/modules/progress.mjs',
|
||||||
|
'./server/scripts/modules/settings.mjs',
|
||||||
|
'./server/scripts/modules/utils/setting.mjs',
|
||||||
|
'./server/scripts/modules/icons.mjs',
|
||||||
|
'./server/scripts/modules/utils/cache.mjs',
|
||||||
|
'./server/scripts/modules/utils/debug.mjs',
|
||||||
|
'./server/scripts/modules/utils/image.mjs',
|
||||||
|
'./server/scripts/modules/utils/metar.mjs',
|
||||||
|
'./server/scripts/modules/utils/mapclick.mjs',
|
||||||
|
'./server/scripts/modules/utils/units.mjs',
|
||||||
|
],
|
||||||
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: true,
|
||||||
minimizer: [
|
minimizer: [
|
||||||
@@ -60,7 +97,6 @@ const webpackOptions = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const jsVendorSources = [
|
const jsVendorSources = [
|
||||||
'server/scripts/vendor/auto/nosleep.js',
|
|
||||||
'server/scripts/vendor/auto/swiped-events.js',
|
'server/scripts/vendor/auto/swiped-events.js',
|
||||||
'server/scripts/vendor/auto/suncalc.js',
|
'server/scripts/vendor/auto/suncalc.js',
|
||||||
];
|
];
|
||||||
@@ -98,35 +134,36 @@ const buildJs = () => src(mjsSources)
|
|||||||
const cssSources = [
|
const cssSources = [
|
||||||
'server/styles/scss/**/*.scss',
|
'server/styles/scss/**/*.scss',
|
||||||
];
|
];
|
||||||
const buildCss = () => src(cssSources)
|
const buildCss = () => src(cssSources, { sourcemaps: true })
|
||||||
.pipe(sourceMaps.init())
|
|
||||||
.pipe(sass({ style: 'compressed' }).on('error', sass.logError))
|
.pipe(sass({ style: 'compressed' }).on('error', sass.logError))
|
||||||
.pipe(rename({ suffix: '.min' }))
|
.pipe(rename({ suffix: '.min' }))
|
||||||
.pipe(sourceMaps.write('./'))
|
.pipe(dest(RESOURCES_PATH, { sourcemaps: '.' }));
|
||||||
.pipe(dest(RESOURCES_PATH));
|
|
||||||
|
|
||||||
const htmlSources = [
|
const htmlSources = [
|
||||||
'views/*.ejs',
|
'views/*.ejs',
|
||||||
];
|
];
|
||||||
const packageJson = await readFile('package.json');
|
|
||||||
let { version } = JSON.parse(packageJson);
|
const getVersion = async () => {
|
||||||
const previewVersion = async () => {
|
const packageJson = await readFile('package.json');
|
||||||
// generate a unique timestamp for cache invalidation of the preview site
|
const packageVersion = JSON.parse(packageJson).version;
|
||||||
const now = DateTime.utc();
|
|
||||||
version = now.toFormat('yyyyLLddHHmm').substring(3);
|
return process.env.WS4KP_VERSION ?? packageVersion;
|
||||||
};
|
};
|
||||||
|
|
||||||
const compressHtml = async () => src(htmlSources)
|
const compressHtml = async () => {
|
||||||
.pipe(ejs({
|
const version = await getVersion();
|
||||||
production: version,
|
return src(htmlSources)
|
||||||
serverAvailable: false,
|
.pipe(ejs({
|
||||||
version,
|
production: version,
|
||||||
OVERRIDES,
|
serverAvailable: false,
|
||||||
query: {},
|
version,
|
||||||
}))
|
OVERRIDES,
|
||||||
.pipe(rename({ extname: '.html' }))
|
query: {},
|
||||||
.pipe(htmlmin({ collapseWhitespace: true }))
|
}))
|
||||||
.pipe(dest('./dist'));
|
.pipe(rename({ extname: '.html' }))
|
||||||
|
.pipe(htmlmin({ collapseWhitespace: true }))
|
||||||
|
.pipe(dest('./dist'));
|
||||||
|
};
|
||||||
|
|
||||||
const otherFiles = [
|
const otherFiles = [
|
||||||
'server/robots.txt',
|
'server/robots.txt',
|
||||||
@@ -143,70 +180,15 @@ const copyDataFiles = () => src([
|
|||||||
'datagenerators/output/stations.json',
|
'datagenerators/output/stations.json',
|
||||||
]).pipe(dest('./dist/data'));
|
]).pipe(dest('./dist/data'));
|
||||||
|
|
||||||
const s3 = s3Upload({
|
|
||||||
useIAM: true,
|
|
||||||
}, {
|
|
||||||
region: 'us-east-1',
|
|
||||||
});
|
|
||||||
const uploadSources = [
|
|
||||||
'dist/**',
|
|
||||||
'!dist/images/**/*',
|
|
||||||
'!dist/fonts/**/*',
|
|
||||||
];
|
|
||||||
|
|
||||||
const uploadCreator = (bucket) => () => src(uploadSources, { base: './dist', encoding: false })
|
|
||||||
.pipe(s3({
|
|
||||||
Bucket: bucket,
|
|
||||||
StorageClass: 'STANDARD',
|
|
||||||
maps: {
|
|
||||||
CacheControl: (keyname) => {
|
|
||||||
if (keyname.indexOf('index.html') > -1) return 'max-age=300'; // 10 minutes
|
|
||||||
if (keyname.indexOf('.mp3') > -1) return 'max-age=31536000'; // 1 year for mp3 files
|
|
||||||
return 'max-age=2592000'; // 1 month
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const imageSources = [
|
const imageSources = [
|
||||||
'server/fonts/**',
|
'server/fonts/**',
|
||||||
'server/images/**',
|
'server/images/**',
|
||||||
'!server/images/gimp/**',
|
'!server/images/gimp/**',
|
||||||
];
|
];
|
||||||
|
|
||||||
const upload = uploadCreator(process.env.BUCKET);
|
|
||||||
const uploadPreview = uploadCreator(process.env.BUCKET_PREVIEW);
|
|
||||||
|
|
||||||
const uploadImagesCreator = (bucket) => () => src(imageSources, { base: './server', encoding: false })
|
|
||||||
.pipe(
|
|
||||||
s3({
|
|
||||||
Bucket: bucket,
|
|
||||||
StorageClass: 'STANDARD',
|
|
||||||
maps: {
|
|
||||||
CacheControl: () => 'max-age=31536000',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
const uploadImages = uploadImagesCreator(process.env.BUCKET);
|
|
||||||
const uploadImagesPreview = uploadImagesCreator(process.env.BUCKET_PREVIEW);
|
|
||||||
|
|
||||||
const copyImageSources = () => src(imageSources, { base: './server', encoding: false })
|
const copyImageSources = () => src(imageSources, { base: './server', encoding: false })
|
||||||
.pipe(dest('./dist'));
|
.pipe(dest('./dist'));
|
||||||
|
|
||||||
const invalidateCreator = (distributionId) => () => cloudfront.send(new CreateInvalidationCommand({
|
|
||||||
DistributionId: distributionId,
|
|
||||||
InvalidationBatch: {
|
|
||||||
CallerReference: (new Date()).toLocaleString(),
|
|
||||||
Paths: {
|
|
||||||
Quantity: 1,
|
|
||||||
Items: ['/*'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const invalidate = invalidateCreator(process.env.DISTRIBUTION_ID);
|
|
||||||
const invalidatePreview = invalidateCreator(process.env.DISTRIBUTION_ID_PREVIEW);
|
|
||||||
|
|
||||||
const buildPlaylist = async () => {
|
const buildPlaylist = async () => {
|
||||||
const availableFiles = await reader();
|
const availableFiles = await reader();
|
||||||
const playlist = { availableFiles };
|
const playlist = { availableFiles };
|
||||||
@@ -214,20 +196,13 @@ const buildPlaylist = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const logVersion = async () => {
|
const logVersion = async () => {
|
||||||
log(`Version Published: ${version}`);
|
log(`Built version: ${await getVersion()}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const buildDist = series(clean, parallel(buildJs, compressJsVendor, buildCss, compressHtml, copyOtherFiles, copyDataFiles, copyImageSources, buildPlaylist));
|
const buildDist = series(clean, parallel(buildJs, compressJsVendor, buildCss, compressHtml, copyOtherFiles, copyDataFiles, copyImageSources, buildPlaylist), logVersion);
|
||||||
|
|
||||||
// upload_images could be in parallel with upload, but _images logs a lot and has little changes
|
export default buildDist;
|
||||||
// by running upload last the majority of the changes will be at the bottom of the log for easy viewing
|
|
||||||
const publishFrontend = series(buildDist, uploadImages, upload, invalidate, logVersion);
|
|
||||||
const stageFrontend = series(previewVersion, buildDist, uploadImagesPreview, uploadPreview, invalidatePreview, logVersion);
|
|
||||||
|
|
||||||
export default publishFrontend;
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
buildDist,
|
logVersion,
|
||||||
invalidate,
|
|
||||||
stageFrontend,
|
|
||||||
};
|
};
|
||||||
@@ -7,7 +7,7 @@ const clean = () => deleteAsync(['./server/scripts/vendor/auto/**']);
|
|||||||
const vendorFiles = [
|
const vendorFiles = [
|
||||||
'./node_modules/luxon/build/es6/luxon.mjs',
|
'./node_modules/luxon/build/es6/luxon.mjs',
|
||||||
'./node_modules/luxon/build/es6/luxon.mjs.map',
|
'./node_modules/luxon/build/es6/luxon.mjs.map',
|
||||||
'./node_modules/nosleep.js/dist/NoSleep.js',
|
'./node_modules/@zakj/no-sleep/dist/no-sleep.js',
|
||||||
'./node_modules/suncalc/suncalc.js',
|
'./node_modules/suncalc/suncalc.js',
|
||||||
'./node_modules/swiped-events/src/swiped-events.js',
|
'./node_modules/swiped-events/src/swiped-events.js',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
import updateVendor from './gulp/update-vendor.mjs';
|
import updateVendor from './gulp/update-vendor.mjs';
|
||||||
import publishFrontend, { buildDist, invalidate, stageFrontend } from './gulp/publish-frontend.mjs';
|
import buildDist from './gulp/build.mjs';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
updateVendor,
|
updateVendor,
|
||||||
publishFrontend,
|
|
||||||
buildDist,
|
buildDist,
|
||||||
invalidate,
|
|
||||||
stageFrontend,
|
|
||||||
};
|
};
|
||||||
|
|||||||
3396
package-lock.json
generated
3396
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "6.5.7",
|
"version": "6.5.9",
|
||||||
"description": "Welcome to the WeatherStar 4000+ project page!",
|
"description": "Welcome to the WeatherStar 4000+ project page!",
|
||||||
"main": "index.mjs",
|
"main": "index.mjs",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -27,38 +27,34 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/netbymatt/ws4kp#readme",
|
"homepage": "https://github.com/netbymatt/ws4kp#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@aws-sdk/client-cloudfront": "^3.609.0",
|
|
||||||
"@eslint/eslintrc": "^3.3.1",
|
"@eslint/eslintrc": "^3.3.1",
|
||||||
|
"@zakj/no-sleep": "^0.13.6",
|
||||||
"ajv": "^8.17.1",
|
"ajv": "^8.17.1",
|
||||||
"del": "^8.0.0",
|
"del": "^8.0.0",
|
||||||
"eslint": "^10.0.3",
|
"eslint": "^9.0.0",
|
||||||
"eslint-config-airbnb-base": "15.0.0",
|
"eslint-config-airbnb-base": "15.0.0",
|
||||||
"eslint-plugin-import": "^2.10.0",
|
"eslint-plugin-import": "^2.10.0",
|
||||||
"fancy-log": "^2.0.0",
|
|
||||||
"gulp": "^5.0.0",
|
"gulp": "^5.0.0",
|
||||||
"gulp-awspublish": "^9.0.0",
|
|
||||||
"gulp-concat": "^2.6.1",
|
"gulp-concat": "^2.6.1",
|
||||||
"gulp-ejs": "^5.1.0",
|
"gulp-ejs": "^5.1.0",
|
||||||
"gulp-file": "^0.4.0",
|
"gulp-file": "^0.4.0",
|
||||||
"gulp-html-minifier-terser": "^8.0.0",
|
"gulp-html-minifier-terser": "^8.0.0",
|
||||||
"gulp-rename": "^2.0.0",
|
"gulp-rename": "^2.0.0",
|
||||||
"gulp-s3-uploader": "^1.0.6",
|
|
||||||
"gulp-sass": "^6.0.0",
|
"gulp-sass": "^6.0.0",
|
||||||
"gulp-sourcemaps": "^3.0.0",
|
|
||||||
"gulp-terser": "^2.0.0",
|
"gulp-terser": "^2.0.0",
|
||||||
"luxon": "^3.0.0",
|
"luxon": "^3.0.0",
|
||||||
"metar-taf-parser": "^9.0.0",
|
"metar-taf-parser": "^9.0.0",
|
||||||
"nosleep.js": "^0.12.0",
|
|
||||||
"sass": "^1.54.0",
|
"sass": "^1.54.0",
|
||||||
"suncalc": "^1.8.0",
|
"suncalc": "^1.8.0",
|
||||||
"swiped-events": "^1.1.4",
|
"swiped-events": "^1.1.4",
|
||||||
"terser-webpack-plugin": "^5.3.6",
|
"terser-webpack-plugin": "^5.3.6",
|
||||||
"webpack": "^5.99.9",
|
"webpack": "^5.99.9",
|
||||||
"webpack-stream": "^7.0.0"
|
"webpack-stream": "^7.0.0",
|
||||||
|
"fancy-log": "^2.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dotenv": "^17.0.1",
|
"dotenv": "^17.0.1",
|
||||||
"ejs": "^5.0.1",
|
"ejs": "^5.0.1",
|
||||||
"express": "^5.1.0"
|
"express": "^5.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ const init = async () => {
|
|||||||
if (!navigator.geolocation) btnGetGps.style.display = 'none';
|
if (!navigator.geolocation) btnGetGps.style.display = 'none';
|
||||||
|
|
||||||
document.querySelector('#divTwc').addEventListener('mousemove', () => {
|
document.querySelector('#divTwc').addEventListener('mousemove', () => {
|
||||||
if (document.fullscreenElement) updateFullScreenNavigate();
|
if (document.fullscreenElement || settings.kiosk?.value) updateFullScreenNavigate();
|
||||||
});
|
});
|
||||||
|
|
||||||
document.querySelector('#btnGetLatLng').addEventListener('click', () => autoComplete.directFormSubmit());
|
document.querySelector('#btnGetLatLng').addEventListener('click', () => autoComplete.directFormSubmit());
|
||||||
@@ -141,7 +141,7 @@ const init = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handle kiosk mode initialization
|
// Handle kiosk mode initialization
|
||||||
const urlKioskCheckbox = parsedParameters['settings-kiosk-checkbox'];
|
const urlKioskCheckbox = parsedParameters?.kiosk ?? parsedParameters['settings-kiosk-checkbox'];
|
||||||
|
|
||||||
// If kiosk=false is specified, disable kiosk mode and clear any stored value
|
// If kiosk=false is specified, disable kiosk mode and clear any stored value
|
||||||
if (urlKioskCheckbox === 'false') {
|
if (urlKioskCheckbox === 'false') {
|
||||||
@@ -384,7 +384,7 @@ const updateFullScreenNavigate = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
navigateFadeIntervalId = setTimeout(() => {
|
navigateFadeIntervalId = setTimeout(() => {
|
||||||
if (document.fullscreenElement) {
|
if (document.fullscreenElement || settings.kiosk?.value) {
|
||||||
divTwcBottom.classList.remove('visible');
|
divTwcBottom.classList.remove('visible');
|
||||||
divTwcBottom.classList.add('hidden');
|
divTwcBottom.classList.add('hidden');
|
||||||
document.querySelector('#divTwc').classList.add('no-cursor');
|
document.querySelector('#divTwc').classList.add('no-cursor');
|
||||||
|
|||||||
@@ -103,9 +103,8 @@ class CurrentWeather extends WeatherDisplay {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// copy enhanced data and restore the timestamp if it was overwritten by older data from mapclick
|
// copy enhanced data and restore the timestamp if it was overwritten by older data from mapclick
|
||||||
const { timestamp } = candidateObservation.features[0].properties;
|
|
||||||
candidateObservation.features[0].properties = enhancedResult.data;
|
candidateObservation.features[0].properties = enhancedResult.data;
|
||||||
candidateObservation.features[0].properties.timestamp = timestamp;
|
|
||||||
|
|
||||||
const { missingFields } = enhancedResult;
|
const { missingFields } = enhancedResult;
|
||||||
const missingRequired = missingFields.filter((fieldName) => {
|
const missingRequired = missingFields.filter((fieldName) => {
|
||||||
@@ -195,7 +194,7 @@ class CurrentWeather extends WeatherDisplay {
|
|||||||
|
|
||||||
// get location (city name) from StationInfo if available (allows for overrides)
|
// get location (city name) from StationInfo if available (allows for overrides)
|
||||||
// longer name allowed if in wide-enhanced
|
// longer name allowed if in wide-enhanced
|
||||||
const locationLimit = (settings.wide?.value && settings.enhancedScreens?.value) ? 25 : 20;
|
const locationLimit = (settings.wide?.value && settings.enhanced?.value) ? 25 : 20;
|
||||||
const location = (StationInfo[this.data.station.properties.stationIdentifier]?.city ?? locationCleanup(this.data.station.properties.name)).substr(0, locationLimit);
|
const location = (StationInfo[this.data.station.properties.stationIdentifier]?.city ?? locationCleanup(this.data.station.properties.name)).substr(0, locationLimit);
|
||||||
|
|
||||||
const fill = {
|
const fill = {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const changeEnable = (newValue) => {
|
|||||||
// hide the string entry
|
// hide the string entry
|
||||||
newDisplay = 'none';
|
newDisplay = 'none';
|
||||||
}
|
}
|
||||||
const stringEntry = document.getElementById('settings-customText-label');
|
const stringEntry = document.getElementById('settings-customText-string');
|
||||||
if (stringEntry) {
|
if (stringEntry) {
|
||||||
stringEntry.style.display = newDisplay;
|
stringEntry.style.display = newDisplay;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const scaling = () => {
|
|||||||
xTicks: 4,
|
xTicks: 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (settings.wide?.value && settings.enhancedScreens?.value) {
|
if (settings.wide?.value && settings.enhanced?.value) {
|
||||||
available.width = available.width + 107 + 107;
|
available.width = available.width + 107 + 107;
|
||||||
available.height = 285;
|
available.height = 285;
|
||||||
dataLength.hours = 48;
|
dataLength.hours = 48;
|
||||||
|
|||||||
@@ -162,8 +162,8 @@ class LatestObservations extends WeatherDisplay {
|
|||||||
const Like = likeTemperature(condition.heatIndex?.value, condition.windChill?.value, Temperature, temperatureConverter);
|
const Like = likeTemperature(condition.heatIndex?.value, condition.windChill?.value, Temperature, temperatureConverter);
|
||||||
const WindSpeed = windConverter(condition.windSpeed.value);
|
const WindSpeed = windConverter(condition.windSpeed.value);
|
||||||
|
|
||||||
const locationLimit = (settings.wide?.value && settings.enhancedScreens?.value) ? 20 : 14;
|
const locationLimit = (settings.wide?.value && settings.enhanced?.value) ? 20 : 14;
|
||||||
const weatherLimit = (settings.wide?.value && settings.enhancedScreens?.value) ? 10 : 9;
|
const weatherLimit = (settings.wide?.value && settings.enhanced?.value) ? 10 : 9;
|
||||||
|
|
||||||
const fill = {
|
const fill = {
|
||||||
location: locationCleanup(condition.city).substr(0, locationLimit),
|
location: locationCleanup(condition.city).substr(0, locationLimit),
|
||||||
@@ -183,7 +183,7 @@ class LatestObservations extends WeatherDisplay {
|
|||||||
const filledRow = this.fillTemplate('observation-row', fill);
|
const filledRow = this.fillTemplate('observation-row', fill);
|
||||||
|
|
||||||
// add the feels like class
|
// add the feels like class
|
||||||
filledRow.querySelector('.like').classList.add(Like.cssClass);
|
if (Like.cssClass) filledRow.querySelector('.like').classList.add(Like.cssClass);
|
||||||
|
|
||||||
return filledRow;
|
return filledRow;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ class LocalForecast extends WeatherDisplay {
|
|||||||
// read each text
|
// read each text
|
||||||
this.screenTexts = conditions.map((condition) => {
|
this.screenTexts = conditions.map((condition) => {
|
||||||
// process the text
|
// process the text
|
||||||
let text = `${condition.DayName.toUpperCase()}...`;
|
let text = `${condition.DayName}...`;
|
||||||
const conditionText = condition.Text;
|
const conditionText = condition.Text;
|
||||||
text += conditionText.toUpperCase().replace('...', ' ');
|
text += conditionText.replace('...', ' ');
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
});
|
});
|
||||||
@@ -257,7 +257,7 @@ const parse = (forecast, forecastUrl) => {
|
|||||||
|
|
||||||
return activePeriods.slice(0, 6).map((text) => ({
|
return activePeriods.slice(0, 6).map((text) => ({
|
||||||
// format day and text
|
// format day and text
|
||||||
DayName: text.name.toUpperCase(),
|
DayName: text.name,
|
||||||
Text: text.detailedForecast,
|
Text: text.detailedForecast,
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { text } from './utils/fetch.mjs';
|
import { text } from './utils/fetch.mjs';
|
||||||
import Setting from './utils/setting.mjs';
|
import Setting from './utils/setting.mjs';
|
||||||
import { registerHiddenSetting } from './share.mjs';
|
|
||||||
|
|
||||||
let playlist;
|
let playlist;
|
||||||
let currentTrack = 0;
|
let currentTrack = 0;
|
||||||
@@ -33,9 +32,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
// get the playlist
|
// get the playlist
|
||||||
getMedia();
|
getMedia();
|
||||||
|
|
||||||
// register the volume setting
|
|
||||||
registerHiddenSetting(mediaVolume.elemId, mediaVolume);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const scanMusicDirectory = async () => {
|
const scanMusicDirectory = async () => {
|
||||||
@@ -246,6 +242,7 @@ const mediaVolume = new Setting('mediaVolume', {
|
|||||||
[0.25, '25%'],
|
[0.25, '25%'],
|
||||||
],
|
],
|
||||||
changeAction: setVolume,
|
changeAction: setVolume,
|
||||||
|
visible: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const initializePlayer = () => {
|
const initializePlayer = () => {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const radarFinalSize = () => {
|
|||||||
const size = {
|
const size = {
|
||||||
width: 640, height: 367,
|
width: 640, height: 367,
|
||||||
};
|
};
|
||||||
if (settings.wide?.value && settings.enhancedScreens?.value) {
|
if (settings.wide?.value && settings.enhanced?.value) {
|
||||||
size.width = 854;
|
size.width = 854;
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
@@ -15,7 +15,7 @@ const radarSourceSize = () => {
|
|||||||
width: 240,
|
width: 240,
|
||||||
height: 163,
|
height: 163,
|
||||||
};
|
};
|
||||||
if (settings.wide?.value && settings.enhancedScreens?.value) {
|
if (settings.wide?.value && settings.enhanced?.value) {
|
||||||
size.width = 240 / 640 * 854; // original size of 640 scaled up to wide at 854
|
size.width = 240 / 640 * 854; // original size of 640 scaled up to wide at 854
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
@@ -26,7 +26,7 @@ const radarOffset = () => {
|
|||||||
x: 240,
|
x: 240,
|
||||||
y: 138,
|
y: 138,
|
||||||
};
|
};
|
||||||
if (settings.wide?.value && settings.enhancedScreens?.value) {
|
if (settings.wide?.value && settings.enhanced?.value) {
|
||||||
// 107 is the margins shift, 640/854 is the scaling factor normal => wide, /2 is because of the fixed 2:1 scaling between source radar and map tiles
|
// 107 is the margins shift, 640/854 is the scaling factor normal => wide, /2 is because of the fixed 2:1 scaling between source radar and map tiles
|
||||||
offset.x = 240 + (107 * 640 / 854 / 2); // original size of 640 scaled up to wide at 854;
|
offset.x = 240 + (107 * 640 / 854 / 2); // original size of 640 scaled up to wide at 854;
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ const radarShift = () => {
|
|||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
};
|
};
|
||||||
if (settings.wide?.value && settings.enhancedScreens?.value) {
|
if (settings.wide?.value && settings.enhanced?.value) {
|
||||||
shift.x = 107;
|
shift.x = 107;
|
||||||
}
|
}
|
||||||
return shift;
|
return shift;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const scaling = () => {
|
|||||||
y: 117,
|
y: 117,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (settings.wide?.value && settings.enhancedScreens?.value) {
|
if (settings.wide?.value && settings.enhanced?.value) {
|
||||||
mapOffsetXY.x = 320;
|
mapOffsetXY.x = 320;
|
||||||
available.x = 854;
|
available.x = 854;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ const deferredDomSettings = new Set();
|
|||||||
// don't show checkboxes for these settings
|
// don't show checkboxes for these settings
|
||||||
const hiddenSettings = [
|
const hiddenSettings = [
|
||||||
'scanLines',
|
'scanLines',
|
||||||
|
|
||||||
|
// wide, portrait and enhanced are handled by a dropdown which sets these individual settings accordingly
|
||||||
|
'wide',
|
||||||
|
'portrait',
|
||||||
|
'enhanced',
|
||||||
];
|
];
|
||||||
|
|
||||||
// Declare change functions first, before they're referenced in init() to avoid the Temporal Dead Zone (TDZ)
|
// Declare change functions first, before they're referenced in init() to avoid the Temporal Dead Zone (TDZ)
|
||||||
@@ -32,12 +37,31 @@ const wideScreenChange = (value) => {
|
|||||||
window.dispatchEvent(new Event('resize'));
|
window.dispatchEvent(new Event('resize'));
|
||||||
};
|
};
|
||||||
|
|
||||||
const enhancedScreenChange = (value) => {
|
const portraitChange = (value) => {
|
||||||
const container = document.querySelector('#divTwc');
|
const container = document.querySelector('#divTwc');
|
||||||
if (!container) {
|
if (!container) {
|
||||||
// DOM not ready; defer enabling if set
|
// DOM not ready; defer enabling if set
|
||||||
if (value) {
|
if (value) {
|
||||||
deferredDomSettings.add('enhancedScreens');
|
deferredDomSettings.add('portrait');
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value) {
|
||||||
|
container.classList.add('portrait');
|
||||||
|
} else {
|
||||||
|
container.classList.remove('portrait');
|
||||||
|
}
|
||||||
|
// Trigger resize to recalculate scaling for new width
|
||||||
|
window.dispatchEvent(new Event('resize'));
|
||||||
|
};
|
||||||
|
|
||||||
|
const enhancedChange = (value) => {
|
||||||
|
const container = document.querySelector('#divTwc');
|
||||||
|
if (!container) {
|
||||||
|
// DOM not ready; defer enabling if set
|
||||||
|
if (value) {
|
||||||
|
deferredDomSettings.add('enhanced');
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -51,6 +75,31 @@ const enhancedScreenChange = (value) => {
|
|||||||
window.dispatchEvent(new Event('redraw'));
|
window.dispatchEvent(new Event('redraw'));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const viewModeChange = (value) => {
|
||||||
|
// set the appropriate mode bits which triggers change actions above
|
||||||
|
switch (value) {
|
||||||
|
case 'wide':
|
||||||
|
settings.wide.value = true;
|
||||||
|
settings.enhanced.value = false;
|
||||||
|
settings.portrait.value = false;
|
||||||
|
break;
|
||||||
|
case 'wide-enhanced':
|
||||||
|
settings.wide.value = true;
|
||||||
|
settings.enhanced.value = true;
|
||||||
|
settings.portrait.value = false;
|
||||||
|
break;
|
||||||
|
case 'portrait-enhanced':
|
||||||
|
settings.wide.value = false;
|
||||||
|
settings.enhanced.value = true;
|
||||||
|
settings.portrait.value = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
settings.wide.value = false;
|
||||||
|
settings.enhanced.value = false;
|
||||||
|
settings.portrait.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const kioskChange = (value) => {
|
const kioskChange = (value) => {
|
||||||
const body = document.querySelector('body');
|
const body = document.querySelector('body');
|
||||||
if (!body) {
|
if (!body) {
|
||||||
@@ -63,9 +112,11 @@ const kioskChange = (value) => {
|
|||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
body.classList.add('kiosk');
|
body.classList.add('kiosk');
|
||||||
|
document.querySelector('#divTwc')?.classList.add('no-cursor');
|
||||||
window.dispatchEvent(new Event('resize'));
|
window.dispatchEvent(new Event('resize'));
|
||||||
} else {
|
} else {
|
||||||
body.classList.remove('kiosk');
|
body.classList.remove('kiosk');
|
||||||
|
document.querySelector('#divTwc')?.classList.remove('no-cursor');
|
||||||
window.dispatchEvent(new Event('resize'));
|
window.dispatchEvent(new Event('resize'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,15 +202,37 @@ const init = () => {
|
|||||||
});
|
});
|
||||||
settings.portrait = new Setting('portrait', {
|
settings.portrait = new Setting('portrait', {
|
||||||
name: 'Allow Portrait',
|
name: 'Allow Portrait',
|
||||||
|
changeAction: portraitChange,
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
sticky: true,
|
sticky: true,
|
||||||
});
|
});
|
||||||
settings.enhancedScreens = new Setting('enhancedScreens', {
|
settings.enhanced = new Setting('enhanced', {
|
||||||
name: 'Enhanced Screens',
|
name: 'Enhanced Screens',
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
changeAction: enhancedScreenChange,
|
changeAction: enhancedChange,
|
||||||
sticky: true,
|
sticky: true,
|
||||||
});
|
});
|
||||||
|
// widescreen, portrait and enhanced are handled by a dropdown
|
||||||
|
// the dropdown change action sets the above bits accordingly
|
||||||
|
// first, figure out the default value based on other settings
|
||||||
|
// this also enforces rules on how these can be combined
|
||||||
|
let viewModeDefault = 'standard';
|
||||||
|
if (settings.wide.value && !settings.enhanced.value) viewModeDefault = 'wide';
|
||||||
|
if (settings.wide.value && settings.enhanced.value) viewModeDefault = 'wide-enhanced';
|
||||||
|
if (settings.portrait.value) viewModeDefault = 'portrait-enhanced';
|
||||||
|
settings.viewMode = new Setting('viewMode', {
|
||||||
|
name: 'Display mode',
|
||||||
|
type: 'select',
|
||||||
|
defaultValue: viewModeDefault,
|
||||||
|
changeAction: viewModeChange,
|
||||||
|
sticky: false, // not sticky because the above 3 settings are sticky and define this item's starting state
|
||||||
|
values: [
|
||||||
|
['standard', 'Standard'],
|
||||||
|
['wide', 'Widescreen'],
|
||||||
|
['wide-enhanced', 'Widescreen enhanced'],
|
||||||
|
['portrait-enhanced', 'Portrait enhanced'],
|
||||||
|
],
|
||||||
|
});
|
||||||
settings.kiosk = new Setting('kiosk', {
|
settings.kiosk = new Setting('kiosk', {
|
||||||
name: 'Kiosk',
|
name: 'Kiosk',
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
@@ -202,6 +275,7 @@ const init = () => {
|
|||||||
['medium', 'Medium (2x)'],
|
['medium', 'Medium (2x)'],
|
||||||
['thick', 'Thick (3x)'],
|
['thick', 'Thick (3x)'],
|
||||||
],
|
],
|
||||||
|
visible: false,
|
||||||
});
|
});
|
||||||
settings.units = new Setting('units', {
|
settings.units = new Setting('units', {
|
||||||
name: 'Units',
|
name: 'Units',
|
||||||
@@ -251,7 +325,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
const settingHtml = Object.values(settings).map((setting) => {
|
const settingHtml = Object.values(settings).map((setting) => {
|
||||||
if (hiddenSettings.includes(setting.shortName)) {
|
if (hiddenSettings.includes(setting.shortName)) {
|
||||||
// setting is hidden, register it
|
// setting is hidden, register it
|
||||||
registerHiddenSetting(setting.elemId, setting);
|
registerHiddenSetting(setting.shortName, setting);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// generate HTML for setting
|
// generate HTML for setting
|
||||||
@@ -269,7 +343,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
} else if (modeSelect) {
|
} else if (modeSelect) {
|
||||||
modeSelect.style.display = 'none';
|
modeSelect.style.display = 'none';
|
||||||
}
|
}
|
||||||
registerHiddenSetting('settings-scanLineMode-select', settings.scanLineMode);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default settings;
|
export default settings;
|
||||||
|
|||||||
@@ -25,22 +25,28 @@ const createLink = async (e) => {
|
|||||||
const queryStringElements = {};
|
const queryStringElements = {};
|
||||||
|
|
||||||
elemForEach('input[type=checkbox]', (elem) => {
|
elemForEach('input[type=checkbox]', (elem) => {
|
||||||
if (elem?.id) {
|
// use name, and fallback to id (older prefix/suffix permalinks)
|
||||||
queryStringElements[elem.id] = elem?.checked ?? false;
|
const key = elem?.name ?? elem?.id;
|
||||||
|
if (key) {
|
||||||
|
queryStringElements[key] = elem?.checked ?? false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// get all select boxes
|
// get all select boxes
|
||||||
elemForEach('select', (elem) => {
|
elemForEach('select', (elem) => {
|
||||||
if (elem?.id) {
|
// use name, and fallback to id (older prefix/suffix permalinks)
|
||||||
queryStringElements[elem.id] = encodeURIComponent(elem?.value ?? '');
|
const key = elem?.name ?? elem?.id;
|
||||||
|
if (key) {
|
||||||
|
queryStringElements[key] = encodeURIComponent(elem?.value ?? '');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// get all text boxes
|
// get all text boxes
|
||||||
elemForEach('input[type=text]', ((elem) => {
|
elemForEach('input[type=text]', ((elem) => {
|
||||||
if (elem?.id) {
|
// use name, and fallback to id (older prefix/suffix permalinks)
|
||||||
queryStringElements[elem.id] = elem?.value ?? 0;
|
const key = elem?.name ?? elem?.id;
|
||||||
|
if (key && key !== '') {
|
||||||
|
queryStringElements[key] = elem?.value ?? 0;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ export const enhanceObservationWithMapClick = async (observationData, options =
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
data: mapClickProps,
|
data: { ...mapClickProps, timestamp: observationData.timestamp },
|
||||||
wasImproved: true,
|
wasImproved: true,
|
||||||
improvements,
|
improvements,
|
||||||
missingFields: [...mapClickMissingRequired, ...mapClickMissingOptional],
|
missingFields: [...mapClickMissingRequired, ...mapClickMissingOptional],
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// track state of nosleep locally to avoid a null case error
|
// track state of nosleep locally to avoid a null case error
|
||||||
// when nosleep.disable is called without first calling .enable
|
// when nosleep.disable is called without first calling .enable
|
||||||
|
// eslint-disable-next-line import/extensions
|
||||||
|
import NoSleep from '../../vendor/auto/no-sleep.js';
|
||||||
|
|
||||||
let wakeLock = false;
|
let wakeLock = false;
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ class Setting {
|
|||||||
this.elemId = `settings-${shortName}-${this.type}`;
|
this.elemId = `settings-${shortName}-${this.type}`;
|
||||||
|
|
||||||
// get value from url
|
// get value from url
|
||||||
const urlValue = parseQueryString()?.[this.elemId];
|
// includes a fallback to the older prefix/suffix version
|
||||||
|
const queryString = parseQueryString();
|
||||||
|
const urlValue = queryString?.[shortName] ?? queryString?.[this.elemId];
|
||||||
let urlState;
|
let urlState;
|
||||||
if (this.type === 'checkbox' && urlValue !== undefined) {
|
if (this.type === 'checkbox' && urlValue !== undefined) {
|
||||||
urlState = urlValue === 'true';
|
urlState = urlValue === 'true';
|
||||||
@@ -92,7 +94,7 @@ class Setting {
|
|||||||
|
|
||||||
const select = document.createElement('select');
|
const select = document.createElement('select');
|
||||||
select.id = `settings-${this.shortName}-select`;
|
select.id = `settings-${this.shortName}-select`;
|
||||||
select.name = `settings-${this.shortName}-select`;
|
select.name = this.shortName;
|
||||||
select.addEventListener('change', (e) => this.selectChange(e));
|
select.addEventListener('change', (e) => this.selectChange(e));
|
||||||
|
|
||||||
this.values.forEach(([value, text]) => {
|
this.values.forEach(([value, text]) => {
|
||||||
@@ -125,7 +127,7 @@ class Setting {
|
|||||||
checkbox.type = 'checkbox';
|
checkbox.type = 'checkbox';
|
||||||
checkbox.value = true;
|
checkbox.value = true;
|
||||||
checkbox.id = `settings-${this.shortName}-checkbox`;
|
checkbox.id = `settings-${this.shortName}-checkbox`;
|
||||||
checkbox.name = `settings-${this.shortName}-checkbox`;
|
checkbox.name = this.shortName;
|
||||||
checkbox.checked = this.myValue;
|
checkbox.checked = this.myValue;
|
||||||
checkbox.addEventListener('change', (e) => this.checkboxChange(e));
|
checkbox.addEventListener('change', (e) => this.checkboxChange(e));
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
@@ -148,14 +150,14 @@ class Setting {
|
|||||||
textInput.type = 'text';
|
textInput.type = 'text';
|
||||||
textInput.value = this.myValue;
|
textInput.value = this.myValue;
|
||||||
textInput.id = `settings-${this.shortName}-string`;
|
textInput.id = `settings-${this.shortName}-string`;
|
||||||
textInput.name = `settings-${this.shortName}-string`;
|
textInput.name = this.shortName;
|
||||||
textInput.placeholder = this.placeholder;
|
textInput.placeholder = this.placeholder;
|
||||||
// set button
|
// set button
|
||||||
const setButton = document.createElement('input');
|
const setButton = document.createElement('input');
|
||||||
setButton.type = 'button';
|
setButton.type = 'button';
|
||||||
setButton.value = 'Set';
|
setButton.value = 'Set';
|
||||||
setButton.id = `settings-${this.shortName}-button`;
|
setButton.id = `settings-${this.shortName}-button`;
|
||||||
setButton.name = `settings-${this.shortName}-button`;
|
setButton.name = this.shortName;
|
||||||
setButton.addEventListener('click', () => {
|
setButton.addEventListener('click', () => {
|
||||||
this.stringChange({ target: { value: textInput.value } });
|
this.stringChange({ target: { value: textInput.value } });
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -55,8 +55,9 @@ class WeatherDisplay {
|
|||||||
// no checkbox if progress
|
// no checkbox if progress
|
||||||
if (this.elemId === 'progress') return false;
|
if (this.elemId === 'progress') return false;
|
||||||
|
|
||||||
// get url provided state
|
// get url provided state, and fall back to the older suffix naming convention
|
||||||
const urlValue = parseQueryString()?.[`${this.elemId}-checkbox`];
|
const queryString = parseQueryString();
|
||||||
|
const urlValue = queryString?.[this.elemId] ?? queryString?.[`${this.elemId}-checkbox`];
|
||||||
let urlState;
|
let urlState;
|
||||||
if (urlValue !== undefined) {
|
if (urlValue !== undefined) {
|
||||||
urlState = urlValue === 'true';
|
urlState = urlValue === 'true';
|
||||||
@@ -78,7 +79,7 @@ class WeatherDisplay {
|
|||||||
checkbox.type = 'checkbox';
|
checkbox.type = 'checkbox';
|
||||||
checkbox.value = true;
|
checkbox.value = true;
|
||||||
checkbox.id = `${this.elemId}-checkbox`;
|
checkbox.id = `${this.elemId}-checkbox`;
|
||||||
checkbox.name = `${this.elemId}-checkbox`;
|
checkbox.name = this.elemId;
|
||||||
checkbox.checked = this.isEnabled;
|
checkbox.checked = this.isEnabled;
|
||||||
checkbox.addEventListener('change', (e) => this.checkboxChange(e));
|
checkbox.addEventListener('change', (e) => this.checkboxChange(e));
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
|
|||||||
77
server/scripts/vendor/auto/no-sleep.js
vendored
Normal file
77
server/scripts/vendor/auto/no-sleep.js
vendored
Normal file
File diff suppressed because one or more lines are too long
265
server/scripts/vendor/auto/nosleep.js
vendored
265
server/scripts/vendor/auto/nosleep.js
vendored
File diff suppressed because one or more lines are too long
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#hazards-html.weather-display {
|
#hazards-html.weather-display {
|
||||||
background-image: url('../images/backgrounds/7.png');
|
background-image: url('../images/backgrounds/7.png');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.weather-display .main.hazards {
|
.weather-display .main.hazards {
|
||||||
@@ -12,6 +13,11 @@
|
|||||||
height: p.$standard-height;
|
height: p.$standard-height;
|
||||||
background-color: rgb(112, 35, 35);
|
background-color: rgb(112, 35, 35);
|
||||||
|
|
||||||
|
width: p.$standard-width;
|
||||||
|
|
||||||
|
.wide.enhanced & {
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.hazard-lines {
|
.hazard-lines {
|
||||||
min-height: 400px;
|
min-height: 400px;
|
||||||
|
|||||||
@@ -32,6 +32,12 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.like {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.temp {
|
.temp {
|
||||||
@@ -62,9 +68,11 @@
|
|||||||
|
|
||||||
&.heat-index {
|
&.heat-index {
|
||||||
color: c.$heat-index;
|
color: c.$heat-index;
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.wind-chill {
|
&.wind-chill {
|
||||||
|
display: block;
|
||||||
color: c.$wind-chill;
|
color: c.$wind-chill;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
.forecast {
|
.forecast {
|
||||||
font-family: 'Star4000';
|
font-family: 'Star4000';
|
||||||
font-size: 24pt;
|
font-size: 24pt;
|
||||||
text-transform: uppercase;
|
|
||||||
@include u.text-shadow();
|
@include u.text-shadow();
|
||||||
min-height: 280px;
|
min-height: 280px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
|
|||||||
@@ -825,4 +825,19 @@ body.kiosk #loading .instructions {
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
max-width: 250px;
|
max-width: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lower-flex-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: flex-start;
|
||||||
|
align-content: stretch;
|
||||||
|
gap: 8px;
|
||||||
|
column-gap: 64px;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -168,6 +168,21 @@
|
|||||||
// adjust for wide
|
// adjust for wide
|
||||||
.wide & {
|
.wide & {
|
||||||
left: p.$wide-margin;
|
left: p.$wide-margin;
|
||||||
|
width: p.$wide-width;
|
||||||
|
margin-left: -1*p.$wide-margin;
|
||||||
|
|
||||||
|
.scroll-container {
|
||||||
|
margin-left: p.$wide-margin;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.wide.enhanced & {
|
||||||
|
|
||||||
|
&:has(.scroll-area) .scroll-container {
|
||||||
|
width: p.$wide-width;
|
||||||
|
margin-left: 0px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.hazard {
|
&.hazard {
|
||||||
@@ -208,13 +223,4 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.wide #container>.scroll {
|
|
||||||
width: p.$wide-width;
|
|
||||||
margin-left: -1*p.$wide-margin;
|
|
||||||
|
|
||||||
.scroll-container {
|
|
||||||
margin-left: p.$wide-margin;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
2
server/styles/ws.min.css
vendored
2
server/styles/ws.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -31,7 +31,10 @@
|
|||||||
<% if (production) { %>
|
<% if (production) { %>
|
||||||
<link rel="stylesheet" type="text/css" href="resources/ws.min.css?_=<%=production%>" />
|
<link rel="stylesheet" type="text/css" href="resources/ws.min.css?_=<%=production%>" />
|
||||||
<script type="text/javascript" src="resources/vendor.min.js?_=<%=production%>"></script>
|
<script type="text/javascript" src="resources/vendor.min.js?_=<%=production%>"></script>
|
||||||
<script type="text/javascript" src="resources/ws.min.js?_=<%=production%>"></script>
|
<script type="text/javascript" src="resources/index.min.js?_=<%=production%>"></script>
|
||||||
|
<script type="text/javascript" src="resources/displays.min.js?_=<%=production%>"></script>
|
||||||
|
<script type="text/javascript" src="resources/features.min.js?_=<%=production%>"></script>
|
||||||
|
<script type="text/javascript" src="resources/shared.min.js?_=<%=production%>"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const OVERRIDES = <%- JSON.stringify(OVERRIDES ?? {}) %>;
|
const OVERRIDES = <%- JSON.stringify(OVERRIDES ?? {}) %>;
|
||||||
</script>
|
</script>
|
||||||
@@ -41,7 +44,6 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
OVERRIDES = <%- JSON.stringify(OVERRIDES ?? {}) %>;
|
OVERRIDES = <%- JSON.stringify(OVERRIDES ?? {}) %>;
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="scripts/vendor/auto/nosleep.js"></script>
|
|
||||||
<script type="text/javascript" src="scripts/vendor/auto/swiped-events.js"></script>
|
<script type="text/javascript" src="scripts/vendor/auto/swiped-events.js"></script>
|
||||||
<script type="text/javascript" src="scripts/vendor/auto/suncalc.js"></script>
|
<script type="text/javascript" src="scripts/vendor/auto/suncalc.js"></script>
|
||||||
<script type="module" src="scripts/modules/hazards.mjs"></script>
|
<script type="module" src="scripts/modules/hazards.mjs"></script>
|
||||||
@@ -68,10 +70,10 @@
|
|||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body <% if (query && query['settings-kiosk-checkbox'] === 'true' ) { %>class="kiosk" <% }%>>
|
<body <% if (query && (query['kiosk'] === true || query['settings-kiosk-checkbox'] === 'true' )) { %>class="kiosk" <% }%>>
|
||||||
|
|
||||||
<div id="divQuery">
|
<div id="divQuery">
|
||||||
<input id="txtLocation" type="text" value="" placeholder="ZIP Code or City, State" data-1p-ignore />
|
<input id="txtLocation" name="txtLocation" type="text" value="" placeholder="ZIP Code or City, State" data-1p-ignore />
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button id="btnGetGps" type="button" title="Get GPS Location"><img src="images/nav/ic_gps_fixed_black_18dp_1x.png" class="light" />
|
<button id="btnGetGps" type="button" title="Get GPS Location"><img src="images/nav/ic_gps_fixed_black_18dp_1x.png" class="light" />
|
||||||
<img src="images/nav/ic_gps_fixed_white_18dp_1x.png" class="dark" />
|
<img src="images/nav/ic_gps_fixed_white_18dp_1x.png" class="dark" />
|
||||||
@@ -174,21 +176,25 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="media"></div>
|
<div class="media"></div>
|
||||||
|
|
||||||
<div class='heading'>Selected displays</div>
|
<div class='lower-flex-container'>
|
||||||
<div id='enabledDisplays'>
|
<div class='item'>
|
||||||
|
<div class='heading'>Selected displays</div>
|
||||||
|
<div id='enabledDisplays'>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class='heading'>Settings</div>
|
<div class='item'>
|
||||||
<div id='settings'>
|
<div class='heading'>Settings</div>
|
||||||
</div>
|
<div id='settings'>
|
||||||
|
<div class='heading'>Sharing</div>
|
||||||
<div class='heading'>Sharing</div>
|
</div>
|
||||||
<div class='info'>
|
<div class='item'>
|
||||||
<a href='' id='share-link'>Copy Permalink</a> <span id="share-link-copied">Link copied to clipboard!</span>
|
<a href='' id='share-link'>Copy Permalink</a> <span id="share-link-copied">Link copied to clipboard!</span>
|
||||||
<div id="share-link-instructions">
|
<div id="share-link-instructions">
|
||||||
Copy this long URL:
|
Copy this long URL:
|
||||||
<input type='text' id="share-link-url">
|
<input type='text' id="share-link-url">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -211,7 +217,6 @@
|
|||||||
<div class="header">Ws4kp Version:</div>
|
<div class="header">Ws4kp Version:</div>
|
||||||
<div class="header"><span><%- version %></span></div>
|
<div class="header"><span><%- version %></span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="main hazards no-header">
|
<div class="main hazards no-header can-enhance">
|
||||||
<div class="hazard-lines">
|
<div class="hazard-lines">
|
||||||
<div class="hazard template">
|
<div class="hazard template">
|
||||||
<div class="hazard-text"></div>
|
<div class="hazard-text"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -12,7 +12,8 @@
|
|||||||
"**/bower_components": true,
|
"**/bower_components": true,
|
||||||
"**/node_modules": true,
|
"**/node_modules": true,
|
||||||
"**/vendor": true,
|
"**/vendor": true,
|
||||||
"dist/**": true
|
"dist/**": true,
|
||||||
|
"package-lock.json": true,
|
||||||
},
|
},
|
||||||
"cSpell.enabledFileTypes": {
|
"cSpell.enabledFileTypes": {
|
||||||
"markdown": true,
|
"markdown": true,
|
||||||
@@ -76,7 +77,8 @@
|
|||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.eslint": "explicit"
|
||||||
},
|
},
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"hibyehihi"
|
"hibyehihi",
|
||||||
|
"zakj"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"extensions": {
|
"extensions": {
|
||||||
|
|||||||
Reference in New Issue
Block a user