diff options
Diffstat (limited to 'client-web')
-rw-r--r-- | client-web/source/locale/de.ts | 2 | ||||
-rw-r--r-- | client-web/source/locale/en.ts | 4 | ||||
-rw-r--r-- | client-web/source/preferences/decl.ts | 1 | ||||
-rw-r--r-- | client-web/source/preferences/ui.ts | 20 |
4 files changed, 17 insertions, 10 deletions
diff --git a/client-web/source/locale/de.ts b/client-web/source/locale/de.ts index 31ab6fe..eee093c 100644 --- a/client-web/source/locale/de.ts +++ b/client-web/source/locale/de.ts @@ -64,7 +64,7 @@ export const PO_DE_DE: LanguageStrings = { warn_redirect: "Interne Option, die der Server bei einer Weiterleitung setzt.", image_view_popup: "Öffne Bilder in einem neuen Tab", webrtc_debug: "Zeige erweiterte Informationen zu WebRTC zeugs", - + screencast_audio: "Anwendungsaudio bei Bildschirmübertragung aufzeichnen", microphone_enabled: "Füge eine Mikrofonspur beim start hinzu.", screencast_enabled: "Füge eine Bildschirmspur beim start hinzu.", camera_enabled: "Füge eine Kameraspur beim start hinzu.", diff --git a/client-web/source/locale/en.ts b/client-web/source/locale/en.ts index 3bf5f7e..897ac15 100644 --- a/client-web/source/locale/en.ts +++ b/client-web/source/locale/en.ts @@ -64,7 +64,7 @@ export const PO_EN_US: LanguageStrings = { warn_redirect: "Internal option that is set by a server redirect.", image_view_popup: "Open image in popup instead of new tab", webrtc_debug: "Show additional information for WebRTC related stuff", - + screencast_audio: "Include audio when sharing your screen.", microphone_enabled: "Add one microphone track on startup", screencast_enabled: "Add one screencast track on startup", camera_enabled: "Add one camera track on startup", @@ -82,7 +82,7 @@ export const PO_EN_US: LanguageStrings = { notify_chat: "Send notifications for incoming chat messages", notify_join: "Send notifications when users join", notify_leave: "Send notifications when users leave", - enable_onbeforeunload: "Prompt for confirmation when leaving the site while local resources are active", + 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", } diff --git a/client-web/source/preferences/decl.ts b/client-web/source/preferences/decl.ts index a8c33a6..269e247 100644 --- a/client-web/source/preferences/decl.ts +++ b/client-web/source/preferences/decl.ts @@ -33,6 +33,7 @@ export const PREF_DECLS = { video_fps: { type: number }, video_resolution: { type: number }, camera_facing_mode: { type: optional(string), possible_values: ["environment", "user"] }, + screencast_audio: { type: bool, default: false }, auto_gain_control: { type: bool }, echo_cancellation: { type: bool, allow_url: true }, audio_activity_threshold: { type: number, optional: true, default: 0.003 }, diff --git a/client-web/source/preferences/ui.ts b/client-web/source/preferences/ui.ts index 1be4458..252cba8 100644 --- a/client-web/source/preferences/ui.ts +++ b/client-web/source/preferences/ui.ts @@ -15,19 +15,22 @@ export function ui_preferences(): HTMLElement { const key = key_ as keyof typeof PREF_DECLS const id = `pref-${key}` let prim_control: HTMLInputElement | HTMLSelectElement | undefined; - if (decl.possible_values) { + if (decl.possible_values && typeof decl.type == "string") { const sel = document.createElement("select") sel.id = id - for (const v of decl.possible_values) { + for (const v of decl.possible_values as string[]) { const opt = document.createElement("option") - opt.value = opt.textContent = JSON.stringify(v ?? null) + opt.value = opt.textContent = v ?? "" sel.append(opt) } sel.onchange = () => { - change_pref(key, JSON.parse(sel.value) ?? undefined) + if (!sel.value.length) return + change_pref(key, sel.value ?? undefined) } - on_pref_changed(key, () => sel.value = JSON.stringify(PREFS[key] ?? null)) - sel.value = JSON.stringify(PREFS[key]) + on_pref_changed(key, () => { + sel.value = PREFS[key] as string ?? "" + }) + sel.value = PREFS[key] as string prim_control = sel } else if (typeof decl.type == "boolean") { const checkbox = document.createElement("input") @@ -57,7 +60,9 @@ export function ui_preferences(): HTMLElement { textbox.onchange = () => { change_pref(key, parseFloat(textbox.value)) } - on_pref_changed(key, () => textbox.value = PREFS[key] as string) + on_pref_changed(key, () => { + textbox.value = PREFS[key] as string + }) prim_control = textbox } @@ -69,6 +74,7 @@ export function ui_preferences(): HTMLElement { use_opt.checked = PREFS[key] !== undefined if (prim_control) prim_control.disabled = !use_opt.checked use_opt.onchange = () => { + if (prim_control) prim_control.disabled = !use_opt.checked if (use_opt.checked) { if (prim_control?.onchange) prim_control.onchange(new Event("change")) } else change_pref(key, undefined) } |