summaryrefslogtreecommitdiff
path: root/client-web/source/helper.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-09-08 17:03:56 +0200
committermetamuffin <metamuffin@disroot.org>2022-09-08 17:03:56 +0200
commit922149f0cd84c9aa5753d5b3bc62901c94b9b5e3 (patch)
tree4f79ec6e43973dff62d952b584775af615c38d58 /client-web/source/helper.ts
parentcd733e846d6e5921d97843ac895d45e8b22e79b4 (diff)
downloadkeks-meet-922149f0cd84c9aa5753d5b3bc62901c94b9b5e3.tar
keks-meet-922149f0cd84c9aa5753d5b3bc62901c94b9b5e3.tar.bz2
keks-meet-922149f0cd84c9aa5753d5b3bc62901c94b9b5e3.tar.zst
lots of changes, new prefs
Diffstat (limited to 'client-web/source/helper.ts')
-rw-r--r--client-web/source/helper.ts37
1 files changed, 0 insertions, 37 deletions
diff --git a/client-web/source/helper.ts b/client-web/source/helper.ts
index 31e500a..ef95e3a 100644
--- a/client-web/source/helper.ts
+++ b/client-web/source/helper.ts
@@ -1,43 +1,6 @@
/// <reference lib="dom" />
-import { parameters } from "./index.ts"
-
-export function get_query_params(): { [key: string]: string } {
- const q: { [key: string]: string } = {}
- for (const kv of window.location.hash.substring(1).split("&")) {
- const [key, value] = kv.split("=")
- q[decodeURIComponent(key)] = decodeURIComponent(value)
- }
- return q
-}
-
export function hex_id(len = 8): string {
if (len > 8) return hex_id() + hex_id(len - 8)
return Math.floor(Math.random() * 16 ** len).toString(16).padStart(len, "0")
}
-
-export function parameter_bool(name: string, def: boolean): boolean {
- const v = parameters[name]
- if (!v) return def
- if (v == "0" || v == "false" || v == "no") return false
- if (v == "1" || v == "true" || v == "yes") return true
- alert(`parameter ${name} is invalid`)
- return def
-}
-
-export function parameter_number(name: string, def: number): number {
- const v = parameters[name]
- if (!v) return def
- const n = parseFloat(v)
- if (Number.isNaN(n)) {
- alert(`parameter ${name} is invalid`)
- return def
- }
- return n
-}
-
-export function parameter_string(name: string, def: string): string {
- const v = parameters[name]
- if (!v) return def
- return v
-}