-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex1.js
66 lines (63 loc) · 1.79 KB
/
index1.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var oss = [
{
"url": "https://github.com/dharmafly/noodle",
"name": "dharmafly/noodle",
"stars": 707,
"forks": 71,
"prs": [
{
"url": "https://github.com/dharmafly/noodle/pull/122",
"title": "added request parameter to the result of noodle.. same as headers.. b…",
"state": "open"
}
]
},
{
"url": "https://github.com/Codigami/tech-crowdfire",
"name": "Codigami/tech-crowdfire",
"stars": 3,
"forks": 6,
"prs": [
{
"url": "https://github.com/Codigami/tech-crowdfire/pull/6",
"title": "let usage added",
"state": "merged"
}
]
}
];
var html = oss.map(function(repo) {
return (
'<li class="repos__item">' +
'<div class="repos__item__header">' +
'<a class="repos__item__name" href="' + repo.url + '" target="_blank" rel="noopener nofollow">' +
repo.name +
'</a>' +
'<div>' +
'<span class="repos__item__stat">' +
'<i class="icon-star"></i>' +
repo.stars +
'</span>' +
'<span class="repos__item__stat">' +
'<i class="icon-fork"></i>' +
repo.forks +
'</span>' +
'</div>' +
'</div>' +
'<span class="repos__item__body">Pull Requests:</span>' +
'<ul class="repos__item__list">' +
repo.prs.map(function(pr) {
return (
'<li class="repos__item__list__item">' +
'- <a href="' + pr.url + '" target="_blank" rel="noopener nofollow">' +
pr.title +
'</a>' +
' [' + pr.state + ']' +
'</li>'
);
}).join('') +
'</ul>' +
'</li>'
);
});
$('.js-repos-list').html(html.join(''));