-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
78 lines (65 loc) · 2.18 KB
/
index.html
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
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="utf-8" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js"></script>
<style>
.title { font-size: 2em; margin-right: 0.5em; }
img { float: right; margin: 1em; }
#issues thead { text-align: left; }
#issues td { text-align: left; padding: 0 0.5em; }
#issues tr { line-height: 1.5em; }
</style>
</head>
<body>
<h1>MozTW 網站更新松進度一覽</h1>
<div id="stats">
<p>
<span class="title">完成率 <span class="perc">0</span> %</span>
<span class="reviewed">0</span> / <span class="all"></span>
</p>
<img src="images.gif" alt="">
<table id="issues">
<thead>
<tr>
<th></th>
<th>Open Issues</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<ul id="issues">
<script id="issues-template" type="text/x-handlebars-template">
{{#each data}}
<tr>
<td>{{@index}}.</td>
<td><a href="{{url}}" target="_blank">{{title}}</url></td>
{{/each}}
</script>
</ul>
</div>
<script>
function init(data){
var milestone = data[0].milestone;
var len = milestone.closed_issues + milestone.open_issues;
var owned = 0;
var owner = {};
var $stat = $('#stats');
$stat.find('.perc').text(Math.round(milestone.closed_issues/len * 1000)/10);
$stat.find('.reviewed').text(milestone.closed_issues);
$stat.find('.all').text(len);
var source = $("#issues-template").html();
var issuehbs = Handlebars.compile(source);
var dat = { 'data': data };
$stat.find('#issues tbody').html(issuehbs(dat));
window.setTimeout(function(){ init(data); }, 60000);
};
window.getDat = function(data){
init(data.data);
};
</script>
<script type="text/javascript" src="https://api.github.com/repos/moztw/www.moztw.org/issues?milestone=4&callback=getDat"></script>
</body>
</html>