27 lines
777 B
JavaScript
27 lines
777 B
JavaScript
// Init:
|
|
pageInit();
|
|
|
|
if ("serviceWorker" in navigator) {
|
|
navigator.serviceWorker.register("/sw.js");
|
|
}
|
|
|
|
async function pageInit() {
|
|
await loadQuickLinks();
|
|
hideLoading(); // From lib.main
|
|
localStorage.setItem("ver-web", document.getElementById('ver_str').textContent)
|
|
}
|
|
|
|
async function gotoBoard(station){
|
|
vibe("ok")
|
|
window.location.assign(`${window.location.origin}/board.html?stn=${station}`);
|
|
}
|
|
|
|
async function loadQuickLinks(){
|
|
var data = await getQuickLinks(); // From lib.main
|
|
var buttons = "";
|
|
for(var i = 0; i < data.length; i++) {
|
|
buttons += `
|
|
<button class="actionbutton" onclick="gotoBoard('${data[i]}')">${data[i].toUpperCase()}</button>`
|
|
}
|
|
document.getElementById("quick_links").insertAdjacentHTML("beforeend", buttons)
|
|
} |