mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 01:47:35 +00:00
minor changes
This commit is contained in:
parent
ef1bc4133c
commit
5b64662696
2 changed files with 30 additions and 5 deletions
|
|
@ -74,10 +74,15 @@ var CloudCommander, Util, DOM, $, Github;
|
|||
url:'/api/v1/auth',
|
||||
data: lCode,
|
||||
success: function(pData){
|
||||
if(pData)
|
||||
GithubStore.Login(pData.token);
|
||||
var lToken = pData.token;
|
||||
|
||||
if(pData){
|
||||
GithubStore.Login(lToken);
|
||||
|
||||
getUserData(lToken);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
$.post("https://github.com/login/oauth/access_token",{
|
||||
|
|
@ -103,7 +108,25 @@ var CloudCommander, Util, DOM, $, Github;
|
|||
CLIENT_ID + '&&scope=repo,user,gist';
|
||||
};
|
||||
|
||||
cloudcmd.Storage.Keys = function(){
|
||||
function getUserData(pToken){
|
||||
var lHelloFunc = function(pData){
|
||||
var lName;
|
||||
if(pData)
|
||||
lName = ' ' + pData.name ;
|
||||
|
||||
console.log('Hello' + lName + ' :)!');
|
||||
};
|
||||
|
||||
if(pToken)
|
||||
$.ajax({
|
||||
url : 'https://api.github.com/user?access_token=' + pToken,
|
||||
success : lHelloFunc
|
||||
});
|
||||
else
|
||||
lHelloFunc();
|
||||
}
|
||||
|
||||
cloudcmd.Storage.Keys = function(){
|
||||
DOM.jqueryLoad( Util.retLoadOnLoad([
|
||||
init,
|
||||
setConfig,
|
||||
|
|
|
|||
|
|
@ -80,7 +80,9 @@
|
|||
// -------
|
||||
|
||||
this.show = function(username, cb) {
|
||||
_request("GET", "/users/"+username, null, function(err, res) {
|
||||
var command = username ? "/users/"+username : "/user";
|
||||
|
||||
_request("GET", command, null, function(err, res) {
|
||||
cb(err, res);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue