mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactored
This commit is contained in:
parent
34987517c2
commit
6655fc9eed
4 changed files with 39 additions and 34 deletions
13
client.js
13
client.js
|
|
@ -465,17 +465,20 @@ CloudClient.Util = (function(){
|
|||
* все параметры опциональны
|
||||
*/
|
||||
this.cssLoad = function(pParams_o){
|
||||
if(pParams_o instanceof Array){
|
||||
for(var i=0; i < pParams_o.length; i++){
|
||||
if( this.isArray(pParams_o) ){
|
||||
for(var i = 0, n = pParams_o.length; i < n; i++){
|
||||
pParams_o[i].name = 'link';
|
||||
pParams_o[i].parent = pParams_o.parent || document.head;
|
||||
}
|
||||
|
||||
return this.anyload(pParams_o);
|
||||
}
|
||||
}
|
||||
|
||||
else if( this.isString(pParams_o) )
|
||||
pParams_o = { src: pParams_o };
|
||||
|
||||
pParams_o.name = 'link';
|
||||
pParams_o.parent = pParams_o.parent || document.head;
|
||||
pParams_o.parent = pParams_o.parent || document.head;
|
||||
|
||||
return this.anyload(pParams_o);
|
||||
};
|
||||
|
|
@ -1631,7 +1634,7 @@ return CloudClient;
|
|||
|
||||
try{
|
||||
window.onload = function(){
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
/* базовая инициализация*/
|
||||
CloudCommander.init();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ var CloudCommander, io;
|
|||
socket,
|
||||
JqueryTerminal = cloudcmd.Terminal.JqueryTerminal;
|
||||
|
||||
Util.jsload("/socket.io/lib/socket.io.js", {
|
||||
Util.jsload('/socket.io/lib/socket.io.js', {
|
||||
onload : function(){
|
||||
socket = io.connect(document.location.hostname);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,38 +22,40 @@ var CloudCommander, $;
|
|||
* function loads jquery-terminal
|
||||
*/
|
||||
function load(){
|
||||
Util.cssLoad({
|
||||
src : 'lib/client/terminal/jquery-terminal/jquery.terminal.css'
|
||||
});
|
||||
console.time('terminal load');
|
||||
|
||||
var lDir = 'lib/client/terminal/jquery-terminal/jquery.';
|
||||
|
||||
Util.cssLoad(lDir + 'terminal.css');
|
||||
|
||||
Util.jsload('lib/client/socket.js');
|
||||
|
||||
var lLoadTerm_func = function(){
|
||||
Util.jsload('lib/client/terminal/jquery-terminal/jquery.terminal.js',
|
||||
function(){
|
||||
init();
|
||||
|
||||
$(function($, undefined) {
|
||||
Term = JqueryTerminal.Term = $('#terminal').terminal(function(command, term){
|
||||
term.echo('');
|
||||
cloudcmd.Socket.send(command);
|
||||
}, {
|
||||
greetings : '[[;#729FCF;]Cloud Commander Terminal]',
|
||||
prompt : '[[;#729FCF;]cloudcmd> ]',
|
||||
color : '#729FCF;'
|
||||
});
|
||||
|
||||
Util.anyLoadOnload([
|
||||
lDir + 'terminal.js',
|
||||
lDir + 'mousewheel.js'],
|
||||
|
||||
function(){
|
||||
console.timeEnd('terminal load');
|
||||
init();
|
||||
|
||||
$(function($, undefined) {
|
||||
Term = JqueryTerminal.Term = $('#terminal').terminal(function(command, term){
|
||||
term.echo('');
|
||||
cloudcmd.Socket.send(command);
|
||||
}, {
|
||||
greetings : '[[;#729FCF;]Cloud Commander Terminal]',
|
||||
prompt : '[[;#729FCF;]cloudcmd> ]',
|
||||
color : '#729FCF;'
|
||||
});
|
||||
/* removing resize function, no need for us */
|
||||
Term.resize = function(pEvent){};
|
||||
|
||||
$(window).unbind('resize');
|
||||
|
||||
JqueryTerminal.show();
|
||||
});
|
||||
};
|
||||
|
||||
Util.jsload('lib/client/terminal/jquery-terminal/jquery.mousewheel.js',
|
||||
lLoadTerm_func);
|
||||
/* removing resize function, no need for us */
|
||||
Term.resize = function(){};
|
||||
|
||||
$(window).unbind('resize');
|
||||
|
||||
JqueryTerminal.show();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ var CloudCommander, CloudFunc, $;
|
|||
* @pCallBack - executes, when everything loaded
|
||||
*/
|
||||
FancyBox.load = function(pCallBack){
|
||||
console.time('fancybox load');
|
||||
console.time('fancybox load');
|
||||
var lDir = FancyBox.dir;
|
||||
|
||||
Util.anyLoadOnload([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue