mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
minor changes
This commit is contained in:
parent
a6f885c334
commit
640197a52e
5 changed files with 62 additions and 33 deletions
34
client.js
34
client.js
|
|
@ -375,6 +375,13 @@ CloudClient._currentToParent = function(pDirName){
|
|||
* инициализации
|
||||
*/
|
||||
CloudClient.init = function(){
|
||||
var lFunc = function(){
|
||||
Util.loadOnLoad([
|
||||
initModules,
|
||||
baseInit
|
||||
]);
|
||||
};
|
||||
|
||||
getByClass = DOM.getByClass;
|
||||
getById = DOM.getById;
|
||||
|
||||
|
|
@ -385,13 +392,13 @@ CloudClient.init = function(){
|
|||
this.OLD_BROWSER = true;
|
||||
DOM.jsload(CloudClient.LIBDIRCLIENT + 'ie.js',
|
||||
function(){
|
||||
DOM.jqueryLoad( baseInit );
|
||||
DOM.jqueryLoad( lFunc );
|
||||
});
|
||||
}
|
||||
else baseInit();
|
||||
}else
|
||||
lFunc();
|
||||
};
|
||||
|
||||
function initModules(){
|
||||
function initModules(pCallBack){
|
||||
|
||||
loadModule({
|
||||
/* привязываем клавиши к функциям */
|
||||
|
|
@ -408,11 +415,13 @@ function initModules(){
|
|||
if( Util.isArray(pModules) )
|
||||
for(var i = 0, n = pModules.length; i < n ; i++)
|
||||
loadModule(pModules[i]);
|
||||
|
||||
Util.exec(pCallBack);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function baseInit(){
|
||||
function baseInit(pCallBack){
|
||||
if(applicationCache){
|
||||
var lFunc = applicationCache.onupdateready;
|
||||
|
||||
|
|
@ -480,10 +489,23 @@ function baseInit(){
|
|||
'}'
|
||||
});
|
||||
|
||||
initModules();
|
||||
Util.exec(pCallBack || initModules);
|
||||
cloudcmd.KeyBinding();
|
||||
}
|
||||
|
||||
CloudClient.loadConfig = function(pCallBack){
|
||||
if(!cloudcmd.Config)
|
||||
return DOM.ajax({
|
||||
url:'/config.json',
|
||||
success: function(pConfig){
|
||||
cloudcmd.Config = pConfig;
|
||||
|
||||
Util.exec(pCallBack, pConfig);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/* функция меняет ссыки на ajax-овые */
|
||||
CloudClient._changeLinks = function(pPanelID){
|
||||
/* назначаем кнопку очистить кэш и показываем её */
|
||||
|
|
|
|||
|
|
@ -145,17 +145,6 @@ var CloudCommander, $, Util, DOM;
|
|||
return lID;
|
||||
},
|
||||
|
||||
DOM.loadOnload = function(pFunc_a){
|
||||
if( Util.isArray(pFunc_a) ) {
|
||||
var lFunc_f = pFunc_a.pop();
|
||||
|
||||
if(typeof lFunc_f === 'function')
|
||||
lFunc_f();
|
||||
|
||||
return DOM.loadOnload(pFunc_a);
|
||||
}
|
||||
else return Util.exec(pFunc_a);
|
||||
};
|
||||
|
||||
DOM.anyLoadOnLoad = function(pParams_a, pFunc){
|
||||
if( Util.isArray(pParams_a) ) {
|
||||
|
|
|
|||
|
|
@ -6,10 +6,8 @@ var CloudCommander, Util, DOM, $, Github;
|
|||
|
||||
var cloudcmd = CloudCommander,
|
||||
|
||||
CLIENT_ID = '435c670f44320e287ad6',
|
||||
//'891c251b925e4e967fa9',
|
||||
CLIENT_SECRET = 'a8b49e8c8c1a6253b149d224149a076270d8d614',
|
||||
//'afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545',
|
||||
CLIENT_ID, // = '891c251b925e4e967fa9',
|
||||
CLIENT_SECRET,// = 'afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545',
|
||||
GithubStore = {};
|
||||
|
||||
cloudcmd.Storage = {};
|
||||
|
|
@ -19,7 +17,7 @@ var CloudCommander, Util, DOM, $, Github;
|
|||
/**
|
||||
* function loads github.js
|
||||
*/
|
||||
function load(){
|
||||
function load(pCallBack){
|
||||
console.time('github load');
|
||||
|
||||
var lDir = './lib/client/storage/github/';
|
||||
|
|
@ -31,16 +29,23 @@ var CloudCommander, Util, DOM, $, Github;
|
|||
function(){
|
||||
console.timeEnd('github load');
|
||||
DOM.Images.hideLoad();
|
||||
init();
|
||||
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
}
|
||||
|
||||
function callback(pError, pDate){
|
||||
if(pError)
|
||||
console.log(pError);
|
||||
|
||||
if(pDate)
|
||||
console.log(pDate);
|
||||
function setConfig(pCallBack){
|
||||
cloudcmd.loadConfig(function(){
|
||||
var lConfig = cloudcmd.Config;
|
||||
CLIENT_ID = lConfig.oauth_client_id;
|
||||
CLIENT_SECRET = lConfig.oauth_client_secret;
|
||||
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
}
|
||||
|
||||
function callback(pError, pData){
|
||||
console.log(pError || pData);
|
||||
}
|
||||
|
||||
/* PUBLICK FUNCTIONS */
|
||||
|
|
@ -87,8 +92,10 @@ var CloudCommander, Util, DOM, $, Github;
|
|||
};
|
||||
|
||||
cloudcmd.Storage.Keys = function(){
|
||||
DOM.jqueryLoad( load );
|
||||
DOM.jqueryLoad(function(){
|
||||
Util.loadOnLoad([ init, load, setConfig ]);
|
||||
});
|
||||
};
|
||||
|
||||
cloudcmd.Storage.Github = GithubStore;
|
||||
cloudcmd.Storage.Github = GithubStore;
|
||||
})();
|
||||
|
|
|
|||
12
lib/util.js
12
lib/util.js
|
|
@ -58,6 +58,18 @@ var Util, exports;
|
|||
return lRet;
|
||||
};
|
||||
|
||||
Util.loadOnLoad = function(pFunc_a){
|
||||
if( Util.isArray(pFunc_a) ) {
|
||||
var lFunc = pFunc_a.pop();
|
||||
|
||||
Util.exec(lFunc, function(){
|
||||
return Util.loadOnLoad(pFunc_a);
|
||||
});
|
||||
}
|
||||
else
|
||||
return Util.exec(pFunc_a);
|
||||
};
|
||||
|
||||
/**
|
||||
* function remove substring from string
|
||||
* @param pStr
|
||||
|
|
|
|||
|
|
@ -3,6 +3,5 @@
|
|||
"viewer",
|
||||
"storage/_github",
|
||||
"terminal",
|
||||
"menu",
|
||||
"config"
|
||||
"menu"
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue