diff --git a/model/chat.go b/model/chat.go index 80daebe1c..05bc35721 100644 --- a/model/chat.go +++ b/model/chat.go @@ -37,7 +37,7 @@ var ( ) const ( - maxMessageLength = 250 + maxMessageLength = 1000 coolDown = time.Minute * 2 coolDownMessages = 5 // 5 messages -> 5 messages per 2 minutes max ) diff --git a/web/template/components/chat.gohtml b/web/template/components/chat.gohtml index 07e2331bd..0d34d4b4e 100644 --- a/web/template/components/chat.gohtml +++ b/web/template/components/chat.gohtml @@ -288,11 +288,11 @@ -
+
-{{end}} \ No newline at end of file +{{end}} diff --git a/web/ts/components/chat-prompt.ts b/web/ts/components/chat-prompt.ts index 94d524a53..55eaf50c2 100644 --- a/web/ts/components/chat-prompt.ts +++ b/web/ts/components/chat-prompt.ts @@ -21,7 +21,7 @@ export function chatPromptContext(streamId: number): AlpineComponent { ws: new ChatWebsocketConnection(SocketConnections.ws), - inputEl: document.getElementById("chat-input") as HTMLInputElement, + inputEl: document.getElementById("chat-input") as HTMLTextAreaElement, usersEl: document.getElementById("chat-user-list") as HTMLInputElement, emojiEl: document.getElementById("chat-emoji-list") as HTMLInputElement, @@ -41,7 +41,10 @@ export function chatPromptContext(streamId: number): AlpineComponent { this.users.reset(); }, - send() { + send(event: KeyboardEvent) { + if (event.shiftKey) { + return; + } console.log("🌑 send message '", this.message, "'"); this.ws.sendMessage({ msg: this.message, @@ -84,6 +87,10 @@ export function chatPromptContext(streamId: number): AlpineComponent { } else if (this.emojis.hasSuggestions()) { this.emojiEl.focus(); } + + // https://stackoverflow.com/a/21079335 + this.inputEl.style.height = "0px"; + this.inputEl.style.height = this.inputEl.scrollHeight + "px"; }, keypressAlphanumeric(e) {