Commit 408d7381 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

geotrain: show likelihood, distinguish between no track / no trains

parent f5cdad84
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2,12 +2,12 @@
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url(/static/v48/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
  src: url(/static/v49/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
  src: local('Material Icons'),
       local('MaterialIcons-Regular'),
       url(/static/v48/fonts/MaterialIcons-Regular.woff2) format('woff2'),
       url(/static/v48/fonts/MaterialIcons-Regular.woff) format('woff'),
       url(/static/v48/fonts/MaterialIcons-Regular.ttf) format('truetype');
       url(/static/v49/fonts/MaterialIcons-Regular.woff2) format('woff2'),
       url(/static/v49/fonts/MaterialIcons-Regular.woff) format('woff'),
       url(/static/v49/fonts/MaterialIcons-Regular.ttf) format('truetype');
}

.material-icons {
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+4 −2
Original line number Diff line number Diff line
@@ -31,8 +31,10 @@ $(function() {
		removeStatus();
		if (data.error) {
			showError('Backend-Fehler:', data.error, null);
		} else if (data.trains.length == 0) {
		} else if (data.evas.length == 0) {
			showError('Keine Bahnstrecke gefunden', '', null);
		} else if (data.trains.length == 0) {
			showError('Keine Züge auf der Strecke gefunden', '', null);
		} else {
			$.each(data.trains, function(i, train) {

@@ -48,7 +50,7 @@ $(function() {

				var distancenode = $(document.createElement('div'));
				distancenode.attr('class', 'traininfo');
				distancenode.html(prev_time + ' ' + prev + '<br/>' + next_time + ' ' + next);
				distancenode.html(train.likelihood + '%<br/>' + prev_time + ' ' + prev + '<br/>' + next_time + ' ' + next);

				stationlink.append(distancenode);
				$('div.candidatelist').append(stationlink);
+1 −1
Original line number Diff line number Diff line
$(function(){var e=function(){$("div.candidatestatus").remove()},t=function(e,t,n){var r=$(document.createElement("div"));r.attr("class","error"),r.text(t);var o=$(document.createElement("strong"));if(o.text(e),r.prepend(o),n){var a=$(document.createElement("div"));a.attr("class","errcode"),a.text(n),r.append(a)}$("div.candidatelist").append(r)},n=function(n){e(),n.error?t("Backend-Fehler:",n.error,null):0==n.trains.length?t("Keine Bahnstrecke gefunden","",null):$.each(n.trains,function(e,t){const n=t.stops[0][1],r=t.stops[0][2],o=t.stops[1][0],a=t.stops[1][1],i=t.stops[1][2];var d=$(document.createElement("a"));d.attr("href","/z/"+t.train+"/"+o),d.text(t.line);var c=$(document.createElement("div"));c.attr("class","traininfo"),c.html(r+" "+n+"<br/>"+i+" "+a),d.append(c),$("div.candidatelist").append(d)})},r=function(e){$.get("https://dbf.finalrewind.org/__geotrain/search",{lon:e.coords.longitude,lat:e.coords.latitude},n),$("div.candidatestatus").text("Suche Züge…")},o=function(n){e(),n.code==n.PERMISSION_DENIED?t("Standortanfrage nicht möglich.","Vermutlich fehlen die Rechte im Browser oder der Android Location Service ist deaktiviert.","geolocation.error.PERMISSION_DENIED"):n.code==n.POSITION_UNAVAILABLE?t("Standort konnte nicht ermittelt werden","(Service nicht verfügbar)","geolocation.error.POSITION_UNAVAILABLE"):n.code==n.TIMEOUT?t("Standort konnte nicht ermittelt werden","(Timeout)","geolocation.error.TIMEOUT"):t("Standort konnte nicht ermittelt werden","(unbekannter Fehler)","unknown geolocation.error code")};navigator.geolocation?(navigator.geolocation.getCurrentPosition(r,o),$("div.candidatestatus").text("Position wird bestimmt…")):(e(),t("Standortanfragen werden von diesem Browser nicht unterstützt","",null))});
$(function(){var e=function(){$("div.candidatestatus").remove()},t=function(e,t,n){var r=$(document.createElement("div"));r.attr("class","error"),r.text(t);var o=$(document.createElement("strong"));if(o.text(e),r.prepend(o),n){var i=$(document.createElement("div"));i.attr("class","errcode"),i.text(n),r.append(i)}$("div.candidatelist").append(r)},n=function(n){e(),n.error?t("Backend-Fehler:",n.error,null):0==n.evas.length?t("Keine Bahnstrecke gefunden","",null):0==n.trains.length?t("Keine Züge auf der Strecke gefunden","",null):$.each(n.trains,function(e,t){const n=t.stops[0][1],r=t.stops[0][2],o=t.stops[1][0],i=t.stops[1][1],a=t.stops[1][2];var d=$(document.createElement("a"));d.attr("href","/z/"+t.train+"/"+o),d.text(t.line);var c=$(document.createElement("div"));c.attr("class","traininfo"),c.html(t.likelihood+"%<br/>"+r+" "+n+"<br/>"+a+" "+i),d.append(c),$("div.candidatelist").append(d)})},r=function(e){$.get("https://dbf.finalrewind.org/__geotrain/search",{lon:e.coords.longitude,lat:e.coords.latitude},n),$("div.candidatestatus").text("Suche Züge…")},o=function(n){e(),n.code==n.PERMISSION_DENIED?t("Standortanfrage nicht möglich.","Vermutlich fehlen die Rechte im Browser oder der Android Location Service ist deaktiviert.","geolocation.error.PERMISSION_DENIED"):n.code==n.POSITION_UNAVAILABLE?t("Standort konnte nicht ermittelt werden","(Service nicht verfügbar)","geolocation.error.POSITION_UNAVAILABLE"):n.code==n.TIMEOUT?t("Standort konnte nicht ermittelt werden","(Timeout)","geolocation.error.TIMEOUT"):t("Standort konnte nicht ermittelt werden","(unbekannter Fehler)","unknown geolocation.error code")};navigator.geolocation?(navigator.geolocation.getCurrentPosition(r,o),$("div.candidatestatus").text("Position wird bestimmt…")):(e(),t("Standortanfragen werden von diesem Browser nicht unterstützt","",null))});
Loading