From 56443d9e9cfa0570402b82996aa77b9e859fd4e9 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Thu, 9 Apr 2020 03:20:18 +0100 Subject: [PATCH] remove jquery from broker chat client side --- websocket-chat-broker/static/index.html | 266 +++++++++++++++++------- 1 file changed, 190 insertions(+), 76 deletions(-) diff --git a/websocket-chat-broker/static/index.html b/websocket-chat-broker/static/index.html index e59e13f1..85afb174 100644 --- a/websocket-chat-broker/static/index.html +++ b/websocket-chat-broker/static/index.html @@ -1,90 +1,204 @@ - - - - - - -

Chat!

-
-  | Status: - disconnected -
-
-
-
- - -
- + + updateConnectionStatus() + }) + + $form.addEventListener('submit', (ev) => { + ev.preventDefault() + + const text = $input.value + + log('Sending: ' + text) + socket.send(text) + + $input.value = '' + $input.focus() + }) + + updateConnectionStatus() + +