mirror of
https://github.com/smittix/intercept.git
synced 2026-07-07 09:08:12 -07:00
Merge pull request #145 from mitchross/main
All review issues addressed. Merging with fixup commit for XSS escaping, import cleanup, VDL2 click behavior, frequency defaults, and misc fixes.
This commit is contained in:
@@ -89,3 +89,27 @@
|
||||
0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 158, 255, 0.7); }
|
||||
50% { opacity: 0.6; box-shadow: 0 0 6px 3px rgba(74, 158, 255, 0.3); }
|
||||
}
|
||||
|
||||
/* ACARS Standalone Message Feed */
|
||||
.acars-message-feed {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--border-color) transparent;
|
||||
}
|
||||
.acars-message-feed::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
.acars-message-feed::-webkit-scrollbar-thumb {
|
||||
background: var(--border-color);
|
||||
border-radius: 2px;
|
||||
}
|
||||
.acars-feed-card {
|
||||
transition: background 0.15s;
|
||||
}
|
||||
.acars-feed-card:hover {
|
||||
background: rgba(74, 158, 255, 0.05);
|
||||
}
|
||||
|
||||
/* Clickable ACARS sidebar messages (linked to tracked aircraft) */
|
||||
.acars-message-item[style*="cursor: pointer"]:hover {
|
||||
background: rgba(74, 158, 255, 0.1);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ const WeatherSat = (function() {
|
||||
let isRunning = false;
|
||||
let eventSource = null;
|
||||
let images = [];
|
||||
let allPasses = [];
|
||||
let passes = [];
|
||||
let selectedPassIndex = -1;
|
||||
let currentSatellite = null;
|
||||
@@ -130,6 +131,8 @@ const WeatherSat = (function() {
|
||||
if (!locationListenersAttached) {
|
||||
if (latInput) latInput.addEventListener('change', saveLocationFromInputs);
|
||||
if (lonInput) lonInput.addEventListener('change', saveLocationFromInputs);
|
||||
const satSelect = document.getElementById('weatherSatSelect');
|
||||
if (satSelect) satSelect.addEventListener('change', applyPassFilter);
|
||||
locationListenersAttached = true;
|
||||
}
|
||||
}
|
||||
@@ -584,6 +587,7 @@ const WeatherSat = (function() {
|
||||
}
|
||||
|
||||
if (!storedLat || !storedLon) {
|
||||
allPasses = [];
|
||||
passes = [];
|
||||
selectedPassIndex = -1;
|
||||
renderPasses([]);
|
||||
@@ -599,8 +603,7 @@ const WeatherSat = (function() {
|
||||
const data = await response.json();
|
||||
|
||||
if (data.status === 'ok') {
|
||||
passes = data.passes || [];
|
||||
// Apply satellite filter and render
|
||||
allPasses = data.passes || [];
|
||||
applyPassFilter();
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -608,6 +611,29 @@ const WeatherSat = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter displayed passes by the currently selected satellite dropdown value.
|
||||
* Updates the module-level `passes` from `allPasses` so selectPass/countdown work.
|
||||
*/
|
||||
function applyPassFilter() {
|
||||
const satSelect = document.getElementById('weatherSatSelect');
|
||||
const selected = satSelect?.value;
|
||||
passes = selected
|
||||
? allPasses.filter(p => p.satellite === selected)
|
||||
: allPasses.slice();
|
||||
|
||||
selectedPassIndex = -1;
|
||||
renderPasses(passes);
|
||||
renderTimeline(passes);
|
||||
updateCountdownFromPasses();
|
||||
if (passes.length > 0) {
|
||||
selectPass(0);
|
||||
} else {
|
||||
updateGroundTrack(null);
|
||||
drawPolarPlot(null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Select a pass to display in polar plot and map
|
||||
*/
|
||||
@@ -712,6 +738,7 @@ const WeatherSat = (function() {
|
||||
* Draw polar plot for a pass trajectory
|
||||
*/
|
||||
function drawPolarPlot(pass) {
|
||||
if (!pass) return;
|
||||
const canvas = document.getElementById('wxsatPolarCanvas');
|
||||
if (!canvas) return;
|
||||
|
||||
@@ -771,7 +798,7 @@ const WeatherSat = (function() {
|
||||
ctx.stroke();
|
||||
|
||||
// Trajectory
|
||||
const trajectory = pass.trajectory;
|
||||
const trajectory = pass?.trajectory;
|
||||
if (!trajectory || trajectory.length === 0) return;
|
||||
|
||||
const color = pass.mode === 'LRPT' ? '#00ff88' : '#00d4ff';
|
||||
|
||||
Reference in New Issue
Block a user