statusbar.innerHTML = 'No websockets :(. This means that you either use <em>Internet Explorer</em> or <em>Android</em>. In both cases, I suggest that you use <ahref="http://www.google.com/chrome/">Chrome</a> or <ahref="http://www.getfirefox.net/">Firefox</a>!';
@ -80,46 +76,52 @@
}
function onMessage(evt) {
var people = JSON.parse(evt.data);
for (var i = people.length - 1; i >= 0; i--) {
var user = document.getElementById(people[i].name);
if(user){
user.style.left = people[i].position.x + "px";
user.style.top = people[i].position.y + "px";
var ret = JSON.parse(evt.data);
var people = ret.people;
var balls = ret.balls;
var lines = ret.lines;
for(ball in balls_online){
ball.should_remove = true;
}
for (var i = balls.length - 1; i >= 0; i--) {
var ball = document.getElementById(balls[i].information);
if(ball){
ball.style.left = balls[i].position.x + "px";
ball.style.top = balls[i].position.y + "px";
ball.should_remove = false;
} else {
var name = document.createElement('span')
name.className = "name";
name.innerText = people[i].name;
var user = document.createElement('div');
user.id = people[i].name;
user.className = 'user';
user.innerHTML = '<divclass="bullet"></div>';
user.appendChild(name);
user.style.left = people[i].position.x + "px";
user.style.top = people[i].position.y + "px";
circle.appendChild(user);
var ball = document.createElement('div');
ball.should_remove = false;
ball.id = balls[i].information;
ball.className = 'ball';
ball.innerHTML = '<divclass="bullet"></div>';
ball.style.left = balls[i].position.x + "px";
ball.style.top = balls[i].position.y + "px";
ballscreen.appendChild(ball);
balls_online.push(ball);
}
}
var nodes = circle.childNodes;
for(var i = nodes.length -1; i >= 0; i--) {
var should_remove = true;
for (var j = people.length - 1; j >= 0; j--){
if(people[j].name == nodes[i].id) {
should_remove = false;
break;
}
}
if(should_remove){
circle.removeChild(nodes[i]);
for (var i = balls_online.length - 1; i >= 0; i--) {
if(balls_online[i].should_remove){
ballscreen.removeChild(balls_online[i]);
balls_online.splice(i, 1);
}
}
};
for (var i = svglines_online.length - 1; i >= 0; i--) {