diff --git a/js/lib.main.js b/js/lib.main.js index abdd41b..e6f2225 100644 --- a/js/lib.main.js +++ b/js/lib.main.js @@ -1,6 +1,6 @@ /* eslint-disable no-unused-vars */ /* All Page Init */ -const version = '2023.5.10' +const version = '2023.6.1' /* Feature Detectors */ diff --git a/js/pis.js b/js/pis.js index 004a511..fd524bd 100644 --- a/js/pis.js +++ b/js/pis.js @@ -23,6 +23,12 @@ async function findByOrigDest() { hideLoading() } +async function findByHeadcode() { + showLoading() + const formData = await fetchHeadcode() + window.location.assign(`./train-detail.html?headcode=${formData}`) +} + async function findByPisCode() { showLoading() const formData = await fetchPisCode() @@ -72,6 +78,10 @@ async function fetchPisCode() { return document.getElementById('pis').value } +async function fetchHeadcode() { + return document.getElementById('headcode').value +} + async function insertData(json) { // Receives the JSON Respose ([{},{}]) containing one or more possible // PIS codes. Display the code and the stops with a method of scrolling between them. diff --git a/pis.html b/pis.html index c383874..328609e 100644 --- a/pis.html +++ b/pis.html @@ -45,6 +45,16 @@

Currently supported (Beta): GWR: ex-Wessex, HEx
Duplicate stopping patterns have been removed.

You need to be logged into a free rail staff version account for this feature.

+

Search by Headcode

+
+
+
+
+

+
+
+ +

Search by CRS Codes

diff --git a/styles/train-detail.css b/styles/train-detail.css index c17be98..742d091 100644 --- a/styles/train-detail.css +++ b/styles/train-detail.css @@ -4,6 +4,16 @@ padding-bottom: 0; } +.service_button { + font-size: 15px; + color: white; + background-color: var(--accent-color); + border: none; + border-radius: 30px; + padding: 10px; + margin: 5px; +} + #data_headcode { color: var(--second-text-color); font-size: 25px; diff --git a/sw.js b/sw.js index d137b65..a83e4fb 100644 --- a/sw.js +++ b/sw.js @@ -1,6 +1,6 @@ /* Service Worker */ -const swVersion = '2023.5.10-1' +const swVersion = '2023.6.1-1' const cacheName = `owlboard-${swVersion}` const cacheIDs = [cacheName] let staticCache = [ @@ -34,8 +34,9 @@ const dynamicCache = [ '/find-code.html', '/settings.html', '/pis.html', - 'stats.html', - 'registered.html', + '/stats.html', + '/registered.html', + '/train-detail.html', '/manifest.json', '/styles/board.css', '/styles/find-code.css', @@ -45,6 +46,7 @@ const dynamicCache = [ '/styles/settings.css', '/styles/pis.css', '/styles/stats.css', + '/styles/train-detail.css', '/js/find-code.js', '/js/index.js', '/js/issue.js', @@ -55,7 +57,8 @@ const dynamicCache = [ '/js/simple-board.js', '/js/pis.js', '/js/stats.js', - '/js/registered.js' + '/js/registered.js', + '/js/train-detail.js' ] for(let i = 0; i < dynamicCache.length; i++) {