forked from maptime/maptime.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.js
33 lines (30 loc) · 1.04 KB
/
site.js
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
---
---
{% include js/handlebars-4.0.3.min.js %}
{% include js/lunr-0.5.12.min.js %}
{% include js/jquery.highlight.js %}
{% include js/glossary.js %}
function githubWatchers() {
var watchers = $('.followers');
$.ajax({
url: 'https://api.github.com/repos/' +
'maptime' + '/' +
'{{site.repo}}' + '/subscribers',
dataType: 'jsonp',
success: function(res) {
if (!res.data.length) return;
var template =
"<a class='thumbnail contain' href='http://github.com/<%=login%>' style='background-image:url(<%=avatar_url%>)'>" +
"<span class='popup center fill-light strong small round pad0y pad1x'>" +
"<span class='truncate'><%=login%></span>" +
"</span>" +
"</a>";
var data = _(res.data)
.map(function(i) { return _(template).template(i); })
.reverse()
.join('');
watchers.append(data);
}
});
};
$(githubWatchers);