Add some web socket goodness.

This commit is contained in:
Jonathan Harker 2016-02-06 17:02:45 +13:00
parent 04d90b7c7a
commit 74b370f19b
4 changed files with 73 additions and 5 deletions

View file

@ -1,17 +1,19 @@
doctype html
html
head
title #{room} - Webchat
style.
textarea, input { width: 100%; }
textarea { resize: vertical; }
style(type="text/css", src="main.css")
body
- import vibe.data.json;
script(src="chat.js")
script connect(#{Json(room)}, #{Json(nick)})
h1 Room '#{room}'
textarea#history(rows=20, readonly=true)
- foreach (m; messages)
|= m
form(action="room", method="POST")
form(action="room", method="POST", autocomplete="off", onsubmit="return sendMessage()")
input(type="hidden", name="room", value=room)
input(type="hidden", name="nick", value=nick)
input#inputLine(type="text", name="message", autofocus=true)