Skip to content
Browse files

index.html: fixed clickability from mouse move demo

  • Loading branch information...
1 parent e730a5a commit 208e4b15e0079a1dc378ab52890d49801ac69f5c @jeromeetienne committed
Showing with 5 additions and 5 deletions.
  1. +1 −1 easyWebSocket-node.min.js
  2. +1 −1 easyWebSocket.min.js
  3. +3 −3 index.html
View
2 easyWebSocket-node.min.js
@@ -104,5 +104,5 @@ for(var g=0;g<WebSocket.__tasks.length;++g)WebSocket.__tasks[g]();WebSocket.__ta
return c.enabledPlugin.filename.match(/flashlite/i)?true:false};window.webSocketLog=function(c){b.log(decodeURIComponent(c))};window.webSocketError=function(c){b.error(decodeURIComponent(c))};window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION||(window.addEventListener?window.addEventListener("load",WebSocket.__initialize,false):window.attachEvent("onload",WebSocket.__initialize))}else b.error("Flash Player is not installed.")}})();EasyWebSocket=function(a){var b=this;this.url=a;this.bufferedAmount=0;this.readyState=EasyWebSocket.CONNECTING;this._clientId="clientid-sio-"+this.url+"-"+Math.floor(Math.random()*999999).toString(36);this.log=EasyWebSocket.logFunction;this.onopen=function(){b.log("default onopen method")};this.onmessage=function(){b.log("default onmessage method")};this.onerror=function(){b.log("default onerror method")};this.onclose=function(){b.log("default onclose method")};this._sioCtor()};
EasyWebSocket.prototype._sioCtor=function(){var a=this,b=this.parseUri(EasyWebSocket.serverUrl),c=b.host;b=parseInt(b.port);WEB_SOCKET_SWF_LOCATION="http://easywebsocket.org/node/server/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMainInsecure.swf";this._sockio=new io.Socket(c,{port:b});this._sockio.connect();this._sockio.on("connect",function(){a.log("socket connected",a._sockio,a._clientId);a._sockio.send({type:"connect",data:{wsUrl:a.url,clientId:a._clientId}});
a.readyState=EasyWebSocket.CONNECTED;a.onopen()});this._sockio.on("connect_failed",function(){a.onerror()});this._sockio.on("message",function(e){a.log("received message",e);a.onmessage({data:e})});this._sockio.on("disconnect",function(){a.log("socket disconnected");a.onclose()})};EasyWebSocket.prototype.send=function(a){this._sockio.send({type:"message",data:{clientId:this._clientId,message:a}})};EasyWebSocket.prototype.close=function(){this._sockio.disconnect()};EasyWebSocket.CONNECTING=0;
-EasyWebSocket.OPEN=1;EasyWebSocket.CLOSING=2;EasyWebSocket.CLOSED=3;EasyWebSocket.serverUrl="http://88.191.76.230:8667";EasyWebSocket.logFunction=function(){};EasyWebSocket.prototype.parseUri=function(a){var b=this.parseUri.options;a=b.parser[b.strictMode?"strict":"loose"].exec(a);for(var c={},e=14;e--;)c[b.key[e]]=a[e]||"";c[b.q.name]={};c[b.key[12]].replace(b.q.parser,function(g,k,q){if(k)c[b.q.name][k]=q});return c};
+EasyWebSocket.OPEN=1;EasyWebSocket.CLOSING=2;EasyWebSocket.CLOSED=3;EasyWebSocket.serverUrl="http://88.191.76.230:8950";EasyWebSocket.logFunction=function(){};EasyWebSocket.prototype.parseUri=function(a){var b=this.parseUri.options;a=b.parser[b.strictMode?"strict":"loose"].exec(a);for(var c={},e=14;e--;)c[b.key[e]]=a[e]||"";c[b.q.name]={};c[b.key[12]].replace(b.q.parser,function(g,k,q){if(k)c[b.q.name][k]=q});return c};
EasyWebSocket.prototype.parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};
View
2 easyWebSocket.min.js
@@ -104,5 +104,5 @@ for(var g=0;g<WebSocket.__tasks.length;++g)WebSocket.__tasks[g]();WebSocket.__ta
return c.enabledPlugin.filename.match(/flashlite/i)?true:false};window.webSocketLog=function(c){b.log(decodeURIComponent(c))};window.webSocketError=function(c){b.error(decodeURIComponent(c))};window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION||(window.addEventListener?window.addEventListener("load",WebSocket.__initialize,false):window.attachEvent("onload",WebSocket.__initialize))}else b.error("Flash Player is not installed.")}})();EasyWebSocket=function(a){var b=this;this.url=a;this.bufferedAmount=0;this.readyState=EasyWebSocket.CONNECTING;this._clientId="clientid-sio-"+this.url+"-"+Math.floor(Math.random()*999999).toString(36);this.log=EasyWebSocket.logFunction;this.onopen=function(){b.log("default onopen method")};this.onmessage=function(){b.log("default onmessage method")};this.onerror=function(){b.log("default onerror method")};this.onclose=function(){b.log("default onclose method")};this._sioCtor()};
EasyWebSocket.prototype._sioCtor=function(){var a=this,b=this.parseUri(EasyWebSocket.serverUrl),c=b.host;b=parseInt(b.port);WEB_SOCKET_SWF_LOCATION="http://easywebsocket.org/node/server/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMainInsecure.swf";this._sockio=new io.Socket(c,{port:b});this._sockio.connect();this._sockio.on("connect",function(){a.log("socket connected",a._sockio,a._clientId);a._sockio.send({type:"connect",data:{wsUrl:a.url,clientId:a._clientId}});
a.readyState=EasyWebSocket.CONNECTED;a.onopen()});this._sockio.on("connect_failed",function(){a.onerror()});this._sockio.on("message",function(e){a.log("received message",e);a.onmessage({data:e})});this._sockio.on("disconnect",function(){a.log("socket disconnected");a.onclose()})};EasyWebSocket.prototype.send=function(a){this._sockio.send({type:"message",data:{clientId:this._clientId,message:a}})};EasyWebSocket.prototype.close=function(){this._sockio.disconnect()};EasyWebSocket.CONNECTING=0;
-EasyWebSocket.OPEN=1;EasyWebSocket.CLOSING=2;EasyWebSocket.CLOSED=3;EasyWebSocket.serverUrl="http://88.191.76.230:8667";EasyWebSocket.logFunction=function(){};EasyWebSocket.prototype.parseUri=function(a){var b=this.parseUri.options;a=b.parser[b.strictMode?"strict":"loose"].exec(a);for(var c={},e=14;e--;)c[b.key[e]]=a[e]||"";c[b.q.name]={};c[b.key[12]].replace(b.q.parser,function(g,k,q){if(k)c[b.q.name][k]=q});return c};
+EasyWebSocket.OPEN=1;EasyWebSocket.CLOSING=2;EasyWebSocket.CLOSED=3;EasyWebSocket.serverUrl="http://88.191.76.230:8950";EasyWebSocket.logFunction=function(){};EasyWebSocket.prototype.parseUri=function(a){var b=this.parseUri.options;a=b.parser[b.strictMode?"strict":"loose"].exec(a);for(var c={},e=14;e--;)c[b.key[e]]=a[e]||"";c[b.q.name]={};c[b.key[12]].replace(b.q.parser,function(g,k,q){if(k)c[b.q.name][k]=q});return c};
EasyWebSocket.prototype.parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};
View
6 index.html
@@ -153,7 +153,7 @@
setInterval(function(){
if( mouseCurX == mouseOldX && mouseCurY == mouseOldY ) return;
socket.send(me + ' ' + tail.join(' '));
- tail = [];
+ tail = [];
mouseOldX = mouseCurX;
mouseOldY = mouseCurY;
}, 100)
@@ -175,7 +175,7 @@
inc++;
setTimeout(function() {
xy = xy.split(',');
- cursors[id].css({ left: xy[0] + 'px', top: xy[1] + 'px' });
+ cursors[id].css({ left: xy[0] + 'px', top: xy[1] + 'px' });
}, mul * inc);
})
}
@@ -189,7 +189,7 @@
mouseCurX = e.pageX;
mouseCurY = e.pageY;
tail.push([ mouseCurX, mouseCurY ]);
- cursors[me].css({ left: mouseCurX + 'px', top: mouseCurY + 'px' });
+ cursors[me].css({ left: (mouseCurX+2) + 'px', top: (mouseCurY+2) + 'px' });
})
})
</script>

0 comments on commit 208e4b1

Please sign in to comment.
Something went wrong with that request. Please try again.