Finalise initial release of 'find by headcode', bump version
This commit is contained in:
parent
665de609d0
commit
d2ba491675
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
/* All Page Init */
|
/* All Page Init */
|
||||||
const version = '2023.5.10'
|
const version = '2023.6.1'
|
||||||
|
|
||||||
/* Feature Detectors */
|
/* Feature Detectors */
|
||||||
|
|
||||||
|
10
js/pis.js
10
js/pis.js
@ -23,6 +23,12 @@ async function findByOrigDest() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function findByHeadcode() {
|
||||||
|
showLoading()
|
||||||
|
const formData = await fetchHeadcode()
|
||||||
|
window.location.assign(`./train-detail.html?headcode=${formData}`)
|
||||||
|
}
|
||||||
|
|
||||||
async function findByPisCode() {
|
async function findByPisCode() {
|
||||||
showLoading()
|
showLoading()
|
||||||
const formData = await fetchPisCode()
|
const formData = await fetchPisCode()
|
||||||
@ -72,6 +78,10 @@ async function fetchPisCode() {
|
|||||||
return document.getElementById('pis').value
|
return document.getElementById('pis').value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function fetchHeadcode() {
|
||||||
|
return document.getElementById('headcode').value
|
||||||
|
}
|
||||||
|
|
||||||
async function insertData(json) {
|
async function insertData(json) {
|
||||||
// Receives the JSON Respose ([{},{}]) containing one or more possible
|
// Receives the JSON Respose ([{},{}]) containing one or more possible
|
||||||
// PIS codes. Display the code and the stops with a method of scrolling between them.
|
// PIS codes. Display the code and the stops with a method of scrolling between them.
|
||||||
|
10
pis.html
10
pis.html
@ -45,6 +45,16 @@
|
|||||||
<div id="crs-box">
|
<div id="crs-box">
|
||||||
<p>Currently supported (Beta): GWR: ex-Wessex, HEx<br>Duplicate stopping patterns have been removed.</p>
|
<p>Currently supported (Beta): GWR: ex-Wessex, HEx<br>Duplicate stopping patterns have been removed.</p>
|
||||||
<p id="auth-required">You need to be logged into a free <a href="./settings.html#railstaff">rail staff version</a> account for this feature.</p>
|
<p id="auth-required">You need to be logged into a free <a href="./settings.html#railstaff">rail staff version</a> account for this feature.</p>
|
||||||
|
<h3>Search by Headcode</h3>
|
||||||
|
<form action="javascript:findByHeadcode();">
|
||||||
|
<div id="crs-inputs">
|
||||||
|
<div class="crs-input">
|
||||||
|
<label for="pis">PIS Code:</label><br>
|
||||||
|
<input type="text" class="small-lookup-box pis-input" id="headcode" name="headcode" maxlength="4" autocomplete="off"><br><br>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="submit" value="Find" class="lookup-button">Submit</button>
|
||||||
|
</form>
|
||||||
<h3>Search by CRS Codes</h3>
|
<h3>Search by CRS Codes</h3>
|
||||||
<form action="javascript:findByOrigDest();">
|
<form action="javascript:findByOrigDest();">
|
||||||
<div id="crs-inputs">
|
<div id="crs-inputs">
|
||||||
|
@ -4,6 +4,16 @@
|
|||||||
padding-bottom: 0;
|
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 {
|
#data_headcode {
|
||||||
color: var(--second-text-color);
|
color: var(--second-text-color);
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
|
11
sw.js
11
sw.js
@ -1,6 +1,6 @@
|
|||||||
/* Service Worker */
|
/* Service Worker */
|
||||||
|
|
||||||
const swVersion = '2023.5.10-1'
|
const swVersion = '2023.6.1-1'
|
||||||
const cacheName = `owlboard-${swVersion}`
|
const cacheName = `owlboard-${swVersion}`
|
||||||
const cacheIDs = [cacheName]
|
const cacheIDs = [cacheName]
|
||||||
let staticCache = [
|
let staticCache = [
|
||||||
@ -34,8 +34,9 @@ const dynamicCache = [
|
|||||||
'/find-code.html',
|
'/find-code.html',
|
||||||
'/settings.html',
|
'/settings.html',
|
||||||
'/pis.html',
|
'/pis.html',
|
||||||
'stats.html',
|
'/stats.html',
|
||||||
'registered.html',
|
'/registered.html',
|
||||||
|
'/train-detail.html',
|
||||||
'/manifest.json',
|
'/manifest.json',
|
||||||
'/styles/board.css',
|
'/styles/board.css',
|
||||||
'/styles/find-code.css',
|
'/styles/find-code.css',
|
||||||
@ -45,6 +46,7 @@ const dynamicCache = [
|
|||||||
'/styles/settings.css',
|
'/styles/settings.css',
|
||||||
'/styles/pis.css',
|
'/styles/pis.css',
|
||||||
'/styles/stats.css',
|
'/styles/stats.css',
|
||||||
|
'/styles/train-detail.css',
|
||||||
'/js/find-code.js',
|
'/js/find-code.js',
|
||||||
'/js/index.js',
|
'/js/index.js',
|
||||||
'/js/issue.js',
|
'/js/issue.js',
|
||||||
@ -55,7 +57,8 @@ const dynamicCache = [
|
|||||||
'/js/simple-board.js',
|
'/js/simple-board.js',
|
||||||
'/js/pis.js',
|
'/js/pis.js',
|
||||||
'/js/stats.js',
|
'/js/stats.js',
|
||||||
'/js/registered.js'
|
'/js/registered.js',
|
||||||
|
'/js/train-detail.js'
|
||||||
]
|
]
|
||||||
|
|
||||||
for(let i = 0; i < dynamicCache.length; i++) {
|
for(let i = 0; i < dynamicCache.length; i++) {
|
||||||
|
Reference in New Issue
Block a user