Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f9f5d86

Browse files
committed
Merge branch 'master' of github.com:michael/github
2 parents a4458fb + b2e088b commit f9f5d86

File tree

5 files changed

+8
-98
lines changed

5 files changed

+8
-98
lines changed

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
_site/*
21
.DS_Store
3-
4-
test/.DS_Store
5-
node_modules/
2+
node_modules/
3+
npm-debug.log

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,12 @@ Github.js is automatically™ tested by the users of [Prose](http://prose.io). B
279279
Github.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

284284
Include 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

github.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
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'){
@@ -63,7 +62,7 @@
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)

lib/base64.js

Lines changed: 0 additions & 87 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
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"

0 commit comments

Comments
 (0)