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 timetable = target.querySelector("td div.detailContainer table.result tbody");
var products = timetable.querySelectorAll("tr.first td.products"); var products = timetable.querySelectorAll("tr.first td.products");
products.forEach((product) => { products.forEach((product) => {
var train_name = bahnParseTrainName(product.querySelector("span a").innerText); var train_names = product.querySelectorAll("span a");
if(typeof train_name !== 'undefined') { train_names.forEach((train) => {
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_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"); var stations = timetable.querySelectorAll("tr td.station");
stations.forEach((station) => { stations.forEach((station) => {