summaryrefslogtreecommitdiff
path: root/public/static/js
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-10-18 19:17:10 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-10-18 19:17:10 +0200
commit4dda0fd251e6c82c73cf7ae280caf1ae94d3012e (patch)
treef0301daaac4af07af8e5507d08cce8f1f05c0397 /public/static/js
parentd8ffb5163a0f4bf543e5b026879cfff8ada0ab52 (diff)
Add preliminary EFA support
Diffstat (limited to 'public/static/js')
-rw-r--r--public/static/js/geostop.js9
-rw-r--r--public/static/js/map-refresh.js2
2 files changed, 7 insertions, 4 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);
});
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') + '&amp;hafas=' + param.get('hafas'), function(data) {
$('#infobox').html(data);
dbf_map_parse();
setTimeout(dbf_map_reload, 61000);