Skip to content

Commit

Permalink
Merge branch 'wiedehopf:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rkarikari authored Nov 22, 2024
2 parents 388eabe + 93efebb commit 2433833
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 23 deletions.
6 changes: 3 additions & 3 deletions html/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,16 @@ flightawareLinks = true;
/* // remove this line to mofify columns (and the one at the end)
HideCols = [
"#icao",
// "#flag",
// "#country",
// "#flight",
// "#route",
"#registration",
// "#aircraft_type",
// "#type",
// "#squawk",
// "#altitude",
// "#speed",
"#vert_rate",
// "#distance",
// "#sitedist",
"#track",
"#msgs",
"#seen",
Expand Down
6 changes: 3 additions & 3 deletions html/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,16 @@ let squareMania = false;
// Columns that have a // in front of them are shown.
let HideCols = [
"#icao",
// "#flag",
// "#country",
// "#flight",
// "#route",
"#registration",
// "#aircraft_type",
// "#type",
// "#squawk",
// "#altitude",
// "#speed",
"#vert_rate",
// "#distance",
// "#sitedist",
"#track",
"#msgs",
"#seen",
Expand Down
17 changes: 15 additions & 2 deletions html/early.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,13 @@ function zuluTime(date) {
+ ":" + date.getUTCMinutes().toString().padStart(2,'0')
+ ":" + date.getUTCSeconds().toString().padStart(2,'0');
}
const TIMEZONE = new Date().toLocaleTimeString(undefined,{timeZoneName:'short'}).split(' ')[2];
let TIMEZONE;
if (navigator.language == 'en-US') {
TIMEZONE = new Date().toLocaleTimeString('en-US', {timeZoneName:'short'}).split(' ')[2];
} else {
TIMEZONE = new Date().toLocaleTimeString('en-GB', {timeZoneName:'short'}).split(' ')[1];
}
TIMEZONE = TIMEZONE.replace("GMT", "UTC");
function localTime(date) {
return date.getHours().toString().padStart(2,'0')
+ ":" + date.getMinutes().toString().padStart(2,'0')
Expand Down Expand Up @@ -469,6 +475,8 @@ function loadHeatChunk() {
xhr: arraybufferRequest,
});
{req.done(function (responseData) {
heatmapLoadingState.completed++;
jQuery("#loader_progress").attr('value', heatmapLoadingState.completed);
heatChunks[this.num] = responseData;
loadHeatChunk();
});}
Expand All @@ -492,9 +500,14 @@ if (!heatmap) {
heatmapLoadingState.index = 0;
heatmapLoadingState.interval = interval;
heatmapLoadingState.start = start;

heatmapLoadingState.completed = 0;
jQuery("#loader_progress").attr('value', heatmapLoadingState.completed);
jQuery("#loader_progress").attr('max', numChunks);

// 2 async chains of heat chunk loading:
loadHeatChunk();
loadHeatChunk();
setTimeout(loadHeatChunk, 500);
}

if (uuid != null) {
Expand Down
3 changes: 2 additions & 1 deletion html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -826,11 +826,12 @@
<div id="replayBar">
<button id="replayPlay" >Play</button>
<p id="replayDateHint" >Date:</p>
<p id="replayDateHintLocal" ></p>
<input type="text" class="datepicker" id="replayDatepicker" >
<p id="replayTimeHint" >Time:</p>
<p id="hourSelect"></p>
<p id="minuteSelect"></p>
<p id="replayTimeZone">UTC</p>
<p id="replayTimeZone">UTC Date:</p>
<p id="replaySpeedHint">Speed:</p>
<p id="replaySpeedSelect"></p>
<p id="replayLoading"></p>
Expand Down
31 changes: 19 additions & 12 deletions html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ function fetchDone(data) {
checkRefresh();
}
}

if (fetchCalls == 1) { console.timeEnd("first fetch()"); };
fetchDoneCount++;
if (fetchDoneCount == 1) { console.timeEnd("first fetch()"); };

if (!g.firstFetchDone) { afterFirstFetch(); };

Expand Down Expand Up @@ -525,6 +525,7 @@ function afterFirstFetch() {
let debugFetch = false;
let C429 = 0;
let fetchCalls = 0;
let fetchDoneCount = 0;
function fetchData(options) {
options = options || {};
if (!timersActive) {
Expand Down Expand Up @@ -6812,7 +6813,7 @@ function initSitePos() {
drawSiteCircle();
createLocationDot();
} else {
TAR.planeMan.setColumnVis('distance', false);
TAR.planeMan.setColumnVis('sitedist', false);
}

if (initSitePosFirstRun) {
Expand Down Expand Up @@ -7681,6 +7682,17 @@ function initReplay(chunk, data) {
replayStep();
}

function setReplayTimeHint(date) {
if (true || utcTimesHistoric) {
jQuery("#replayDateHintLocal").html(TIMEZONE + " Date: " + lDateString(date));
jQuery("#replayDateHint").html("" + zDateString(date));
jQuery("#replayTimeHint").html("UTC:" + NBSP + zuluTime(date) + ' / ' + TIMEZONE + ":" + NBSP + localTime(date));
} else {
jQuery("#replayDateHintLocal").html("");
jQuery("#replayDateHint").html("Date: " + lDateString(date));
jQuery("#replayTimeHint").html("Time: " + localTime(date) + NBSP + TIMEZONE);
}
}
function replayOnSliderMove() {
clearTimeout(refreshId);

Expand All @@ -7689,13 +7701,8 @@ function replayOnSliderMove() {
date.setUTCMinutes(Number(replay.minutes));
replay.seconds = 0;
date.setUTCSeconds(Number(replay.seconds));
if (true || utcTimesHistoric) {
jQuery("#replayDateHint").html("Date: " + zDateString(date));
jQuery("#replayTimeHint").html("Time: " + zuluTime(date) + NBSP + 'Z');
} else {
jQuery("#replayDateHint").html("Date: " + lDateString(date));
jQuery("#replayTimeHint").html("Time: " + localTime(date) + NBSP + TIMEZONE);
}

setReplayTimeHint(date);
}
let replayJumpEnabled = true;
function replayJump() {
Expand Down Expand Up @@ -7730,8 +7737,8 @@ function replaySetTimeHint(arg) {
dateString = zDateString(replay.ts);
timeString = zuluTime(replay.ts) + NBSP + 'Z';

jQuery("#replayDateHint").html("Date: " + dateString);
jQuery("#replayTimeHint").html("Time: " + timeString);
setReplayTimeHint(replay.ts);

if (replay.datepickerDate != dateString) {
replay.datepickerDate = dateString;
jQuery("#replayDatepicker").datepicker('setDate', dateString);
Expand Down
5 changes: 4 additions & 1 deletion html/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ input{
grid-template-areas:
"timezone dateHint timeHint speedHint"
"play datepicker hours speedSelect"
"loading . minutes ."
". dateHintLocal minutes loading "
". . . .";
}

Expand Down Expand Up @@ -907,6 +907,9 @@ input{
#replayTimeHint{
grid-area: timeHint;
}
#replayDateHintLocal{
grid-area: dateHintLocal;
}
#replayDateHint{
grid-area: dateHint;
}
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.14.1685
3.14.1688

0 comments on commit 2433833

Please sign in to comment.