Skip to content

Commit 60e4e74

Browse files
committed
u
1 parent f0240b5 commit 60e4e74

12 files changed

Lines changed: 393 additions & 362 deletions

src/env.d.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
/// <reference types="astro/client" />
1+
/// <reference types="astro/client" />
2+
3+
interface Window {
4+
makeRequest: (moduleName: string, params?: string[][], callback?: (data: unknown) => void) => Promise<void>
5+
checkAuthentication: (u: string, p: string) => boolean
6+
setCredentials: (username: string, password: string, dest: string) => void
7+
setCookie: (cname: string, cvalue: string, exdays: number) => void
8+
getCookie: (cname: string) => string
9+
assertError: (err: unknown, name: string) => void
10+
goToPage: (name: string) => void
11+
showModal: (title: string, content: string) => void
12+
addNotification: (module: string, name: string, icon: string, content: string, attatchmentInfo: unknown) => void
13+
getNotifications: (module?: unknown, title?: unknown, description?: unknown, content?: unknown, attatchmentInfo?: unknown) => void
14+
openSelection: (e: HTMLElement) => void
15+
closeSelection: (e: HTMLElement) => void
16+
showRoutePath: (aId: unknown, rId: unknown) => void
17+
findUsingValueofKey: (arr: Record<string, unknown>[], key: string, val: unknown) => Record<string, unknown>[]
18+
}

src/pages/tracker.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,11 @@ function showRoutePath(aId, rId) {
547547
// This would require using a routing service or drawing polylines
548548
console.log('Route path display not yet implemented with Leaflet');
549549
}
550+
window.showRoutePath = showRoutePath
550551

551552
function findUsingValueofKey(arr, key, val) {
552553
var res = arr.filter(item => item[key] === val)
553554
return res
554555
}
556+
window.findUsingValueofKey = findUsingValueofKey
555557
</script>

src/scripts/511Request.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,5 @@
6161
console.error('511 API Error:', err)
6262
}
6363
}
64+
window.makeRequest = makeRequest
6465
</script>

src/scripts/authentication.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
if (u && p) return true
1717
return false
1818
}
19+
window.checkAuthentication = checkAuthentication
1920

2021
function setCredentials(username, password, dest) {
2122
authentication = JSON.stringify({
@@ -25,4 +26,5 @@
2526
localStorage.setItem('auth', authentication)
2627
location.href = dest
2728
}
29+
window.setCredentials = setCredentials
2830
</script>

src/scripts/cookies.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
let expires = "expires="+ d.toUTCString();
66
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
77
}
8+
window.setCookie = setCookie
89

910
function getCookie(cname) {
1011
let name = cname + "=";
@@ -21,4 +22,5 @@
2122
})
2223
return rValue;
2324
}
25+
window.getCookie = getCookie
2426
</script>

0 commit comments

Comments
 (0)