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 /*
2
1
.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
279
279
Github.js has the following dependencies:
280
280
281
281
- 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)
283
283
284
284
Include these before github.js :
285
285
286
286
```
287
287
<script src="lib/underscore-min.js">
288
- <script src="lib/base64.js">
289
288
<script src="github.js">
290
289
```
291
290
Original file line number Diff line number Diff line change 15
15
// Initial Setup
16
16
// -------------
17
17
18
- var XMLHttpRequest , Base64 , _ ;
18
+ var XMLHttpRequest , _ ;
19
19
if ( typeof exports !== 'undefined' ) {
20
20
XMLHttpRequest = require ( 'xmlhttprequest' ) . XMLHttpRequest ;
21
21
_ = require ( 'underscore' ) ;
22
- Base64 = require ( './lib/base64.js ' ) ;
23
- } else {
22
+ btoa = require ( 'btoa ' ) ;
23
+ } else {
24
24
_ = window . _ ;
25
- Base64 = window . Base64 ;
26
25
}
27
26
//prefer native XMLHttpRequest always
28
27
if ( typeof window !== 'undefined' && typeof window . XMLHttpRequest !== 'undefined' ) {
63
62
xhr . setRequestHeader ( 'Accept' , 'application/vnd.github.v3.raw+json' ) ;
64
63
xhr . setRequestHeader ( 'Content-Type' , 'application/json;charset=UTF-8' ) ;
65
64
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 ) ;
67
66
xhr . setRequestHeader ( 'Authorization' , authorization ) ;
68
67
}
69
68
if ( data )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4
4
"description" : " A higher-level wrapper around the Github API." ,
5
5
"main" : " github.js" ,
6
6
"dependencies" : {
7
+ "btoa" : " ^1.1.2" ,
7
8
"tape" : " ^3.0.3" ,
8
9
"underscore" : " ~1.6.0" ,
9
10
"xmlhttprequest" : " ~1.6.0"
You can’t perform that action at this time.
0 commit comments