diff options
author | stale <redkugelblitzin@gmail.com> | 2022-05-20 06:39:58 -0300 |
---|---|---|
committer | stale <redkugelblitzin@gmail.com> | 2022-05-20 06:39:58 -0300 |
commit | fae0fca7aabb81325a296a1d6202239c3db44b60 (patch) | |
tree | 687a95f381ee13ee3de9f8eabdf4cd371a258091 /assets/client.js | |
parent | d89b9ea43ac65af549279f6e86c68c66243dcdf3 (diff) |
wip room support
Diffstat (limited to 'assets/client.js')
-rw-r--r-- | assets/client.js | 10 |
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}`); } |