summaryrefslogtreecommitdiff
path: root/assets/client.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/client.js')
-rw-r--r--assets/client.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/assets/client.js b/assets/client.js
index 0e90d4b..f888104 100644
--- a/assets/client.js
+++ b/assets/client.js
@@ -3,9 +3,11 @@ window.name = "anon";
window.clr = "#f03333";
window.info_elem = document.getElementById("miscinfo");
window.info_elem.innerHTML =`
- <input id="name-in" type="text" value="anon">
- <input id="clr-in" type="color" value="#33c033"></input>
- <button onclick=register()>Join</button>`;
+ <form action="javascript:;" onsubmit="register()">
+ <input id="name-in" type="text" value="anon">
+ <input id="clr-in" type="color" value="#33c033"></input>
+ <button>Join</button>
+ </form>`;
window.board_elem = document.getElementById("board");
window.bwidth = NaN;
window.bheight = NaN;
@@ -25,7 +27,7 @@ function register() {
function connect() {
let wsproto = (window.location.protocol == "https:")? "wss:": "ws:";
- let s = new WebSocket(`${wsproto}//${window.location.hostname}:${window.location.port}${window.location.pathname}ws`);
+ let s = new WebSocket(`${wsproto}//${location.hostname}:${location.port}${location.pathname}/ws`);
s.onopen = function() {
s.send(`register ${window.name} ${window.clr}`);
}