diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-18 19:17:10 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-18 19:17:10 +0200 |
commit | 4dda0fd251e6c82c73cf7ae280caf1ae94d3012e (patch) | |
tree | f0301daaac4af07af8e5507d08cce8f1f05c0397 /public/static/js/geostop.js | |
parent | d8ffb5163a0f4bf543e5b026879cfff8ada0ab52 (diff) |
Add preliminary EFA support
Diffstat (limited to 'public/static/js/geostop.js')
-rw-r--r-- | public/static/js/geostop.js | 9 |
1 files changed, 6 insertions, 3 deletions
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); }); |