Skip to content

Commit

Permalink
Add completion counter
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Oct 8, 2015
1 parent 9d6d128 commit bc71e99
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 3 deletions.
44 changes: 43 additions & 1 deletion checklist.html
Expand Up @@ -19,6 +19,22 @@
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
}

#counter {
position: fixed;
top: 5px;
right: 5px;
padding: 5px;
border: 1px solid #ddd;
font-size: 2em;
transition: all 1s;
}

#counter.complete {
color: green;
border-color: #bdb;
background: #dfd;
}
</style>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
Expand All @@ -27,7 +43,7 @@
</head>
<body>
<div class="container">
<h1>Nikola Release Checklist (v8/2015-09-04)</h1>
<h1>Nikola Release Checklist (v9/2015-10-08)</h1>
<h2>Requirements</h2>
<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>
<h2>Housekeeping</h2>
Expand Down Expand Up @@ -103,5 +119,31 @@ <h2>Finishing up</h2>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script>
// Completed task counter
// by Chris Warrick -- JS code in public domain
var max = 0;
var inp;
$(document).ready(function() {
inp = $('input');
max = inp.length;
$('#total').text(max);
});
$('input').click(function() {
inp = $('input');
var count = 0;
for (var i = 0; i < inp.length; i++) {
if (inp[i].checked) {
count += 1;
}
}
$('#current').text(count);
if (count == max) {
$('#counter').addClass('complete');
} else {
$('#counter').removeClass('complete');
}
});
</script>
</body>
</html>
26 changes: 26 additions & 0 deletions src/bootstrap-foot.html
@@ -1,5 +1,31 @@
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script>
// Completed task counter
// by Chris Warrick -- JS code in public domain
var max = 0;
var inp;
$(document).ready(function() {
inp = $('input');
max = inp.length;
$('#total').text(max);
});
$('input').click(function() {
inp = $('input');
var count = 0;
for (var i = 0; i < inp.length; i++) {
if (inp[i].checked) {
count += 1;
}
}
$('#current').text(count);
if (count == max) {
$('#counter').addClass('complete');
} else {
$('#counter').removeClass('complete');
}
});
</script>
</body>
</html>
16 changes: 16 additions & 0 deletions src/bootstrap-head.html
Expand Up @@ -19,6 +19,22 @@
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
}

#counter {
position: fixed;
top: 5px;
right: 5px;
padding: 5px;
border: 1px solid #ddd;
font-size: 2em;
transition: all 1s;
}

#counter.complete {
color: green;
border-color: #bdb;
background: #dfd;
}
</style>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion src/checklist.html
@@ -1,4 +1,4 @@
<h1>Nikola Release Checklist (v8/2015-09-04)</h1>
<h1>Nikola Release Checklist (v9/2015-10-08)</h1>
<h2>Requirements</h2>
<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>
<h2>Housekeeping</h2>
Expand Down
2 changes: 1 addition & 1 deletion src/checklist.md
@@ -1,4 +1,4 @@
# Nikola Release Checklist (v8/2015-09-04)
# Nikola Release Checklist (v9/2015-10-08)

## Requirements

Expand Down

0 comments on commit bc71e99

Please sign in to comment.