summaryrefslogtreecommitdiff
path: root/public/static
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-07-16 10:34:05 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-07-16 10:34:05 +0200
commit0bcfd0988b56a8d1120d46f2f3482ae28e4ecbeb (patch)
tree7dd4f7e636c9b1902b1f28c5ccbb5ff7d231e58e /public/static
parent6277cdd929f81db764333cfc6473f476a04d2fcb (diff)
auto-refresh timeline
Diffstat (limited to 'public/static')
-rw-r--r--public/static/js/travelynx-actions.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js
index d89874a..30f2439 100644
--- a/public/static/js/travelynx-actions.js
+++ b/public/static/js/travelynx-actions.js
@@ -129,6 +129,15 @@ function tvly_update_public() {
setTimeout(tvly_update_public, 5000);
});
}
+function tvly_update_timeline() {
+ $.get('/timeline/in-transit', {ajax: 1}, function(data) {
+ $('.timeline-in-transit').html(data);
+ setTimeout(tvly_update_timeline, 60000);
+ }).fail(function() {
+ $('.sync-failed-marker').css('display', 'block');
+ setTimeout(tvly_update_timeline, 10000);
+ });
+}
function tvly_journey_progress() {
var now = Date.now() / 1000;
var progress = 0;
@@ -277,6 +286,9 @@ $(document).ready(function() {
setTimeout(tvly_update_public, 40000);
setTimeout(tvly_journey_progress, 5000);
}
+ if ($('.timeline-in-transit .autorefresh').length) {
+ setTimeout(tvly_update_timeline, 60000);
+ }
$('a[href]').click(function() {
$('nav .preloader-wrapper').addClass('active');
});