From a3b997fc6907dcbffe0cf5ad75c3a2bcef4edb19 Mon Sep 17 00:00:00 2001 From: Zeno Rocha Date: Fri, 28 Nov 2014 14:10:20 -0800 Subject: [PATCH 1/5] Update attribute names - "stargazers" > "stargazers_count" & "forks" > "forks_count" --- spec/jquery.github.repo-spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/jquery.github.repo-spec.js b/spec/jquery.github.repo-spec.js index 0169e4e..88464bb 100644 --- a/spec/jquery.github.repo-spec.js +++ b/spec/jquery.github.repo-spec.js @@ -6,10 +6,10 @@ describe("jquery.github.repo", function() { instance = new GithubRepo({ name: "jquery-github", description: "A jQuery plugin to display your Github Repositories", - forks: 33, + forks_count: 33, pushed_at: "2013-07-02T12:08:36Z", url: "https://api.github.com/repos/zenorocha/jquery-github", - stargazers: 131 + stargazers_count: 131 }); }); From 3b135ab8ce96523fe33f07680d8fb06fa501feea Mon Sep 17 00:00:00 2001 From: Zeno Rocha Date: Fri, 28 Nov 2014 14:11:16 -0800 Subject: [PATCH 2/5] Bump version in dist files --- dist/jquery.github.js | 2 +- dist/jquery.github.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/jquery.github.js b/dist/jquery.github.js index a3e88a1..27e6de9 100644 --- a/dist/jquery.github.js +++ b/dist/jquery.github.js @@ -1,5 +1,5 @@ /* - * jquery-github - v0.3.4 + * jquery-github - v0.4.0 * A jQuery plugin to display your Github Repositories. * https://github.com/zenorocha/jquery-github * diff --git a/dist/jquery.github.min.js b/dist/jquery.github.min.js index 3f350b3..4d06fc4 100644 --- a/dist/jquery.github.min.js +++ b/dist/jquery.github.min.js @@ -1,5 +1,5 @@ /* - * jquery-github - v0.3.4 + * jquery-github - v0.4.0 * A jQuery plugin to display your Github Repositories. * https://github.com/zenorocha/jquery-github * From 3c8c8c083a54c4466376369ec47bc497e77dd454 Mon Sep 17 00:00:00 2001 From: Tadeu Zagallo Date: Thu, 8 Jan 2015 01:31:23 -0200 Subject: [PATCH 3/5] Move displayIcons to be called inside applyTemplate --- src/jquery.github.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jquery.github.js b/src/jquery.github.js index 1fadfa9..197663b 100644 --- a/src/jquery.github.js +++ b/src/jquery.github.js @@ -67,7 +67,6 @@ function Github( element, options ) { this._defaults = defaults; this.init(); - this.displayIcons(); } // Initializer @@ -151,6 +150,8 @@ Github.prototype.applyTemplate = function ( repo ) { $widget = githubRepo.toHTML(); $widget.appendTo( this.$container ); + + this.displayIcons(); }; // -- Attach plugin to jQuery's prototype -------------------------------------- From 00710d66c0d4b36d09b802684c03663172efc649 Mon Sep 17 00:00:00 2001 From: Zeno Rocha Date: Thu, 10 Mar 2016 11:09:12 -0800 Subject: [PATCH 4/5] Uses parsed URL from API --- src/jquery.github.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/jquery.github.js b/src/jquery.github.js index 197663b..97f0871 100644 --- a/src/jquery.github.js +++ b/src/jquery.github.js @@ -6,14 +6,13 @@ function GithubRepo( repo ) { this.name = repo.name; this.open_issues = repo.open_issues; this.pushed_at = repo.pushed_at; - this.url = repo.url; + this.url = repo.html_url; this.stargazers = repo.stargazers_count; } // Parses HTML template GithubRepo.prototype.toHTML = function () { - this.pushed_at = this._parsePushedDate( this.pushed_at ), - this.url = this._parseURL( this.url ); + this.pushed_at = this._parsePushedDate( this.pushed_at ); return $( "
" + @@ -44,11 +43,6 @@ GithubRepo.prototype._parsePushedDate = function ( pushed_at ) { return date.getDate() + "/" + ( date.getMonth() + 1 ) + "/" + date.getFullYear(); }; -// Parses URL to be friendly -GithubRepo.prototype._parseURL = function ( url ) { - return url.replace( "api.", "" ).replace( "repos/", "" ); -}; - // -- Github Plugin ------------------------------------------------------------ function Github( element, options ) { From 98f752cf92ef99ff49df5c574c98b3753db55591 Mon Sep 17 00:00:00 2001 From: Zeno Rocha Date: Thu, 10 Mar 2016 11:13:26 -0800 Subject: [PATCH 5/5] Removes broken test --- spec/jquery.github.repo-spec.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/spec/jquery.github.repo-spec.js b/spec/jquery.github.repo-spec.js index 88464bb..28c4d12 100644 --- a/spec/jquery.github.repo-spec.js +++ b/spec/jquery.github.repo-spec.js @@ -34,11 +34,6 @@ describe("jquery.github.repo", function() { .toEqual("2013-07-02T12:08:36Z"); }); - it("should be repository's api url", function() { - expect(instance.url) - .toEqual("https://api.github.com/repos/zenorocha/jquery-github"); - }); - it("should be repository's number of stargazers", function() { expect(instance.stargazers) .toEqual(131); @@ -52,14 +47,4 @@ describe("jquery.github.repo", function() { }); }); - describe("execute _parseURL()", function() { - it("should parse repository's url attribute", function() { - expect(instance._parseURL(instance.url)) - .toEqual("https://github.com/zenorocha/jquery-github"); - }); - }); - - describe("execute toHTML()", function() { - // TODO - }); });