Linking to trains with timestamp
This commit is contained in:
parent
68301c44d4
commit
efec9271c3
@ -237,7 +237,7 @@ var connection_result_observer = new MutationObserver((mutations) => {
|
|||||||
product.after(bahn_insight_field);
|
product.after(bahn_insight_field);
|
||||||
|
|
||||||
// Button linking to marudor.de
|
// 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);
|
bahn_insight_field.appendChild(marudor_button);
|
||||||
|
|
||||||
// Move linebreaks from link inner, after our 'bahn-insight' field
|
// 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');
|
var target = document.getElementById('resultsOverview');
|
||||||
|
|
||||||
if(typeof target !== 'undefined') {
|
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, {
|
connection_result_observer.observe(target, {
|
||||||
subtree: true,
|
subtree: true,
|
||||||
childList: true
|
childList: true
|
||||||
|
Loading…
Reference in New Issue
Block a user