File tree Expand file tree Collapse file tree 5 files changed +8
-98
lines changed
Expand file tree Collapse file tree 5 files changed +8
-98
lines changed Original file line number Diff line number Diff line change 1- _site /*
21.DS_Store
3-
4- test /.DS_Store
5- node_modules /
2+ node_modules /
3+ npm-debug.log
Original file line number Diff line number Diff line change @@ -279,13 +279,12 @@ Github.js is automatically™ tested by the users of [Prose](http://prose.io). B
279279Github.js has the following dependencies:
280280
281281- Underscore
282- - Base64 (for basic auth). You can leave this if you are not using basic auth.
282+ - btoa (included in modern browsers, an npm module is included in package.json for node)
283283
284284Include these before github.js :
285285
286286```
287287<script src="lib/underscore-min.js">
288- <script src="lib/base64.js">
289288<script src="github.js">
290289```
291290
Original file line number Diff line number Diff line change 1515 // Initial Setup
1616 // -------------
1717
18- var XMLHttpRequest , Base64 , _ ;
18+ var XMLHttpRequest , _ ;
1919 if ( typeof exports !== 'undefined' ) {
2020 XMLHttpRequest = require ( 'xmlhttprequest' ) . XMLHttpRequest ;
2121 _ = require ( 'underscore' ) ;
22- Base64 = require ( './lib/base64.js ' ) ;
23- } else {
22+ btoa = require ( 'btoa ' ) ;
23+ } else {
2424 _ = window . _ ;
25- Base64 = window . Base64 ;
2625 }
2726 //prefer native XMLHttpRequest always
2827 if ( typeof window !== 'undefined' && typeof window . XMLHttpRequest !== 'undefined' ) {
6362 xhr . setRequestHeader ( 'Accept' , 'application/vnd.github.v3.raw+json' ) ;
6463 xhr . setRequestHeader ( 'Content-Type' , 'application/json;charset=UTF-8' ) ;
6564 if ( ( options . token ) || ( options . username && options . password ) ) {
66- var authorization = options . token ? 'token ' + options . token : 'Basic ' + Base64 . encode ( options . username + ':' + options . password ) ;
65+ var authorization = options . token ? 'token ' + options . token : 'Basic ' + btoa ( options . username + ':' + options . password ) ;
6766 xhr . setRequestHeader ( 'Authorization' , authorization ) ;
6867 }
6968 if ( data )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 44 "description" : " A higher-level wrapper around the Github API." ,
55 "main" : " github.js" ,
66 "dependencies" : {
7+ "btoa" : " ^1.1.2" ,
78 "tape" : " ^3.0.3" ,
89 "underscore" : " ~1.6.0" ,
910 "xmlhttprequest" : " ~1.6.0"
You can’t perform that action at this time.
0 commit comments