add checkbox cross off effect to challenges and reword pairwise bonfire

This commit is contained in:
Michael Q Larson
2015-04-13 02:41:42 -04:00
parent 83c14cccc4
commit 11548bfcf9
4 changed files with 22 additions and 5 deletions

View File

@ -910,6 +910,10 @@ iframe.iphone {
text-decoration: underline;
}
.step-text {
margin-left: -10px;
}
//uncomment this to see the dimensions of all elements outlined in red
//* {
// border-color: red;

View File

@ -30,6 +30,15 @@ $(document).ready(function() {
.addClass('animated fadeInDown');
});
$('.challenge-list-checkbox').on('change', function() {
if ($(this).is(":checked")) {
$(this).parent().parent().children('.step-text').addClass('strikethrough text-primary');
}
if (!$(this).is(":checked")) {
$(this).parent().parent().children('.step-text').removeClass('strikethrough text-primary');
}
});
function completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash, bonfireName) {
$('#complete-bonfire-dialog').modal('show');
// Only post to server if there is an authenticated user

View File

@ -495,7 +495,7 @@
"assert.deepEqual(steamroller([[['a']], [['b']]]), ['a', 'b'], 'should flatten nested arrays');",
"assert.deepEqual(steamroller([1, [2], [3, [[4]]]]), [1, 2, 3, 4], 'should flatten nested arrays');",
"assert.deepEqual(steamroller([1, [], [3, [[4]]]]), [1, 3, 4], 'should work with empty arrays');"
],
],
"MDNlinks" : ["Array.isArray()"]
},
{
@ -519,12 +519,12 @@
"difficulty": "2.16",
"description": [
"Return the sum of all indices of elements of 'arr' that can be paired with one other element to form a sum that equals the value in the second argument 'arg'. If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.",
"For example, pairwise([1, 4, 2, 3, 0, 5], 5) should return 15 because every element can be paired with another element to equal 5.",
"For example, pairwise([1, 4, 2, 3, 0, 5], 7) should return 11 because 4, 2, 3 and 5 can be paired with each other to equal 7.",
"pairwise([1, 3, 2, 4], 4) would only equal 1, because only the first two elements can be paired to equal 4, and the first element has an index of 0!"
],
"challengeSeed": "function pairwise(arr, arg) {\n return arg;\n}\n\npairwise([1,4,2,3,0,5], 5);",
"challengeSeed": "function pairwise(arr, arg) {\n return arg;\n}\n\npairwise([1,4,2,3,0,5], 7);",
"tests": [
"expect(pairwise([1, 4, 2, 3, 0, 5], 5)).to.equal(15);",
"expect(pairwise([1, 4, 2, 3, 0, 5], 7)).to.equal(11);",
"expect(pairwise([1, 3, 2, 4], 4)).to.equal(1);",
"expect(pairwise([1,1,1], 2)).to.equal(1);",
"expect(pairwise([0, 0, 0, 0, 1, 1], 1)).to.equal(10);",

View File

@ -7,7 +7,11 @@ block content
h4
ol
for step in details
li!= step
.row
li
.col-xs-2
input(type='checkbox' class='challenge-list-checkbox')
.col-xs-10.step-text!= step
.col-xs-12.col-sm-12.col-md-8
.embed-responsive.embed-responsive-16by9
iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')