summaryrefslogtreecommitdiff
path: root/client-web/source/chat.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-06-24 22:06:34 +0200
committermetamuffin <metamuffin@disroot.org>2023-06-24 22:06:34 +0200
commite3d056a8807d52f95b7df9537ce931925b00d98f (patch)
treec3610de295177346d50f995c8b2ab72f35324127 /client-web/source/chat.ts
parent94d1c689bb2923285e8ec988aa7dc270302f1e55 (diff)
downloadkeks-meet-e3d056a8807d52f95b7df9537ce931925b00d98f.tar
keks-meet-e3d056a8807d52f95b7df9537ce931925b00d98f.tar.bz2
keks-meet-e3d056a8807d52f95b7df9537ce931925b00d98f.tar.zst
rework ui design, broke a lot of stuff
Diffstat (limited to 'client-web/source/chat.ts')
-rw-r--r--client-web/source/chat.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/client-web/source/chat.ts b/client-web/source/chat.ts
index 47b0678..6e74139 100644
--- a/client-web/source/chat.ts
+++ b/client-web/source/chat.ts
@@ -6,17 +6,18 @@
/// <reference lib="dom" />
import { ChatMessage } from "../../common/packets.d.ts";
-import { ediv, esection, espan, image_view, notify, OverlayUi } from "./helper.ts";
+import { ediv, esection, espan, image_view, notify } from "./helper.ts";
import { log } from "./logger.ts";
import { PREFS } from "./preferences/mod.ts";
import { Room } from "./room.ts";
import { LocalUser } from "./user/local.ts";
import { User } from "./user/mod.ts";
-export class Chat extends OverlayUi {
+export class Chat {
messages: HTMLElement
controls: HTMLElement
send_el: HTMLInputElement
+ element: HTMLElement
constructor(public room: Room) {
const send = document.createElement("input")
@@ -28,7 +29,8 @@ export class Chat extends OverlayUi {
const controls = ediv({ class: "controls" })
controls.append(send)
messages.append(document.createElement("hr"))
- super(esection({ class: "chat", aria_label: "chat", role: "dialog" }, messages, controls))
+
+ this.element = esection({ class: "chat", aria_label: "chat", role: "dialog" }, messages, controls)
this.messages = messages
this.controls = controls
this.send_el = send
@@ -37,7 +39,8 @@ export class Chat extends OverlayUi {
if (ev.code == "Enter") {
if (send.value.trim().length == 0) {
// keybind for toggle chat is Enter, so lets close here
- this.shown = false
+ // TODO! open
+ // this.control.check = false
return
}
this.send({ text: send.value })
@@ -75,7 +78,8 @@ export class Chat extends OverlayUi {
if (message.text) els.push(espan(message.text, { class: "text" }))
if (message.image) els.push(image_view(message.image, { class: "image" }))
- this.shown = true
+ // TODO! open
+ // this.shown = true
const e = ediv({ class: "message" }, espan(sender.display_name, { class: "author" }), ": ", ...els)
this.messages.append(e)
e.scrollIntoView({ block: "end", behavior: "smooth", inline: "end" })