diff options
-rw-r--r-- | remotecontrol/www/js/masterControl.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/remotecontrol/www/js/masterControl.js b/remotecontrol/www/js/masterControl.js index fdab9a3..733f541 100644 --- a/remotecontrol/www/js/masterControl.js +++ b/remotecontrol/www/js/masterControl.js @@ -149,10 +149,8 @@ function loadImages(sources, callback) function connect() { var host = window.location.hostname; - if(host == "localhost") - ws = new WebSocket("ws://localhost:9999/"); - else - ws = new WebSocket("ws://10.7.198.99:9999/"); + ws = new WebSocket("ws://" + host + ":9999/"); + ws.onopen = function() { send({ "type": "connect", @@ -256,12 +254,11 @@ button: "assets/button.png", $(window).bind('resize', resizeCanvas); - //mouseClicksLayer.addEventListener('mousemove', onMouseMove); - //mouseClicksLayer.addEventListener('mouseup', onMouseUp); + mouseClicksLayer.addEventListener('mousemove', onMouseMove); + mouseClicksLayer.addEventListener('mousedown', onMouseDown); mouseClicksLayer.addEventListener('touchmove', onTouchMove); mouseClicksLayer.addEventListener('touchstart', onTouchStart); mouseClicksLayer.addEventListener('touchend', onTouchEnd); - //connect(); } function switchMenu(nextMenu) |