This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

remove pr calls and add some docs

  • Loading branch information...
schacon committed Jun 20, 2011
1 parent 50bb980 commit bf0a9184aa79d69f26aae9812f73920341948fa8
Showing with 8 additions and 49 deletions.
  1. +4 −1 README.md
  2. +4 −48 public/js/github.js
View
@@ -1,6 +1,8 @@
# GitHub Terminal
-This is an example application written to demonstrate what is possible with the new GitHub Git Data API and GitHub OAuth2 services. This app allows you to login as your GitHub user and edit and commit groups of files through a virtual terminal. With this you could contribute meaningfully to a project using just Javascript in the browser - no Git or editor needs to be installed locally.
+This is an example application written to demonstrate what is possible with the new GitHub [Git Data API][api] and GitHub OAuth2 services. This app allows you to login as your GitHub user and edit and commit groups of files through a virtual terminal. With this you could contribute meaningfully to a project using just Javascript in the browser - no Git or editor needs to be installed locally.
+
+[api]: http://developer.github.com/v3/git/
# Features
@@ -27,6 +29,7 @@ You can `cd` into a project and a branch, then an `ls` will show you the project
* Ace JS Editor (http://ace.ajax.org/)
* Termlib (http://www.masswerk.at/termlib/)
+* GitHub-API JS Library (https://github.com/fitzgen/github-api) (hacked to death)
# Contributing
View
@@ -1,4 +1,8 @@
// ## Client-side Javascript API wrapper for GitHub (mostly v3)
+//
+// Stolen, stripped and rebuilt from https://github.com/fitzgen/github-api
+// thanks to Nick Fitzgerald
+//
(function (globals) {
@@ -354,54 +358,6 @@
return this;
};
-
- // ### Pull Requests
-
- gh.pulls = function(user, repo) {
- if (!(this instanceof gh.pulls)) {
- return new gh.pulls(user, repo);
- }
- this.user = user;
- this.repo = repo;
- };
-
- // Get all pull requests for the repo
- //
- // gh.pulls("fitzgen", "github-api").allPulls(function (data) {
- // data.pulls.forEach(function (pull) {
- // console.log("Title: " + pull.title);
- // });
- // });
- gh.pulls.prototype.allPulls = function (callback, context) {
- jsonp("pulls/" + this.user + "/" + this.repo, callback, context);
- return this;
- };
-
- // Get pull requests filtered by state. `state` can be "open" or "closed".
- //
- // gh.pulls("fitzgen", "github-api").forState("closed", function (data) {
- // data.pulls.forEach(function (pull) {
- // console.log("Title: " + pull.title + " State: " + pull.state);
- // });
- // });
- gh.pulls.prototype.forState = function (state, callback, context) {
- jsonp("pulls/" + this.user + "/" + this.repo + "/" + state, callback, context);
- return this;
- };
-
- // Get pull requests by number
- //
- // Important: This call returns a single object called "pull" instead of multiple "pulls" objects!
- //
- // gh.pulls("fitzgen", "github-api").forNumber("1", function (data) {
- // console.log("Title: " + data.pull.title + " Number: " + data.pull.number);
- // });
- gh.pulls.prototype.forNumber = function (number, callback, context) {
- jsonp("pulls/" + this.user + "/" + this.repo + "/" + number, callback, context);
- return this;
- };
-
-
}(window));
var Base64 = {

0 comments on commit bf0a918

Please sign in to comment.