1
0

Linking to trains with timestamp

This commit is contained in:
clerie 2020-09-19 23:02:42 +02:00
parent 68301c44d4
commit efec9271c3

View File

@ -237,7 +237,7 @@ var connection_result_observer = new MutationObserver((mutations) => {
product.after(bahn_insight_field);
// Button linking to marudor.de
var marudor_button = domCreateButtonMarudor("/details/" + data[i]["products"][j]["train_number"]);
var marudor_button = domCreateButtonMarudor("/details/" + data[i]["products"][j]["train_number"] + "/" + Date.parse(connection_result_date + " " + data[i]["from"]["time"]));
bahn_insight_field.appendChild(marudor_button);
// Move linebreaks from link inner, after our 'bahn-insight' field
@ -282,6 +282,9 @@ var connection_result_observer = new MutationObserver((mutations) => {
var target = document.getElementById('resultsOverview');
if(typeof target !== 'undefined') {
var connection_result_date = document.querySelector("html body div div div.resultContentHolder form div h2 span").innerText.replace(/(\d{2})\.(\d{2})\.(\d{2})/,'20$3-$2-$1');
connection_result_observer.observe(target, {
subtree: true,
childList: true