From 11548bfcf90cac482bac0e08d6b414c13541d2d8 Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Mon, 13 Apr 2015 02:41:42 -0400 Subject: [PATCH] add checkbox cross off effect to challenges and reword pairwise bonfire --- public/css/main.less | 4 ++++ public/js/main.js | 9 +++++++++ seed_data/bonfires.json | 8 ++++---- views/coursewares/showVideo.jade | 6 +++++- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/public/css/main.less b/public/css/main.less index 3b9f63a04e..4695c29419 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -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; diff --git a/public/js/main.js b/public/js/main.js index 14db8f7f1b..47a533ad33 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -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 diff --git a/seed_data/bonfires.json b/seed_data/bonfires.json index 444878ff01..71b66427db 100644 --- a/seed_data/bonfires.json +++ b/seed_data/bonfires.json @@ -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);", diff --git a/views/coursewares/showVideo.jade b/views/coursewares/showVideo.jade index 901f11bfbe..96e0f7a526 100644 --- a/views/coursewares/showVideo.jade +++ b/views/coursewares/showVideo.jade @@ -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}')