From: Brian Jones Date: Wed, 26 Sep 2012 20:26:27 +0000 (-0700) Subject: Fixing ip finding error. Also putting mouse events back in. X-Git-Tag: 1.0_branch X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2F1.0_branch;p=profile%2Fivi%2Fremotecontrol.git Fixing ip finding error. Also putting mouse events back in. --- 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)