diff --git a/plugins/dropbox/dropbox.js b/plugins/dropbox/dropbox.js index add7bfdc..7a987046 100644 --- a/plugins/dropbox/dropbox.js +++ b/plugins/dropbox/dropbox.js @@ -68,11 +68,11 @@ exports.Dropbox = (function(){ } // Create your auth_url for the view - request.get({url:url, oauth:oauth}, function (e, r, body) { + request.get({url:url, oauth:oauth}, function (e, r, d) { if(e) return cb(e,null) - return cb(null,qs.parse(body)) + return cb(null,qs.parse(d)) }) // end request.get() @@ -86,11 +86,11 @@ exports.Dropbox = (function(){ , token_secret: dropbox_obj.oauth.access_token_secret } - request.get({url: ACCOUNT_INFO_URI, oauth:oauth}, function (e, r, b) { + request.get({url: ACCOUNT_INFO_URI, oauth:oauth}, function (e, r, d) { if(e) return cb(e,null) - return cb(null,b) + return cb(null,d) }) // end request.post() @@ -147,12 +147,12 @@ exports.Dropbox = (function(){ , token_secret: dropbox_obj.oauth.access_token_secret } - request.get({url: uri, oauth:oauth}, function (e, r, b) { + request.get({url: uri, oauth:oauth}, function (e, r, d) { if(e) return cb(e,null) - b = JSON.parse(b) - return cb(null,b) + d = JSON.parse(d) + return cb(null,d) }) // end request.get() diff --git a/plugins/github/github.js b/plugins/github/github.js index f581a6da..75584a01 100644 --- a/plugins/github/github.js +++ b/plugins/github/github.js @@ -43,14 +43,14 @@ exports.Github = (function(){ var uri = github_api + 'user?access_token=' + req.session.github.oauth - request.get(uri, function(err, resp, data){ - if(err) { - console.error(err) - return res.redirect(resp.statusCode) + request.get(uri, function(e, r, d){ + if(e) { + console.error(e) + return res.redirect(r.statusCode) } - else if(!err && resp.statusCode === 200) + else if(!e && r.statusCode === 200) { - var d = JSON.parse(data) + d = JSON.parse(d) req.session.github.username = d.login cb && cb() } @@ -104,17 +104,17 @@ exports.Github = (function(){ + req.body.repo +'/branches?access_token=' + req.session.github.oauth - request.get(uri, function(err, resp, data){ - if(err) { + request.get(uri, function(e, r, d){ + if(e) { res.send( { error: 'Request error.' - , data: resp.statusCode + , d: r.statusCode }) } - else if(!err && resp.statusCode === 200) + else if(!e && r.statusCode === 200) { - res.send(data) + res.send(d) } // end else if else{ res.json({error: 'Unable to fetch repos from Github.'}) @@ -134,18 +134,18 @@ exports.Github = (function(){ + '/git/trees/' + req.body.sha + '?recursive=1&access_token=' + req.session.github.oauth - request.get(uri, function(err, resp, data){ - if(err) { + request.get(uri, function(e, r, d){ + if(e) { res.send( { error: 'Request error.' - , data: resp.statusCode + , data: r.statusCode }) } - else if(!err && resp.statusCode === 200) + else if(!e && r.statusCode === 200) { - data = JSON.parse(data) - res.json(data) + d = JSON.parse(d) + res.json(d) } // end else if else{ res.json({error: 'Unable to fetch repos from Github.'}) @@ -164,25 +164,25 @@ exports.Github = (function(){ url += '?access_token=' + req.session.github.oauth } - request.get(url, function(err, resp, data){ - if(err){ + request.get(url, function(e, r, d){ + if(e){ res.send( { error: 'Request error.' - , data: resp.statusCode + , data: r.statusCode }) } - else if(!err && resp.statusCode === 200) + else if(!e && r.statusCode === 200) { var json_resp = { - data: data + data: d , error: false } if(isPrivateRepo){ - var d = JSON.parse(data) + d = JSON.parse(d) json_resp.data = (new Buffer(d.content, 'base64').toString('ascii')) } diff --git a/public/js/dillinger.js b/public/js/dillinger.js index b65f89a6..a5c9d5d4 100755 --- a/public/js/dillinger.js +++ b/public/js/dillinger.js @@ -947,6 +947,7 @@ $(function(){ repos.sort(_alphaNumSort) repos.forEach(function(item){ + console.log(item['private'] ); list += '
  • ' + item.name + '
  • ' })