From 2b0428fe51c498f2b2af90c1605f8b5107fe72c1 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Sun, 8 Feb 2015 00:57:37 -0500 Subject: [PATCH 1/6] Fix old redirect in courseware.js --- controllers/courseware.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/courseware.js b/controllers/courseware.js index 9c6c1da6497..7e2c85f0a2b 100644 --- a/controllers/courseware.js +++ b/controllers/courseware.js @@ -16,7 +16,7 @@ exports.coursewareNames = function(req, res) { exports.returnNextCourseware = function(req, res) { if (!req.user) { - return res.redirect('coursewares/intro'); + return res.redirect('coursewares/start-our-challenges'); } var completed = req.user.completedCoursewares.map(function (elem) { return elem._id; @@ -41,7 +41,7 @@ exports.returnNextCourseware = function(req, res) { req.flash('errors', { msg: "It looks like you've completed all the courses we have available. Good job!" }) - return res.redirect('../coursewares/intro'); + return res.redirect('../coursewares/start-our-challenges'); } nameString = courseware.name.toLowerCase().replace(/\s/g, '-'); return res.redirect('../coursewares/' + nameString); From 4fa6c9c65d21e6195125ee838013431583a52ba8 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Sun, 8 Feb 2015 01:12:40 -0500 Subject: [PATCH 2/6] iFrame cleanup for courseware to get rid of domain error, rename both framework files to force browser fetches to most recent code --- .../bonfire/{bonfireFramework.js => bonfireFramework_v0.1.0.js} | 0 .../{coursewaresFramework.js => coursewaresFramework_v0.1.0.js} | 1 - views/bonfire/bonfire.jade | 2 +- views/bonfire/show.jade | 2 +- views/coursewares/show.jade | 2 +- 5 files changed, 3 insertions(+), 4 deletions(-) rename public/js/lib/bonfire/{bonfireFramework.js => bonfireFramework_v0.1.0.js} (100%) rename public/js/lib/coursewares/{coursewaresFramework.js => coursewaresFramework_v0.1.0.js} (98%) diff --git a/public/js/lib/bonfire/bonfireFramework.js b/public/js/lib/bonfire/bonfireFramework_v0.1.0.js similarity index 100% rename from public/js/lib/bonfire/bonfireFramework.js rename to public/js/lib/bonfire/bonfireFramework_v0.1.0.js diff --git a/public/js/lib/coursewares/coursewaresFramework.js b/public/js/lib/coursewares/coursewaresFramework_v0.1.0.js similarity index 98% rename from public/js/lib/coursewares/coursewaresFramework.js rename to public/js/lib/coursewares/coursewaresFramework_v0.1.0.js index 733d8e9fa8c..8d39c02f790 100644 --- a/public/js/lib/coursewares/coursewaresFramework.js +++ b/public/js/lib/coursewares/coursewaresFramework_v0.1.0.js @@ -34,7 +34,6 @@ editor.setOption("extraKeys", { editor.setSize("100%", "auto"); var libraryIncludes = "" + - "" + "" + "" + "" + diff --git a/views/bonfire/bonfire.jade b/views/bonfire/bonfire.jade index 498f7d3a239..ca22dc30058 100644 --- a/views/bonfire/bonfire.jade +++ b/views/bonfire/bonfire.jade @@ -42,4 +42,4 @@ block content br ul#testSuite.list-group br - script(src='/js/lib/bonfire/bonfireFramework.js') \ No newline at end of file + script(src='/js/lib/bonfire/bonfireFramework_v0.1.0.js') \ No newline at end of file diff --git a/views/bonfire/show.jade b/views/bonfire/show.jade index 42f8cdce89f..7604a602622 100644 --- a/views/bonfire/show.jade +++ b/views/bonfire/show.jade @@ -96,7 +96,7 @@ block content form.code .form-group.codeMirrorView textarea#codeEditor(autofocus=true) - script(src='/js/lib/bonfire/bonfireFramework.js') + script(src='/js/lib/bonfire/bonfireFramework_v0.1.0.js') diff --git a/views/coursewares/show.jade b/views/coursewares/show.jade index a842bffacd2..8535677cd5c 100644 --- a/views/coursewares/show.jade +++ b/views/coursewares/show.jade @@ -60,7 +60,7 @@ block content form.code .form-group.codeMirrorView textarea#codeEditor(autofocus=true) - script(src='/js/lib/coursewares/coursewaresFramework.js') + script(src='/js/lib/coursewares/coursewaresFramework_v0.1.0.js') .col-md-4.col-lg-3 .hidden-xs.hidden-sm img.iphone-position(src="https://s3.amazonaws.com/freecodecamp/iphone6-frame.png") From aac8fce2c566fb805df7a1db57465b274bfcf753 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Sun, 8 Feb 2015 01:17:06 -0500 Subject: [PATCH 3/6] Fix failing test for "create a style tag", change rgb(255,0,0) to rgb(0,0,255) --- seed_data/coursewares.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/coursewares.json b/seed_data/coursewares.json index d743390948c..6d60c808cf5 100644 --- a/seed_data/coursewares.json +++ b/seed_data/coursewares.json @@ -156,7 +156,7 @@ "Note that it's important to have an opening and closing curly braces ({ and }) around each element's style. You also need to make sure your element's style is between the opening and closing style tags. Finally, be sure to add the semicolon to the end of each of the element's styles." ], "tests": [ - "expect($('h2')).to.have.css('color', 'rgb(255, 0, 0)');" + "expect($('h2')).to.have.css('color', 'rgb(0, 0, 255)');" ], "challengeSeed": [ "

hello world

", From f572e4cb77960f394b2e27a3e24e0ede38102702 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Sun, 8 Feb 2015 12:39:00 -0500 Subject: [PATCH 4/6] Simple fix for requesting challenges over challenge 53 --- app.js | 2 +- controllers/challenges.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 3b620225cd9..2417185e983 100644 --- a/app.js +++ b/app.js @@ -319,7 +319,7 @@ app.post('/completed-challenge', function (req, res) { var timestamp = req.user.challengesHash; var points = 0; for (var key in timestamp) { - if (timestamp[key] > 0) { + if (timestamp[key] > 0 && req.body.challengeNumber < 54) { points += 1; } } diff --git a/controllers/challenges.js b/controllers/challenges.js index 6341ce520f3..9de4496a4cd 100644 --- a/controllers/challenges.js +++ b/controllers/challenges.js @@ -11,7 +11,12 @@ var highestChallengeNumber = 53; exports.returnChallenge = function(req, res, next) { var challengeNumber = parseInt(req.params.challengeNumber) || 0; - if (challengeNumber > highestChallengeNumber) { challengeNumber = 0; } + if (challengeNumber > highestChallengeNumber) { + req.flash('errors', { + msg: "It looks like you've either completed all the challenges we have available or requested a challenge we don't have." + }); + return res.redirect('../challenges/0'); + } Challenge.find({}, null, { sort: { challengeNumber: 1 } }, function(err, c) { if (err) { debug('Challenge err: ', err); From 9808db4f305cb3b9ba8207d01b960e5f87dc656d Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Sun, 8 Feb 2015 14:24:42 -0500 Subject: [PATCH 5/6] Fixing undefined challengeName on info pages --- controllers/challenges.js | 1 + views/contact/nonprofits.jade | 4 +++- views/home.jade | 4 +++- views/resources/learn-to-code.jade | 2 ++ views/resources/privacy.jade | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/controllers/challenges.js b/controllers/challenges.js index 9de4496a4cd..b20ff6287bc 100644 --- a/controllers/challenges.js +++ b/controllers/challenges.js @@ -11,6 +11,7 @@ var highestChallengeNumber = 53; exports.returnChallenge = function(req, res, next) { var challengeNumber = parseInt(req.params.challengeNumber) || 0; + debug(challengeNumber); if (challengeNumber > highestChallengeNumber) { req.flash('errors', { msg: "It looks like you've either completed all the challenges we have available or requested a challenge we don't have." diff --git a/views/contact/nonprofits.jade b/views/contact/nonprofits.jade index f52f36bec94..4d3115c15c5 100644 --- a/views/contact/nonprofits.jade +++ b/views/contact/nonprofits.jade @@ -44,4 +44,6 @@ block content .col-sm-offset-2.col-sm-8 button.btn.btn-primary(type='submit', ng-disabled='nonprofitForm.$invalid') span.ion-paper-airplane - | Submit \ No newline at end of file + | Submit + script. + var challengeName = 'Non-profit Interest' \ No newline at end of file diff --git a/views/home.jade b/views/home.jade index 206cfd78112..69d0196c0ab 100644 --- a/views/home.jade +++ b/views/home.jade @@ -84,4 +84,6 @@ block content li.ion-code   You can get help in real time from our community chat rooms and forum li.ion-code   We all share one common goal: to boost our careers with code .big-break - a.btn.btn-cta.signup-btn(href="/login") Learn to code today (it's free) \ No newline at end of file + a.btn.btn-cta.signup-btn(href="/login") Learn to code today (it's free) + script. + challengeName = 'Home' \ No newline at end of file diff --git a/views/resources/learn-to-code.jade b/views/resources/learn-to-code.jade index 6c820865095..12c1d64b61c 100644 --- a/views/resources/learn-to-code.jade +++ b/views/resources/learn-to-code.jade @@ -1,5 +1,7 @@ extends ../layout block content + script. + var challengeName = 'Learn to code' include ../partials/stats include ../partials/blog include ../partials/about diff --git a/views/resources/privacy.jade b/views/resources/privacy.jade index 9ab932774e7..896c2437b56 100644 --- a/views/resources/privacy.jade +++ b/views/resources/privacy.jade @@ -36,3 +36,5 @@ block content

Acceptance of Privacy Policy Terms and Conditions

By using this site, you signify your agreement to the terms and conditions of this FreeCodeCamp.com Privacy Policy. If you do not agree to these terms, please do not use this site. We reserve the right, at our sole discretion, to change, modify, add, or remove portions of this policy at any time. All amended terms automatically take effect 30 days after they are initially posted on the site. Please check this page periodically for any modifications. Your continued use of FreeCodeCamp.com following the posting of any changes to these terms shall mean that you have accepted those changes.

If you have any questions or concerns, please send an e-mail to team@freecodecamp.com.

+ script. + var challengeName = 'Privacy'; From 0689793ef81b546d225d198ff2183d95bc22af07 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Sun, 8 Feb 2015 14:25:26 -0500 Subject: [PATCH 6/6] Remove debug statement --- controllers/challenges.js | 1 - 1 file changed, 1 deletion(-) diff --git a/controllers/challenges.js b/controllers/challenges.js index b20ff6287bc..9de4496a4cd 100644 --- a/controllers/challenges.js +++ b/controllers/challenges.js @@ -11,7 +11,6 @@ var highestChallengeNumber = 53; exports.returnChallenge = function(req, res, next) { var challengeNumber = parseInt(req.params.challengeNumber) || 0; - debug(challengeNumber); if (challengeNumber > highestChallengeNumber) { req.flash('errors', { msg: "It looks like you've either completed all the challenges we have available or requested a challenge we don't have."