diff --git a/app.js b/app.js index 106e6e2671..0c2546d754 100644 --- a/app.js +++ b/app.js @@ -234,6 +234,7 @@ app.get('/deploy-a-website', resourcesController.deployAWebsite); app.get('/gmail-shortcuts', resourcesController.gmailShortcuts); app.get('/control-shortcuts', resourcesController.controlShortcuts); app.get('/control-shortcuts', resourcesController.deployAWebsite); +app.get('/nodeschool-challenges', resourcesController.nodeSchoolChallenges); app.get('/stats', function(req, res) { res.redirect(301, '/learn-to-code'); }); diff --git a/controllers/resources.js b/controllers/resources.js index fb38abeeeb..3a7e096b74 100644 --- a/controllers/resources.js +++ b/controllers/resources.js @@ -131,6 +131,13 @@ module.exports = { title: 'JavaScript in your Inbox' }); }, + + nodeSchoolChallenges: function(req, res) { + res.render('resources/nodeschool-challenges', { + title: 'NodeSchool Challenges' + }); + }, + githubCalls: function(req, res) { var githubHeaders = {headers: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1521.3 Safari/537.36'}, port:80 }; request('https://api.github.com/repos/freecodecamp/freecodecamp/pulls?client_id=' + secrets.github.clientID + '&client_secret=' + secrets.github.clientSecret, githubHeaders, function(err, status1, pulls) { diff --git a/controllers/resources.json b/controllers/resources.json index c292aa8aca..3237d77c37 100644 --- a/controllers/resources.json +++ b/controllers/resources.json @@ -1,7 +1,7 @@ { "announcements": [ + ["Some of Code School's courses are no longer free. We're switching to NodeSchool.io for our Node.js and Express.js challenges.", "http://freecodecamp.com/nodeschool-challenges"], ["Screen Hero is now free on Windows and Mac! Follow these special instructions to install it.", "http://freecodecamp.com/install-screenhero"], - ["Bonfire is now live with 30+ challenges! If you haven't started CoderByte, do these instead.", "http://freecodecamp.com/bonfires"], ["Once you finish all the challenges, we welcome you to attend our Nonprofit Project Office Hours every Monday and Thursday Night at 9 pm EST.", "https://gitter.im/FreeCodeCamp/NonprofitProjects"] ], "questions": [{ diff --git a/public/js/main.js b/public/js/main.js index 54abe0decc..9c874abfd8 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -4,6 +4,13 @@ $(document).ready(function() { ga('send', 'event', 'Challenge', 'load', challengeName); } + // When introducing a new announcement, change the localStorage attribute + // and the HTML located in the footer + if (!localStorage || !localStorage.nodeSchoolAnnouncement) { + $('#announcementModal').modal('show'); + localStorage.fccShowAnnouncement = "true"; + } + var CSRF_HEADER = 'X-CSRF-Token'; var setCSRFToken = function(securityToken) { @@ -37,6 +44,7 @@ $(document).ready(function() { } }); + function completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash) { $('#complete-bonfire-dialog').modal('show'); // Only post to server if there is an authenticated user diff --git a/seed_data/challenges.json b/seed_data/challenges.json index 0a6f70227e..826dc92cd1 100644 --- a/seed_data/challenges.json +++ b/seed_data/challenges.json @@ -460,9 +460,9 @@ "video": "114686471", "challengeNumber": 36, "steps": [ + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "Now that we understand some Computer Science and JavaScript programming, you're ready to move on to Full-stack JavaScript!", "The first step is to familiarize ourselves Node.js, the JavaScript-based web server that most full-stack JavaScript apps use.", - "Code School has an excellent course on Node.js. Note that this course requires a Code School subscription, but that you can get a free two-day membership to Code School by going to https://www.codeschool.com/hall_passes/213f3fedb6b9/claim_shared. The challenges immediately following these Node.js challenges also require a Code School course, so you may want to try to complete all these challenges in one two-day period. Alternatively, you could subscribe to Code School for one month, then take your time in completing these challenges.", "When you're ready, go to http://campus.codeschool.com/courses/real-time-web-with-node-js/level/1/video/1 and complete the first chapter." ] }, @@ -472,6 +472,7 @@ "video": "114684206", "challengeNumber": 37, "steps": [ + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "One of the reasons Node.js is so fast is that it is \"evented.\" It processes events in an asynchronous manner.", "As a result, Node.js relies on asynchronous callbacks.", "We'll learn more about how events and callbacks work in this exciting Code School lesson.", @@ -484,6 +485,7 @@ "video": "114684209", "challengeNumber": 38, "steps": [ + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "In this Code School lesson, we'll learn about streaming data back and forth between the client to the server.", "We'll also learn about FS, or File System, an important Node.js module for streaming data.", "Go to http://campus.codeschool.com/courses/real-time-web-with-node-js/level/3/video/1 and complete the section." @@ -495,6 +497,7 @@ "video": "114684213", "challengeNumber": 39, "steps": [ + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "One of the most exciting features of Node.js is NPM - Node Package Manager", "With NPM, you quickly install any of thousands of Node.js modules into your app, and it will automatically handle the other modules that each module dependends upon downstream.", "In this lesson, we'll learn how to include these modules in our Node.js app by requiring them as variables.", @@ -507,6 +510,7 @@ "video": "114684247", "challengeNumber": 40, "steps": [ + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "We'll complete Code School's Express.js course shortly after completing this course, but this challenge will give you a quick tour of the Express.js framework.", "Go to http://campus.codeschool.com/courses/real-time-web-with-node-js/level/5/video/1 and complete the section." ] @@ -517,6 +521,7 @@ "video": "114684530", "challengeNumber": 41, "steps": [ + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "Go to http://campus.codeschool.com/courses/real-time-web-with-node-js/level/6/video/1 and complete the section." ] }, @@ -526,6 +531,7 @@ "video": "114684532", "challengeNumber": 42, "steps": [ + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "Redis is a key-value store, which is a type of non-relational database. It's one of the fastest and easiest ways to persist data.", "Even though we'll ultimately use MongoDB and other technologies to persist data, Redis is quite easy to learn and is still worth learning.", "Go to http://campus.codeschool.com/courses/real-time-web-with-node-js/level/7/video/1 and complete the section." @@ -537,7 +543,7 @@ "video": "114684533", "challengeNumber": 43, "steps": [ - "Code School has one of the first comprehensive courses on Express.js. Note that this course requires a Code School subscription, but that you can get a free two-day membership to Code School by going to https://www.codeschool.com/hall_passes/213f3fedb6b9/claim_shared. If you've already used your Code School two-day membership, go to the Free Code Camp main chat room and ask how you can get some extra time to work through this course. Alternatively, you could subscribe to Code School for one month, then take your time in completing these challenges.", + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "Go to http://campus.codeschool.com/courses/building-blocks-of-express-js/level/1/video/1 and complete the section." ] }, @@ -548,6 +554,7 @@ "video": "114684535", "challengeNumber": 44, "steps": [ + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "Express.js makes extensive use of middleware - a stack of functions that run sequentially in response to a specific event.", "Let's learn how to incorporate modules and middleware into our Express.js app.", "Go to http://campus.codeschool.com/courses/building-blocks-of-express-js/level/2/video/1 and complete the section." @@ -559,6 +566,7 @@ "video": "114684537", "challengeNumber": 45, "steps": [ + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "Have you ever noticed a question mark in your browser's address bar, followed by a series of strings? Those are parameters. Parameters are an efficient way to pass information to the server between page loads.", "We'll learn about parameters, along with a powerful Express.js feature called Dynamic Routing, in this exciting Code School lesson.", "Go to http://campus.codeschool.com/courses/building-blocks-of-express-js/level/3/video/1 and complete the section." @@ -570,6 +578,7 @@ "video": "114684720", "challengeNumber": 46, "steps": [ + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "Now we'll add the Body Parser module to Express.js. Body Parser is a powerful middleware that helps with routing.", "We'll also learn more about HTTP Requests, such as Post and Delete.", "Go to http://campus.codeschool.com/courses/building-blocks-of-express-js/level/4/video/1 and complete the section." @@ -581,6 +590,7 @@ "video": "114684724", "challengeNumber": 47, "steps": [ + "Note that this Code School course is no longer free. We have free alternatives to this course here.", "For this last Code School Express.js challenge, we'll refactor our routes.", "Go to http://campus.codeschool.com/courses/building-blocks-of-express-js/level/5/video/1 and complete the section." diff --git a/views/resources/learn-to-code.jade b/views/resources/learn-to-code.jade index 6c51c08957..fb31bd3523 100644 --- a/views/resources/learn-to-code.jade +++ b/views/resources/learn-to-code.jade @@ -78,4 +78,20 @@ block content include ../partials/about .col-xs-12.col-sm-12.col-md-6 - include ../partials/faq \ No newline at end of file + include ../partials/faq + #announcementModal.modal(tabindex='-1') + .modal-dialog + .modal-content + .modal-header.challenge-list-header New NodeSchool Challenges + a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × + .modal-body + h3.text-left Some of Code School's courses are no longer free. We're switching to NodeSchool.io for our Node.js and Express.js challenges. + a.btn.btn-lg.btn-info.btn-block(name='_csrf', value=_csrf, aria-hidden='true', href='/nodeschool-challenges') Take me to these new challenges + a.btn.btn-lg.btn-primary.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Thanks for the heads-up! + script. + $(document).ready(function() { + if (!localStorage || !localStorage.nodeSchoolAnnouncement) { + $('#announcementModal').modal('show'); + localStorage.nodeSchoolAnnouncement = "true"; + } + }); \ No newline at end of file diff --git a/views/resources/nodeschool-challenges.jade b/views/resources/nodeschool-challenges.jade new file mode 100644 index 0000000000..cc8f48f736 --- /dev/null +++ b/views/resources/nodeschool-challenges.jade @@ -0,0 +1,22 @@ +extends ../layout +block content + .jumbotron.text-center + h1.hug-top NodeSchool Challenges + h2 Learn Node.js, NPM, Express.js, and advanced JavaScript like Functional Programming and Promises + br + .embed-responsive.embed-responsive-16by9 + iframe.embed-responsive-item(src='//player.vimeo.com/video/122719685') + .text-left + h3 Here are the NodeSchool courses you should complete: + ol + li + a(href='http://runnable.com/VQuO_Y4BbkhaOOsV/nodeschool-io-s-learnyounode-course-available-in-your-browser-for-node-js-and-freecodecamp' target='_blank') NodeSchool.io's LearnYouNode course + li + a(href='http://runnable.com/VQt7deuMe6RZ3Gcl/nodeschool-io-s-learn-to-npm-course-running-in-your-browser-for-node-js-and-hello-world' target='_blank') NodeSchool.io's Learn-to-NPM course + li + a(href='http://runnable.com/VQufnaRAlaNc9JuM/nodeschool-io-s-express-js-course-available-in-your-browser-for-node-js-and-freecodecamp' target='_blank') NodeSchool.io's Express.js course + li + a(href='http://runnable.com/VQuZjvia8Gxcqkpy/nodeschool-io-s-functional-programming-in-javascript-course-available-in-your-browser-for-node-js-and-freecodecamp' target='_blank') NodeSchool.io's Functional Programming in JavaScript course + li + a(href='http://runnable.com/VQunH26qdytcbLBg/nodeschool-io-s-promise-it-won-t-hurt-promises-course-available-in-your-browser-for-node-js-javascript-and-freecodecamp' target='_blank') NodeSchool.io's Promise It Won't Hurt Promises course + br \ No newline at end of file diff --git a/views/resources/sitemap.jade b/views/resources/sitemap.jade index 0fe1ab6da6..c51b2a3c99 100644 --- a/views/resources/sitemap.jade +++ b/views/resources/sitemap.jade @@ -13,6 +13,13 @@ urlset(xmlns="http://www.sitemaps.org/schemas/sitemap/0.9") lastmod= now priority= 0.5 + url + loc http://www.freecodecamp.com/nodeschool-challenges + changefreq weekly + lastmod= now + priority= 0.5 + + url loc http://www.freecodecamp.com/deploy-a-website changefreq weekly