File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed
Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change 1- // Github.js 0.7 .0
2- // (c) 2012 Michael Aufreiter, Development Seed
1+ // Github.js 0.8 .0
2+ // (c) 2013 Michael Aufreiter, Development Seed
33// Github.js is freely distributable under the MIT license.
44// For all details and documentation:
55// http://substance.io/michael/github
66
77( function ( ) {
8- var Github ;
8+
9+ // Initial Setup
10+ // -------------
11+
12+ if ( typeof exports !== 'undefined' ) {
13+ var XMLHttpRequest = require ( 'xmlhttprequest' ) . XMLHttpRequest ;
14+ var _ = require ( 'underscore' ) ;
15+ }
16+
917 var API_URL = 'https://api.github.com' ;
1018
11- Github = window . Github = function ( options ) {
19+ var Github = function ( options ) {
1220
1321 // HTTP Request Abstraction
1422 // =======
4856 data ? xhr . send ( JSON . stringify ( data ) ) : xhr . send ( ) ;
4957 }
5058
59+
60+
5161 // User API
5262 // =======
5363
496506 return new Github . Gist ( { id : id } ) ;
497507 } ;
498508 } ;
499- } ) . call ( this ) ;
509+
510+
511+ if ( typeof exports !== 'undefined' ) {
512+ // Github = exports;
513+ module . exports = Github ;
514+ } else {
515+ window . Github = Github ;
516+ }
517+ } ) . call ( this ) ;
You can’t perform that action at this time.
0 commit comments