added ability to connect github development id to cloud cmd working on any host

This commit is contained in:
coderaiser 2012-11-19 05:26:44 -05:00
parent 347bd9e5c8
commit 0fda72a425
4 changed files with 37 additions and 5 deletions

View file

@ -7,7 +7,9 @@ var CloudCommander, Util, DOM, $, Github, cb;
var cloudcmd = CloudCommander,
API_URL = '/api/v1/auth',
APIURL = '/api/v1',
AuthURL = APIURL + '/auth',
ClientIdURL = APIURL + '/client_id',
CLIENT_ID,
Cache = DOM.Cache,
GitHub,
@ -41,12 +43,22 @@ var CloudCommander, Util, DOM, $, Github, cb;
}
function setConfig(pCallBack){
/*
cloudcmd.loadConfig(function(){
var lConfig = cloudcmd.Config;
CLIENT_ID = lConfig.oauth_client_id;
Util.exec(pCallBack);
});
*/
DOM.ajax({
url : ClientIdURL,
success : function(pData){
CLIENT_ID = pData;
Util.exec(pCallBack);
}
});
}
function saveToken(pToken){
@ -89,7 +101,7 @@ var CloudCommander, Util, DOM, $, Github, cb;
DOM.ajax({
type : 'put',
url : API_URL,
url : AuthURL,
data: lCode,
success: function(pData){
if(pData && pData.token){