From 13c3d213ce8af1655c54ca772ee6a7bc31093f3b Mon Sep 17 00:00:00 2001 From: Matias Cao Date: Tue, 16 Jun 2015 18:27:58 -0300 Subject: [PATCH 01/21] WP11 ES Translation --- seed/challenges/basic-html5-and-css.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/seed/challenges/basic-html5-and-css.json b/seed/challenges/basic-html5-and-css.json index 4640facb09..f1b8f5608c 100644 --- a/seed/challenges/basic-html5-and-css.json +++ b/seed/challenges/basic-html5-and-css.json @@ -439,8 +439,17 @@ "descriptionFr": [], "nameRu": "", "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], + "nameEs": "Waypoint: Utiliza una clase CSS para darle estilo a un elemento", + "descriptionEs": [ + "Crea una clase CSS llamada \"red-text\" y aplicala a tu elemento h2.", + "Las clases son estilos reutilizables que pueden ser añadidos a elementos HTML", + "Esta es la anatomía de una clase CSS:", + "a diagram of how style tags are composed, which is also described in detail on the following lines.", + "Puedes ver que hemos creado una clase CSS llamada \"blue-text\" dentro de la etiqueta <style>.", + "Puedes aplicar una clase a un elemento HTML de esta manera: <h2 class=\"blue-text\">CatPhotoApp</h2>.", + "Nota que en el elemento CSS style, las clases deberían comenzar con un punto. En los elementos HTML, las declaraciones de clase, NO deberían comenzar con punto. ", + "En vez de de crear un nuevo elemento style, prueba remover la declaración de estilo de h2 y reemplazarla por la declaración \"red-text\"." + ], "namePt": "", "descriptionPt": [] }, From d0477bfb2b055ad3b0955333c6b54fd2f4baf34d Mon Sep 17 00:00:00 2001 From: Matias Cao Date: Mon, 22 Jun 2015 20:22:09 -0300 Subject: [PATCH 02/21] WP 12-13 ES Translation --- seed/challenges/basic-html5-and-css.json | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/seed/challenges/basic-html5-and-css.json b/seed/challenges/basic-html5-and-css.json index f1b8f5608c..fcb1eb9f77 100644 --- a/seed/challenges/basic-html5-and-css.json +++ b/seed/challenges/basic-html5-and-css.json @@ -487,8 +487,12 @@ "descriptionFr": [], "nameRu": "", "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], + "nameEs": "Waypoint: Estila multiples elementos con una clase CSS", + "descriptionEs": [ + "Aplica la clase \"red-text\" a tus elementos h2 y p.", + "Recuerda que puedes agregar clases a elementos HTML utilizando class=\"your-class-here\" dentro de la tag de entrada del mismo.", + "Recuerda que los selectores CSS requieren un punto al principio: .blue-text { color: blue; }, pero que las declaraciones de clase NO llevan punto: <h2 class=\"blue-text\">CatPhotoApp<h2>." + ], "namePt": "", "descriptionPt": [] }, @@ -527,8 +531,13 @@ "descriptionFr": [], "nameRu": "", "descriptionRu": [], - "nameEs": "", - "descriptionEs": [], + "nameEs": "Waypoint: Cambia el tamaño de fuente de un elemento.", + "descriptionEs": [ + "Crea un segundo elemento p. Luego, dentro de tu elemento <style>, pon el \"font-size\" de todos los elementos p a 16 pixeles.", + "El tamaño de fuente es controlado por el atributo CSS \"font-size\", como aquí: h1 { font-size: 30px; }.", + "Primero, crea un segundo elemento p con el siguiente texto Kitty Ipsum: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.", + "Ve si puedes encontrar una manera de darle a ambos elementos p un font-size de 16 pixeles (16px). Puedes hacer esto dentro de la misma etiqueta <style> que creamos para la clase \"red-text\"." + ], "namePt": "", "descriptionPt": [] }, From 3636b76f7b549f3e3dc1a9752ec454dc502971ae Mon Sep 17 00:00:00 2001 From: ahstro Date: Thu, 6 Aug 2015 23:28:27 +0200 Subject: [PATCH 03/21] Improves 'Target Elements by ID Using jQuery' --- seed/challenges/jquery-ajax-and-json.json | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/seed/challenges/jquery-ajax-and-json.json b/seed/challenges/jquery-ajax-and-json.json index dad707f590..ce8cf694d9 100644 --- a/seed/challenges/jquery-ajax-and-json.json +++ b/seed/challenges/jquery-ajax-and-json.json @@ -153,15 +153,17 @@ "dashedName": "waypoint-target-elements-by-id-using-jquery", "difficulty": 3.04, "description": [ - "You can also target elements by their id attributes.", - "First target your div element with the class \"target3\" by using the $('#target3') selector.", - "Note that, just like with CSS declarations, you type a # before the class's name.", - "Then use jQuery's .addClass() function to add the classes \"animated\" and \"fadeOut\".", - "Make all the button element with the id \"target3\" fadeOut. $('#target3').addClass('animated fadeOut')." + "Just like you can target elements by their classes, you can also target them by their id attributes.", + "First target the element with the id target3 by using the $('#target3') selector.", + "Note that, just like with CSS selectors, you type a # before the id's name.", + "Then use jQuery's .addClass() function to add the class fadeOut.", + "Since #target3 is a button, and we already added the animated-class to all button-elements, we do not need to add it again.", + "Make all the elements with the id target3 fade out. $('#target3').addClass('fadeOut')." ], "tests": [ - "assert($('#target3').hasClass('animated') && $('#target3').hasClass('fadeOut'), 'Select the buttonelement with the id of \"target3\" and use the jQuery addClass() function to give it the classes of \"animated\" and \"fadeOut\".');", - "assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.');" + "assert($('#target3').hasClass('animated'), 'Make sure the old animated-class is still added to all buttons.')", + "assert($('#target3').hasClass('fadeOut'), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.')", + "assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')" ], "challengeSeed": [ "fccss", From 93083eb1c901fb639854f158a37ddb57764b16e7 Mon Sep 17 00:00:00 2001 From: Samuel Plumppu Date: Fri, 7 Aug 2015 16:32:20 +0200 Subject: [PATCH 04/21] clarified description for waypoint: make images mobile responsive --- seed/challenges/bootstrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index def874e207..c929ee9591 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/challenges/bootstrap.json @@ -92,7 +92,7 @@ "dashedName": "waypoint-make-images-mobile-responsive", "difficulty": 2.02, "description": [ - "First, Add a new image with the src attribute of \"http://bit.ly/fcc-kittens2\".", + "First, Add a new image below the existing one. Set it's src attribute to \"http://bit.ly/fcc-kittens2\".", "It would be great if this image could be exactly the width of our phone's screen.", "Fortunately, with Bootstrap, all we need to do is add the \"img-responsive\" class to your image. Do this, and the image should perfectly fit the width of your page." ], From 9d6c5e63abdad265dbd59323b244ef62f9c51e1f Mon Sep 17 00:00:00 2001 From: ahstro Date: Sat, 8 Aug 2015 03:29:22 +0200 Subject: [PATCH 05/21] 'Convert HTML Entities' now allows upper and lower case entities #1647 --- seed/challenges/intermediate-bonfires.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/seed/challenges/intermediate-bonfires.json b/seed/challenges/intermediate-bonfires.json index 184a648748..7f6c88ae26 100644 --- a/seed/challenges/intermediate-bonfires.json +++ b/seed/challenges/intermediate-bonfires.json @@ -398,12 +398,12 @@ "convert('Dolce & Gabbana');" ], "tests": [ - "assert.strictEqual(convert('Dolce & Gabbana'), 'Dolce & Gabbana', 'should escape characters');", - "assert.strictEqual(convert('Hamburgers < Pizza < Tacos'), 'Hamburgers < Pizza < Tacos', 'should escape characters');", - "assert.strictEqual(convert('Sixty > twelve'), 'Sixty > twelve', 'should escape characters');", - "assert.strictEqual(convert('Stuff in \"quotation marks\"'), 'Stuff in "quotation marks"', 'should escape characters');", - "assert.strictEqual(convert(\"Shindler's List\"), 'Shindler's List', 'should escape characters');", - "assert.strictEqual(convert('<>'), '<>', 'should escape characters');", + "assert.match(convert('Dolce & Gabbana'), /Dolce &(amp|AMP); Gabbana/, 'should escape characters');", + "assert.match(convert('Hamburgers < Pizza < Tacos'), /Hamburgers &(lt|LT); Pizza &(lt|LT); Tacos/, 'should escape characters');", + "assert.match(convert('Sixty > twelve'), /Sixty &(gt|GT); twelve/, 'should escape characters');", + "assert.match(convert('Stuff in \"quotation marks\"'), /Stuff in &(quot|QUOT);quotation marks&(quot|QUOT);/, 'should escape characters');", + "assert.match(convert(\"Shindler's List\"), /Shindler&(apos|APOS);s List/, 'should escape characters');", + "assert.match(convert('<>'), /&(lt|LT);&(gt|GT);/, 'should escape characters');", "assert.strictEqual(convert('abc'), 'abc', 'should handle strings with nothing to escape');" ], "MDNlinks": [ From c5fb8c83f561fc31c18ed2cea728086193c60b2e Mon Sep 17 00:00:00 2001 From: ahstro Date: Sat, 8 Aug 2015 03:43:14 +0200 Subject: [PATCH 06/21] Added even more HTML entities and removed &APOS; --- seed/challenges/intermediate-bonfires.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/seed/challenges/intermediate-bonfires.json b/seed/challenges/intermediate-bonfires.json index 7f6c88ae26..42b5178011 100644 --- a/seed/challenges/intermediate-bonfires.json +++ b/seed/challenges/intermediate-bonfires.json @@ -398,12 +398,12 @@ "convert('Dolce & Gabbana');" ], "tests": [ - "assert.match(convert('Dolce & Gabbana'), /Dolce &(amp|AMP); Gabbana/, 'should escape characters');", - "assert.match(convert('Hamburgers < Pizza < Tacos'), /Hamburgers &(lt|LT); Pizza &(lt|LT); Tacos/, 'should escape characters');", - "assert.match(convert('Sixty > twelve'), /Sixty &(gt|GT); twelve/, 'should escape characters');", - "assert.match(convert('Stuff in \"quotation marks\"'), /Stuff in &(quot|QUOT);quotation marks&(quot|QUOT);/, 'should escape characters');", - "assert.match(convert(\"Shindler's List\"), /Shindler&(apos|APOS);s List/, 'should escape characters');", - "assert.match(convert('<>'), /&(lt|LT);&(gt|GT);/, 'should escape characters');", + "assert.match(convert('Dolce & Gabbana'), /Dolce &(amp|AMP|#x00026|#38); Gabbana/, 'should escape characters');", + "assert.match(convert('Hamburgers < Pizza < Tacos'), /Hamburgers &(lt|LT|#x0003C|#60); Pizza &(lt|LT|#x0003C|#60); Tacos/, 'should escape characters');", + "assert.match(convert('Sixty > twelve'), /Sixty &(gt|GT|#x0003E|#62); twelve/, 'should escape characters');", + "assert.match(convert('Stuff in \"quotation marks\"'), /Stuff in &(quot|QUOT|#x00022|#34);quotation marks&(quot|QUOT|#x00022|#34);/, 'should escape characters');", + "assert.match(convert(\"Shindler's List\"), /Shindler&(apos|#x00027|#39);s List/, 'should escape characters');", + "assert.match(convert('<>'), /&(lt|LT|#x0003C|#60);&(gt|GT|#x0003E|#62);/, 'should escape characters');", "assert.strictEqual(convert('abc'), 'abc', 'should handle strings with nothing to escape');" ], "MDNlinks": [ From 7348cff96ecf5659d77887a6576cf3e0e8ce64ac Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Tue, 11 Aug 2015 12:49:37 -0700 Subject: [PATCH 07/21] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 13007cd912..d62477d7bd 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,6 @@ TWITTER_TOKEN=stuff TWITTER_TOKEN_SECRET=stuff BLOGGER_KEY=stuff -SLACK_WEBHOOK=stuff SESSION_SECRET=secretstuff COOKIE_SECRET='this is a secret' From 6fd19738ce5c9b812f6cf3465153a757764a837b Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Tue, 11 Aug 2015 13:22:16 -0700 Subject: [PATCH 08/21] refactor and lint home router --- server/boot/home.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/server/boot/home.js b/server/boot/home.js index 1e40fb01a3..177a2eff2b 100644 --- a/server/boot/home.js +++ b/server/boot/home.js @@ -1,29 +1,29 @@ -var defaultProfileImage = - require('../../common/utils/constantStrings.json').defaultProfileImage; -var message = +import { defaultProfileImage } from '../../common/utils/constantStrings.json'; + +const message = 'Learn to Code JavaScript and get a Coding Job by Helping Nonprofits'; module.exports = function(app) { var router = app.loopback.Router(); - router.get('/', index); + router.get('/', addDefaultImage, index); app.use(router); - function index(req, res, next) { - if (req.user) - if (!req.user.picture) { - req.user.picture = defaultProfileImage; - - req.user.save(function (err) { - if (err) { - return next(err); - } - res.render('get-started', {title: message}); - }); - } else { - res.render('resources/get-started', {title: message}); - } else { - res.render('home', { title: message }); + function addDefaultImage(req, res, next) { + if (!req.user || req.user.picture) { + return next(); } + req.user.picture = defaultProfileImage; + req.user.save(function(err) { + if (err) { return next(err); } + next(); + }); + } + + function index(req, res) { + if (req.user) { + return res.render('resources/get-started', { title: message }); + } + res.render('home', { title: message }); } }; From 0fcf3bcf42214abae84db4919871496e2392c8ba Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Tue, 11 Aug 2015 14:17:08 -0700 Subject: [PATCH 09/21] fix challenge completion should give brownie points closes #1665 --- server/boot/challenge.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/boot/challenge.js b/server/boot/challenge.js index feea89818a..cbcc47e614 100644 --- a/server/boot/challenge.js +++ b/server/boot/challenge.js @@ -38,9 +38,10 @@ function updateUserProgress(user, challengeId, completedChallenge) { return id === challengeId; }); - if (alreadyCompleted) { + if (!alreadyCompleted) { user.progressTimestamps.push({ - timestamp: Date.now() + timestamp: Date.now(), + completedChallenge }); } user.completedChallenges.push(completedChallenge); From 08384864832c16b29cfba98cf82b29804d870922 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Tue, 11 Aug 2015 14:49:57 -0700 Subject: [PATCH 10/21] properly define id fields for basic models closes #1724 --- common/models/challenge.json | 4 ++++ common/models/job.json | 4 ++++ common/models/nonprofit.json | 4 ++++ common/models/story.json | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/common/models/challenge.json b/common/models/challenge.json index 08fa48779b..84cf3a4c6b 100644 --- a/common/models/challenge.json +++ b/common/models/challenge.json @@ -4,6 +4,10 @@ "idInjection": true, "trackChanges": false, "properties": { + "id": { + "type": "string", + "id": true + }, "name": { "type": "string", "index": { diff --git a/common/models/job.json b/common/models/job.json index 12473628cc..a3392fee82 100644 --- a/common/models/job.json +++ b/common/models/job.json @@ -4,6 +4,10 @@ "idInjection": true, "trackChanges": false, "properties": { + "id": { + "type": "string", + "id": true + }, "position": { "type": "string" }, diff --git a/common/models/nonprofit.json b/common/models/nonprofit.json index 5d8dddbc3d..d83bd55739 100644 --- a/common/models/nonprofit.json +++ b/common/models/nonprofit.json @@ -4,6 +4,10 @@ "idInjection": true, "trackChanges": false, "properties": { + "id": { + "type": "string", + "id": true + }, "name": { "type": "string", "index": { diff --git a/common/models/story.json b/common/models/story.json index 6f252cefb3..5d8e56dfb2 100644 --- a/common/models/story.json +++ b/common/models/story.json @@ -4,6 +4,10 @@ "idInjection": true, "trackChanges": false, "properties": { + "id": { + "type": "string", + "id": true + }, "name": { "type": "string", "index": { From e42e954517f3c35f04f9028070abaca994c8900b Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Tue, 11 Aug 2015 23:53:30 -0700 Subject: [PATCH 11/21] fix omission in simon zipline --- seed/challenges/intermediate-ziplines.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/intermediate-ziplines.json b/seed/challenges/intermediate-ziplines.json index 2a2d5af952..4839ec8760 100644 --- a/seed/challenges/intermediate-ziplines.json +++ b/seed/challenges/intermediate-ziplines.json @@ -140,7 +140,7 @@ "difficulty": 1.07, "challengeSeed": ["126415123"], "description": [ - "Objective: Build a CodePen.io app that successfully reverse-engineers this: http://codepen.io/dting/full/KpJXZV/.", + "Objective: Build a CodePen.io app that successfully reverse-engineers this: http://codepen.io/dting/full/KpJXZV/.", "Rule #1: Don't look at the example project's code on CodePen. Figure it out for yourself.", "Rule #2: You may use whichever libraries or APIs you need.", "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.", From 5830ac2f8a9ccd6c9d849dc5e76e535d5405deaf Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Wed, 12 Aug 2015 00:52:40 -0700 Subject: [PATCH 12/21] make all single quotes in jquery challenges double quotes --- seed/challenges/jquery-ajax-and-json.json | 895 --------------------- seed/challenges/jquery.json | 899 ++++++++++++++++++++++ 2 files changed, 899 insertions(+), 895 deletions(-) delete mode 100644 seed/challenges/jquery-ajax-and-json.json create mode 100644 seed/challenges/jquery.json diff --git a/seed/challenges/jquery-ajax-and-json.json b/seed/challenges/jquery-ajax-and-json.json deleted file mode 100644 index 26cdb46b8a..0000000000 --- a/seed/challenges/jquery-ajax-and-json.json +++ /dev/null @@ -1,895 +0,0 @@ -{ - "name": "jQuery", - "order": 0.004, - "challenges": [ - { - "id": "bad87fee1348bd9acdd08826", - "title": "Learn how Script Tags and Document Ready Work", - "difficulty": 3.01, - "description": [ - "Now we're ready to learn jQuery, the most popular JavaScript tool of all time. Don't worry about JavaScript itself - we will cover it soon.", - "Before we can start using jQuery, we need to add some things to our HTML.", - "First, add a script element at the top of your page. Be sure to close it on the following line.", - "Your browser will run any JavaScript inside a script element, including jQuery.", - "Inside your script element, add this code: $(document).ready(function() { to your script. Then close it on the following line (still inside your script element) with: });" - ], - "tests": [ - "assert(editor.match(/