mirror of
https://github.com/Threnklyn/myBahn.git
synced 2026-05-18 20:23:29 +02:00
Fixes für geändertes Format vom DB-Abfrageergebnis
This commit is contained in:
+2
-26
@@ -64,11 +64,6 @@ static void prv_create_default_settings() {
|
|||||||
settings.default_products.ast = true;
|
settings.default_products.ast = true;
|
||||||
|
|
||||||
int i = -1;
|
int i = -1;
|
||||||
i++;
|
|
||||||
strcpy(settings.stations[i].ibnr, "8006596");
|
|
||||||
strcpy(settings.stations[i].title, "Wpt. Barmen");
|
|
||||||
settings.stations[i].is_enabled = true;
|
|
||||||
settings.stations[i].use_default_products = true;
|
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
strcpy(settings.stations[i].ibnr, "8003368");
|
strcpy(settings.stations[i].ibnr, "8003368");
|
||||||
@@ -137,30 +132,11 @@ static void prv_create_default_settings() {
|
|||||||
settings.connections[i].allowed_products.ubahn = true;
|
settings.connections[i].allowed_products.ubahn = true;
|
||||||
settings.connections[i].allowed_products.tram = true;
|
settings.connections[i].allowed_products.tram = true;
|
||||||
settings.connections[i].allowed_products.ast = true;
|
settings.connections[i].allowed_products.ast = true;
|
||||||
|
|
||||||
i++;
|
|
||||||
strcpy(settings.connections[i].start_ibnr, "8000266");
|
|
||||||
strcpy(settings.connections[i].dest_ibnr, "8006596");
|
|
||||||
strcpy(settings.connections[i].title, "Wpt. Hbf");
|
|
||||||
strcpy(settings.connections[i].subtitle, "->Wpt. Barmen");
|
|
||||||
settings.connections[i].is_enabled = true;
|
|
||||||
settings.connections[i].use_default_products = false;
|
|
||||||
settings.connections[i].allowed_products.allow_all = false;
|
|
||||||
settings.connections[i].allowed_products.ice = false;
|
|
||||||
settings.connections[i].allowed_products.ic = false;
|
|
||||||
settings.connections[i].allowed_products.ir = false;
|
|
||||||
settings.connections[i].allowed_products.zug = true;
|
|
||||||
settings.connections[i].allowed_products.sbahn = true;
|
|
||||||
settings.connections[i].allowed_products.bus = true;
|
|
||||||
settings.connections[i].allowed_products.schiff = true;
|
|
||||||
settings.connections[i].allowed_products.ubahn = true;
|
|
||||||
settings.connections[i].allowed_products.tram = true;
|
|
||||||
settings.connections[i].allowed_products.ast = true;
|
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
strcpy(settings.connections[i].start_ibnr, "8006596");
|
strcpy(settings.connections[i].start_ibnr, "8000266");
|
||||||
strcpy(settings.connections[i].dest_ibnr, "8003368");
|
strcpy(settings.connections[i].dest_ibnr, "8003368");
|
||||||
strcpy(settings.connections[i].title, "Wpt. Barmen");
|
strcpy(settings.connections[i].title, "Wpt. Hbf");
|
||||||
strcpy(settings.connections[i].subtitle, "->Köln Messe/Deutz");
|
strcpy(settings.connections[i].subtitle, "->Köln Messe/Deutz");
|
||||||
settings.connections[i].is_enabled = true;
|
settings.connections[i].is_enabled = true;
|
||||||
settings.connections[i].use_default_products = false;
|
settings.connections[i].use_default_products = false;
|
||||||
|
|||||||
@@ -5,7 +5,13 @@ function xhrRequest(url, type, callback) {
|
|||||||
var async = callback ? true : false;
|
var async = callback ? true : false;
|
||||||
if (async) {
|
if (async) {
|
||||||
xhr.onreadystatechange = function () {
|
xhr.onreadystatechange = function () {
|
||||||
|
if (!this.readyState) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.readyState === 4) {
|
if (this.readyState === 4) {
|
||||||
|
if (!this.status) {
|
||||||
|
callback(null);
|
||||||
|
}
|
||||||
if (this.status >= 200 && this.status < 300) {
|
if (this.status >= 200 && this.status < 300) {
|
||||||
callback(this.responseText);
|
callback(this.responseText);
|
||||||
} else {
|
} else {
|
||||||
@@ -38,12 +44,12 @@ function extractConnectionResultInfos(text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var detailLinkExp = /a href="([^"]*)"/;
|
var detailLinkExp = /a href="([^"]*)"/;
|
||||||
var zeitExp = /span class="bold">(\d*:\d*)</g;
|
var zeitExp = /span class="bold" *>(\d*:\d*)</g;
|
||||||
var vmExp = /<td class="overview iphonepfeil">([^<]*)</;
|
var vmExp = /<td class="overview iphonepfeil" *>([^<]*)</;
|
||||||
var umstiegeUndDauerExp = /<td class="overview">(\d*) *<br *.>(\d*:\d*)/;
|
var umstiegeUndDauerExp = /<td class="overview" *>(\d*) *<br *.>(\d*:\d*)/;
|
||||||
var delaysExp = /<td class="overview tprt"> *<span[^>]*>(.\d*)<.*<span[^>]*>(.\d*)</;
|
var delaysExp = /<td class="overview tprt" *> *<span[^>]*>(.\d*)<.*<span[^>]*>(.\d*)</;
|
||||||
var nurStartDelayExp = /<td class="overview tprt"> *<span[^>]*>(.\d*)</;
|
var nurStartDelayExp = /<td class="overview tprt" *> *<span[^>]*>(.\d*)</;
|
||||||
var nurZielDelayExp = /<td class="overview tprt"> * .*<span[^>]*>(.\d*)</;
|
var nurZielDelayExp = /<td class="overview tprt" *> * .*<span[^>]*>(.\d*)</;
|
||||||
var achtungExp = /achtung_17x19_mitschatten.png/;
|
var achtungExp = /achtung_17x19_mitschatten.png/;
|
||||||
var ausfallExp = /Icon_Zug_faellt_aus_mit_Schatten_17x19.png/;
|
var ausfallExp = /Icon_Zug_faellt_aus_mit_Schatten_17x19.png/;
|
||||||
var frueherExp = /(http:\/\/reiseauskunft\.bahn\.de\/bin\/query2\.exe\/dox\?[^"]*amp;e=2[^"]*)"/;
|
var frueherExp = /(http:\/\/reiseauskunft\.bahn\.de\/bin\/query2\.exe\/dox\?[^"]*amp;e=2[^"]*)"/;
|
||||||
@@ -73,8 +79,11 @@ function extractConnectionResultInfos(text) {
|
|||||||
zeitExp.lastIndex = 0;
|
zeitExp.lastIndex = 0;
|
||||||
result.von = zeitExp.exec(connectionInfo)[1];
|
result.von = zeitExp.exec(connectionInfo)[1];
|
||||||
result.bis = zeitExp.exec(connectionInfo)[1];
|
result.bis = zeitExp.exec(connectionInfo)[1];
|
||||||
|
|
||||||
result.vm = connectionInfo.match(vmExp)[1].trim();
|
var vm = connectionInfo.match(vmExp);
|
||||||
|
if (vm) {
|
||||||
|
result.vm = vm[1].trim();
|
||||||
|
}
|
||||||
|
|
||||||
var umstiegeUndDauer = connectionInfo.match(umstiegeUndDauerExp);
|
var umstiegeUndDauer = connectionInfo.match(umstiegeUndDauerExp);
|
||||||
if (umstiegeUndDauer) {
|
if (umstiegeUndDauer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user