aboutsummaryrefslogtreecommitdiff
path: root/client-web
diff options
context:
space:
mode:
Diffstat (limited to 'client-web')
-rw-r--r--client-web/source/helper.ts4
-rw-r--r--client-web/source/preferences/decl.ts1
2 files changed, 4 insertions, 1 deletions
diff --git a/client-web/source/helper.ts b/client-web/source/helper.ts
index 4075a0f..60ecf09 100644
--- a/client-web/source/helper.ts
+++ b/client-web/source/helper.ts
@@ -1,5 +1,7 @@
/// <reference lib="dom" />
+import { PREFS } from "./preferences/mod.ts";
+
const elem = (s: string) => document.createElement(s)
interface Opts { class?: string[] | string, id?: string, src?: string, onclick?: () => void }
@@ -60,7 +62,7 @@ export function image_view(url: string, opts?: Opts): HTMLElement {
img.src = url
img.alt = `Image (click to open)`
img.addEventListener("click", () => {
- window.open(url, "_blank", "noreferrer=true,noopener=true,popup=true")
+ window.open(url, "_blank", `noreferrer=true,noopener=true,popup=${PREFS.image_view_popup}`)
})
return img
}
diff --git a/client-web/source/preferences/decl.ts b/client-web/source/preferences/decl.ts
index 82d9c09..6590eea 100644
--- a/client-web/source/preferences/decl.ts
+++ b/client-web/source/preferences/decl.ts
@@ -10,6 +10,7 @@ const string = "", bool = false, number = 0; // example types for ts
export const PREF_DECLS = {
username: { type: string, default: "guest-" + hex_id(), description: "Username" },
warn_redirect: { type: bool, default: false, description: "Interal option that is set by a server redirect." },
+ image_view_popup: { type: bool, default: true, description: "Open image in popup instead of new tab" },
/* MEDIA */
microphone_enabled: { type: bool, default: false, description: "Add one microphone track on startup" },