From 6d261197e3138c80357ec485749e2089ef6ff96a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 27 Feb 2023 22:14:54 +0100 Subject: set visibility per journey (wip) some odds and ends left to polish, but ready for testing --- public/static/js/travelynx-actions.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'public/static/js') diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js index 054b600..7e95a43 100644 --- a/public/static/js/travelynx-actions.js +++ b/public/static/js/travelynx-actions.js @@ -8,8 +8,13 @@ var j_duration = 0; var j_arrival = 0; var j_dest = ''; var j_stops = []; +var j_token = ''; function upd_journey_data() { $('.countdown').each(function() { + const journey_token = $(this).data('token'); + if (journey_token) { + j_token = journey_token; + } var journey_data = $(this).data('journey'); if (journey_data) { journey_data = journey_data.split(';'); @@ -105,7 +110,7 @@ function tvly_update_public() { $('.publicstatuscol').each(function() { user_name = $(this).data('user'); }); - $.get('/ajax/status/' + user_name + '.html', function(data) { + $.get('/ajax/status/' + user_name + '.html', {token: j_token}, function(data) { $('.publicstatuscol').html(data); upd_journey_data(); setTimeout(tvly_update_public, 40000); -- cgit v1.2.3