From 6f590990ca78dfcd8e8c434b6b6ff941ad2a5442 Mon Sep 17 00:00:00 2001 From: Joshua Moerman Date: Mon, 25 Mar 2013 17:05:52 +0100 Subject: [PATCH] Added command to add line :D --- index.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 23350bd..c52934e 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ border: 1px solid black; } .ball { - -webkit-transition: left 0.5s linear, top 0.5s linear; + -webkit-transition: left 0.1s linear, top 0.1s linear; position: absolute; } .ball .bullet { @@ -133,8 +133,13 @@ } function drawEnd(line){ - console.log(JSON.stringify(line)); drawRemove(line); + line.line_kind = 1; + var packet = { + command: 'add line', + data: line + }; + websocket.send(JSON.stringify(packet)); } function drawRemove(line){ @@ -149,8 +154,11 @@ name: myName, size: {width: window.innerWidth, height: window.innerHeight} }; - - websocket.send(JSON.stringify(myself)); + var packet = { + command: 'update user', + data: myself + }; + websocket.send(JSON.stringify(packet)); } window.addEventListener("load", init, false);