From 13c3d213ce8af1655c54ca772ee6a7bc31093f3b Mon Sep 17 00:00:00 2001 From: Matias Cao Date: Tue, 16 Jun 2015 18:27:58 -0300 Subject: [PATCH 01/25] 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/25] 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 064fc68b304cb3ae44005da008313e91a760743e Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 4 Aug 2015 11:04:40 -0500 Subject: [PATCH 03/25] Update bootstrap.json fixed line 1886, changed col-xs-12 to col-xs-6 "assert($('.col-xs-6').children('h4') && $('.col-xs-6').children('h4').length > 1, 'Add an h4 element to each of your <div class=\\'col-xs-6\\'> elements.');", --- 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 c0b4014f93..68d6c70fc9 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/challenges/bootstrap.json @@ -1883,7 +1883,7 @@ "Above your right-well, inside its \"col-xs-6\" div element, add a h4 element with the text \"#right-well\"." ], "tests": [ - "assert($('.col-xs-12').children('h4') && $('.col-xs-12').children('h4').length > 1, 'Add an h4 element to each of your <div class=\\'col-xs-6\\'> elements.');", + "assert($('.col-xs-6').children('h4') && $('.col-xs-6').children('h4').length > 1, 'Add an h4 element to each of your <div class=\\'col-xs-6\\'> elements.');", "assert(new RegExp('#left-well','gi').test($('h4').text()), 'One h4 element should have the text \"#left-well\".');", "assert(new RegExp('#right-well','gi').test($('h4').text()), 'One h4 element should have the text \"#right-well\".');" ], From 3636b76f7b549f3e3dc1a9752ec454dc502971ae Mon Sep 17 00:00:00 2001 From: ahstro Date: Thu, 6 Aug 2015 23:28:27 +0200 Subject: [PATCH 04/25] 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 05/25] 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 06/25] '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 07/25] 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 8a1694203675e872c4eb50cbbda5ac21ab1e8ae5 Mon Sep 17 00:00:00 2001 From: sonorangirl Date: Mon, 10 Aug 2015 18:05:07 -0700 Subject: [PATCH 08/25] Fixed typos in 1st slot machine challenge --- seed/challenges/basic-javascript.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index c8cd7046a9..04fd44d166 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -1071,16 +1071,16 @@ "title": "Create a JavaScript Slot Machine", "difficulty":"9.988", "description":[ - "We are now going to try and combine some of the stuff we've just learnt abd create the logic for a slot machine game", + "We are now going to try and combine some of the stuff we've just learned and create the logic for a slot machine game", "For this we will need to generate three random numbers between 1 and 5 to represent the possible values of each individual slot", "Store the three random numbers in slotOne, slotTwo and slotThree", "Generate the random numbers by using the system we used earlier in /challenges/random-whole-numbers-in-a-range", "Math.floor(Math.random() * (5 - 1 + 1)) + 1; " ], "tests":[ - "assert(typeof(runSlots($('.slot'))[0]) == 'number', 'SlotOne should be a random number');", - "assert(typeof(runSlots($('.slot'))[1]) == 'number', 'SlotTwo should be a random number');", - "assert(typeof(runSlots($('.slot'))[2]) == 'number', 'SlotThree should be a random number');", + "assert(typeof(runSlots($('.slot'))[0]) == 'number', 'slotOne should be a random number');", + "assert(typeof(runSlots($('.slot'))[1]) == 'number', 'slotTwo should be a random number');", + "assert(typeof(runSlots($('.slot'))[2]) == 'number', 'slotThree should be a random number');", "assert((function(){if(editor.match(/Math.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi) !== null){return(editor.match(/Math.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi).length >= 3);}else{return(false);}})(), 'You should have used Math.floor(Math.random() * (5 - 1 + 1)) + 1; three times to generate your random numbers');" ], "challengeSeed":[ From 8efe8ee825b2f22e3aa6a41d595b9ebb63e7b8ca Mon Sep 17 00:00:00 2001 From: sonorangirl Date: Mon, 10 Aug 2015 19:22:18 -0700 Subject: [PATCH 09/25] Fixed RegEx so that 4th test would pass --- seed/challenges/basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index 04fd44d166..7834110ea0 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -1081,7 +1081,7 @@ "assert(typeof(runSlots($('.slot'))[0]) == 'number', 'slotOne should be a random number');", "assert(typeof(runSlots($('.slot'))[1]) == 'number', 'slotTwo should be a random number');", "assert(typeof(runSlots($('.slot'))[2]) == 'number', 'slotThree should be a random number');", - "assert((function(){if(editor.match(/Math.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi) !== null){return(editor.match(/Math.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi).length >= 3);}else{return(false);}})(), 'You should have used Math.floor(Math.random() * (5 - 1 + 1)) + 1; three times to generate your random numbers');" + "assert((function(){if(editor.match(/Math\\.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi) !== null){return(editor.match(/Math\\.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi).length >= 3);}else{return(false);}})(), 'You should have used Math.floor(Math.random() * (5 - 1 + 1)) + 1; three times to generate your random numbers');" ], "challengeSeed":[ "fccss", From fb44b50941a575781e815223ace36da9a6dd3f04 Mon Sep 17 00:00:00 2001 From: sonorangirl Date: Mon, 10 Aug 2015 19:32:52 -0700 Subject: [PATCH 10/25] Made some spaces optional for 4th test --- seed/challenges/basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index 7834110ea0..0aa6f4f02f 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -1081,7 +1081,7 @@ "assert(typeof(runSlots($('.slot'))[0]) == 'number', 'slotOne should be a random number');", "assert(typeof(runSlots($('.slot'))[1]) == 'number', 'slotTwo should be a random number');", "assert(typeof(runSlots($('.slot'))[2]) == 'number', 'slotThree should be a random number');", - "assert((function(){if(editor.match(/Math\\.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi) !== null){return(editor.match(/Math\\.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi).length >= 3);}else{return(false);}})(), 'You should have used Math.floor(Math.random() * (5 - 1 + 1)) + 1; three times to generate your random numbers');" + "assert((function(){if(editor.match(/Math\\.floor\\(\\s?Math\\.random\\(\\)\\s?\\*\\s?\\(\\s?5\\s?\\-\\s?1\\s?\\+\\s?1\\s?\\)\\s?\\)\\s?\\+\\s?1;/gi) !== null){return(editor.match(/Math\\.floor\\(\\s?Math\\.random\\(\\)\\s?\\*\\s?\\(\\s?5\\s?\\-\\s?1\\s?\\+\\s?1\\s?\\)\\s?\\)\\s?\\+\\s?1;/gi).length >= 3);}else{return(false);}})(), 'You should have used Math.floor(Math.random() * (5 - 1 + 1)) + 1; three times to generate your random numbers');" ], "challengeSeed":[ "fccss", From 5f21db457d74ef364e2c0f43fb88be1ef73110af Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Mon, 10 Aug 2015 23:29:32 -0700 Subject: [PATCH 11/25] fix challenge ordering Now challenges are ordered on map first by top order value of json file second by index of array --- common/models/challenge.json | 3 +++ seed/index.js | 3 ++- server/boot/challenge.js | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/models/challenge.json b/common/models/challenge.json index 743332107d..08fa48779b 100644 --- a/common/models/challenge.json +++ b/common/models/challenge.json @@ -22,6 +22,9 @@ "order": { "type": "number" }, + "suborder": { + "type": "number" + }, "dashedName": { "type": "string" }, diff --git a/seed/index.js b/seed/index.js index 38305428a2..334a11d3dc 100644 --- a/seed/index.js +++ b/seed/index.js @@ -63,7 +63,8 @@ Challenge.destroyAll(function(err, info) { .toLowerCase() .replace(/\:/g, '') .replace(/\s/g, '-'); - challenge.order = +('' + order + (index + 1)); + challenge.order = order; + challenge.suborder = index + 1; challenge.block = block; return challenge; diff --git a/server/boot/challenge.js b/server/boot/challenge.js index 1fc4342def..feea89818a 100644 --- a/server/boot/challenge.js +++ b/server/boot/challenge.js @@ -458,7 +458,10 @@ module.exports = function(app) { .map(camperCount => numberWithCommas(camperCount)); const query = { - order: 'order ASC' + order: [ + 'order ASC', + 'suborder ASC' + ] }; // create a stream of all the challenges From 2256f3ef6e2cfec7dd82b975ca5795ba792d2401 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Mon, 10 Aug 2015 23:38:10 -0700 Subject: [PATCH 12/25] fix add github link to passport --- common/models/User-Identity.js | 2 +- server/passport-providers.js | 14 ++++++++++++++ server/server.js | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/common/models/User-Identity.js b/common/models/User-Identity.js index 87a7ffef57..779ad2f48f 100644 --- a/common/models/User-Identity.js +++ b/common/models/User-Identity.js @@ -79,7 +79,7 @@ export default function(UserIdent) { } // if user signed in with github refresh their info - if (userIdent.provider === 'github-login') { + if (/github/.test(userIdent.provider)) { debug("user isn't github cool or username from github is different"); setProfileFromGithub(user, profile, profile._json); userChanged = true; diff --git a/server/passport-providers.js b/server/passport-providers.js index ddd29f64db..5ffcbf1a09 100644 --- a/server/passport-providers.js +++ b/server/passport-providers.js @@ -141,5 +141,19 @@ module.exports = { clientSecret: process.env.GITHUB_SECRET, scope: ['email'], failureFlash: true + }, + 'github-link': { + provider: 'github', + authScheme: 'oauth2', + module: 'passport-github', + authPath: '/link/github', + callbackURL: '/link/github/callback', + callbackPath: '/link/github/callback', + successRedirect: successRedirect, + failureRedirect: failureRedirect, + clientID: process.env.GITHUB_ID, + clientSecret: process.env.GITHUB_SECRET, + scope: ['email'], + failureFlash: true } }; diff --git a/server/server.js b/server/server.js index 93a0f06d8d..bf0cb8c396 100755 --- a/server/server.js +++ b/server/server.js @@ -102,7 +102,7 @@ var passportOptions = { userObj.email = email; } - if (provider === 'github-login') { + if (/github/.test(provider)) { setProfileFromGithub(userObj, profile, profile._json); } return userObj; From 7348cff96ecf5659d77887a6576cf3e0e8ce64ac Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Tue, 11 Aug 2015 12:49:37 -0700 Subject: [PATCH 13/25] 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 14/25] 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 15/25] 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 16/25] 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 17/25] 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 18/25] 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(/