From e01826e38e528ce3e84d1813e795df45bbf83503 Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 14:18:08 +0200 Subject: [PATCH 01/23] Improves 'Create a Bootstrap Button' --- seed_data/challenges/bootstrap.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index 58d8aa5dbe..92190cceeb 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -180,8 +180,8 @@ "Bootstrap has its own button styles, which look much better than the plain HTML ones." ], "tests": [ - "assert($('.btn').length > 0, 'your new button should have the class \"btn\".');", - "assert(new RegExp('like this photo','gi').test($('.btn').text()), 'your button should have the text \"like this photo\"');" + "assert($('button').hasClass('btn'), 'Your new button should have the class \"btn\".')", + "assert(new RegExp('like this photo','gi').test($('button.btn').text()), 'Your button should have the text \"like this photo\".')" ], "challengeSeed": [ "", From b36b75e80026c7432dbb1593fd2da4b6a65a9fbe Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 15:25:05 +0200 Subject: [PATCH 02/23] Grammar fix --- seed_data/challenges/basic-html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json index ef5ae673a9..8f0ba56acd 100644 --- a/seed_data/challenges/basic-html5-and-css.json +++ b/seed_data/challenges/basic-html5-and-css.json @@ -2363,7 +2363,7 @@ }, { "_id": "bad87fee1248bd9aedf08824", - "name": "Waypoint: Add Different a Margin to Each Side of an Element", + "name": "Waypoint: Add Different Margins to Each Side of an Element", "difficulty": 0.068, "description": [ "Give the green box a margin of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.", From 94887a70250abebf34100a30dcb15597974c6c82 Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 15:29:40 +0200 Subject: [PATCH 03/23] Improves 'Create a Block Element Bootstrap Button' --- seed_data/challenges/bootstrap.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index 92190cceeb..dc6c06c8f0 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -260,11 +260,12 @@ "difficulty": 0.050, "description": [ "Add Bootstrap's btn-block class to your Bootstrap button.", - "Normally, your buttons are only as wide as the text they contain. By making them block elements, your button will stretch to fill your page's entire horizontal space.", + "Normally, your buttons are only as wide as the text they contain. By making them block elements, your button will stretch to fill your page's entire horizontal space.", "Note that these buttons still need the btn class." ], "tests": [ - "assert($('.btn-block').length > 0, 'your new button should have the class \"btn-block\".')" + "assert($('button').hasClass('btn'), 'Your button should still have the class \"btn\".')", + "assert($('button').hasClass('btn-block'), 'Your button should have the class \"btn-block\".')" ], "challengeSeed": [ "", From fd9e3d4cdb7a89a1d473fdc9ef83d457ebaa3276 Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 15:35:09 +0200 Subject: [PATCH 04/23] Improves 'Taste the Bootstrap Button Color Rainbow' --- seed_data/challenges/bootstrap.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index dc6c06c8f0..bc840c8068 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -349,8 +349,8 @@ "Note that this button will still need the btn class." ], "tests": [ - "assert($('.btn-primary').length > 0, 'Your new button should have the class \"btn-primary\".')", - "assert($('.btn').length > 0, 'Your new button should have the class \"btn\".')" + "assert($('button').hasClass('btn-primary'), 'Your button should have the class \"btn-primary\".')", + "assert($('button').hasClass('btn-block') && $('button').hasClass('btn'), 'Your button should still have the \"btn\" and \"btn-block\" classes.')" ], "challengeSeed": [ "", From 677644ce0b44a918d2114e9dce5cf8d0dd12359d Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 15:51:43 +0200 Subject: [PATCH 05/23] Improves 'Call out Optional Actions with Button Info' --- seed_data/challenges/bootstrap.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index bc840c8068..9ed893482d 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -429,13 +429,14 @@ "name": "Waypoint: Call out Optional Actions with Button Info", "difficulty": 0.052, "description": [ - "Create a new block-level Bootstrap button below your \"like\" button with the text \"Info\", and add Bootstrap's btn-info and btn-block classes to it.", + "Create a new block-level Bootstrap button below your \"Like\" button with the text \"Info\", and add Bootstrap's btn-info and btn-block classes to it.", "Bootstrap comes with several pre-defined colors for buttons. The btn-info class is used to call attention to optional actions that the user can take.", "Note that these buttons still need the btn and btn-block classes." ], "tests": [ - "assert($('.btn-info').length > 0, 'your new button should have the class \"btn-info\".')", - "assert($('.btn-block').length > 1, 'Both of your Bootstrap buttons should have the class \"btn-block\".')" + "assert($('button').hasClass('btn-info'), 'Your new button should have the class \"btn-info\".')", + "assert($('button.btn-block.btn').length > 1, 'Both of your Bootstrap buttons should have the \"btn\" and \"btn-block\" classes.')", + "assert(new RegExp('info', 'gi').test($('button.btn-info').text()), 'Your new button should have the text \"Info\".')" ], "challengeSeed": [ "", From 3a84d48cec788b32077a899a5f8bc2f6185c19c4 Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 16:28:33 +0200 Subject: [PATCH 06/23] Improves 'Warn your Users of a Dangerous Action' --- seed_data/challenges/bootstrap.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index 9ed893482d..b9cbe82209 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -515,13 +515,14 @@ "name": "Waypoint: Warn your Users of a Dangerous Action", "difficulty": 0.053, "description": [ - "Create a button with the text \"delete\" and give it the class btn-danger.", + "Create a button with the text \"Delete\" and give it the class btn-danger.", "Bootstrap comes with several pre-defined colors for buttons. The btn-danger class is the button color you'll use to notify users that the button performs a destructive action, such as deleting a cat photo.", "Note that these buttons still need the btn and btn-block classes." ], "tests": [ - "assert($('.btn-danger').length > 0, 'Your new button should have the class \"btn-danger\".')", - "assert($('.btn-block').length > 1, 'Both of your Bootstrap buttons should have the class \"btn-block\".')" + "assert($('button').hasClass('btn-danger'), 'Your new button should have the class \"btn-danger\".')", + "assert($('button.btn-block.btn').length > 2, 'All of your Bootstrap buttons should have the \"btn\" and \"btn-block\" classes.')", + "assert(new RegExp('delete', 'gi').test($('button.btn-danger').text()), 'Your new button should have the text \"delete\".')" ], "challengeSeed": [ "", From b1f7c215e42358a320856dd934c951c04035fb96 Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 18:27:53 +0200 Subject: [PATCH 07/23] Improves 'Use the Bootstrap Grid to Put Elements Side By Side' --- seed_data/challenges/bootstrap.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index b9cbe82209..e19c9c4918 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -602,7 +602,7 @@ "name": "Waypoint: Use the Bootstrap Grid to Put Elements Side By Side", "difficulty": 0.054, "description": [ - "Put the \"like\", \"Info\" and \"Delete\" buttons side-by-side by wrapping all three of them within one <div class=\"row\"> element, then each of them within a <div class=\"col-xs-4\"> element.", + "Put the \"Like\", \"Info\" and \"Delete\" buttons side-by-side by wrapping all three of them within one <div class=\"row\"> element, then each of them within a <div class=\"col-xs-4\"> element.", "Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a div element.", "Here's a diagram of how Bootstrap's 12-column grid layout works:", "", @@ -611,8 +611,8 @@ "The row class is applied to a div, and the buttons themselves can be wrapped within it." ], "tests": [ - "assert($('.row').length > 0, 'Your new button should be wrapped within a div with the class \"row\".')", - "assert($('.col-xs-4').length > 2, 'Each of your bootstrap buttons should be wrapped in a div with the class \"col-xs-4\".')" + "assert($('div.row:has(button)').length > 0, 'Your buttons should be wrapped within a div with the class \"row\".')", + "assert($('div.col-xs-4').length > 2, 'Each of your Bootstrap buttons should be wrapped in a div with the class \"col-xs-4\".')" ], "challengeSeed": [ "", From 13b9a6fd56b9ceb49f0b47295e139a8850edbd40 Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 17:30:50 +0200 Subject: [PATCH 08/23] Improves 'Ditch Custom CSS for Bootstrap' --- seed_data/challenges/bootstrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index e19c9c4918..9ea58cdf65 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -701,7 +701,7 @@ "assert(!$('h2').hasClass('red-text'), 'You h2 element should no longer have the class \"red-text\".')", "assert($('h2').hasClass('text-primary'), 'You h2 element should now have the class \"text-primary\".')", "assert(!$('p').css('font-family').match(/monospace/i), 'Your paragraph elements should no longer use the font \"Monospace\".')", - "assert($('.img-responsive').length > 1, 'Remove the \"smaller-image\" class from your top image and replace it with the \"img-responsive\" class.')" + "assert($('img').hasClass('img-responsive') && !$('img').hasClass('smaller-image'), 'Remove the \"smaller-image\" class from your top image and replace it with the \"img-responsive\" class.')" ], "challengeSeed": [ "", From 48d031d211daefe11e3cb5e64b05032266a6ddcc Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 18:55:33 +0200 Subject: [PATCH 09/23] Improves 'Create a Custom Heading' --- seed_data/challenges/bootstrap.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index 9ea58cdf65..eab6cf5978 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -791,7 +791,7 @@ "name": "Waypoint: Create a Custom Heading", "difficulty": 0.056, "description": [ - "Wrap your first image and your h2 element within a single <div class='row'> element. Wrap your h2 text within a <div class='col-xs-8'> and your image in a <div class='col-xs-4'> so that they are on the same line.", + "Wrap your first image and your h2 element within a single <div class='row'> element. Wrap your h2 text within a <div class='col-xs-8'> and your image in a <div class='col-xs-4'> so that they are on the same line.", "We will make a simple heading for our Cat Photo App by putting them in the same row.", "Remember, Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a div element.", "Here's a diagram of how Bootstrap's 12-column grid layout works:", @@ -801,9 +801,9 @@ "Notice how the image is now just the right size to fit along the text?" ], "tests": [ - "assert($('.row').length > 1, 'Your h2 and top image elements should both be wrapped together within a div with the class \"row\".')", - "assert($('.col-xs-4').length > 3, 'Wrap your top image inside a div with the class \"col-xs-4\".')", - "assert($('.col-xs-8').length > 0, 'Wrap your h2 element inside a div with the class \"col-xs-8\".')" + "assert($('div.row:has(h2)').length > 0 && $('div.row:has(img)').length > 0, 'Your h2 and top image elements should both be wrapped together within a div with the class \"row\".')", + "assert($('div.col-xs-4:has(img)').length > 0, 'Wrap your top image inside a div with the class \"col-xs-4\".')", + "assert($('div.col-xs-8:has(h2)').length > 0, 'Wrap your h2 element inside a div with the class \"col-xs-8\".')" ], "challengeSeed": [ "", From 8ae527ecb769619621d3539597eae2c906645f53 Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 18:56:57 +0200 Subject: [PATCH 10/23] Improves 'Add Font Awesome Icons to our Buttons' --- seed_data/challenges/bootstrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index eab6cf5978..5b3c9398cd 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -884,7 +884,7 @@ "Go ahead and add a <i class=\"fa fa-thumbs-up\"></i> within your like button's element." ], "tests": [ - "assert($('.fa-thumbs-up').length > 0, 'Add a i element with the classes \"fa\" and \"fa-thumbs-up\".')", + "assert($('i').hasClass('fa fa-thumbs-up'), 'Add an i element with the classes \"fa\" and \"fa-thumbs-up\".')", "assert($('button').children('i').length > 0, 'Wrap your i element within your button element.')", "assert(editor.match(/<\\/i>/g), 'Be sure to close your i element with a closing tag.')" ], From 72e4428cc8bedc633ad543120f37bc12a138d49a Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 19:00:42 +0200 Subject: [PATCH 11/23] Improves 'Add Font Awesome Icons all of our Buttons' --- seed_data/challenges/bootstrap.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index 5b3c9398cd..316947bd06 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -971,8 +971,8 @@ "Add <i class=\"fa fa-info-circle\"></i> within your info button's element, and a <i class=\"fa fa-trash\"></i> within your delete button." ], "tests": [ - "assert($('.fa-trash').length > 0, 'You should add a <i class=\"fa fa-trash\"></i> within your delete button element.')", - "assert($('.fa-info-circle').length > 0, 'You should add a <i class=\"fa fa-info-circle\"></i> within your info button element.')" + "assert($('i').hasClass('fa fa-trash'), 'You should add a <i class=\"fa fa-trash\"></i> within your delete button element.')", + "assert($('i').hasClass('fa fa-info-circle'), 'You should add a <i class=\"fa fa-info-circle\"></i> within your info button element.')" ], "challengeSeed": [ "", From ffced214c27c971e76cf84bc72f00c7391f460c7 Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 19:09:40 +0200 Subject: [PATCH 12/23] Improves 'Responsively Style Radio Buttons' --- seed_data/challenges/bootstrap.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index 316947bd06..97fce6af97 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -1056,8 +1056,8 @@ "You can use Bootstrap's col-xs-* classes on form elements, too! This way, our radio buttons will be evenly spread out across the page, regardless of how wide the screen resolution is." ], "tests": [ - "assert($('.row').length > 2, 'Wrap your all of your radio buttons inside one div with the class \"row\".')", - "assert($('.col-xs-6').length > 1, 'Wrap each of your radio buttons inside its own div with the class \"col-xs-6\".')" + "assert($('div.row:has(input[type=\\'radio\\'])').length > 0, 'Wrap all of your radio buttons inside one div with the class \"row\".')", + "assert($('div.col-xs-6:has(input[type=\\'radio\\'])').length > 1, 'Wrap each of your radio buttons inside its own div with the class \"col-xs-6\".')" ], "challengeSeed": [ "", From 1b227d658d4ad4038f602e573c49e814dee5dd64 Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 19:15:20 +0200 Subject: [PATCH 13/23] Improves 'Responsively Style Checkboxes' --- seed_data/challenges/bootstrap.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index 97fce6af97..e6f80586a6 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -1141,8 +1141,8 @@ "You can use Bootstrap's col-xs-* classes on form elements, too! This way, our checkboxes will be evenly spread out across the page, regardless of how wide the screen resolution is." ], "tests": [ - "assert($('.row').length > 3, 'Wrap your all of your checkboxes inside one div with the class \"row\".')", - "assert($('.col-xs-4').length > 6, 'Wrap each of your checkboxes inside its own div with the class \"col-xs-4\".')" + "assert($('div.row:has(input[type=\\'checkbox\\'])').length > 0, 'Wrap all of your checkboxes inside one div with the class \"row\".')", + "assert($('div.col-xs-4:has(input[type=\\'checkbox\\'])').length > 2, 'Wrap each of your checkboxes inside its own div with the class \"col-xs-4\".')" ], "challengeSeed": [ "", From c2e299d9dbdb4c482fa4c54df35039f2b102b5e3 Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 19:24:57 +0200 Subject: [PATCH 14/23] Improves 'Style Text Inputs as Form Controls' --- seed_data/challenges/bootstrap.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index e6f80586a6..8932032fa6 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -1232,9 +1232,9 @@ "Give your form's text input field a class of form-control. Give your form's submit button the classes btn btn-primary and give it the Font Awesome icon of fa-paper-plane." ], "tests": [ - "assert($('.btn-primary').length > 1, 'Give the submit button in your form the classes \"btn btn-primary\".')", - "assert($('.fa-paper-plane').length > 0, 'Add a <i class=\"fa fa-paper-plane\"></i> within your submit button element.')", - "assert($('.form-control').length > 0, 'Give the text input field in your form the class \"form-control\".')" + "assert($('button[type=\\'submit\\']').hasClass('btn btn-primary'), 'Give the submit button in your form the classes \"btn btn-primary\".')", + "assert($('button[type=\\'submit\\']:has(i.fa.fa-paper-plane)').length > 0, 'Add a <i class=\"fa fa-paper-plane\"></i> within your submit button element.')", + "assert($('input[type=\\'text\\']').hasClass('form-control'), 'Give the text input field in your form the class \"form-control\".')" ], "challengeSeed": [ "", From 83eeaf8d82ae3cbc39e6833260f3c00ea48b76f3 Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 19:37:16 +0200 Subject: [PATCH 15/23] Improves 'Line up Form Elements Responsively with Bootstrap' --- seed_data/challenges/bootstrap.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json index 8932032fa6..fd4f7a8803 100644 --- a/seed_data/challenges/bootstrap.json +++ b/seed_data/challenges/bootstrap.json @@ -1335,9 +1335,9 @@ "This is the last challenge we'll do for our Cat Photo App for now. We hope you've enjoyed learning Font Awesome, Bootstrap, and responsive design!" ], "tests": [ - "assert($('.row').length > 4, 'Wrap your form submission button and text area in a div with class \"row\".')", - "assert($('.col-xs-5').length > 0, 'Wrap your form submission button in a div with the class \"col-xs-5\".')", - "assert($('.col-xs-7').length > 0, 'Wrap your form text area in a div with the class \"col-xs-7\".')" + "assert($('div.row:has(input[type=\\'text\\'])').length > 0 && $('div.row:has(button[type=\\'submit\\'])').length > 0, 'Wrap your form submission button and text area in a div with class \"row\".')", + "assert($('div.col-xs-5:has(button[type=\\'submit\\'])').length > 0, 'Wrap your form submission button in a div with the class \"col-xs-5\".')", + "assert($('div.col-xs-7:has(input[type=\\'text\\'])').length > 0, 'Wrap your form text area in a div with the class \"col-xs-7\".')" ], "challengeSeed": [ "", From b6b62da000b3010e757cb9ff382d4c8da1809abd Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Sun, 31 May 2015 20:55:34 +0200 Subject: [PATCH 16/23] Improves 'Wrap an Anchor Element within a Paragraph' --- seed_data/challenges/basic-html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json index 8f0ba56acd..048671b855 100644 --- a/seed_data/challenges/basic-html5-and-css.json +++ b/seed_data/challenges/basic-html5-and-css.json @@ -1044,7 +1044,7 @@ "tests": [ "assert($('a').attr('href').match(/catphotoapp.com/gi).length > 0, 'You need an a element that links to \"catphotoapp.com\".')", "assert($('a').text().match(/cat\\sphotos/gi).length > 0, 'Your a element should have the anchor text of \"cat photos\"')", - "assert($('a').parent().is('p'), 'Your anchor element should be wrapped within a paragraph element.')", + "assert($('a[href=\\'http://www.catphotoapp.com\\']').parent().is('p'), 'Your anchor element should be wrapped within a paragraph element.')", "assert($('p').text().match(/click\\shere\\sfor/gi), 'Your p element should have the text \"click here for\".')", "assert(editor.match(/<\\/p>/g).length > 2, 'Be sure that each of your p elements has a closing tag.')" ], From 4a8445e8a0637b8fd19fcf5f26e678f492dff410 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sun, 31 May 2015 14:00:21 -0700 Subject: [PATCH 17/23] closes #780 --- seed_data/challenges/basic-html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json index 317a6daaa4..b5ca05013e 100644 --- a/seed_data/challenges/basic-html5-and-css.json +++ b/seed_data/challenges/basic-html5-and-css.json @@ -513,7 +513,7 @@ "description": [ "Make all of your p elements use the \"Monospace\" font.", "You can set an element's font by using the \"font-family\" attribute.", - "For example, if you wanted to set your h2 element's font to \"Sans-serif\", you would use the following CSS: h2 { font-family: 'Sans-serif'; }" + "For example, if you wanted to set your h2 element's font to \"Sans-serif\", you would use the following CSS: h2 { font-family: Sans-serif; }" ], "tests": [ "assert($('p').css('font-family').match(/monospace/i), 'Your p elements should use the font \"Monospace\".')" From 2c30f3e1f9e33a68b9600fbdeda630959586cbaf Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sun, 31 May 2015 14:08:44 -0700 Subject: [PATCH 18/23] close #767 --- seed_data/challenges/basic-bonfires.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed_data/challenges/basic-bonfires.json b/seed_data/challenges/basic-bonfires.json index 002f2221d8..94fd787a39 100644 --- a/seed_data/challenges/basic-bonfires.json +++ b/seed_data/challenges/basic-bonfires.json @@ -530,7 +530,7 @@ "expect(mutation(['floor', 'for'])).to.be.true;" ], "MDNlinks": [ - "Array.sort()" + "Array.indexOf()" ], "challengeType": 5, "nameCn": "", @@ -1470,4 +1470,4 @@ "descriptionPt": [] } ] -} \ No newline at end of file +} From e08b81a7176315a7ecb5c6450179f175a4a54286 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sun, 31 May 2015 14:13:06 -0700 Subject: [PATCH 19/23] fix #712 --- seed_data/challenges/basic-html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json index b5ca05013e..f5f92f61fa 100644 --- a/seed_data/challenges/basic-html5-and-css.json +++ b/seed_data/challenges/basic-html5-and-css.json @@ -645,7 +645,7 @@ "name": "Waypoint: Override Styles with Important", "difficulty": 0.025, "description": [ - "Create a \"blue-text\" class that gives an element the font-color of blue. Also create an \"urgently-red\" class that gives an element the font-color of red, but add !important to the class to ensure the element is rendered as being red. Apply both classes to your h2 element.", + "Create an \"urgently-red\" class that gives an element the font-color of red, but add !important to the class to ensure the element is rendered as being red. Immediately below your \"urgently-red\" class declaration, create a \"blue-text\" class that gives an element the font-color of blue. Apply both classes to your h2 element.", "You can add more than one class to an element by separating the class declarations with a space, like this: <h2 class='green-text giant-text'>This will be giant green text</h2>.", "Sometimes HTML elements will receive conflicting information from CSS classes as to how they should be styled.", "If there's a conflict in the CSS, the browser will use whichever style declaration is closest to the bottom of the CSS document (whichever declaration comes last). Note that in-line style declarations are the final authority in how an HTML element will be rendered.", From a330dce09e0667e6eedfe7e22a5b288bf6c7d20e Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sun, 31 May 2015 15:42:54 -0700 Subject: [PATCH 20/23] Add dashed names to field guides --- models/FieldGuide.js | 4 +++ seed_data/challenges/basic-html5-and-css.json | 24 +++++++------- seed_data/field-guides.json | 31 ++++++++++++++++++- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/models/FieldGuide.js b/models/FieldGuide.js index b705f44774..b9c2613eed 100644 --- a/models/FieldGuide.js +++ b/models/FieldGuide.js @@ -6,6 +6,10 @@ var fieldGuideSchema = new mongoose.Schema({ type: String, unique: false }, + dashedName: { + type: String, + unique: false + }, description: { type: Array, unique: false diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json index f5f92f61fa..1f22850de3 100644 --- a/seed_data/challenges/basic-html5-and-css.json +++ b/seed_data/challenges/basic-html5-and-css.json @@ -53,7 +53,7 @@ ], "tests": [ "assert(($('h2').length > 0), 'Create an h2 element.')", - "assert(editor.match(/<\\/h2>/g) && editor.match(/<\\/h2>/g).length === editor.match(/

/g).length, 'Be sure that your h2 element has a closing tag.')", + "assert(editor.match(/<\\/h2>/g) && editor.match(/<\\/h2>/g).length === editor.match(/

/g).length, 'Make sureyour h2 element has a closing tag.')", "assert.isTrue((/cat(\\s)?photo(\\s)?app/gi).test($('h2').text()), 'Your h2 element should have the text \"CatPhotoApp\"')", "assert.isTrue((/hello(\\s)+world/gi).test($('h1').text()), 'Your h1 element should have the text \"Hello World\"')" ], @@ -89,7 +89,7 @@ "tests": [ "assert(($('p').length > 0), 'Create a p element.')", "assert.isTrue((/hello(\\s)+paragraph/gi).test($('p').text()), 'Your p element should have the text \"Hello Paragraph\".')", - "assert(new RegExp('

', 'gi').test(editor), 'Be sure to complete your p element with a closing tag.')" + "assert(editor.match(/<\\/p>/g) && editor.match(/<\\/p>/g).length === editor.match(/

/g).length, 'Make sureyour p element has a closing tag.')" ], "challengeSeed": [ "

Hello World

", @@ -480,7 +480,7 @@ ], "tests": [ "assert($('p').length > 1, 'You need 2 p elements with Kitty Ipsum text.')", - "assert(editor.match(/<\\/p>/g).length > 1, 'Be sure that each of your p elements has a closing tag.')", + "assert(editor.match(/<\\/p>/g).length > 1, 'Make sureeach of your p elements has a closing tag.')", "assert($('p').css('font-size') === '16px', 'Give your p elements the font-size of 16px.')" ], "challengeSeed": [ @@ -1041,7 +1041,7 @@ "assert($('a').text().match(/cat\\sphotos/gi).length > 0, 'Your a element should have the anchor text of \"cat photos\"')", "assert($('a[href=\\'http://www.catphotoapp.com\\']').parent().is('p'), 'Your anchor element should be wrapped within a paragraph element.')", "assert($('p').text().match(/click\\shere\\sfor/gi), 'Your p element should have the text \"click here for\".')", - "assert(editor.match(/<\\/p>/g).length > 2, 'Be sure that each of your p elements has a closing tag.')" + "assert(editor.match(/<\\/p>/g).length > 2, 'Make sureeach of your p elements has a closing tag.')" ], "challengeSeed": [ "", @@ -1168,7 +1168,7 @@ "tests": [ "assert(new RegExp('#').test($('a').children('img').parent().attr('href')), 'Your anchor element should be a dead link with a href attribute set to \"#\".')", "assert($('a').children('img').length > 0, 'Wrap your image element inside an anchor element.')", - "assert(editor.match(/<\\/a>/g).length > 1, 'Be sure that each of your a elements has a closing tag.')" + "assert(editor.match(/<\\/a>/g).length > 1, 'Make sureeach of your a elements has a closing tag.')" ], "challengeSeed": [ "", @@ -1295,8 +1295,8 @@ "tests": [ "assert($('ul').length > 0, 'Create a ul element.')", "assert($('li').length > 2, 'Add three li elements to your ul element.')", - "assert(editor.match(/<\\/ul>/g), 'Be sure that your ul element has a closing tag.')", - "assert(editor.match(/<\\/li>/g) && editor.match(/<\\/li>/g).length > 2, 'Be sure that each of your li elements has a closing tag.')" + "assert(editor.match(/<\\/ul>/g), 'Make sureyour ul element has a closing tag.')", + "assert(editor.match(/<\\/li>/g) && editor.match(/<\\/li>/g).length > 2, 'Make sureeach of your li elements has a closing tag.')" ], "challengeSeed": [ "", @@ -1362,9 +1362,9 @@ "assert($('ol').length > 0, 'You should have an ol element on your webpage.')", "assert($('li').length > 5, 'You should have three li elements within your ul element.')", "assert($('li').length > 5, 'You should have three li elements within your ol element.')", - "assert(editor.match(/<\\/ol>/g), 'Be sure that your ol element has a closing tag.')", - "assert(editor.match(/<\\/ul>/g), 'Be sure that your ul element has a closing tag.')", - "assert(editor.match(/<\\/li>/g).length > 5, 'Be sure that each of your li elements has a closing tag.')" + "assert(editor.match(/<\\/ol>/g), 'Make sureyour ol element has a closing tag.')", + "assert(editor.match(/<\\/ul>/g), 'Make sureyour ul element has a closing tag.')", + "assert(editor.match(/<\\/li>/g).length > 5, 'Make sureeach of your li elements has a closing tag.')" ], "challengeSeed": [ "", @@ -1651,7 +1651,7 @@ "assert($('form').children('button').length > 0, 'Your form should have a button inside it.')", "assert($('button').attr('type') === 'submit', 'Your submit button should have be of input type \"submit\".')", "assert($('button').text().match(/submit/gi), 'Your submit button should have the text \"submit\".')", - "assert(editor.match(/<\\/button>/g), 'Be sure that your button element has a closing tag.')" + "assert(editor.match(/<\\/button>/g), 'Make sureyour button element has a closing tag.')" ], "challengeSeed": [ "", @@ -2125,7 +2125,7 @@ "assert($('div').children('ol').length > 0, 'Wrap your ol element inside your div element.')", "assert($('div').children('p').length > 1, 'Wrap your p element inside your div element.')", "assert($('div').children('ul').length > 0, 'Wrap your ul element inside your div element.')", - "assert(editor.match(/<\\/div>/g) && editor.match(/<\\/div>/g).length === editor.match(/
/g).length, 'Be sure that your div element has a closing tag.')" + "assert(editor.match(/<\\/div>/g) && editor.match(/<\\/div>/g).length === editor.match(/
/g).length, 'Make sureyour div element has a closing tag.')" ], "challengeSeed": [ "", diff --git a/seed_data/field-guides.json b/seed_data/field-guides.json index 4de82c5a26..d55d682a66 100644 --- a/seed_data/field-guides.json +++ b/seed_data/field-guides.json @@ -2,6 +2,7 @@ { "_id": "bd7158d9c441eddfaeb5bdef", "name": "How do I use this guide?", + "dashedName": "how-do-i-use-this-guide", "description": [ "
", "

This guide strives to provide clear answers to common questions about Free Code Camp, learning to code, and getting a coding job.

", @@ -13,6 +14,7 @@ { "_id": "bd7158d9c441eddfaeb5bdff", "name": "What exactly is Free Code Camp?", + "dashedName": "what-exactly-is-free-code-camp", "description": [ "
", "

We're a community of busy people who learn to code by building projects for nonprofits.

", @@ -30,6 +32,7 @@ { "_id": "bd7158d9c441eddfaeb5bd1f", "name": "Why do I need Free Code Camp?", + "dashedName": "why-do-i-need-free-code-camp", "description": [ "
", "

Learning to code is hard.

", @@ -47,6 +50,7 @@ { "_id": "bd7158d9c441eddfaeb5bd2f", "name": "What are the main advantages of Free Code Camp?", + "dashedName": "what-are-the-main-advantages-of-free-code-camp", "description": [ "
", "

Our main advantage is that we're accessible to busy adults who want to change careers. Specifically, we're:

", @@ -63,6 +67,7 @@ { "_id": "bd7158d9c441eddfaeb5bd3f", "name": "How does Free Code Camp work?", + "dashedName": "how-does-free-code-camp-work", "description": [ "
", "

Our free, self-paced, browser-based program takes about 1,600 hours to complete.", @@ -83,7 +88,8 @@ }, { "_id": "bd7158d9c441eddfaeb5bd4f", - "name": "Will I really be able to get a job after Free Code Camp?", + "name": "Will I really be able to get software engineering job after Free Code Camp?", + "dashedName": "will-i-really-be-able-to-get-a-software-engineering-job-after-free-code-camp", "description": [ "
", "

If you complete this program, you will be able to get a coding job. Many of our campers have already gotten coding jobs.

", @@ -103,6 +109,7 @@ { "_id": "bd7158d9c440eddfaeb5bdef", "name": "What will I learn, and in what sequence?", + "dashedName": "what-will-i-learn-and-in-what-sequence", "description": [ "
", "

First, you'll learn basic web design tools like:

", @@ -139,6 +146,7 @@ { "_id": "bd7158d9c434eddfaeb5bdef", "name": "How long does Free Code Camp take?", + "dashedName": "how-long-does-free-code-camp-take", "description": [ "
", "

It takes about 1,600 hours of coding to develop the skills you'll need to get an entry level software engineering job.

", @@ -176,6 +184,7 @@ { "_id": "bd7158d9c438eddfaeb5bdef", "name": "Why does Free Code Camp use JavaScript instead of Ruby or Python?", + "dashedName": "why-does-free-code-camp-use-javascript-instead-of-ruby-or-python", "description": [ "
", "

Like JavaScript, Ruby and Python are high-level scripting languages that can be used for full stack web development.

", @@ -189,6 +198,7 @@ { "_id": "bd7158d9c437eddfaeb5bdef", "name": "What is pair programming, and why is it special?", + "dashedName": "what-is-pair-programming-and-why-is-it-special", "description": [ "
", "

Pair programming is where two people code together on one computer.

", @@ -201,6 +211,7 @@ { "_id": "bd7158d9c436eddfaeb5bd2f", "name": "How do I get help when I get stuck?", + "dashedName": "how-do-i-get-help-when-i-get-stuck", "description": [ "
", "

When you get stuck, remember: RSAP.

", @@ -223,6 +234,7 @@ { "_id": "bd7158d9c436eddfaeb5bd3f", "name": "Can I jump around in this guide?", + "dashedName": "can-i-jump-around-in-this-guide", "description": [ "
", "

This guide was designed as a reference for you. You shouldn't try to read it all today.

", @@ -234,6 +246,7 @@ { "_id": "bd7158d9c436eddfaeb5bdef", "name": "If Free Code Camp is free, how does it make money?", + "dashedName": "if-free-code-camp-is-free-how-does-it-make-money", "description": [ "
", "

We are completely free for both students and for nonprofits.

", @@ -246,6 +259,7 @@ { "_id": "bd7158d9c435eddfaeb5bdef", "name": "Does Free Code Camp have an application process?", + "dashedName": "does-free-code-camp-have-an-application-process", "description": [ "
", "

Unlike coding bootcamps, anyone can study at Free Code Camp.

", @@ -257,6 +271,7 @@ { "_id": "bd7158d9c436eddfaeb5bd3b", "name": "How can I stream my live coding sessions on Free Code Camp's Twitch.tv channel?", + "dashedName": "how-can-i-stream-my-live-coding-sessions-on-free-code-camps-twitch-tv-channel", "description": [ "
", "

If you're interested in coding JavaScript live in front of dozens of people on our popular twitch.tv channel, we'd love to have you.

", @@ -277,6 +292,7 @@ { "_id": "bd7158d9c436eddfaeb5bd3d", "name": "How can I find other Free Code Camp campers in my city?", + "dashedName": "how-can-i-find-other-free-code-camp-campers-in-my-city", "description": [ "
", "

Find your city below and join their group. This is a great way to hang out with other coders, share insights, and pair program.

", @@ -463,6 +479,7 @@ { "_id": "bd7158d9c436eddfaeb5bd3e", "name": "Does Free Code Camp have an alumni network?", + "dashedName": "does-free-code-camp-have-an-alumni-network", "description": [ "
", "

We have a growing alumni network on LinkedIn. Once you've finished Free Code Camp and have gotten a coding job, we'd love to include you in this group, too!

", @@ -472,6 +489,7 @@ { "_id": "bd7158d9c442eddfaeb5b2ef", "name": "Why doesn't Free Code Camp teach technical interviewing skills?", + "dashedName": "why-doesnt-free-code-camp-teach-technical-interviewing-skills", "description": [ "
", "

The skills you'll need to succeed in the job interview are quite different from the skills you'll need to succeed on the job.


", @@ -487,6 +505,7 @@ { "_id": "bd7158d9c442eddfaeb5bdef", "name": "How do I best use the Global Control Shortcuts for Mac?", + "dashedName": "how-do-i-best-use-the-global-control-shortcuts-for-mac", "description": [ "
", "

These Global Control Shortcuts for Mac will save you hours by speeding up your typing.


", @@ -511,6 +530,7 @@ { "_id": "bd7158d9c445eddfaeb5bdef", "name": "How can I get to Inbox Zero with Gmail shortcuts?", + "dashedName": "how-can-i-get-to-inbox-zero-with-gmail-shortcuts", "description": [ "
", "

These Gmail Shortcuts will save you hours and help you get to Inbox Zero.


", @@ -539,6 +559,7 @@ { "_id": "bd7158d9c445eddfaeb5bdff", "name": "How can I deploy a website without writing any code at all?", + "dashedName": "how-can-i-deploy-a-website-without-writing-any-code-at-all", "description": [ "
", "

It's possible to build dynamic, mobile-responsive websites without writing any code at all, in just a few minutes.


", @@ -561,6 +582,7 @@ { "_id": "bd7158d9c446eddfaeb5bdef", "name": "How do Free Code Camp's Nonprofit Projects work?", + "dashedName": "how-do-free-code-camps-nonprofit-projects-work", "description": [ "
", "

Building nonprofit projects is the main way that our campers learn full stack JavaScript and agile software development. Once you complete the Free Code Camp Waypoints, Bonfires, Ziplines and Basejumps, you'll begin this process.

", @@ -635,6 +657,7 @@ { "_id": "bd7158d9c447eddfaeb5bdef", "name": "How do I install Screenhero?", + "dashedName": "how-do-i-install-screenhero", "description": [ "
", "

Download for Mac

", @@ -646,6 +669,7 @@ { "_id": "bd7158d9c451eddfaeb5bded", "name": "What is the style guide for Bonfires?", + "dashedName": "what-is-the-style-guide-for-bonfires", "description": [ "
", "

Writing Bonfire challenges is a great way to exercise your own problem solving and testing abilities. Follow this process closely to maximize the chances of us accepting your bonfire.

", @@ -681,6 +705,7 @@ { "_id": "bd7158d9c451eddfaeb5bdee", "name": "What is the Free Code Camp Code of Conduct?", + "dashedName": "what-is-the-free-code-camp-code-of-conduct", "description": [ "
", "

Free Code Camp is friendly place to learn to code. We're committed to keeping it that way.

", @@ -705,6 +730,7 @@ { "_id": "bd7158d9c451eddfaeb5bdef", "name": "What is the Free Code Camp Privacy Policy?", + "dashedName": "what-is-the-free-code-camp-privacy-policy", "description": [ "
", "

Free Code Camp is committed to respecting the privacy of visitors to our web sites and web applications. The guidelines below explain how we protect the privacy of visitors to FreeCodeCamp.com and its features.

", @@ -746,6 +772,7 @@ { "_id": "bd7158d9c436eddfaeb5bd3c", "name": "How can I reach the Free Code Camp team to interview them for my publication?", + "dashedName": "how-can-i-reach-the-free-code-camp-team-to-interview-them-for-my-publication", "description": [ "
", "

We're happy to do a quick interview for your publication or show. Here's whom you should contact about what, and how to best reach them:

", @@ -764,6 +791,7 @@ { "_id": "bd7158d9c436eddfaeb5dd3b", "name": "What other resources does Free Code Camp recommend to nonprofits?", + "dashedName": "what-other-resources-does-free-code-camp-recommend-to-nonprofits", "description": [ "
", "

Here are some excellent resources for nonprofits.

", @@ -805,6 +833,7 @@ { "_id": "bd7158d9c436eddfadb5bd3e", "name": "How can I contribute to this guide?", + "dashedName": "how-can-i-contribute-to-this-guide", "description": [ "
", "

Contributing to our field guide is a great way to establish your history on GitHub, add to your portfolio, and help other campers. If you have a question about JavaScript or programming in general that you'd like us to add to the field guide, here are two ways to get it into the guide:

", From c4a92855088a0a22341d7972bad26ee2139b7960 Mon Sep 17 00:00:00 2001 From: terakilobyte Date: Sun, 31 May 2015 18:43:11 -0400 Subject: [PATCH 21/23] Fix dasherization for stories, closes #648 --- controllers/story.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/controllers/story.js b/controllers/story.js index 3a34c7b883..4911409861 100755 --- a/controllers/story.js +++ b/controllers/story.js @@ -330,8 +330,8 @@ exports.storySubmission = function(req, res, next) { return next(new Error('Not authorized')); } var storyLink = data.headline - .replace(/\s+/g, ' ') .replace(/[^a-z0-9\s]/gi, '') + .replace(/\s+/g, ' ') .toLowerCase() .trim(); var link = data.link; @@ -346,6 +346,8 @@ exports.storySubmission = function(req, res, next) { // if duplicate storyLink add unique number storyLink = (storyCount === 0) ? storyLink : storyLink + ' ' + storyCount; + debug(storyLink); + var link = data.link; if (link.search(/^https?:\/\//g) === -1) { link = 'http://' + link; @@ -389,7 +391,7 @@ exports.storySubmission = function(req, res, next) { } }); res.send(JSON.stringify({ - storyLink: story.storyLink.replace(/\s/g, '-').toLowerCase() + storyLink: story.storyLink.replace(/\s+/g, '-').toLowerCase() })); }); }); From 1fca5898054f7714d1395e8f30780c41cac4de83 Mon Sep 17 00:00:00 2001 From: terakilobyte Date: Sun, 31 May 2015 18:44:43 -0400 Subject: [PATCH 22/23] Update story cleanup script --- seed_data/storyCleanup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/storyCleanup.js b/seed_data/storyCleanup.js index c216e67293..2598526c8a 100644 --- a/seed_data/storyCleanup.js +++ b/seed_data/storyCleanup.js @@ -18,8 +18,8 @@ function storyLinkCleanup(cb) { console.log(i++); this.pause(); story.storyLink = story.storyLink. - replace(/\s+/g, ' '). replace(/[^a-z0-9\s]/gi, ''). + replace(/\s+/g, ' '). toLowerCase(). trim(); story.save(function (err) { From 85e907478d221d3725edb4c99e1fddfbed120309 Mon Sep 17 00:00:00 2001 From: terakilobyte Date: Sun, 31 May 2015 18:45:51 -0400 Subject: [PATCH 23/23] Remove debug --- controllers/story.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/controllers/story.js b/controllers/story.js index 4911409861..a828f70d05 100755 --- a/controllers/story.js +++ b/controllers/story.js @@ -346,8 +346,6 @@ exports.storySubmission = function(req, res, next) { // if duplicate storyLink add unique number storyLink = (storyCount === 0) ? storyLink : storyLink + ' ' + storyCount; - debug(storyLink); - var link = data.link; if (link.search(/^https?:\/\//g) === -1) { link = 'http://' + link;