minor changes

This commit is contained in:
coderaiser 2012-11-16 08:59:08 -05:00
parent ef1bc4133c
commit 5b64662696
2 changed files with 30 additions and 5 deletions

View file

@ -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,

View file

@ -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);
});
};