modules moved to modules.json

This commit is contained in:
coderaiser 2012-10-25 09:20:48 -04:00
parent 8ea555e9ca
commit aea3d8d9ff
3 changed files with 36 additions and 34 deletions

View file

@ -106,30 +106,6 @@ var loadModule = function(pParams){
};
};
var Modules = [{
path : 'keyBinding.js',
func : function(){
KeyBinding = cloudcmd.KeyBinding;
KeyBinding.init();
}
},
'editor/_codemirror',
'viewer',
'storage/_github',
'terminal',
'menu',
{
path : 'config',
dobefore : function(){
Util.Images.showLoad({top: true});
}
}
];
/*
* Обьект для работы с кэшем
* в него будут включены функции для
@ -1267,10 +1243,34 @@ CloudClient.init = function(){
this.OLD_BROWSER = true;
Util.jsload(CloudClient.LIBDIRCLIENT + 'ie.js',
function(){
Util.jqueryLoad(CloudClient.baseInit);
Util.jqueryLoad( CloudClient.initModules );
});
}
else CloudClient.baseInit();
else CloudClient.initModules();
};
CloudClient.initModules = function(){
loadModule({
path : 'keyBinding.js',
func : function(){
KeyBinding = cloudcmd.KeyBinding;
KeyBinding.init();
}
});
Util.ajax({
url:'/modules.json',
success: function(pModules){
if( Util.isArray(pModules) )
for(var i = 0, n = pModules.length; i < n ; i++)
loadModule(pModules[i]);
CloudClient.baseInit();
},
error: CloudClient.baseInit
});
};
CloudClient.baseInit = function(){
@ -1340,13 +1340,7 @@ CloudClient.baseInit = function(){
'.panel{' +
'height:' + lHeight +'px;' +
'}'
});
for(var i = 0, n = Modules.length; i < n ; i++){
loadModule(Modules[i]);
}
});
};
/* функция меняет ссыки на ajax-овые */

View file

@ -74,7 +74,7 @@ var CloudCommander;
if(lKeyCode === KEY.O && event.altKey){
console.log('openning config window...');
Util.Images.showLoad();
Util.Images.showLoad({top: true});
if ( Util.isFunction(cloudcmd.Config) )
cloudcmd.Config();

8
modules.json Normal file
View file

@ -0,0 +1,8 @@
[
"editor/_codemirror",
"viewer",
"storage/_github",
"terminal",
"menu",
"config"
]