added ability to disable web sockets

This commit is contained in:
coderaiser 2012-10-26 06:18:09 -04:00
parent 0a28289e42
commit f43dd7be61
5 changed files with 19 additions and 41 deletions

View file

@ -37,6 +37,8 @@ new module.
* Fixed bug with context menu hiding (on Esc). Keys was unbinded.
* Added ability to disable web sockets.
2012.10.01, Version 0.1.7

View file

@ -1243,10 +1243,10 @@ CloudClient.init = function(){
this.OLD_BROWSER = true;
Util.jsload(CloudClient.LIBDIRCLIENT + 'ie.js',
function(){
Util.jqueryLoad( initModules );
Util.jqueryLoad( baseInit );
});
}
else initModules();
else baseInit();
};
function initModules(){
@ -1264,9 +1264,7 @@ function initModules(){
success: function(pModules){
if( Util.isArray(pModules) )
for(var i = 0, n = pModules.length; i < n ; i++)
loadModule(pModules[i]);
baseInit();
loadModule(pModules[i]);
},
error: baseInit
@ -1340,7 +1338,9 @@ function baseInit(){
'.panel{' +
'height:' + lHeight +'px;' +
'}'
});
});
initModules();
}
/* функция меняет ссыки на ajax-овые */

View file

@ -9,6 +9,7 @@
},
"server" : true,
"logs" : false,
"socket" : true,
"port" : 31337,
"ip" : "127.0.0.1"
}

View file

@ -26,37 +26,6 @@ var CloudFunc = {
};
/* STRINGS */
/**
* function check is strings are equal
* @param pStr1
* @param pStr2
*/
CloudFunc.strCmp = function (pStr1, pStr2){
return this.isContainStr(pStr1, pStr2) &&
pStr1.length == pStr2.length;
};
/**
* function returns is pStr1 contains pStr2
* @param pStr1
* @param pStr2
*/
CloudFunc.isContainStr = function(pStr1, pStr2){
return pStr1 &&
pStr2 &&
pStr1.indexOf(pStr2) >= 0;
};
/**
* function remove substring from string
* @param pStr
* @param pSubStr
*/
CloudFunc.removeStr = function(pStr, pSubStr){
return pStr.replace(pSubStr,'');
};
/*
* Функция убирает последний слеш,
* если он - последний символ строки

View file

@ -21,6 +21,7 @@ var CloudServer = {
},
server : true,
logs : false,
socket : true,
port : 31337,
ip : '127.0.0.1'
},
@ -188,9 +189,13 @@ CloudServer.start = function (pConfig) {
this.Server = http.createServer(this._controller);
this.Server.listen(this.Port, this.IP);
if(CloudServer.Socket)
if(this.Config.socket && CloudServer.Socket){
CloudServer.Socket.listen(this.Server);
console.log('sockets running');
}
else
console.log('sockets disabled');
console.log('Cloud Commander server running at http://' +
this.IP + ':' + this.Port);
}catch(pError){
@ -296,7 +301,8 @@ CloudServer._controller = function(pReq, pRes)
var lNoJS_s = CloudFunc.NOJS;
var lFS_s = CloudFunc.FS;
console.log("request for " + pathname + " received...");
/* если в пути нет информации ни о ФС,
* ни об отсутствии js,
* ни о том, что это корневой
@ -450,7 +456,7 @@ CloudServer._controller = function(pReq, pRes)
CloudServer.Queries[DirPath] = lQuery;
/* Проверяем с папкой ли мы имеем дело */
/* читаем основные данные о файле */
Fs.stat(DirPath, CloudServer._stated);