-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsorting.html
More file actions
67 lines (47 loc) · 1.34 KB
/
sorting.html
File metadata and controls
67 lines (47 loc) · 1.34 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Control SORTING</title>
<script src="https://cdn.socket.io/socket.io-1.0.6.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js" charset="utf-8"></script>
<script>window.d3||document.write('<script src="web/js/vendors/d3/d3.min.js"><\/script>');</script>
</head>
<body>
<script>
var sortingController={};
;(function(){
function SortingController() {
var socket;
function initSocket() {
socket = io.connect('http://localhost:8080');
socket.on("open",function(data){
console.log("open",data);
if(data.status=="connected") {
socket.emit("join","sorting-room");
}
});
socket.on("close",function(data){
console.log("close",data)
});
socket.on('error', function (reason){
console.error('Unable to connect Socket.IO', reason);
});
socket.on('joined',function(message){
console.log("joined",message);
})
socket.on('message',function(message){
console.log("message",message);
})
socket.on('change-chart',function(status){
console.log("change chart",status);
socket.emit("change-confirmed",status);
})
}
initSocket();
}
sortingController=new SortingController();
}());
</script>
</body>
</html>