Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added Homepage repository to list, small refactorings

  • Loading branch information...
commit 0e82c491d4f3337c2686b506fe1eedc9ee47b814 1 parent 0cf0c77
@afranken authored
Showing with 23 additions and 26 deletions.
  1. +23 −26 js/git.js
View
49 js/git.js
@@ -1,32 +1,29 @@
jQuery(document).ready(function($) {
- var repos = $('#repositories');
- var username = 'afranken';
+ var repos = $('#repositories');
+ var username = 'afranken';
- $.getJSON('http://github.com/api/v2/json/repos/show/' + username + '?callback=?', function(data, status) {
- $.each(data.repositories.reverse(), function() {
+ $.getJSON('http://github.com/api/v2/json/repos/show/' + username + '?callback=?', function(data, status) {
+ $.each(data.repositories.reverse(), function() {
- if (this.name != username + '.github.com') {
- var fork = this.fork ? ('<span class="forked">forked</span>') : (''),
- page = this.homepage ? ('<a title="Link to Homepage or Post" href="' + this.homepage + '">Homepage or Post</a>') : ('')
- line = $('<li> \
- <h3><a href="' + this.url + '">' + this.name + '</a></h3> \
- ' + fork + ' \
- <span title="Pushed at">' + this.pushed_at.slice(0, 10) + '</span> \
- <div> \
- <span>' + this.language + '</span> \
- <span title="Watchers">' + this.watchers + '</span> \
- <span title="Forks">' + this.forks + '</span> \
- </div> \
- <p> \
- ' + this.description + page + ' \
- </p> \
- </li>').hide();
+ var fork = this.fork ? ('<span class="forked">forked</span>') : ('');
+ var page = this.homepage ? ('<a title="Link to Homepage" href="' + this.homepage + '">Homepage</a>') : ('');
+ var line = $('<li> \
+ <h3><a href="' + this.url + '">' + this.name + '</a></h3> \
+ ' + fork + ' \
+ <span title="Pushed at">' + this.pushed_at.slice(0, 10) + '</span> \
+ <div> \
+ <span>' + this.language + '</span> \
+ <span title="Watchers">' + this.watchers + '</span> \
+ <span title="Forks">' + this.forks + '</span> \
+ </div> \
+ <p> \
+ ' + this.description + page + ' \
+ </p> \
+ </li>').hide();
- $(repos).append(line);
- $(line).fadeIn(500);
- }
-
- });
- });
+ $(repos).append(line);
+ $(line).fadeIn(500);
+ });
+ });
});
Please sign in to comment.
Something went wrong with that request. Please try again.