-
Notifications
You must be signed in to change notification settings - Fork 1
/
site.js
29 lines (26 loc) · 925 Bytes
/
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
---
---
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);