Add train id to data
This commit is contained in:
parent
efec9271c3
commit
5c89d26691
@ -193,6 +193,7 @@ var connection_result_observer = new MutationObserver((mutations) => {
|
|||||||
|
|
||||||
// Prodcut details
|
// Prodcut details
|
||||||
data[i]["products"][j]["product"] = null;
|
data[i]["products"][j]["product"] = null;
|
||||||
|
data[i]["products"][j]["train_id"] = null;
|
||||||
data[i]["products"][j]["train_number"] = null;
|
data[i]["products"][j]["train_number"] = null;
|
||||||
data[i]["products"][j]["line_name"] = null;
|
data[i]["products"][j]["line_name"] = null;
|
||||||
|
|
||||||
@ -201,14 +202,15 @@ var connection_result_observer = new MutationObserver((mutations) => {
|
|||||||
// Product name in format "STB 12 (23561)"
|
// Product name in format "STB 12 (23561)"
|
||||||
if(name_list.length == 3 && name_list[2].charAt(0) == '(' && name_list[2].charAt(name_list[2].length-1) == ')') {
|
if(name_list.length == 3 && name_list[2].charAt(0) == '(' && name_list[2].charAt(name_list[2].length-1) == ')') {
|
||||||
data[i]["products"][j]["product"] = name_list[0];
|
data[i]["products"][j]["product"] = name_list[0];
|
||||||
data[i]["products"][j]["train_number"] = name_list[0] + " " + name_list[2].substring(1, name_list[2].length-1);
|
data[i]["products"][j]["train_id"] = name_list[2].substring(1, name_list[2].length-1)
|
||||||
data[i]["products"][j]["line_name"] = name_list[0] + " " + name_list[1];
|
data[i]["products"][j]["line_name"] = name_list[0] + " " + name_list[1];
|
||||||
}
|
}
|
||||||
// Product name in format "ICE 234"
|
// Product name in format "ICE 234"
|
||||||
else {
|
else {
|
||||||
data[i]["products"][j]["product"] = name_list[0];
|
data[i]["products"][j]["product"] = name_list[0];
|
||||||
data[i]["products"][j]["train_number"] = name_list[0] + " " + name_list[1];
|
data[i]["products"][j]["train_id"] = name_list[1];
|
||||||
}
|
}
|
||||||
|
data[i]["products"][j]["train_number"] = data[i]["products"][j]["product"] + " " + data[i]["products"][j]["train_id"];
|
||||||
});
|
});
|
||||||
|
|
||||||
// Travel information
|
// Travel information
|
||||||
|
Loading…
Reference in New Issue
Block a user