|
1 |
| -/* DownloadBuilder.js - v0.5.0 - 2012-09-12 |
| 1 | +/* DownloadBuilder.js - v0.6.0 - 2012-12-12 |
2 | 2 | * http://www.gregfranko.com/downloadBuilder.js/
|
3 | 3 | * Copyright (c) 2012 Greg Franko; Licensed MIT */
|
4 | 4 |
|
|
35 | 35 | "repo": (obj && obj.repo) || "",
|
36 | 36 |
|
37 | 37 | // Github branch option
|
38 |
| - "branch": (obj && obj.branch) || "" |
| 38 | + "branch": (obj && obj.branch) || "", |
| 39 | + |
| 40 | + // Github client id |
| 41 | + "client_id": (obj && obj.client_id) || "", |
| 42 | + |
| 43 | + // Github client secret |
| 44 | + "client_secret": (obj && obj.client_secret) || "" |
39 | 45 |
|
40 | 46 | };
|
41 | 47 |
|
|
61 | 67 | DownloadBuilder.prototype = {
|
62 | 68 |
|
63 | 69 | // Library Version Number
|
64 |
| - VERSION: "0.5.0", |
| 70 | + VERSION: "0.6.0", |
65 | 71 |
|
66 | 72 | //Github Rate Limit URL
|
67 | 73 | githubRateLimitUrl: "https://api.github.com/rate_limit",
|
|
162 | 168 | var self = this;
|
163 | 169 |
|
164 | 170 | // Calls the custom JSONP method (created by Oscar Goodson)
|
165 |
| - this.JSONP(this.githubRateLimitUrl, function(data){ |
| 171 | + this.JSONP(this.githubRateLimitUrl + "?client_id=" + this.options.client_id + "&client_secret=" + this.options.client_secret, function(data){ |
166 | 172 |
|
167 | 173 | // Sets an instance variable that determines if the Github rate limit has been reached or not
|
168 | 174 | self.rateLimit = data.data.rate.remaining;
|
|
492 | 498 | this.rateLimit -= 1;
|
493 | 499 |
|
494 | 500 | // Sends a third party file request
|
495 |
| - this._thirdPartyRequest({ "type": obj.location, "url": "https://api.github.com/repos/" + obj.repoAuthor + "/" + obj.repoName + "/contents/?ref=" + obj.repoBranch + "&path=" + obj.currentElem.value, "elem": obj.currentElem, "time": obj.time, "lastElem": obj.lastElem, "lang": obj.lang, "fileName": obj.fileName }); |
| 501 | + this._thirdPartyRequest({ "type": obj.location, "url": "https://api.github.com/repos/" + obj.repoAuthor + "/" + obj.repoName + "/contents/?ref=" + obj.repoBranch + "&path=" + obj.currentElem.value + "&client_id=" + this.options.client_id + "&client_secret=" + this.options.client_secret, "elem": obj.currentElem, "time": obj.time, "lastElem": obj.lastElem, "lang": obj.lang, "fileName": obj.fileName }); |
496 | 502 |
|
497 | 503 | }
|
498 | 504 |
|
|
0 commit comments