diff options
author | metamuffin <metamuffin@disroot.org> | 2024-04-02 12:22:09 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-04-02 12:22:09 +0200 |
commit | bf022dbae8583482d86deec63f0f413e01f8d593 (patch) | |
tree | 7134386897251fe49b75f7993702f060c86d2416 | |
parent | 3b87805d50bef3e73e857dd8025a4383e5f6651d (diff) | |
download | keks-meet-bf022dbae8583482d86deec63f0f413e01f8d593.tar keks-meet-bf022dbae8583482d86deec63f0f413e01f8d593.tar.bz2 keks-meet-bf022dbae8583482d86deec63f0f413e01f8d593.tar.zst |
no async script load and optional logger
-rw-r--r-- | client-web/public/app.html | 2 | ||||
-rw-r--r-- | client-web/source/index.ts | 2 | ||||
-rw-r--r-- | client-web/source/locale/de.ts | 1 | ||||
-rw-r--r-- | client-web/source/locale/en.ts | 2 | ||||
-rw-r--r-- | client-web/source/logger.ts | 3 | ||||
-rw-r--r-- | client-web/source/preferences/decl.ts | 20 |
6 files changed, 17 insertions, 13 deletions
diff --git a/client-web/public/app.html b/client-web/public/app.html index a6dc852..c2414ce 100644 --- a/client-web/public/app.html +++ b/client-web/public/app.html @@ -7,7 +7,7 @@ name="description" content="A simple secure web conferencing application using webrtc" /> - <script async type="module" src="/assets/bundle.js"></script> + <script type="module" src="/assets/bundle.js"></script> <link rel="stylesheet" href="/style.css" /> <title>keks-meet</title> </head> diff --git a/client-web/source/index.ts b/client-web/source/index.ts index 4be573f..73572cb 100644 --- a/client-web/source/index.ts +++ b/client-web/source/index.ts @@ -18,7 +18,7 @@ import { init_locale } from "./locale/mod.ts"; import { PO } from "./locale/mod.ts"; export const VERSION = "1.0.4" -globalThis.onload = () => main() +globalThis.addEventListener("DOMContentLoaded", () => main()) export interface ClientConfig { appearance?: { diff --git a/client-web/source/locale/de.ts b/client-web/source/locale/de.ts index 83ce075..174d821 100644 --- a/client-web/source/locale/de.ts +++ b/client-web/source/locale/de.ts @@ -91,5 +91,6 @@ export const PO_DE_DE: LanguageStrings = { enable_onbeforeunload: "Frage nach Bestätigung beim verlassen der Seite wenn Spuren geteilt sind.", room_watches: "Bekannte Räume (Als semikolongetrennte Liste von name=geheimnis Paaren)", username: "Benutzername", + show_log: "Zeige ausführlichen log." } } diff --git a/client-web/source/locale/en.ts b/client-web/source/locale/en.ts index db16fe7..418b15c 100644 --- a/client-web/source/locale/en.ts +++ b/client-web/source/locale/en.ts @@ -91,6 +91,6 @@ export const PO_EN_US: LanguageStrings = { enable_onbeforeunload: "Prompt for confirmation when leaving the site while local resources are shared", room_watches: "Known rooms (as semicolon seperated list of name=secret pairs)", username: "Username", + show_log: "Show extended log." } - } diff --git a/client-web/source/logger.ts b/client-web/source/logger.ts index 210644a..0141281 100644 --- a/client-web/source/logger.ts +++ b/client-web/source/logger.ts @@ -6,6 +6,7 @@ /// <reference lib="dom" /> import { e } from "./helper.ts"; +import { PREFS } from "./preferences/mod.ts"; export const LOGGER_CONTAINER = e("div", { class: "logger-container", role: "log", aria_live: "off" }) @@ -35,7 +36,7 @@ export function log(k: LogScope | LogDesc, message: string, ...data: unknown[]) (d.error ? console.error : d.warn ? console.warn : console.log)(`%c[${d.scope}] ${message}`, `color:${log_scope_color[d.scope]}`, ...data); - if (LOGGER_CONTAINER) { + if (LOGGER_CONTAINER && (PREFS.show_log || d.error || d.warn)) { const e = document.createElement("p") e.classList.add("logger-line") if (d.error) e.classList.add("logger-error") diff --git a/client-web/source/preferences/decl.ts b/client-web/source/preferences/decl.ts index 35762d3..7d5c8b6 100644 --- a/client-web/source/preferences/decl.ts +++ b/client-web/source/preferences/decl.ts @@ -19,14 +19,8 @@ const optional = <T>(a: T): T | undefined => a export const PREF_DECLS = { username: { type: string, default: "guest-" + hex_id(), allow_url: true }, language: { type: string, possible_values: ["system", ...Object.keys(LOCALES)], default: "system", allow_url: true }, - warn_redirect: { type: bool, hidden: true, default: false, allow_url: true }, - image_view_popup: { type: bool, default: true }, - webrtc_debug: { type: bool, default: false }, - + /* MEDIA */ - microphone_enabled: { type: bool, default: false }, - screencast_enabled: { type: bool, default: false }, - camera_enabled: { type: bool, default: false }, rnnoise: { type: bool, default: true, allow_url: true }, native_noise_suppression: { type: bool, default: false }, microphone_gain: { type: number, default: 1 }, @@ -37,7 +31,11 @@ export const PREF_DECLS = { auto_gain_control: { type: bool }, echo_cancellation: { type: bool, allow_url: true }, audio_activity_threshold: { type: number, optional: true, default: 0.003 }, - + image_view_popup: { type: bool, default: true }, + microphone_enabled: { type: bool, default: false }, + screencast_enabled: { type: bool, default: false }, + camera_enabled: { type: bool, default: false }, + // TODO differenciate between mic, cam and screen optional_audio_default_enable: { type: bool, default: true }, optional_video_default_enable: { type: bool, default: false }, @@ -47,5 +45,9 @@ export const PREF_DECLS = { notify_leave: { type: bool, default: true, allow_url: true }, enable_onbeforeunload: { type: bool, default: true }, - room_watches: { type: string, default: "[]", hidden: true } + webrtc_debug: { type: bool, default: false }, + show_log: { type: bool, default: false }, + + warn_redirect: { type: bool, hidden: true, default: false, allow_url: true }, + room_watches: { type: string, default: "[]", hidden: true }, } |