aboutsummaryrefslogtreecommitdiff
path: root/client-web/source/index.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-09-07 20:24:21 +0200
committermetamuffin <metamuffin@disroot.org>2023-09-07 20:24:21 +0200
commitf5fa4f7d58344c2dc722d1f37c1d7a008f6ee9b3 (patch)
treec7ac2a7497670745c73f927abf264d63a5a4805d /client-web/source/index.ts
parent2d0761b8932f11b01e241e2db3a8f08250efe878 (diff)
downloadkeks-meet-f5fa4f7d58344c2dc722d1f37c1d7a008f6ee9b3.tar
keks-meet-f5fa4f7d58344c2dc722d1f37c1d7a008f6ee9b3.tar.bz2
keks-meet-f5fa4f7d58344c2dc722d1f37c1d7a008f6ee9b3.tar.zst
new element creation helper
Diffstat (limited to 'client-web/source/index.ts')
-rw-r--r--client-web/source/index.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/client-web/source/index.ts b/client-web/source/index.ts
index 639f0c9..f5f6b2d 100644
--- a/client-web/source/index.ts
+++ b/client-web/source/index.ts
@@ -6,7 +6,7 @@
/// <reference lib="dom" />
import { init_serviceworker } from "./sw/client.ts";
-import { ediv } from "./helper.ts";
+import { e } from "./helper.ts";
import { setup_keybinds } from "./keybinds.ts";
import { log, LOGGER_CONTAINER } from "./logger.ts"
import { load_params, PREFS } from "./preferences/mod.ts";
@@ -61,8 +61,8 @@ export async function main() {
document.body.querySelectorAll(".loading").forEach(e => e.remove())
const room_secret = load_params().rsecret
- if (!globalThis.RTCPeerConnection) return log({ scope: "webrtc", error: true }, "WebRTC not supported.")
if (!globalThis.isSecureContext) log({ scope: "*", warn: true }, "This page is not in a 'Secure Context'")
+ if (!globalThis.RTCPeerConnection) return log({ scope: "webrtc", error: true }, "WebRTC not supported.")
if (!globalThis.crypto.subtle) return log({ scope: "crypto", error: true }, "SubtleCrypto not availible")
if (!globalThis.navigator.serviceWorker) log({ scope: "*", warn: true }, "Your browser does not support the Service Worker API, forced automatic updates are unavoidable.")
if (room_secret.length < 8) log({ scope: "crypto", warn: true }, "Room name is very short. e2ee is insecure!")
@@ -81,10 +81,13 @@ export async function main() {
r = new Room(conn, rtc_config)
+ conn.control_handler = (a) => r.control_handler(a)
+ conn.relay_handler = (a, b) => r.relay_handler(a, b)
+
setup_keybinds(r)
r.on_ready = () => {
- const sud = ediv({ class: "side-ui" })
- const center = ediv({ class: "main" }, r.element, info_br(), sud)
+ const sud = e("div", { class: "side-ui" })
+ const center = e("div", { class: "main" }, r.element, info_br(), sud)
document.body.append(center, control_bar(r, sud))
}