Repository navigation
Expand file tree
/
Copy pathprojects.html
More file actions
56 lines (47 loc) · 1.71 KB
/
Copy pathprojects.html
File metadata and controls
56 lines (47 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
layout: page
title: Projects
group: navigation
---
{% include JB/setup %}
<h3>This is a list of open-source projects on which I am working.</h3>
<p/>
<div id="github-projects">
</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
jQuery.writeProjectDiv = function() {
$('#github-projects').append("\
<div class='full'>\
<p class='repostats-link'>\
<a class='watchers' href='"+ this.html_url +"/watchers'>"+this.watchers+" watchers</a>\
<a class='forks' href='"+ this.html_url +"/network'>"+this.forks+" forks</a>\
</p>\
<h2 class='repo-title'><a href='" + this.html_url + "'>" + this.name + "</a></h2>\
<div class='repo-content full-content'>"+this.description+"</div>\
<div class='clear'></div>\
</div>\
<div class='rule'><hr/></div>");
}
$('#github-projects').html('');
<!-- Get all my Github projects -->
jQuery.getJSON("https://api.github.com/users/{{site.author.github}}/repos?callback=?", function(data) {
var repos = data.data;
<!-- Only display original repos -->
repos = repos.filter(function(element, index, array) {
return !element.fork && element.name != '{{site.author.github}}.github.com';
});
<!-- Manually add CTK -->
jQuery.getJSON("https://api.github.com/repos/commontk/CTK?callback=?", function(data) {
repos.push(data.data);
<!-- Manually add MITK -->
jQuery.getJSON("https://api.github.com/repos/MITK/MITK?callback=?", function(data) {
repos.push(data.data);
repos.sort(function(a,b) {
return b.watchers - a.watchers;
});
$(repos).each($.writeProjectDiv);
});
});
});
</script>