- {#each quicklinks as link}
+ {#each $ql as link}
{#if link.length === 3}
{link.toUpperCase()}
diff --git a/src/lib/islands/quick-link-set-island.svelte b/src/lib/islands/quick-link-set-island.svelte
new file mode 100644
index 0000000..22cd2a2
--- /dev/null
+++ b/src/lib/islands/quick-link-set-island.svelte
@@ -0,0 +1,104 @@
+
+
+
+ {#if $ql.length === 0}
+ Click the + button to add links
+ {/if}
+
+ {#each qlData as link}
+
+ {/each}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/lib/stores/quick-links.js b/src/lib/stores/quick-links.js
new file mode 100644
index 0000000..439735d
--- /dev/null
+++ b/src/lib/stores/quick-links.js
@@ -0,0 +1,29 @@
+import { writable } from 'svelte/store'
+import { browser } from '$app/environment';
+
+export const ql = writable(fromLocalStorage('ql', []))
+toLocalStorage(ql, 'ql');
+
+function fromLocalStorage(storageKey, fallback) {
+ if (browser) {
+ const storedValue = localStorage.getItem(storageKey);
+ if (storedValue !== 'undefined' && storedValue !== null) {
+ return (typeof fallback === 'object')
+ ? JSON.parse(storedValue)
+ : storedValue
+ }
+ }
+ return fallback
+}
+
+function toLocalStorage(store, storageKey) {
+ if (browser) {
+ store.subscribe(value => {
+ let storageValue = (typeof value === 'object')
+ ? JSON.stringify(value)
+ : value
+
+ localStorage.setItem(storageKey, storageValue)
+ })
+ }
+}
\ No newline at end of file
diff --git a/src/routes/ldb/+page.svelte b/src/routes/ldb/+page.svelte
index ce416cf..14536d2 100644
--- a/src/routes/ldb/+page.svelte
+++ b/src/routes/ldb/+page.svelte
@@ -10,7 +10,16 @@
return new URLSearchParams(window.location.search).get('station');
}
- let jsonData = [] // Extract train data from the object to pass to #each
+ let jsonData = {}; // Extract train data from the object to pass to #each
+ let services = [];
+
+ $: {
+ if (jsonData && jsonData.GetStationBoardResult && jsonData.GetStationBoardResult.trainServices && jsonData.GetStationBoardResult.trainServices.service) {
+ services = [...jsonData.GetStationBoardResult.trainServices.service];
+ } else {
+ services = ["No train services available"];
+ }
+ }
onMount(async () => {
const station = await getHeadcode();
@@ -24,7 +33,11 @@
Station:
-
+
+{#each services as service}
+ {service.origin?.location?.locationName || 'Unknown'}
+{/each}
+
{JSON.stringify(jsonData)}
diff --git a/src/routes/more/+page.svelte b/src/routes/more/+page.svelte
index 8f0e950..7218ea1 100644
--- a/src/routes/more/+page.svelte
+++ b/src/routes/more/+page.svelte
@@ -4,11 +4,12 @@
const title = "More"
const links = [
- {title: "Your Data", path: ""},
- {title: "Location Reference Codes", path: ""},
- {title: "Privacy Policy", path: ""},
- {title: "App Versions", path: ""},
- {title: "Statictics", path: ""}
+ {title: "Your Data", path: "/more/data"},
+ {title: "Location Reference Codes", path: "/more/corpus"},
+ {title: "Privacy Policy", path: "/more/privacy"},
+ {title: "Component Versions", path: "/more/versions"},
+ {title: "Statictics", path: "/more/statistics"},
+ {title: "Settings", path: "/more/settings"}
]
diff --git a/src/routes/more/corpus/+page.svelte b/src/routes/more/corpus/+page.svelte
new file mode 100644
index 0000000..5e09942
--- /dev/null
+++ b/src/routes/more/corpus/+page.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/routes/more/data/+page.svelte b/src/routes/more/data/+page.svelte
new file mode 100644
index 0000000..fcf17f9
--- /dev/null
+++ b/src/routes/more/data/+page.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/routes/more/privacy/+page.svelte b/src/routes/more/privacy/+page.svelte
new file mode 100644
index 0000000..db00539
--- /dev/null
+++ b/src/routes/more/privacy/+page.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/routes/more/settings/+page.svelte b/src/routes/more/settings/+page.svelte
new file mode 100644
index 0000000..d3e217f
--- /dev/null
+++ b/src/routes/more/settings/+page.svelte
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/src/routes/more/statistics/+page.svelte b/src/routes/more/statistics/+page.svelte
new file mode 100644
index 0000000..b3b5f27
--- /dev/null
+++ b/src/routes/more/statistics/+page.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/routes/more/versions/+page.svelte b/src/routes/more/versions/+page.svelte
new file mode 100644
index 0000000..59e5a41
--- /dev/null
+++ b/src/routes/more/versions/+page.svelte
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ Web-app Version
{web_ver}
+ API Server Version
{srv_ver}
+ DBManager Version
{dbm_ver}
+
+
+
+
\ No newline at end of file