From 4d6d0050304cd267504f6ac21179adede5edf93a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Sun, 25 Nov 2012 05:15:23 -0500 Subject: [PATCH] minor changes --- cloudcmd.js | 2 +- lib/client/storage/_github.js | 2 +- lib/client/storage/github/github.js | 37 +++++++++++++++++++++++++++-- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/cloudcmd.js b/cloudcmd.js index 5d17b1cb..a710a596 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -69,7 +69,7 @@ function appCacheProcessing(){ var lAppCache = srv.AppCache, - + lFiles = [ {'//themes.googleusercontent.com/static/fonts/droidsansmono/v4/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff' : './font/DroidSansMono.woff'}, {'//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js' : './lib/client/jquery.js'}]; diff --git a/lib/client/storage/_github.js b/lib/client/storage/_github.js index 3eac075f..44ea9997 100644 --- a/lib/client/storage/_github.js +++ b/lib/client/storage/_github.js @@ -73,7 +73,7 @@ var CloudCommander, Util, DOM, $, Github, cb; }; GithubStore.Login = function(pToken){ - cloudcmd.Storage.Github = GithubLocal = new Github({ + cloudcmd.Storage.Github = Github = GithubLocal = new Github({ token : pToken, auth : 'oauth' }); diff --git a/lib/client/storage/github/github.js b/lib/client/storage/github/github.js index 68b570ef..f01c44f3 100644 --- a/lib/client/storage/github/github.js +++ b/lib/client/storage/github/github.js @@ -81,8 +81,8 @@ this.show = function(username, cb) { var command = username ? "/users/"+username : "/user"; - - _request("GET", command, null, function(err, res) { + + _request("GET", "/users/"+username, null, function(err, res) { cb(err, res); }); }; @@ -113,6 +113,24 @@ cb(err, res); }); }; + + // Follow user + // ------- + + this.follow = function(username, cb) { + _request("PUT", "/user/following/"+username, null, function(err, res) { + cb(err, res); + }); + }; + + // Unfollow user + // ------- + + this.unfollow = function(username, cb) { + _request("DELETE", "/user/following/"+username, null, function(err, res) { + cb(err, res); + }); + }; }; @@ -419,6 +437,21 @@ }); }; + // Create the gist + // -------- + // { + // "description": "the description for this gist", + // "public": true, + // "files": { + // "file1.txt": { + // "content": "String file contents" + // } + // } + // } + + this.create = function(options, cb){ + _request("POST", "/gists", options, cb); + }; // Delete the gist // --------