Permalink
Browse files

Add completion counter

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information...
1 parent 9d6d128 commit bc71e99b2d1b72cb615e7f024d000695523f6a0d @Kwpolska Kwpolska committed Oct 8, 2015
Showing with 87 additions and 3 deletions.
  1. +43 −1 checklist.html
  2. +26 −0 src/bootstrap-foot.html
  3. +16 −0 src/bootstrap-head.html
  4. +1 −1 src/checklist.html
  5. +1 −1 src/checklist.md
View
@@ -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>
@@ -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>
@@ -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>
View
@@ -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>
View
@@ -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>
View
@@ -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>
View
@@ -1,4 +1,4 @@
-# Nikola Release Checklist (v8/2015-09-04)
+# Nikola Release Checklist (v9/2015-10-08)
## Requirements

0 comments on commit bc71e99

Please sign in to comment.