mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-17 00:59:29 -07:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c07ebe8bdd | ||
|
|
a41b0da196 | ||
|
|
30887202c8 | ||
|
|
38d1455a4b | ||
|
|
30ec847ed5 | ||
|
|
11c54391b2 | ||
|
|
0b47cf79c1 | ||
|
|
ba36904477 | ||
|
|
dae5b20bc6 |
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
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "6.5.5",
|
"version": "6.5.9",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "6.5.5",
|
"version": "6.5.9",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dotenv": "^17.0.1",
|
"dotenv": "^17.0.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "6.5.5",
|
"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",
|
||||||
|
|||||||
@@ -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());
|
||||||
@@ -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');
|
||||||
|
|||||||
@@ -101,7 +101,10 @@ class CurrentWeather extends WeatherDisplay {
|
|||||||
debugContext: 'currentweather',
|
debugContext: 'currentweather',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// copy enhanced data and restore the timestamp if it was overwritten by older data from mapclick
|
||||||
|
|
||||||
candidateObservation.features[0].properties = enhancedResult.data;
|
candidateObservation.features[0].properties = enhancedResult.data;
|
||||||
|
|
||||||
const { missingFields } = enhancedResult;
|
const { missingFields } = enhancedResult;
|
||||||
const missingRequired = missingFields.filter((fieldName) => {
|
const missingRequired = missingFields.filter((fieldName) => {
|
||||||
const field = requiredFields.find((f) => f.name === fieldName && f.required);
|
const field = requiredFields.find((f) => f.name === fieldName && f.required);
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ const pixelToFile = (xPixel, yPixel) => {
|
|||||||
return `${yTile}-${xTile}`;
|
return `${yTile}-${xTile}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
// convert a pixel location in the overall map to a pixel location on the tile
|
// convert a pixel location in the overall map to a pixel location on the tile set
|
||||||
const modTile = (xPixel, yPixel) => {
|
const modTile = (xPixel, yPixel) => {
|
||||||
const x = Math.round(xPixel) % TILE_SIZE.x;
|
// adjust for additional 1 tile when odd
|
||||||
const y = Math.round(yPixel) % TILE_SIZE.y;
|
const x = (Math.floor(xPixel) % (TILE_SIZE.x));
|
||||||
|
const y = (Math.floor(yPixel) % (TILE_SIZE.y));
|
||||||
|
|
||||||
return { x, y };
|
return { x, y };
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -46,8 +48,8 @@ const setTiles = (data) => {
|
|||||||
// determine which tiles are used
|
// determine which tiles are used
|
||||||
const usedTiles = [
|
const usedTiles = [
|
||||||
true,
|
true,
|
||||||
TILE_SIZE.x - tileShift.x < RADAR_FINAL_SIZE.width,
|
tileShift.x + TILE_SIZE.x > RADAR_FINAL_SIZE.width,
|
||||||
TILE_SIZE.y - tileShift.y < RADAR_FINAL_SIZE.width,
|
tileShift.y + TILE_SIZE.y > RADAR_FINAL_SIZE.height,
|
||||||
];
|
];
|
||||||
// if we need t[1] and t[2] then we also need t[3]
|
// if we need t[1] and t[2] then we also need t[3]
|
||||||
usedTiles.push(usedTiles[1] && usedTiles[2]);
|
usedTiles.push(usedTiles[1] && usedTiles[2]);
|
||||||
|
|||||||
@@ -44,9 +44,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'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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],
|
||||||
|
|||||||
Reference in New Issue
Block a user