Додана сторінка "Стенд"
Додане повідомлення про оновлення застосунку Оновлен Service Worker Перероблен WebSocket APІ
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
const Options = {
|
||||
init: async () => {
|
||||
async init() {
|
||||
let html = await fetch('/lib/pages/options/index.html').then((response) => response.text());
|
||||
app.innerHTML = html;
|
||||
|
||||
await Options.optionPush.init();
|
||||
Options.optionFont.init();
|
||||
},
|
||||
|
||||
optionPush: {
|
||||
init: async () => {
|
||||
async init() {
|
||||
const element = document.getElementById("page-options-notifications");
|
||||
const permission = await Notification.requestPermission();
|
||||
|
||||
@@ -25,7 +26,8 @@ const Options = {
|
||||
element.checked = false;
|
||||
}
|
||||
},
|
||||
edit: (state) => {
|
||||
|
||||
edit(state) {
|
||||
if (state) {
|
||||
webPush.init();
|
||||
} else {
|
||||
@@ -33,8 +35,9 @@ const Options = {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
optionFont: {
|
||||
init: () => {
|
||||
init() {
|
||||
const element = document.getElementById("page-options-fontSize");
|
||||
|
||||
let fontSize = localStorage.getItem("fontSize")
|
||||
@@ -43,9 +46,15 @@ const Options = {
|
||||
|
||||
element.value = fontSize;
|
||||
},
|
||||
edit: (mode) => {
|
||||
|
||||
edit(mode) {
|
||||
localStorage.setItem("fontSize", mode);
|
||||
applyFontMode(mode);
|
||||
}
|
||||
},
|
||||
|
||||
logout() {
|
||||
localStorage.removeItem("uuid");
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user