From 449a279b4f91e2b815d82b9eb655180c88e44cdd Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 21 Sep 2012 08:47:15 -0400 Subject: [PATCH] minor changes --- lib/client/socket.js | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/lib/client/socket.js b/lib/client/socket.js index b67bed04..557f283d 100644 --- a/lib/client/socket.js +++ b/lib/client/socket.js @@ -8,30 +8,26 @@ var CloudCommander, io; Messages = [], socket, JqueryTerminal = cloudcmd.Terminal.JqueryTerminal; - - - var socketConfig_f = function(){ - socket = io.connect(document.location.hostname); - cloudcmd.Socket = socket; - - socket.on('connect', function () { - outToTerminal('socket connected'); - }); - - socket.on('message', function (msg) { - outToTerminal(msg); - - }); - - socket.on('disconnect', function () { - outToTerminal('socket disconected'); - socketConfig_f(); - }); - }; - Util.jsload("/socket.io/lib/socket.io.js", { - onload : socketConfig_f, + onload : function(){ + socket = io.connect(document.location.hostname); + + cloudcmd.Socket = socket; + + socket.on('connect', function () { + outToTerminal('socket connected'); + }); + + socket.on('message', function (msg) { + outToTerminal(msg); + + }); + + socket.on('disconnect', function () { + outToTerminal('socket disconected'); + }); + }, onerror : function(){ console.log('could not connect to socket.io\n'+