summaryrefslogtreecommitdiff
path: root/public/static/js
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-07 18:36:11 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-07 18:36:11 +0100
commitfd608391164ddc9e55e2f383620d395b43ae99b7 (patch)
treed7718f37e273918933d42f6d488fa70d78f0b1d6 /public/static/js
parentba6b517e5b6986609996339eae109bb2c279ee5f (diff)
switch from HTTP Auth to Cookie Auth
Diffstat (limited to 'public/static/js')
-rw-r--r--public/static/js/geolocation.js4
-rw-r--r--public/static/js/geolocation.min.js2
-rw-r--r--public/static/js/travelynx-actions.js2
-rw-r--r--public/static/js/travelynx-actions.min.js2
4 files changed, 5 insertions, 5 deletions
diff --git a/public/static/js/geolocation.js b/public/static/js/geolocation.js
index 1c881e2..caf2a2a 100644
--- a/public/static/js/geolocation.js
+++ b/public/static/js/geolocation.js
@@ -25,14 +25,14 @@ $(document).ready(function() {
stationlink.attr('href', ds100);
stationlink.text(name);
- resultBody.append('<tr><td><a href="/' + ds100 + '">' + name + '</a></td></tr>');
+ resultBody.append('<tr><td><a href="/s/' + ds100 + '">' + name + '</a></td></tr>');
});
placeholder.replaceWith(resultTable);
}
};
var processLocation = function(loc) {
- $.post('/x/geolocation', {lon: loc.coords.longitude, lat: loc.coords.latitude}, processResult);
+ $.post('/geolocation', {lon: loc.coords.longitude, lat: loc.coords.latitude}, processResult);
};
var processError = function(error) {
diff --git a/public/static/js/geolocation.min.js b/public/static/js/geolocation.min.js
index 50cd010..1bd2c77 100644
--- a/public/static/js/geolocation.min.js
+++ b/public/static/js/geolocation.min.js
@@ -1 +1 @@
-$(document).ready(function(){var e=$("p.geolocationhint"),t=$("div.geolocation div.progress"),o=function(o,a,n){e.remove(),t.remove()},a=function(e){e.error?o(0,e.error):0==e.candidates.length?o():(resultTable=$("<table><tbody></tbody></table>"),resultBody=resultTable.children(),$.each(e.candidates,function(e,t){var o=t.ds100,a=t.name,n=t.distance;n=n.toFixed(1);var r=$(document.createElement("a"));r.attr("href",o),r.text(a),resultBody.append('<tr><td><a href="/'+o+'">'+a+"</a></td></tr>")}),t.replaceWith(resultTable))},n=function(e){$.post("/x/geolocation",{lon:e.coords.longitude,lat:e.coords.latitude},a)},r=function(e){e.code==e.PERMISSION_DENIED?o():e.code==e.POSITION_UNAVAILABLE?o():(e.code,e.TIMEOUT,o())};navigator.geolocation?navigator.geolocation.getCurrentPosition(n,r):o()});
+$(document).ready(function(){var a=$("p.geolocationhint"),n=$("div.geolocation div.progress"),t=function(e,t,o){a.remove(),n.remove()},o=function(e){e.error?t(0,e.error):0==e.candidates.length?t():(resultTable=$("<table><tbody></tbody></table>"),resultBody=resultTable.children(),$.each(e.candidates,function(e,t){var o=t.ds100,a=t.name,n=t.distance;n=n.toFixed(1);var r=$(document.createElement("a"));r.attr("href",o),r.text(a),resultBody.append('<tr><td><a href="/s/'+o+'">'+a+"</a></td></tr>")}),n.replaceWith(resultTable))};navigator.geolocation?navigator.geolocation.getCurrentPosition(function(e){$.post("/geolocation",{lon:e.coords.longitude,lat:e.coords.latitude},o)},function(e){e.code==e.PERMISSION_DENIED||e.code==e.POSITION_UNAVAILABLE||(e.code,e.TIMEOUT),t()}):t()});
diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js
index d758a1a..0a3d092 100644
--- a/public/static/js/travelynx-actions.js
+++ b/public/static/js/travelynx-actions.js
@@ -34,7 +34,7 @@ $(document).ready(function() {
station: link.data('station'),
force: link.data('force'),
};
- tvly_run(link, req, '/' + req.station, function() {
+ tvly_run(link, req, '/s/' + req.station, function() {
link.append(' – Ohne Echtzeitdaten auschecken?')
link.data('force', true);
});
diff --git a/public/static/js/travelynx-actions.min.js b/public/static/js/travelynx-actions.min.js
index 156c458..9c37d8d 100644
--- a/public/static/js/travelynx-actions.min.js
+++ b/public/static/js/travelynx-actions.min.js
@@ -1 +1 @@
-function tvly_run(n,t,i,a){var c='<i class="material-icons">error</i>',o=$('<div class="progress"><div class="indeterminate"></div></div>');n.hide(),n.after(o),$.post("/action",t,function(t){t.success?$(location).attr("href",i):(M.toast({html:c+" "+t.error}),o.remove(),a&&a(),n.append(" "+c),n.show())})}$(document).ready(function(){$(".action-checkin").click(function(){var t=$(this);tvly_run(t,{action:"checkin",station:t.data("station"),train:t.data("train")},"/")}),$(".action-checkout").click(function(){var t=$(this),n={action:"checkout",station:t.data("station"),force:t.data("force")};tvly_run(t,n,"/"+n.station,function(){t.append(" – Ohne Echtzeitdaten auschecken?"),t.data("force",!0)})}),$(".action-undo").click(function(){tvly_run($(this),{action:"undo"},window.location.href)})});
+function tvly_run(n,t,i,a){var c='<i class="material-icons">error</i>',o=$('<div class="progress"><div class="indeterminate"></div></div>');n.hide(),n.after(o),$.post("/action",t,function(t){t.success?$(location).attr("href",i):(M.toast({html:c+" "+t.error}),o.remove(),a&&a(),n.append(" "+c),n.show())})}$(document).ready(function(){$(".action-checkin").click(function(){var t=$(this);tvly_run(t,{action:"checkin",station:t.data("station"),train:t.data("train")},"/")}),$(".action-checkout").click(function(){var t=$(this),n={action:"checkout",station:t.data("station"),force:t.data("force")};tvly_run(t,n,"/s/"+n.station,function(){t.append(" – Ohne Echtzeitdaten auschecken?"),t.data("force",!0)})}),$(".action-undo").click(function(){tvly_run($(this),{action:"undo"},window.location.href)})});