from now api url on client readed from config.json

This commit is contained in:
coderaiser 2012-12-17 04:42:15 -05:00
parent 4eec65ed8f
commit f127db0cd5
2 changed files with 11 additions and 8 deletions

View file

@ -3,11 +3,11 @@ var CloudCommander, Util, DOM, $, Github, cb;
(function(){
"use strict";
var cloudcmd = CloudCommander,
Cache = DOM.Cache,
APIURL = '/api/v1',
APIURL,
AuthURL = APIURL + '/auth',
GitHub_ID,
@ -36,14 +36,15 @@ var CloudCommander, Util, DOM, $, Github, cb;
DOM.anyLoadInParallel(lFiles, function(){
console.timeEnd('github load');
DOM.Images.hideLoad();
Util.exec(pCallBack);
});
});
}
function setConfig(pCallBack){
cloudcmd.getConfig(function(pConfig){
GitHub_ID = pConfig.github_key;
APIURL = pConfig.api_url;
Util.exec(pCallBack);
});
}
@ -86,7 +87,7 @@ var CloudCommander, Util, DOM, $, Github, cb;
function getUserData(pCallBack){
var lName,
lShowUserInfo = function(pError, pData){
if(!pError){
lName = pData.name;
@ -96,7 +97,7 @@ var CloudCommander, Util, DOM, $, Github, cb;
else
DOM.Cache.remove('token');
};
User.show(null, lShowUserInfo);
Util.exec(pCallBack);
@ -136,7 +137,7 @@ var CloudCommander, Util, DOM, $, Github, cb;
public: true
};
lFiles[pFileName] ={
content: pContent
};