mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
refactored
This commit is contained in:
parent
701fefa632
commit
c4fd5bc1f5
10 changed files with 74 additions and 85 deletions
|
|
@ -1,22 +1,21 @@
|
|||
/* module make possible connectoin thrue socket.io on a client */
|
||||
var CloudCommander, DOM, Util, io;
|
||||
(function(CloudCommander, DOM, Util){
|
||||
"use strict";
|
||||
(function(CloudCmd, DOM, Util){
|
||||
'use strict';
|
||||
|
||||
var cloudcmd = CloudCommander,
|
||||
Messages = [],
|
||||
var Messages = [],
|
||||
socket,
|
||||
JqueryTerminal;
|
||||
|
||||
function getJqueryTerminal(){
|
||||
return cloudcmd.Terminal.JqueryTerminal;
|
||||
return CloudCmd.Terminal.JqueryTerminal;
|
||||
}
|
||||
|
||||
DOM.jsload('/socket.io/lib/socket.io.js', {
|
||||
onload : function(){
|
||||
socket = io.connect(document.location.hostname);
|
||||
|
||||
cloudcmd.Socket = socket;
|
||||
CloudCmd.Socket = socket;
|
||||
|
||||
socket.on('connect', function () {
|
||||
JqueryTerminal = getJqueryTerminal();
|
||||
|
|
@ -98,8 +97,7 @@ var CloudCommander, DOM, Util, io;
|
|||
*/
|
||||
Messages.push(pMsg);
|
||||
lResult = false;
|
||||
}
|
||||
|
||||
}
|
||||
console.log(pMsg);
|
||||
|
||||
return lResult;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue