-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
50 lines (42 loc) · 1.17 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Test Websockets</title>
<script type="text/javascript" src="jquery-1.3.2.min.js" ></script>
<script type="text/javascript" src="jquery.objectify.js" ></script>
<script type="text/javascript" src="lib.js" ></script>
<script type="text/javascript">
var websocket;
// WEBSOCKET STUFF
$(function(){
websocket = new WebSocket('ws://localhost:3001');
websocket.onopen = function(){
console.log('Connected');
};
websocket.onmessage = function(event){
var response = JSON.parse(event.data);
$().trigger('dc.'+response.name, [response.content]);
};
websocket.onclose = function(){
send('I am disconnecting');
console.log('Disconnected');
};
a = $('canvas').drawingCanvas()[0].obj;
});
</script>
<style type="text/css" media="screen">
body {
margin:0;
text-align:center;
}
canvas {
border: 1px solid #ccc;
cursor: pointer;
}
</style>
</head>
<body>
<p>Draw you fat mumma</p>
<canvas width="400" height="400"></canvas>
</body>
</html>