1
0

Mind multiple train names for one train

This commit is contained in:
clerie 2020-09-16 14:18:20 +02:00
parent 0c17dfc94f
commit d4d97d899d

View File

@ -40,10 +40,13 @@ var observer = new MutationObserver((mutations, observer) => {
var timetable = target.querySelector("td div.detailContainer table.result tbody");
var products = timetable.querySelectorAll("tr.first td.products");
products.forEach((product) => {
var train_name = bahnParseTrainName(product.querySelector("span a").innerText);
if(typeof train_name !== 'undefined') {
product.innerHTML = product.innerHTML + ' <a href="https://marudor.de/details/' + train_name + '" target="_blank"><img src="' + getMediaURL("marudor.svg") + '" style="height: 2em; vertical-align:middle;"></a>';
}
var train_names = product.querySelectorAll("span a");
train_names.forEach((train) => {
var train_name = bahnParseTrainName(train.innerText);
if(typeof train_name !== 'undefined') {
product.innerHTML = product.innerHTML + ' <a href="https://marudor.de/details/' + train_name + '" target="_blank"><img src="' + getMediaURL("marudor.svg") + '" style="height: 2em; vertical-align:middle;"></a>';
}
});
});
var stations = timetable.querySelectorAll("tr td.station");
stations.forEach((station) => {