From 4dda0fd251e6c82c73cf7ae280caf1ae94d3012e Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 18 Oct 2024 19:17:10 +0200 Subject: Add preliminary EFA support --- public/static/js/geostop.js | 9 ++++++--- public/static/js/map-refresh.js | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'public/static') diff --git a/public/static/js/geostop.js b/public/static/js/geostop.js index fa2d6f1..69bb607 100644 --- a/public/static/js/geostop.js +++ b/public/static/js/geostop.js @@ -39,10 +39,13 @@ $(function() { const eva = candidate.eva, name = candidate.name, distance = candidate.distance.toFixed(1), + efa = candidate.efa, hafas = candidate.hafas; const stationlink = $(document.createElement('a')); - if (hafas) { + if (efa) { + stationlink.attr('href', eva + '?efa=' + efa); + } else if (hafas) { stationlink.attr('href', eva + '?hafas=' + hafas); } else { stationlink.attr('href', eva); @@ -55,7 +58,7 @@ $(function() { const icon = $(document.createElement('i')); icon.attr('class', 'material-icons'); - icon.text(hafas ? 'directions' : 'train'); + icon.text((hafas || efa) ? 'directions' : 'train'); stationlink.append(icon); stationlink.append(distancenode); @@ -66,7 +69,7 @@ $(function() { const processLocation = function(loc) { const param = new URLSearchParams(window.location.search); - $.post('/_geolocation', {lon: loc.coords.longitude, lat: loc.coords.latitude, hafas: param.get('hafas')}, processResult).fail(function(jqXHR, textStatus, errorThrown) { + $.post('/_geolocation', {lon: loc.coords.longitude, lat: loc.coords.latitude, efa: param.get('efa'), hafas: param.get('hafas')}, processResult).fail(function(jqXHR, textStatus, errorThrown) { removeStatus(); showError("Netzwerkfehler: ", textStatus, errorThrown); }); diff --git a/public/static/js/map-refresh.js b/public/static/js/map-refresh.js index 0389323..1d8453a 100644 --- a/public/static/js/map-refresh.js +++ b/public/static/js/map-refresh.js @@ -69,7 +69,7 @@ function dbf_anim_fine() { function dbf_map_reload() { const param = new URLSearchParams(window.location.search); - $.get('/_ajax_mapinfo/' + j_reqid + '?hafas=' + param.get('hafas'), function(data) { + $.get('/_ajax_mapinfo/' + j_reqid + '?efa=' + param.get('efa') + '&hafas=' + param.get('hafas'), function(data) { $('#infobox').html(data); dbf_map_parse(); setTimeout(dbf_map_reload, 61000); -- cgit v1.2.3