Skip to content

Commit 55cb984

Browse files
committed
Generate v0.2.8
1 parent 4d96358 commit 55cb984

File tree

5 files changed

+44
-43
lines changed

5 files changed

+44
-43
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ Also remember to follow [jQuery's Code Style](http://contribute.jquery.org/style
4949

5050
## History
5151

52+
* v0.2.8 April 30, 2013
53+
* Follow jQuery's core style guide
5254
* v0.2.7 April 29, 2013
5355
* Code refactoring
54-
* Follow jQuery's core style guide
5556
* Upgrade Grunt from v0.3 to v0.4
5657
* v0.2.6 March 14, 2013
5758
* Updated to responsive design

dist/jquery.github.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery Github - v0.2.7
2+
* jQuery Github - v0.2.8
33
* A jQuery plugin to display your Github Repositories.
44
* https://github.com/zenorocha/jquery-github/
55
*
@@ -18,10 +18,10 @@
1818
var self = this;
1919

2020
self.element = element;
21-
self.$container = $(element);
22-
self.repo = self.$container.attr("data-repo");
21+
self.$container = $( element );
22+
self.repo = self.$container.attr( "data-repo" );
2323

24-
self.options = $.extend( {}, defaults, options) ;
24+
self.options = $.extend( {}, defaults, options ) ;
2525

2626
self._defaults = defaults;
2727
self._name = pluginName;
@@ -34,82 +34,82 @@
3434
var self = this,
3535
cached = self.getCache();
3636

37-
if (cached !== null) {
38-
self.applyTemplate(JSON.parse(cached));
37+
if ( cached !== null ) {
38+
self.applyTemplate( JSON.parse( cached ) );
3939
}
4040
else {
41-
self.requestData(self.repo);
41+
self.requestData( self.repo );
4242
}
4343
};
4444

4545
// Apply results to HTML template
46-
Plugin.prototype.applyTemplate = function (repo) {
46+
Plugin.prototype.applyTemplate = function ( repo ) {
4747
var self = this,
48-
$widget = self.parseTemplate(repo);
48+
$widget = self.parseTemplate( repo );
4949

50-
$widget.appendTo(self.$container);
50+
$widget.appendTo( self.$container );
5151
};
5252

5353
// Stores repostories in sessionStorage if available
54-
Plugin.prototype.cacheResults = function (result_data) {
54+
Plugin.prototype.cacheResults = function ( result_data ) {
5555
var self = this;
5656

5757
// Cache data
58-
if (window.sessionStorage) {
59-
window.sessionStorage.setItem("gh-repos:" + self.repo, JSON.stringify(result_data));
58+
if ( window.sessionStorage ) {
59+
window.sessionStorage.setItem( "gh-repos:" + self.repo, JSON.stringify( result_data ) );
6060
}
6161
};
6262

6363
// Grab cached results
64-
Plugin.prototype.getCache = function () {
64+
Plugin.prototype.getCache = function() {
6565
var self = this;
6666

67-
if (window.sessionStorage) {
68-
return window.sessionStorage.getItem("gh-repos:" + self.repo);
67+
if ( window.sessionStorage ) {
68+
return window.sessionStorage.getItem( "gh-repos:" + self.repo );
6969
}
7070
else {
7171
return false;
7272
}
7373
};
7474

7575
// Handle Errors requests
76-
Plugin.prototype.handlerErrorRequests = function (result_data) {
76+
Plugin.prototype.handlerErrorRequests = function ( result_data ) {
7777
var self = this;
7878

79-
console.warn(result_data.message);
79+
console.warn( result_data.message );
8080
return;
8181
};
8282

8383
// Handle Successful request
84-
Plugin.prototype.handlerSuccessfulRequest = function (result_data) {
84+
Plugin.prototype.handlerSuccessfulRequest = function ( result_data ) {
8585
var self = this;
8686

87-
self.applyTemplate(result_data);
88-
self.cacheResults(result_data);
87+
self.applyTemplate( result_data );
88+
self.cacheResults( result_data );
8989
};
9090

9191
// Parses Pushed date with date format
92-
Plugin.prototype.parsePushedDate = function (pushed_at) {
92+
Plugin.prototype.parsePushedDate = function ( pushed_at ) {
9393
var self = this,
94-
date = new Date(pushed_at);
94+
date = new Date( pushed_at );
9595

96-
return date.getDate() + "/" + (date.getMonth() + 1) + "/" + date.getFullYear();
96+
return date.getDate() + "/" + ( date.getMonth() + 1 ) + "/" + date.getFullYear();
9797
};
9898

9999
// Parses repository URL to be friendly
100-
Plugin.prototype.parseRepositoryURL = function (url) {
100+
Plugin.prototype.parseRepositoryURL = function ( url ) {
101101
var self = this;
102102

103-
return url.replace("api.","").replace("repos/","");
103+
return url.replace( "api.", "" ).replace( "repos/", "" );
104104
};
105105

106106
// Parses HTML template
107-
Plugin.prototype.parseTemplate = function (repo) {
107+
Plugin.prototype.parseTemplate = function ( repo ) {
108108
var self = this,
109-
pushed_at = self.parsePushedDate(repo.pushed_at),
110-
repo_url = self.parseRepositoryURL(repo.url);
109+
pushed_at = self.parsePushedDate( repo.pushed_at ),
110+
repo_url = self.parseRepositoryURL( repo.url );
111111

112-
return $($.parseHTML(" \
112+
return $( $.parseHTML(" \
113113
<div class='github-box'> \
114114
<div class='github-box-header'> \
115115
<h3> \
@@ -128,36 +128,36 @@
128128
<a class='repo-download' href='" + repo_url + "'/zipball/master'>Download as zip</a> \
129129
</div> \
130130
</div> \
131-
"));
131+
") );
132132
};
133133

134134
// Request repositories from Github
135-
Plugin.prototype.requestData = function (repo) {
135+
Plugin.prototype.requestData = function ( repo ) {
136136
var self = this;
137137

138138
$.ajax({
139139
url: "https://api.github.com/repos/" + repo,
140140
dataType: "jsonp",
141-
success: function(results) {
141+
success: function( results ) {
142142
var result_data = results.data;
143143

144144
// Handle API failures
145-
if (results.meta.status >= 400 && result_data.message) {
145+
if ( results.meta.status >= 400 && result_data.message ) {
146146
self.handlerErrorRequest();
147147
}
148148
else {
149-
self.handlerSuccessfulRequest(result_data);
149+
self.handlerSuccessfulRequest( result_data );
150150
}
151151
}
152152
});
153153
};
154154

155-
$.fn[pluginName] = function ( options ) {
155+
$.fn[ pluginName ] = function ( options ) {
156156
return this.each(function () {
157-
if (!$.data(this, "plugin_" + pluginName)) {
158-
$.data(this, "plugin_" + pluginName, new Plugin( this, options ));
157+
if ( !$.data( this, "plugin_" + pluginName ) ) {
158+
$.data( this, "plugin_" + pluginName, new Plugin( this, options ) );
159159
}
160160
});
161161
};
162162

163-
}(jQuery, window));
163+
}( jQuery, window ) );

dist/jquery.github.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"repositories",
88
"git"
99
],
10-
"version": "0.2.5",
10+
"version": "0.2.8",
1111
"author": {
1212
"name": "Zeno Rocha",
1313
"url": "https://github.com/zenorocha"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "A jQuery plugin to display your Github Repositories.",
55
"author": "Zeno Rocha",
66
"homepage": "https://github.com/zenorocha/jquery-github/",
7-
"version": "0.2.7",
7+
"version": "0.2.8",
88
"devDependencies": {
99
"grunt": "~0.4.1",
1010
"grunt-cli": "~0.1.7",

0 commit comments

Comments
 (0)