poll is now explicit
This commit is contained in:
parent
59b33559e6
commit
289b111105
1 changed files with 10 additions and 3 deletions
13
index.html
13
index.html
|
@ -92,7 +92,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function onOpen(evt) {
|
function onOpen(evt) {
|
||||||
doSend();
|
updateUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMessage(evt) {
|
function onMessage(evt) {
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
updateLines(lines);
|
updateLines(lines);
|
||||||
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
doSend();
|
poll();
|
||||||
}, speed);
|
}, speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function doSend(message) {
|
function updateUser() {
|
||||||
var myself = {
|
var myself = {
|
||||||
name: myName,
|
name: myName,
|
||||||
size: {width: window.innerWidth, height: window.innerHeight}
|
size: {width: window.innerWidth, height: window.innerHeight}
|
||||||
|
@ -200,6 +200,13 @@
|
||||||
websocket.send(JSON.stringify(packet));
|
websocket.send(JSON.stringify(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function poll(){
|
||||||
|
var packet = {
|
||||||
|
command: 'poll'
|
||||||
|
};
|
||||||
|
websocket.send(JSON.stringify(packet));
|
||||||
|
}
|
||||||
|
|
||||||
function changeKind() {
|
function changeKind() {
|
||||||
line_kind = line_kind + 1;
|
line_kind = line_kind + 1;
|
||||||
line_kind = line_kind % 2;
|
line_kind = line_kind % 2;
|
||||||
|
|
Reference in a new issue