|
|
@ -257,6 +257,37 @@ function onTrainData(data) { |
|
|
|
stationPlatform.textContent = `platform ${station.platform}` |
|
|
|
stationPlatform.textContent = `platform ${station.platform}` |
|
|
|
stationPlatform.classList.add('thi', 'platform') |
|
|
|
stationPlatform.classList.add('thi', 'platform') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (station.notes && station.notes.length > 0) { |
|
|
|
|
|
|
|
var stationNotes = document.createElement('div') |
|
|
|
|
|
|
|
stationItem.appendChild(stationNotes) |
|
|
|
|
|
|
|
stationNotes.classList.add('notes') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
station.notes.forEach(function (note) { |
|
|
|
|
|
|
|
var noteP = document.createElement('p') |
|
|
|
|
|
|
|
stationNotes.appendChild(noteP) |
|
|
|
|
|
|
|
noteP.classList.add('note', 'thi') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (note.kind) { |
|
|
|
|
|
|
|
case 'departsAs': { |
|
|
|
|
|
|
|
noteP.textContent = `Train departs as ${note.rank} ${note.number}` |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case 'detachingWagons': { |
|
|
|
|
|
|
|
noteP.textContent = `Detaching wagons to ${note.station}` |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case 'receivingWagons': { |
|
|
|
|
|
|
|
noteP.textContent = `Receiving wagons from ${note.station}` |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case 'trainNumberChange': { |
|
|
|
|
|
|
|
noteP.textContent = `Train changes number to ${note.rank} ${note.number}` |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
lastSuccessfulFetch = new Date() |
|
|
|
lastSuccessfulFetch = new Date() |
|
|
|