From e8c6d3bfc5996ff4216091372d824192258244dc Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Sun, 22 Jan 2023 10:30:02 +0000 Subject: [PATCH] Add operator names Signed-off-by: Fred Boniface --- static/index.html | 2 +- static/js/boards.js | 43 +++++++++++++++++++++++++++++++++++++++ static/js/public-board.js | 10 +++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index a73f85a..3662a2d 100644 --- a/static/index.html +++ b/static/index.html @@ -55,7 +55,7 @@

This is a development release and is under testing.

-

Departure boards do not yet work and data may be stale.

+

Data may be stale.

Customise your quick links on the `Settings` page.

diff --git a/static/js/boards.js b/static/js/boards.js index 5713182..578e6cc 100644 --- a/static/js/boards.js +++ b/static/js/boards.js @@ -103,4 +103,47 @@ async function deflateAlerts() { document.getElementById("alerts_msg").style = "display.none;"; document.getElementById("alert_expand_arrow").style = "transform: rotate(0deg);"; document.getElementById("alerts_bar").setAttribute("onclick", "inflateAlerts()") +} + +async function buildPrevCalls(data) { + /* + $data: + "previousCallingPoints":{ + "callingPointList":{ + "callingPoint":[ + { + "locationName":"Rhymney", + "crs":"RHY", + "st":"10:27", + "at":"10:32" + }, + { + "locationName":"Pontlottyn", + "crs":"PLT", + "st":"10:30", + "at":"10:36" + }... + ] + */ +} + +async function builtNextCalls(data) { + /* + $data: + "subsequentCallingPoints":{ + "callingPointList":{ + "callingPoint":[ + { + "locationName":"Pye Corner", + "crs":"PYE", + "st":"11:53", + "et":"On time" + }, + {"locationName":"Rogerstone", + "crs":"ROR", + "st":"11:57", + "et":"On time" + }... + } + */ } \ No newline at end of file diff --git a/static/js/public-board.js b/static/js/public-board.js index e7d9b38..5a0fa63 100644 --- a/static/js/public-board.js +++ b/static/js/public-board.js @@ -141,6 +141,11 @@ async function displayService(svc) { ` // Put Table Row table.insertAdjacentHTML("beforeend", row) + // Display Operator + if (svc.operator) { + var opRow = `

A ${svc.operator} service

` + table.insertAdjacentHTML("beforeend", opRow); + } // Parse cancelReason & delayReason if (svc.cancelReason) { var cancelRow = `

${svc.cancelReason}

` @@ -214,6 +219,11 @@ async function displayBusService(svc) { ` // Put Table Row table.insertAdjacentHTML("beforeend", row) + // Display operator + if (svc.operator) { + var opRow = `

A ${svc.operator} service

` + table.insertAdjacentHTML("beforeend", opRow); + } // Parse cancelReason & delayReason if (svc.cancelReason) { var cancelRow = `

${svc.cancelReason}

`