Skip to content

Commit bc71e99

Browse files
committedOct 8, 2015
Add completion counter
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 9d6d128 commit bc71e99

5 files changed

+87
-3
lines changed
 

‎checklist.html

+43-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@
1919
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
2020
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
2121
}
22+
23+
#counter {
24+
position: fixed;
25+
top: 5px;
26+
right: 5px;
27+
padding: 5px;
28+
border: 1px solid #ddd;
29+
font-size: 2em;
30+
transition: all 1s;
31+
}
32+
33+
#counter.complete {
34+
color: green;
35+
border-color: #bdb;
36+
background: #dfd;
37+
}
2238
</style>
2339
<!--[if lt IE 9]>
2440
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
@@ -27,7 +43,7 @@
2743
</head>
2844
<body>
2945
<div class="container">
30-
<h1>Nikola Release Checklist (v8/2015-09-04)</h1>
46+
<h1>Nikola Release Checklist (v9/2015-10-08)</h1>
3147
<h2>Requirements</h2>
3248
<p>In order to create a release, you need a bit of free time and a GPG setup. You could technically do without them (<code>git tag -am</code> + <code>twine upload</code> without <code>-s</code>), but it’s nicer if we have some confirmation it’s really you.</p>
3349
<h2>Housekeeping</h2>
@@ -103,5 +119,31 @@ <h2>Finishing up</h2>
103119
</div>
104120
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
105121
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
122+
<script>
123+
// Completed task counter
124+
// by Chris Warrick -- JS code in public domain
125+
var max = 0;
126+
var inp;
127+
$(document).ready(function() {
128+
inp = $('input');
129+
max = inp.length;
130+
$('#total').text(max);
131+
});
132+
$('input').click(function() {
133+
inp = $('input');
134+
var count = 0;
135+
for (var i = 0; i < inp.length; i++) {
136+
if (inp[i].checked) {
137+
count += 1;
138+
}
139+
}
140+
$('#current').text(count);
141+
if (count == max) {
142+
$('#counter').addClass('complete');
143+
} else {
144+
$('#counter').removeClass('complete');
145+
}
146+
});
147+
</script>
106148
</body>
107149
</html>

‎src/bootstrap-foot.html

+26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
</div>
22
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
33
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
4+
<script>
5+
// Completed task counter
6+
// by Chris Warrick -- JS code in public domain
7+
var max = 0;
8+
var inp;
9+
$(document).ready(function() {
10+
inp = $('input');
11+
max = inp.length;
12+
$('#total').text(max);
13+
});
14+
$('input').click(function() {
15+
inp = $('input');
16+
var count = 0;
17+
for (var i = 0; i < inp.length; i++) {
18+
if (inp[i].checked) {
19+
count += 1;
20+
}
21+
}
22+
$('#current').text(count);
23+
if (count == max) {
24+
$('#counter').addClass('complete');
25+
} else {
26+
$('#counter').removeClass('complete');
27+
}
28+
});
29+
</script>
430
</body>
531
</html>

‎src/bootstrap-head.html

+16
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@
1919
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
2020
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
2121
}
22+
23+
#counter {
24+
position: fixed;
25+
top: 5px;
26+
right: 5px;
27+
padding: 5px;
28+
border: 1px solid #ddd;
29+
font-size: 2em;
30+
transition: all 1s;
31+
}
32+
33+
#counter.complete {
34+
color: green;
35+
border-color: #bdb;
36+
background: #dfd;
37+
}
2238
</style>
2339
<!--[if lt IE 9]>
2440
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>

‎src/checklist.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1>Nikola Release Checklist (v8/2015-09-04)</h1>
1+
<h1>Nikola Release Checklist (v9/2015-10-08)</h1>
22
<h2>Requirements</h2>
33
<p>In order to create a release, you need a bit of free time and a GPG setup. You could technically do without them (<code>git tag -am</code> + <code>twine upload</code> without <code>-s</code>), but it’s nicer if we have some confirmation it’s really you.</p>
44
<h2>Housekeeping</h2>

‎src/checklist.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Nikola Release Checklist (v8/2015-09-04)
1+
# Nikola Release Checklist (v9/2015-10-08)
22

33
## Requirements
44

0 commit comments

Comments
 (0)
Failed to load comments.