Update station name autocompletion for T-S-DE-IRIS 1.60

This commit is contained in:
Daniel Friesel 2021-09-12 10:09:46 +02:00
parent 79b55c430d
commit 2f01ea6f0d
9 changed files with 54 additions and 57 deletions

View file

@ -1,19 +1,19 @@
const CACHE_NAME = 'static-cache-v37';
const CACHE_NAME = 'static-cache-v38';
const FILES_TO_CACHE = [
'/favicon.ico',
'/offline.html',
'/static/v37/css/light.min.css',
'/static/v37/css/dark.min.css',
'/static/v37/css/material-icons.css',
'/static/v37/css/local.css',
'/static/v37/fonts/MaterialIcons-Regular.woff2',
'/static/v37/fonts/MaterialIcons-Regular.woff',
'/static/v37/fonts/MaterialIcons-Regular.ttf',
'/static/v37/js/jquery-3.4.1.min.js',
'/static/v37/js/materialize.min.js',
'/static/v37/js/travelynx-actions.min.js',
'/static/v37/js/autocomplete.min.js',
'/static/v37/js/geolocation.min.js',
'/static/v38/css/light.min.css',
'/static/v38/css/dark.min.css',
'/static/v38/css/material-icons.css',
'/static/v38/css/local.css',
'/static/v38/fonts/MaterialIcons-Regular.woff2',
'/static/v38/fonts/MaterialIcons-Regular.woff',
'/static/v38/fonts/MaterialIcons-Regular.ttf',
'/static/v38/js/jquery-3.4.1.min.js',
'/static/v38/js/materialize.min.js',
'/static/v38/js/travelynx-actions.min.js',
'/static/v38/js/autocomplete.min.js',
'/static/v38/js/geolocation.min.js',
];
self.addEventListener('install', (evt) => {

View file

@ -2,12 +2,12 @@
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(/static/v37/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
src: url(/static/v38/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(/static/v37/fonts/MaterialIcons-Regular.woff2) format('woff2'),
url(/static/v37/fonts/MaterialIcons-Regular.woff) format('woff'),
url(/static/v37/fonts/MaterialIcons-Regular.ttf) format('truetype');
url(/static/v38/fonts/MaterialIcons-Regular.woff2) format('woff2'),
url(/static/v38/fonts/MaterialIcons-Regular.woff) format('woff'),
url(/static/v38/fonts/MaterialIcons-Regular.ttf) format('truetype');
}
.material-icons {

View file

@ -19,6 +19,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Aalter": null,
"Aarau": null,
"Aarburg-Oftringen": null,
"Aarhus": null,
"Abcoude": null,
"Abenden": null,
"Abensberg": null,
@ -72,11 +73,9 @@ document.addEventListener('DOMContentLoaded', function() {
"Aix-en-Provence TGV": null,
"Aix-les-Bains-le-Revard": null,
"Akkrum": null,
"Alassio": null,
"Alba Iulia": null,
"Albate-Camerlata": null,
"Albbruck": null,
"Albenga": null,
"Albersdorf": null,
"Albersweiler(Pfalz)": null,
"Albertville": null,
@ -304,8 +303,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Aschendorf": null,
"Aschersleben": null,
"Ashausen": null,
"Ashford(Kent)": null,
"Ashford(Kent) Int.": null,
"Asperg": null,
"Asse": null,
"Asselheim": null,
@ -595,6 +592,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Barnten": null,
"Barrien": null,
"Barsinghausen": null,
"Bartenheim(Bale)": null,
"Barth": null,
"Barthmühle": null,
"Baruth(Mark)": null,
@ -1247,6 +1245,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Britz": null,
"Brixen im Thale": null,
"Brixlegg": null,
"Brno hl.n.": null,
"Brocken": null,
"Brockhöfe": null,
"Broderstorf": null,
@ -1513,7 +1512,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Chemnitz Schneeberger Straße": null,
"Chemnitz Schule Altchemnitz": null,
"Chemnitz Stadlerplatz": null,
"Chemnitz Stefan-Heym-Platz": null,
"Chemnitz Süd": null,
"Chemnitz TU Campus": null,
"Chemnitz Technopark": null,
@ -1738,7 +1736,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Deventer": null,
"Deventer Colmschate": null,
"Devinska Nova Ves": null,
"Diano Marina": null,
"Didam": null,
"Diebach": null,
"Dieburg": null,
@ -2008,7 +2005,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Düsseldorf-Unterrath": null,
"Düsseldorf-Zoo": null,
"Dütschow": null,
"Ebbsfleet International Eurostar": null,
"Ebelsbach-Eltmann": null,
"Eben im Pongau": null,
"Ebenfurth": null,
@ -2295,6 +2291,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Eschweiler-Weisweiler": null,
"Eschweiler-West": null,
"Esens(Ostfriesl)": null,
"Eslöv station": null,
"Espelkamp": null,
"Espenau-Mönchehof": null,
"Essel": null,
@ -2392,7 +2389,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Feilitzsch": null,
"Feldafing": null,
"Feldbach/Raab": null,
"Feldberg(Meckl)": null,
"Feldberg-Bärental": null,
"Felde": null,
"Feldhausen": null,
@ -2421,7 +2417,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Filderstadt": null,
"Filisur": null,
"Filsen": null,
"Finale Ligure Marina": null,
"Finkenheerd": null,
"Finkenkrug": null,
"Finnentrop": null,
@ -3123,6 +3118,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Haarhausen": null,
"Haarlem": null,
"Haarlem Spaarnwoude": null,
"Habsheim(Mulh)": null,
"Hachenburg": null,
"Hadamar": null,
"Hademarschen": null,
@ -3569,6 +3565,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Hesseneck Schöllenbach": null,
"Hessisch Oldendorf": null,
"Hetschburg": null,
"Hettange Grande": null,
"Hettenhausen": null,
"Hettingen(Hohenz)": null,
"Hettstedt": null,
@ -3730,6 +3727,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Hornstorf": null,
"Horovice": null,
"Horrem": null,
"Horsens st": null,
"Horst(Holst)": null,
"Horst-Sevenum": null,
"Hosena": null,
@ -3770,6 +3768,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Hämelerwald": null,
"Hämerten": null,
"Händelstraße, Karlsruhe": null,
"Hässleholm Central": null,
"Häuserhof": null,
"Höchst Hetschbach": null,
"Höchst Mümling-Grumbach": null,
@ -4016,7 +4015,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Kappelrodeck": null,
"Kappelrodeck Ost": null,
"Kapsweyer": null,
"Kargow": null,
"Karlovy Vary": null,
"Karlovy Vary dolni n.": null,
"Karlsburg": null,
@ -4168,7 +4166,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Klaus in Vorarlberg": null,
"Klecken": null,
"Kledering b.Wien": null,
"Kleeth": null,
"Klein Bünzow": null,
"Klein Gerau": null,
"Klein Winternheim-Ober Olm": null,
@ -4200,7 +4197,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Klinikum Bremen-Nord/Beckedorf": null,
"Klitschmar": null,
"Klitten": null,
"Klockow(b Waren/Müritz)": null,
"Kloster Bronnbach": null,
"Kloster Marienthal": null,
"Kloster Oesede": null,
@ -4731,6 +4727,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Leverkusen-Schlebusch": null,
"Lezignan": null,
"Liberec": null,
"Libramont": null,
"Lich(Oberhess)": null,
"Lichtenberg(Erzgeb)": null,
"Lichtenfels": null,
@ -4780,6 +4777,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Linkenheim Rathaus": null,
"Linkenheim Schulzentrum, Linkenheim-Hochstetten": null,
"Linkenheim Süd, Linkenheim-Hochstetten": null,
"Linköping Central": null,
"Linnich Bhf": null,
"Linnich-Tetz": null,
"Linsburg": null,
@ -4993,6 +4991,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Mainz-Mombach": null,
"Maisach": null,
"Maishofen-Saalbach": null,
"Maizieres-les-Metz": null,
"Mala Velen": null,
"Malbork": null,
"Malchin": null,
@ -5040,6 +5039,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Marbach(b Münsingen)": null,
"Marbach-Grafeneck": null,
"Marbeck-Heiden": null,
"Marbehan": null,
"Marburg Süd": null,
"Marburg(Lahn)": null,
"Marche-les-Dames": null,
@ -5219,6 +5219,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Mettlach": null,
"Mettmann Stadtwald": null,
"Mettmann Zentrum": null,
"Metz Nord": null,
"Metz Ville": null,
"Metzingen(Württ)": null,
"Metzingen-Neuhausen": null,
@ -5246,6 +5247,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Mikulasovice dolni nadrazi": null,
"Milano Centrale": null,
"Milano Greco Pirelli": null,
"Milano Lambrate": null,
"Milano Porta Garibaldi": null,
"Millingen(b Rees)": null,
"Millingen(b Rheinb)": null,
@ -5676,7 +5678,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Neureut Bärenweg, Karlsruhe": null,
"Neureut Welschneureuter Straße, Karlsruhe": null,
"Neuruppin Rheinsberger Tor": null,
"Neuruppin Seedamm": null,
"Neuruppin West": null,
"Neusalza-Spremberg": null,
"Neuses(b Kronach)": null,
@ -5849,6 +5850,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Nordwalde": null,
"Norf": null,
"Norheim": null,
"Norrköping Central": null,
"Norsingen": null,
"Northeim(Han)": null,
"Nortorf": null,
@ -5874,6 +5876,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Nyborg st": null,
"Nyiregyhaza": null,
"Nymburk hl.n.": null,
"Nässjö Central": null,
"Nîmes": null,
"Nöbdenitz": null,
"Nördlingen": null,
@ -5996,7 +5999,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Oberzell": null,
"Oberzissen": null,
"Oberöwisheim": null,
"Obing": null,
"Obourg": null,
"Obstfelderschmiede": null,
"Ochenbruck": null,
@ -6018,6 +6020,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Oelsnitz(Erzgeb)": null,
"Oelsnitz(Vogtl)": null,
"Oerel": null,
"Oerestad st": null,
"Oerlenbach": null,
"Oerlinghausen": null,
"Oermingen": null,
@ -6280,13 +6283,13 @@ document.addEventListener('DOMContentLoaded', function() {
"Pirna-Copitz": null,
"Pirna-Copitz Nord": null,
"Pisa Centrale": null,
"Pittenhart": null,
"Plaaz": null,
"Plaidt": null,
"Planegg": null,
"Plate(Meckl)": null,
"Plattling": null,
"Platz der Deutschen Einheit, Kassel": null,
"Plau am See Bahnhof": null,
"Plaue(Thür)": null,
"Plauen(V) unt Bf": null,
"Plauen(Vogtl) Mitte": null,
@ -6378,7 +6381,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Pritzwalk": null,
"Pritzwalk Hainholz": null,
"Pritzwalk West": null,
"Probsteierhagen": null,
"Probstzella": null,
"Profen": null,
"Profondsart": null,
@ -6450,7 +6452,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Radldorf(Niederbay)": null,
"Radolfzell": null,
"Radstadt": null,
"Raestrup-Everswinkel": null,
"Rafz": null,
"Raguhn": null,
"Rahden": null,
@ -6668,6 +6669,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Ritterhude": null,
"Rivera-Bironico": null,
"Rivesaltes": null,
"Rixheim(Mulhouse)": null,
"Roanne": null,
"Robilante": null,
"Roccavione": null,
@ -6912,7 +6914,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Samstagern": null,
"Samtens": null,
"San Candido/Innichen": null,
"San Remo": null,
"Sand(Niederbay)": null,
"Sande": null,
"Sandebeck": null,
@ -6952,7 +6953,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Saumur Rive Droit": null,
"Sauwerd": null,
"Saverne": null,
"Savona": null,
"Schaan-Vaduz": null,
"Schaerbeek": null,
"Schafbrücke": null,
@ -7166,7 +7166,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Schönfließ(b Oranienburg)": null,
"Schöngeising": null,
"Schönhausen(Elbe)": null,
"Schönkirchen Bf": null,
"Schönmünzach": null,
"Schönow(Angerm)": null,
"Schönstedt": null,
@ -7233,6 +7232,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Selm-Beifang": null,
"Seltendorf": null,
"Selzthal": null,
"Semmering": null,
"Senden": null,
"Senden-Bösensell": null,
"Senftenberg": null,
@ -7264,6 +7264,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Siegsdorf": null,
"Sieniawa Zarska": null,
"Sierck-les-Bains": null,
"Sierentz": null,
"Sierksdorf": null,
"Sierre/Siders": null,
"Siersburg": null,
@ -7306,6 +7307,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Sittard": null,
"Sitzendorf-Unterweißbach": null,
"Skaerbaek st": null,
"Skanderborg st": null,
"Slagelse st": null,
"Slavonski Brod": null,
"Sliedrecht": null,
@ -7410,6 +7412,7 @@ document.addEventListener('DOMContentLoaded', function() {
"St-Jean-de-Maurienne Arvan": null,
"St-Jory(Toulouse)": null,
"St-Louis (Haut-Rhin)": null,
"St-Louis-la-Chaussee": null,
"St-Maurice(CH)": null,
"St-Michel-Valloire": null,
"St-Pierre-dAlbigny": null,
@ -7653,6 +7656,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Szolnok": null,
"Sättelstädt": null,
"Sélestat": null,
"Södertälje Syd station": null,
"Söllingen Kapellenstraße": null,
"Söllingen Reetzstr.": null,
"Söllingen(b Karlsr)": null,
@ -7694,7 +7698,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Taucha(Leipzig)": null,
"Taufkirchen": null,
"Taufkirchen an der Pram": null,
"Taulov st": null,
"Tautenhain": null,
"Taverne-Torricella": null,
"Taxenbach-Rauris": null,
@ -7722,7 +7725,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Tenneck": null,
"Teplice v Cechach": null,
"Terborg": null,
"Terespol": null,
"Terfens-Weer": null,
"Tergnier": null,
"Teschenhagen": null,
@ -7817,7 +7819,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Trechtingshausen": null,
"Treibach-Althofen": null,
"Treis-Karden": null,
"Trelleborg F": null,
"Trento": null,
"Treuchtlingen": null,
"Treuen": null,
@ -7988,7 +7989,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Vaihingen(Enz)Nord": null,
"Vaires Torcy": null,
"Val-de-Reuil": null,
"Valby(Koebenhavn)": null,
"Valdaora-Anterselva/Olang-Antholz": null,
"Valdek": null,
"Valence TGV": null,
@ -8021,6 +8021,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Vehlefanz": null,
"Veilsdorf": null,
"Veitshöchheim": null,
"Vejle st": null,
"Velbert Rosenhügel": null,
"Velbert-Langenberg": null,
"Velbert-Neviges": null,
@ -8084,6 +8085,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Villingen-Schwenningen Eisstadion": null,
"Villingen-Schwenningen Hammerstatt": null,
"Villmar": null,
"Vils Stadt": null,
"Vils in Tirol": null,
"Vilsbiburg": null,
"Vilseck": null,
@ -8106,7 +8108,6 @@ document.addEventListener('DOMContentLoaded', function() {
"Voerendaal": null,
"Vogelsang(Gransee)": null,
"Vogelweh": null,
"Voghera": null,
"Vohburg": null,
"Vohren": null,
"Voigtsgrün": null,
@ -8205,6 +8206,7 @@ document.addEventListener('DOMContentLoaded', function() {
"Walsrode": null,
"Waltershausen": null,
"Waltershausen Schnepfenthal": null,
"Walygator Parc": null,
"Wandersleben": null,
"Wandlitz": null,
"Wandlitzsee": null,

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
$(document).ready(function(){function e(){return $("div.geolocation div.progress")}var t=function(t,n,o){e().remove();var r=$(document.createElement("div"));r.attr("class","error"),r.text(n);var i=$(document.createElement("strong"));i.text(t),r.prepend(i),$("div.geolocation").append(r)},n=function(n){n.error?t("Backend-Fehler:",n.error):0==n.candidates.length?t("Keine Bahnhöfe in 70km Umkreis gefunden",""):(resultTable=$("<table><tbody></tbody></table>"),resultBody=resultTable.children(),$.each(n.candidates,function(e,t){var n=t.ds100,o=t.name,r=t.distance;r=r.toFixed(1);var i=$(document.createElement("a"));i.attr("href",n),i.text(o),resultBody.append('<tr><td><a href="/s/'+n+'">'+o+"</a></td></tr>")}),e().replaceWith(resultTable))},o=function(e){$.post("/geolocation",{lon:e.coords.longitude,lat:e.coords.latitude},n)},r=function(e){e.code==e.PERMISSION_DENIED?t("Standortanfrage nicht möglich.","Vermutlich fehlen die Rechte im Browser oder der Android Location Service ist deaktiviert."):e.code==e.POSITION_UNAVAILABLE?t("Standort konnte nicht ermittelt werden","(Service nicht verfügbar)"):e.code==e.TIMEOUT?t("Standort konnte nicht ermittelt werden","(Timeout)"):t("Standort konnte nicht ermittelt werden","(unbekannter Fehler)")},i=$("div.geolocation > button"),a=function(){i.replaceWith($('<p class="geolocationhint">Stationen in der Umgebung:</p><div class="progress"><div class="indeterminate"></div></div>')),navigator.geolocation.getCurrentPosition(o,r)};i.length&&(navigator.geolocation?navigator.permissions?navigator.permissions.query({name:"geolocation"}).then(function(e){"prompt"===e.state?i.on("click",a):a()}):i.on("click",a):t("Standortanfragen werden von diesem Browser nicht unterstützt",""))});
$(document).ready(function(){function r(){return $("div.geolocation div.progress")}function e(e){$.post("/geolocation",{lon:e.coords.longitude,lat:e.coords.latitude},i)}function t(e){e.code==e.PERMISSION_DENIED?o("Standortanfrage nicht möglich.","Vermutlich fehlen die Rechte im Browser oder der Android Location Service ist deaktiviert.","geolocation.error.PERMISSION_DENIED"):e.code==e.POSITION_UNAVAILABLE?o("Standort konnte nicht ermittelt werden","(Service nicht verfügbar)","geolocation.error.POSITION_UNAVAILABLE"):e.code==e.TIMEOUT?o("Standort konnte nicht ermittelt werden","(Timeout)","geolocation.error.TIMEOUT"):o("Standort konnte nicht ermittelt werden","(unbekannter Fehler)","unknown geolocation.error code")}function n(){a.replaceWith($('<p class="geolocationhint">Stationen in der Umgebung:</p><div class="progress"><div class="indeterminate"></div></div>')),navigator.geolocation.getCurrentPosition(e,t)}var o=function(e,t,n){r().remove();var o=$(document.createElement("div"));o.attr("class","error"),o.text(t);t=$(document.createElement("strong"));t.text(e),o.prepend(t),$("div.geolocation").append(o)},i=function(e){e.error?o("Backend-Fehler:",e.error,null):0==e.candidates.length?o("Keine Bahnhöfe in 70km Umkreis gefunden","",null):(resultTable=$("<table><tbody></tbody></table>"),resultBody=resultTable.children(),$.each(e.candidates,function(e,t){var n=t.ds100,o=t.name,t=(t.distance.toFixed(1),$(document.createElement("a")));t.attr("href",n),t.text(o),resultBody.append('<tr><td><a href="/s/'+n+'">'+o+"</a></td></tr>")}),r().replaceWith(resultTable))},a=$("div.geolocation > button");a.length&&(navigator.geolocation?navigator.permissions?navigator.permissions.query({name:"geolocation"}).then(function(e){"prompt"===e.state?a.on("click",n):n()}):a.on("click",n):o("Standortanfragen werden von diesem Browser nicht unterstützt","",null))});

View file

@ -1 +1 @@
function upd_journey_data(){$(".countdown").each(function(){var t=$(this).data("journey");t&&(t=t.split(";"),j_departure=parseInt(t[0]),j_arrival=parseInt(t[1]),j_duration=j_arrival-j_departure);var e=$(this).data("dest");e&&(j_dest=e);var a=$(this).data("route");if(a){a=a.split("|"),j_stops=[];for(var n in a){for(var o=a[n].split(";"),r=1;r<5;r++)o[r]=parseInt(o[r]);j_stops.push(o)}}})}function upd_countdown(){var t=Date.now()/1e3;j_departure>t?$(".countdown").text("Abfahrt in "+Math.round((j_departure-t)/60)+" Minuten"):j_arrival>0&&(j_arrival>t?$(".countdown").text("Ankunft in "+Math.round((j_arrival-t)/60)+" Minuten"):$(".countdown").text("Ziel erreicht"))}function hhmm(t){var e=new Date(1e3*t),a=e.getHours(),n=e.getMinutes();return(a<10?"0"+a:a)+":"+(n<10?"0"+n:n)}function odelay(t,e){return t<e?" (+"+(e-t)/60+")":t==e?"":" ("+(e-t)/60+")"}function tvly_run(t,e,a){var n='<i class="material-icons">error</i>',o=$('<div class="progress"><div class="indeterminate"></div></div>');t.hide(),t.after(o),$.post("/action",e,function(e){e.success?$(location).attr("href",e.redirect_to):(M.toast({html:n+" "+e.error}),o.remove(),a&&a(),t.append(" "+n),t.show())})}function tvly_update(){$.get("/ajax/status_card.html",function(t){$(".statuscol").html(t),tvly_reg_handlers(),upd_journey_data(),setTimeout(tvly_update,4e4)}).fail(function(){$(".sync-failed-marker").css("display","block"),upd_countdown(),setTimeout(tvly_update,5e3)})}function tvly_update_public(){var t;$(".publicstatuscol").each(function(){t=$(this).data("user")}),$.get("/ajax/status/"+t+".html",function(t){$(".publicstatuscol").html(t),upd_journey_data(),setTimeout(tvly_update_public,4e4)}).fail(function(){$(".sync-failed-marker").css("display","block"),upd_countdown(),setTimeout(tvly_update_public,5e3)})}function tvly_journey_progress(){var t=Date.now()/1e3,e=0;if(j_duration>0){e=1-(j_arrival-t)/j_duration,e<0&&(e=0),e>1&&(e=1),$(".progress .determinate").css("width",100*e+"%");for(stop in j_stops){var a=j_stops[stop][0],n=j_stops[stop][1],o=j_stops[stop][2],r=j_stops[stop][3],i=j_stops[stop][4];if(a==j_dest){$(".next-stop").html("");break}if(0!=o&&o-t>0){$(".next-stop").html(a+"<br/>"+hhmm(o)+odelay(n,o));break}if(0!=i&&i-t>0){$(".next-stop").html(a+"<br/>"+hhmm(o)+" → "+hhmm(i)+odelay(r,i));break}}setTimeout(tvly_journey_progress,5e3)}}function tvly_reg_handlers(){$(".action-checkin").click(function(){var t=$(this);tvly_run(t,{action:"checkin",station:t.data("station"),train:t.data("train"),dest:t.data("dest")})}),$(".action-checkout").click(function(){var t=$(this),e={action:"checkout",station:t.data("station"),force:t.data("force")};tvly_run(t,e,function(){t.append(" Ohne Echtzeitdaten auschecken?"),t.data("force",!0)})}),$(".action-undo").click(function(){var t=$(this),e=Date.now()/1e3,a=parseInt(t.data("checkints")),n={action:"undo",undo_id:t.data("id")},o=!0;e-a>900&&(o=confirm("Checkin wirklich rückgängig machen? Er kann ggf. nicht wiederholt werden.")),o&&tvly_run(t,n)}),$(".action-cancelled-from").click(function(){var t=$(this);tvly_run(t,{action:"cancelled_from",station:t.data("station"),train:t.data("train")})}),$(".action-cancelled-to").click(function(){var t=$(this);tvly_run(t,{action:"cancelled_to",station:t.data("station"),force:!0})}),$(".action-delete").click(function(){var t=$(this),e={action:"delete",id:t.data("id"),checkin:t.data("checkin"),checkout:t.data("checkout")};confirm("Diese Zugfahrt wirklich löschen? Der Eintrag wird sofort aus der Datenbank entfernt und kann nicht wiederhergestellt werden.")&&tvly_run(t,e)}),$(".action-share").click(function(){var t=$(this).data("text"),e=$(this).data("url");if(navigator.share)shareObj={text:t},e&&(shareObj.url=e),navigator.share(shareObj);else{var a=document.createElement("textarea");e&&(t+=" "+e),a.value=t,a.setAttribute("readonly",""),a.style.position="absolute",a.style.left="-9999px",document.body.appendChild(a),a.select(),a.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(a),M.toast({html:"Text kopiert: „"+t+"“"})}})}var j_departure=0,j_duration=0,j_arrival=0,j_dest="",j_stops=[];$(document).ready(function(){tvly_reg_handlers(),$(".statuscol .autorefresh").length&&(upd_journey_data(),setTimeout(tvly_update,4e4),setTimeout(tvly_journey_progress,5e3)),$(".publicstatuscol .autorefresh").length&&(upd_journey_data(),setTimeout(tvly_update_public,4e4),setTimeout(tvly_journey_progress,5e3)),$("a[href]").click(function(){$("nav .preloader-wrapper").addClass("active")})});
var j_departure=0,j_duration=0,j_arrival=0,j_dest="",j_stops=[];function upd_journey_data(){$(".countdown").each(function(){var t=$(this).data("journey");t&&(t=t.split(";"),j_departure=parseInt(t[0]),j_arrival=parseInt(t[1]),j_duration=j_arrival-j_departure);t=$(this).data("dest");t&&(j_dest=t);var e=$(this).data("route");if(e)for(var a in e=e.split("|"),j_stops=[],e){for(var n=e[a].split(";"),o=1;o<5;o++)n[o]=parseInt(n[o]);j_stops.push(n)}})}function upd_countdown(){var t=Date.now()/1e3;t<j_departure?$(".countdown").text("Abfahrt in "+Math.round((j_departure-t)/60)+" Minuten"):0<j_arrival&&(t<j_arrival?$(".countdown").text("Ankunft in "+Math.round((j_arrival-t)/60)+" Minuten"):$(".countdown").text("Ziel erreicht"))}function hhmm(t){var e=new Date(1e3*t),t=e.getHours(),e=e.getMinutes();return(t<10?"0"+t:t)+":"+(e<10?"0"+e:e)}function odelay(t,e){return t<e?" (+"+(e-t)/60+")":t==e?"":" ("+(e-t)/60+")"}function tvly_run(e,t,a){var n='<i class="material-icons">error</i>',o=$('<div class="progress"><div class="indeterminate"></div></div>');e.hide(),e.after(o),$.post("/action",t,function(t){t.success?$(location).attr("href",t.redirect_to):(M.toast({html:n+" "+t.error}),o.remove(),a&&a(),e.append(" "+n),e.show())})}function tvly_update(){$.get("/ajax/status_card.html",function(t){$(".statuscol").html(t),tvly_reg_handlers(),upd_journey_data(),setTimeout(tvly_update,4e4)}).fail(function(){$(".sync-failed-marker").css("display","block"),upd_countdown(),setTimeout(tvly_update,5e3)})}function tvly_update_public(){var t;$(".publicstatuscol").each(function(){t=$(this).data("user")}),$.get("/ajax/status/"+t+".html",function(t){$(".publicstatuscol").html(t),upd_journey_data(),setTimeout(tvly_update_public,4e4)}).fail(function(){$(".sync-failed-marker").css("display","block"),upd_countdown(),setTimeout(tvly_update_public,5e3)})}function tvly_journey_progress(){var t=Date.now()/1e3,e=0;if(0<j_duration){for(stop in 1<(e=(e=1-(j_arrival-t)/j_duration)<0?0:e)&&(e=1),$(".progress .determinate").css("width",100*e+"%"),j_stops){var a=j_stops[stop][0],n=j_stops[stop][1],o=j_stops[stop][2],r=j_stops[stop][3],i=j_stops[stop][4];if(a==j_dest){$(".next-stop").html("");break}if(0!=o&&0<o-t){$(".next-stop").html(a+"<br/>"+hhmm(o)+odelay(n,o));break}if(0!=i&&0<i-t){$(".next-stop").html(a+"<br/>"+hhmm(o)+" → "+hhmm(i)+odelay(r,i));break}}setTimeout(tvly_journey_progress,5e3)}}function tvly_reg_handlers(){$(".action-checkin").click(function(){var t=$(this),e={action:"checkin",station:t.data("station"),train:t.data("train"),dest:t.data("dest")};tvly_run(t,e)}),$(".action-checkout").click(function(){var t=$(this),e={action:"checkout",station:t.data("station"),force:t.data("force")};tvly_run(t,e,function(){t.append(" Ohne Echtzeitdaten auschecken?"),t.data("force",!0)})}),$(".action-undo").click(function(){var t=$(this),e=Date.now()/1e3,a=parseInt(t.data("checkints")),n={action:"undo",undo_id:t.data("id")},o=!0;(o=900<e-a?confirm("Checkin wirklich rückgängig machen? Er kann ggf. nicht wiederholt werden."):o)&&tvly_run(t,n)}),$(".action-cancelled-from").click(function(){var t=$(this),e={action:"cancelled_from",station:t.data("station"),train:t.data("train")};tvly_run(t,e)}),$(".action-cancelled-to").click(function(){var t=$(this),e={action:"cancelled_to",station:t.data("station"),force:!0};tvly_run(t,e)}),$(".action-delete").click(function(){var t=$(this),e={action:"delete",id:t.data("id"),checkin:t.data("checkin"),checkout:t.data("checkout")};confirm("Diese Zugfahrt wirklich löschen? Der Eintrag wird sofort aus der Datenbank entfernt und kann nicht wiederhergestellt werden.")&&tvly_run(t,e)}),$(".action-share").click(function(){var t=$(this).data("text"),e=$(this).data("url");navigator.share?(shareObj={text:t},e&&(shareObj.url=e),navigator.share(shareObj)):(e&&(t+=" "+e),(e=document.createElement("textarea")).value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(e),M.toast({html:"Text kopiert: „"+t+"“"}))})}$(document).ready(function(){tvly_reg_handlers(),$(".statuscol .autorefresh").length&&(upd_journey_data(),setTimeout(tvly_update,4e4),setTimeout(tvly_journey_progress,5e3)),$(".publicstatuscol .autorefresh").length&&(upd_journey_data(),setTimeout(tvly_update_public,4e4),setTimeout(tvly_journey_progress,5e3)),$("a[href]").click(function(){$("nav .preloader-wrapper").addClass("active")})});

View file

@ -3,27 +3,27 @@
"short_name": "Travelynx",
"scope": "/",
"icons": [{
"src": "/static/v37/icons/icon-128x128.png",
"src": "/static/v38/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
}, {
"src": "/static/v37/icons/icon-144x144.png",
"src": "/static/v38/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
}, {
"src": "/static/v37/icons/icon-152x152.png",
"src": "/static/v38/icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png"
}, {
"src": "/static/v37/icons/icon-192x192.png",
"src": "/static/v38/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
}, {
"src": "/static/v37/icons/icon-256x256.png",
"src": "/static/v38/icons/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
}, {
"src": "/static/v37/icons/icon-512x512.png",
"src": "/static/v38/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}],

View file

@ -13,7 +13,7 @@
% while (my ($key, $value) = each %{stash('opengraph') // {}}) {
<meta property="og:<%= $key %>" content="<%= $value %>">
% }
% my $av = 'v37'; # asset version
% my $av = 'v38'; # asset version
<link rel="icon" type="image/png" href="/static/<%= $av %>/icons/icon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/static/<%= $av %>/icons/icon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/static/<%= $av %>/icons/icon-96x96.png" sizes="96x96">