diff --git a/client/README.md b/client/README.md index b75516ce38..5ba2586944 100644 --- a/client/README.md +++ b/client/README.md @@ -1,3 +1,4 @@ This is the entry point for the client Code that should only run on the client should be put here. + NOTE(berks): For react specific stuff this should be the entry point diff --git a/client/config.json b/client/config.json deleted file mode 100644 index 3f5ecb7649..0000000000 --- a/client/config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "restApiRoot": "/api", - "remoting": { - "context": { - "enableHttpContext": false - } - } -} diff --git a/client/config.local.js b/client/config.local.js deleted file mode 100644 index e5058ced89..0000000000 --- a/client/config.local.js +++ /dev/null @@ -1,5 +0,0 @@ -var globalConfig = require('../common/config.global'); - -module.exports = { - restApiRoot: globalConfig.restApi -}; diff --git a/client/datasources.json b/client/datasources.json deleted file mode 100644 index d6d2206bd6..0000000000 --- a/client/datasources.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "remote": { - "name": "remote", - "connector": "remote" - }, - "local": { - "name": "local", - "connector": "memory" - } -} diff --git a/client/datasources.local.js b/client/datasources.local.js deleted file mode 100644 index 4f07ba41f3..0000000000 --- a/client/datasources.local.js +++ /dev/null @@ -1,7 +0,0 @@ -var globalConfig = require('../common/config.global'); - -module.exports = { - remote: { - url: globalConfig.restApiUrl - } -}; diff --git a/client/index.js b/client/index.js index e95bd0f908..c39b55c644 100644 --- a/client/index.js +++ b/client/index.js @@ -1,8 +1,9 @@ import Rx from 'rx'; import React from 'react'; +import Fetchr from 'fetchr'; +import debugFactory from 'debug'; import { Router } from 'react-router'; import { history } from 'react-router/lib/BrowserHistory'; -import debugFactory from 'debug'; import { hydrate } from 'thundercats'; import { Render } from 'thundercats-react'; @@ -11,6 +12,9 @@ import { app$ } from '../common/app'; const debug = debugFactory('fcc:client'); const DOMContianer = document.getElementById('fcc'); const catState = window.__fcc__.data || {}; +const services = new Fetchr({ + xhrPath: '/services' +}); Rx.longStackSupport = !!debug.enabled; @@ -18,7 +22,7 @@ Rx.longStackSupport = !!debug.enabled; app$(history) .flatMap( ({ AppCat }) => { - const appCat = AppCat(); + const appCat = AppCat(null, services); return hydrate(appCat, catState) .map(() => appCat); }, diff --git a/client/loopbackClient.js b/client/loopbackClient.js deleted file mode 100644 index 9f860ae72b..0000000000 --- a/client/loopbackClient.js +++ /dev/null @@ -1,8 +0,0 @@ -var loopback = require('loopback'), - boot = require('loopback-boot'); - -var app = loopback(); - -boot(app, __dirname); - -module.exports = app; diff --git a/client/model-config.json b/client/model-config.json deleted file mode 100644 index 61e1e58d3d..0000000000 --- a/client/model-config.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "_meta": { - "sources": [ - "../common/models", - "./models" - ] - }, - "user": { - "dataSource": "remote" - }, - "bonfire": { - "dataSource": "remote" - }, - "challenge": { - "dataSource": "remote" - }, - "comment": { - "dataSource": "remote" - }, - "fieldGuide": { - "dataSource": "remote" - }, - "job": { - "dataSource": "remote" - }, - "nonprofit": { - "dataSource": "remote" - }, - "story": { - "dataSource": "remote" - } -} diff --git a/common/app/App.jsx b/common/app/App.jsx index e97ac4d83f..1c6c547cc3 100644 --- a/common/app/App.jsx +++ b/common/app/App.jsx @@ -1,28 +1,43 @@ import React, { PropTypes } from 'react'; +import { contain } from 'thundercats-react'; import { Row } from 'react-bootstrap'; import { Nav } from './components/Nav'; import { Footer } from './components/Footer'; -export default class extends React.Component { - constructor(props) { - super(props); - } +export default contain( + { + store: 'appStore', + fetchAction: 'appActions.getUser', + getPayload(props) { + return { + isPrimed: !!props.username + }; + } + }, + React.createClass({ + displayName: 'FreeCodeCamp', - static displayName = 'FreeCodeCamp' - static propTypes = { - children: PropTypes.node - } + propTypes: { + children: PropTypes.node, + username: PropTypes.string, + points: PropTypes.number, + picture: PropTypes.string + }, - render() { - return ( -
+ Need to find the best junior developers? + Want to find dedicated developers eager to join your company? + Sign up now to post your job! +
+ +{ description }
+ /*
and */
",
"Try creating one of each now."
],
- "tests": [
+ "tests":[
"assert(editor.getValue().match(/(\\/\\*)...../g), 'Make sure you have at least one \/\\* \\*\/ style comment that has at least five letters in it');",
"assert(editor.getValue().match(/(\\*\\/)/g), 'Make sure that you close the coment with a \\*\/');",
"assert(editor.getValue().match(/(\\/\\/)...../g), 'Make sure that there is at least one \\/\\/ style comment with at least five letters in it');"
],
- "challengeSeed": [
+ "challengeSeed":[
],
"challengeType": 1
@@ -265,7 +265,7 @@
"challengeType": 1
},
{
- "id": "bd1111c1c11feddfaeb3bdef",
+ "id": "cf1111c1c11feddfaeb3bdef",
"name": "Magical Maths Addition",
"dashedName": "waypoint-magical-maths-addition",
"difficulty": "9.98141",
@@ -289,7 +289,7 @@
"challengeType": 1
},
{
- "id": "bd1111c1c11feddfaeb4bdef",
+ "id": "cf1111c1c11feddfaeb4bdef",
"name": "Magical Maths Subtraction",
"dashedName": "waypoint-magical-maths-subtraction",
"difficulty": "9.98142",
@@ -313,7 +313,7 @@
"challengeType": 1
},
{
- "id": "bd1111c1c11feddfaeb5bdef",
+ "id": "cf1231c1c11feddfaeb5bdef",
"name": "Magical Maths Multiplication",
"dashedName": "waypoint-magical-maths-multiplication",
"difficulty": "9.98143",
@@ -337,7 +337,7 @@
"challengeType": 1
},
{
- "id": "bd1111c1c11feddfaeb6bdef",
+ "id": "cf1111c1c11feddfaeb6bdef",
"name": "Magical Maths Division",
"dashedName": "waypoint-magical-maths-division",
"difficulty": "9.9814",
@@ -361,7 +361,7 @@
"challengeType": 1
},
{
- "id": "bd1111c1c11feddfaeb4bdee",
+ "id": "cf1391c1c11feddfaeb4bdef",
"name": "Creating Decimals",
"dashedName": "waypoint-creating-decimals",
"difficulty": "9.9815",
@@ -439,19 +439,19 @@
"challengeType": 1
},
{
- "id": "bd1111c1c11feddfaeb7bdef",
- "name": "Nesting Arrays",
- "dashedName": "waypoint-nesting-arrays",
- "difficulty": "9.98161",
- "description": [
+ "id":"cf1111c1c11feddfaeb7bdef",
+ "name":"Nesting Arrays",
+ "dashedName":"waypoint-nesting-arrays",
+ "difficulty":"9.98161",
+ "description":[
"",
"We are also able to create arrays within arrays. This technique is called nesting
.",
"Let's now go create a nested array called myArray
"
],
- "tests": [
+ "tests":[
"assert((function(){if(typeof(myArray) !== 'undefined' && typeof(myArray) === 'object' && typeof(myArray[0]) !== 'undefined' && typeof(myArray) === 'object'){return(true);}else{return(false);}})(), 'myArray should contain at least one array');"
],
- "challengeSeed": [
+ "challengeSeed":[
"var myArray = [];",
"",
"",
@@ -460,25 +460,26 @@
"challengeType": 1
},
{
- "id": "bg9997c9c79feddfaeb9bdef",
- "name": "Accessing data with Indexes",
- "dashedName": "waypoint-accessing-data-with-indexes",
- "difficulty": "9.9817",
- "description": [
+ "id":"bg9997c9c79feddfaeb9bdef",
+ "name":"Accessing data with Indexes",
+ "dashedName":"waypoint-accessing-data-with-indexes",
+ "difficulty":"9.9817",
+ "description":[
"",
"Once an array has been created we can access the data we have stored in them using indexes",
"Indexes are written in the same way as bracket notation that we covered earlier",
"Example:",
"",
- "var array = [1,2,3]",
- "array[0]//equals 1",
+ "var array = [1,2,3];",
+ "array[0];//equals 1",
+ "var data = array[1];",
"
",
"Create a var called data
and set it to equal the first value of myArray
"
],
- "tests": [
+ "tests":[
"assert((function(){if(typeof(myArray) != 'undefined' && typeof(data) != 'undefined' && myArray[0] == data){return(true);}else{return(false);}})(), 'the variable data should equal the first value of myArray');"
],
- "challengeSeed": [
+ "challengeSeed":[
"//var ourArray = [1,2,3]",
"//var ourData = ourArray[0]//equals 1",
"",
@@ -490,6 +491,39 @@
],
"challengeType": 1
},
+ {
+ "id":"cf1111c1c11feddfaeb8bdef",
+ "name":"Modifying Data With Indexes",
+ "dashedName":"waypoint-modifying-data-with-indexes",
+ "difficulty":"9.98171",
+ "description":[
+ "",
+ "We are able to modify the data store in an array be using indexes",
+ "Example:",
+ "",
+ "var ourArray = [1,2,3];",
+ "ourArray[0] = 3;//ourArray equals [3,2,3]",
+ "
",
+ "Now Let's modify myArray
using an index",
+ ""
+ ],
+ "tests":[
+ "assert((function(){if(typeof(myArray) != 'undefined' && myArray[0] == 3 && myArray[1] == 2 && myArray[2] == 3){return(true);}else{return(false);}})(), 'myArray should now be [3,2,3]');",
+ "assert((function(){if(editor.getValue().match(/[0]/g).length >= 2 && editor.getValue().match(/=/g).length >= 2){return(true);}else{return(false);}})(), 'You should be using indexes to modify the values in myArray');"
+ ],
+ "challengeSeed":[
+ "//var ourArray = [1,2,3];",
+ "//ourArray[0] = 3;",
+ "",
+ "var myArray = [1,2,3];",
+ "",
+ "",
+ "",
+ "",
+ "if(typeof(myArray) != 'undefined'){(function(){return(myArray);})();}"
+ ],
+ "challengeType": 1
+ },
{
"id": "bg9994c9c69feddfaeb9bdef",
"name": "Manipulating Arrays With pop()",
@@ -593,141 +627,49 @@
"challengeType": 1
},
{
- "id": "bg9997c9c89feddfaeb9bdef",
- "name": "Make it functional",
- "dashedName": "waypoint-make-it-functional",
- "difficulty": "9.9819",
- "description": [
+ "id":"bg9997c9c89feddfaeb9bdef",
+ "name":"Make it functional",
+ "dashedName":"waypoint-make-it-functional",
+ "difficulty":"9.9819",
+ "description":[
"",
"In JavaScript we can divide up our code into separate and reusable parts called functions",
"here's and example of a function",
"",
- "function funcitonName (one, two ,three){",
- " /*Some Code*/",
+ "function functionName (a, b){",
+ " return(a + b);",
"}",
"
",
"our function can be called like this",
"functionName();
",
- "Let's try creating and calling a function now."
+ "Let's try creating and calling a function now called myFunction
"
],
- "tests": [
- "assert(f==data);"
+ "tests":[
+ "assert((function(){if(typeof(f) !== 'undefined' && typeof(f) === 'number' && f === 9){return(true);}else{return(false);}})(), 'Your function should return the value of a + b');"
],
- "challengeSeed": [
- "//var ourData = 'function called!';",
- "//function ourFunction(ourData) {/*ourData is being passed to this function as an argument*/",
- "//return(data);",
- "//}",
- "",
- "var data = 'Function Called!';",
- "",
- "//Create a function called myFunction that takes data as an argument and returns it like the example above",
- "",
+ "challengeSeed":[
+ "var a = 4;",
+ "var b = 5;",
+ "//Don not modify the above!",
+ "//Create a function called myFunction that adds a and b",
"",
"",
"",
"",
"//Don't modify this!",
- "var f=myFunction(data);",
- "(function(){var f=myFunction(data);return(f);})('');"
+ "if(typeof(myFunction) != 'undefined'){",
+ "var f=myFunction(a,b);",
+ "(function(){return(f);})();",
+ "}"
],
"challengeType": 1
},
{
- "id": "bg9997c9c99feddfaeb9bdef",
- "name": "Doing things inside functions",
- "dashedName": "waypoint-doing-things-inside-functions",
- "difficulty": "9.982",
- "description": [
- "",
- "A function that takes the value you give it and returns it isn't very useful! So now let's get our functions to do something!",
- "Starting from where we were last time let's make our function revers whatever we give it by chaining .split('')
, .reverse()
and .join('')
"
- ],
- "tests": [
- "assert(f==data.split('').reverse().join(''), 'myFunction should now return the reversed version of data (!dellaC noitcnuF)');"
- ],
- "challengeSeed": [
- "//You can reverse strings like this",
- "//var notReversed = 'String';",
- "//var reversed = notReversed.split('').reverse().join('');",
- "",
- "var data = 'Function Called!';",
- "",
- "function myFunction(data){",
- " ",
- " return(data);",
- "}",
- "",
- "",
- "",
- "//Don't modify this!",
- "var f=myFunction(data);",
- "(function(f){return(f);})(f);"
- ],
- "challengeType": 1
- },
- {
- "id": "bg9997c9c99feddfaeb9bdee",
- "name": "Keeping In The Scope Of Things",
- "dashedName": "waypoint-keeping-in-the-scope-of-things",
- "difficulty": "9.9821",
- "description": [
- "",
- "All variables are contained in something called a scope
.",
- "A Scope defines where are variable can be accessed.",
- "All variables created outside any functions exist in what is called the global scope
",
- "All variables are container or are scope to inside that function.",
- "",
- "var variable = 'Global Scope'",
- "function test(){",
- " return(variable);",
- "}",
- "test();//Returns Global Scope",
- "",
- "function change(){",
- " variable = 'test';",
- " return(variable);",
- "}",
- "",
- "change();//Returns test",
- "variable //equals Global Scope",
- "",
- "
",
- "Let's give this a go!"
- ],
- "tests": [
- "assert(Global == access(Global), 'access should return your Global var');",
- "assert(Global != localChange(Global), 'localChange should return your Global var');"
- ],
- "challengeSeed": [
- "//Create Your global variable with any value here",
- "var Global = _;",
- "",
- "//Make access() return you global variable",
- "function access(){",
- " ",
- "}",
- "",
- "access();",
- "",
- "//Pass you global variable into localChange and modify it within the function",
- "function localChange(){",
- " ",
- "}",
- "",
- "//Don't forget to call localChange here and pass your global variable",
- "",
- "",
- "(function(x,y,z){return('access returns: ' + y(x) + ' & localChange returns: ' + z(x));})(Global, access, localChange);"
- ],
- "challengeType": 1
- },
- {
- "id": "bg9998c9c99feddfaeb9bdef",
- "name": "I Object!",
- "dashedName": "waypoint-i-object",
- "difficulty": "9.9822",
- "description": [
+ "id":"bg9998c9c99feddfaeb9bdef",
+ "name":"I Object!",
+ "dashedName":"waypoint-i-object",
+ "difficulty":"9.9822",
+ "description":[
"",
"A very important data type in javascript is the Object
",
" Objects
a similar to arrays
except that instead of using indexes to access and modify their data, Objects have what are called properties
",
@@ -744,13 +686,13 @@
"Let's try to make a Object that represents a dog called myDog!"
],
- "tests": [
+ "tests":[
"assert((function(z){if(z.hasOwnProperty('name') && z.name != undefined && typeof(z.name) == 'string'){return(true);}else{return(false);}})(myDog), 'myDog should contain the property name and it should be a string');",
"assert((function(z){if(z.hasOwnProperty('legs') && z.legs != undefined && typeof(z.legs) == 'number'){return(true);}else{return(false);}})(myDog), 'myDog should contain the property legs and it should be a number');",
"assert((function(z){if(z.hasOwnProperty('tails') && z.tails != undefined && typeof(z.tails) == 'number'){return(true);}else{return(false);}})(myDog), 'myDog should contain the property tails and it should be a number');",
"assert((function(z){if(z.hasOwnProperty('friends') && z.friends != undefined && Array.isArray(z.friends)){return(true);}else{return(false);}})(myDog), 'myDog should contain the property friends and it should be an array');"
],
- "challengeSeed": [
+ "challengeSeed":[
"//var ourDog = {",
"// \"name\": \"Camper\"",
"// \"legs\": 4",
@@ -770,11 +712,11 @@
"challengeType": 1
},
{
- "id": "bg9999c9c99feddfaeb9bdef",
- "name": "Manipulating Objects",
- "dashedName": "waypoint-manipulating-objects",
- "difficulty": "9.9823",
- "description": [
+ "id":"bg9999c9c99feddfaeb9bdef",
+ "name":"Manipulating Objects",
+ "dashedName":"waypoint-manipulating-objects",
+ "difficulty":"9.9823",
+ "description":[
"",
"Now that we have an objects we need to know how to add and remove properties from it",
"We add properties to objects like this",
@@ -784,11 +726,11 @@
"Let's add the property bark",
""
],
- "tests": [
+ "tests":[
"assert(myDog.bark != undefined, 'The property tails should have been deleted');",
"assert(myDog.tails == undefined, 'The property tails should have been deleted');"
],
- "challengeSeed": [
+ "challengeSeed":[
"//var ourDog = {",
"//\"name\": \"Camper\"",
"//\"legs\": 4",
@@ -816,11 +758,11 @@
"challengeType": 1
},
{
- "id": "bd1111c1c11feddfaeb5bdee",
- "name": "Looping with for",
- "dashedName": "waypoint-looping-with-for",
- "difficulty": "9.9824",
- "description": [
+ "id":"cf1111c1c11feddfaeb5bdef",
+ "name":"Looping with for",
+ "dashedName":"waypoint-looping-with-for",
+ "difficulty":"9.9824",
+ "description":[
"",
"Loops are a critical part of any program! The next few challenges",
"first we will be taking a look at the for loop",
@@ -833,11 +775,11 @@
"ourArray now contains [0,1,2,3,4] ",
"Let's try getting a for loop to work by pushing values to an array"
],
- "tests": [
+ "tests":[
"assert(editor.getValue().match(/for\\(/g), 'You should be using a for loop for this!');",
"assert.deepEqual(myArray, [0,1,2,3,4], 'myArray should equal [0,1,2,3,4]');"
],
- "challengeSeed": [
+ "challengeSeed":[
"var myArray = [];",
"//Push the numbers 0-4 to myArray",
"",
@@ -846,11 +788,11 @@
"challengeType": 1
},
{
- "id": "bd1111c1c11feddfaeb1bdef",
- "name": "Looping with while",
- "dashedName": "waypoint-looping-with-while",
- "difficulty": "9.9825",
- "description": [
+ "id":"cf1111c1c11feddfaeb1bdef",
+ "name":"Looping with while",
+ "dashedName":"waypoint-looping-with-while",
+ "difficulty":"9.9825",
+ "description":[
"",
"Loops are a critical part of any program! The next few challenges",
"first we will be taking a look at the for loop",
@@ -864,11 +806,11 @@
"",
"Let's try getting a for loop to work by pushing values to an array"
],
- "tests": [
+ "tests":[
"assert(editor.getValue().match(/while\\(/g), 'You should be using a while loop for this!');",
"assert.deepEqual(myArray, [0,1,2,3,4], 'myArray should equal [0,1,2,3,4]');"
],
- "challengeSeed": [
+ "challengeSeed":[
"var myArray = [];",
"//Push the numbers 0-4 to myArray",
"",
@@ -877,11 +819,11 @@
"challengeType": 1
},
{
- "id": "bd1111c1c11feddfaeb2bdef",
- "name": "Looping with do while",
- "dashedName": "waypoint-looping-with-do-while",
- "difficulty": "9.9826",
- "description": [
+ "id":"cf1111c1c11feddfaeb2bdef",
+ "name":"Looping with do while",
+ "dashedName":"waypoint-looping-with-do-while",
+ "difficulty":"9.9826",
+ "description":[
"",
"Let's now take a look at the do - while loop",
"",
@@ -895,17 +837,238 @@
"A do - while has a very special difference when compared to the for and while loops. The do while loop is guaranteed to execute preform it's action once regardless of whether or not the condition inside the while is met!",
"Let's try getting a do - while loop to work by pushing values to an array"
],
- "tests": [
+ "tests":[
"assert.deepEqual(myArray, [0,1,2,3,4], 'myArray should equal [0,1,2,3,4]');",
"assert((function(){if(editor.getValue().match(/do/g) && editor.getValue(/while/g).match()){return(true);}else{return(false);}})(), 'You should be using a do while loop for this!');"
],
- "challengeSeed": [
+ "challengeSeed":[
"var myArray = [];",
"//Push the numbers 0-4 to myArray",
"",
""
],
"challengeType": 1
+ },
+ {
+ "id":"cf1111c1c11feddfaeb9bdef",
+ "name":"Random Numbers",
+ "dashedName":"waypoint-random-numbers",
+ "difficulty":"9.9827",
+ "description":[
+ "",
+ "Random numbers are a very useful for creating random behaviours and games",
+ "Javascript has a Math.random()
method that can generate a random decimal number",
+ "Let's have a go of Math.random()
now be getting myFunction
to return a random number"
+ ],
+ "tests":[
+ "assert(typeof(myFunction()) === 'number', 'myFunction should return a random number');",
+ "assert((myFunction()+''). match(/\\./g), 'The number returned by myFunction should be a decimal');",
+ "assert(editor.getValue().match(/Math\\.random/g).length >= 2, 'You should be using Math.random to generate the random decimal number');"
+ ],
+ "challengeSeed":[
+ "",
+ "function myFunction(){",
+ " //Change the 0 to Math.random()",
+ " return(0);",
+ "}",
+ "",
+ "(function(){return(myFunction());})();"
+ ],
+ "challengeType": 1
+ },
+ {
+ "id":"cf1111c1c12feddfaeb1bdef",
+ "name":"Random Whole Numbers",
+ "dashedName":"waypoint-random-whole-numbers",
+ "difficulty":"9.9828",
+ "description":[
+ "",
+ "While it's great that we can create random decimal numbers it's a lot more useful to generate a random whole number",
+ "To achieve this we can multiply the random number by ten and use the Math.floor()
to convert the decimal number to a whole number",
+ "This technique gives us a whole number between zero and nine",
+ "Example:",
+ "Math.floor(Math.random()*10);
",
+ "Let's give this technique a go now"
+ ],
+ "tests":[
+ "assert(typeof(myFunction()) == 'number', 'The result of myFunction should be a number');",
+ "assert(editor.getValue().match(/Math.random/g), 'You should be using Math.random to create a random number');",
+ "assert(!(''+myFunction()).match(/\\./g), 'You should have multiplied the result of Math.random but 10 to make it a number that\\'s greater then zero');",
+ "assert(editor.getValue().match(/Math.floor/g), 'You should use Math.floor to remove the decimal part of the number');"
+ ],
+ "challengeSeed":[
+ "function myFunction(){",
+ " //Make myFunction return a random number between zero and nine instead of a float",
+ " return(Math.random());",
+ "}",
+ "",
+ "(function(){return(myFunction());})();"
+ ],
+ "challengeType": 1
+ },
+ {
+ "id":"cf1111c1c12feddfaeb2bdef",
+ "name":"Random Whole Numbers In a Range",
+ "dashedName":"waypoint-random-whole-numbers-in-a-range",
+ "difficulty":"9.9829",
+ "description":[
+ "",
+ "We can use a certain mathematical expression to get a random number between between twp numbers.",
+ "Math.floor(Math.random() * (max - min + 1)) + min
",
+ "By using this we can control the output of the random number.",
+ ""
+ ],
+ "tests":[
+ "assert(myFunction() >= min, 'The random number that\\'s generated by myFunction should be greater than or equal to the minimum number');",
+ "assert(myFunction() <= max, 'The random number that\\'s generated by myFunction should be less than or equal to the maximum number');",
+ "assert((function(){if(editor.getValue().match(/max/g).length >= 2 && editor.getValue().match(/min/g).length >= 3 && editor.getValue().match(/Math.floor/g) && editor.getValue().match(/Math.random/g)){return(true);}else{return(false);}})(), 'You should be using the function given in the description to calculate the random in number in a range');"
+ ],
+ "challengeSeed":[
+ " var min = 0;",
+ " var max = 12;",
+ "function myFunction(){",
+ " //Make myFunction return a random number between zero and nine instead of a float",
+ " return(Math.random());",
+ "}",
+ "",
+ "(function(){return(myFunction());})();"
+ ],
+ "challengeType": 1
+ },
+ {
+ "id":"cf1111c1c12feddfaeb3bdef",
+ "name":"If Else Statements",
+ "dashedName":"waypoint-if-else-statements",
+ "difficulty":"9.983",
+ "description":[
+ "",
+ "We can use if statements in JavaScript to only execute code if a certain condition is met",
+ "if statements require some sort of boolean condition evaluate",
+ "Example:",
+ "if(1==2){",
+ " return(true);",
+ "}",
+ "else{",
+ " return(false);",
+ "}
",
+ "Let's have a go of using if statements now by making a coin-flip game",
+ "Create an if else statement to return heads
if the flip var is zero and to return tails
if it's not"
+ ],
+ "tests":[
+ "assert((function(){if(myFunction() == 'heads' || myFunction() == 'tails'){return(true);}else{return(false);}})(), 'myFunction should either return heads or tails');",
+ "assert(editor.getValue().match(/if/g).length >= 3, 'You should have created a new if statement');",
+ "assert(editor.getValue().match(/else/g).length >= 2, 'You should have created a new else statement');"
+ ],
+ "challengeSeed":[
+ "function myFunction(){",
+ " var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;",
+ " //Create and if else statement here to return heads if flip is 0 otherwise return false",
+ " ",
+ "}",
+ "",
+ "(function(){return(myFunction());})();"
+ ],
+ "challengeType": 1
+ },
+ {
+ "id":"cf1111c1c12feddfaeb6bdef",
+ "name":"An Intro To RegEx",
+ "dashedName":"waypoint-an-intro-to-regex",
+ "difficulty":"9.984",
+ "description":[
+ "",
+ "RegEx is a powerful tool we can use to find certain words or patterns in strings",
+ "RegEx can look difficult at first but there's not much to getting it working",
+ "If we wanted to find the number of times the word \"the\" occured in the string \"The dog chased the cat\" We could use the following RegEx:",
+ "\/the+\/gi
",
+ "Let's break this down a bit",
+ "\"The\" is the pattern we want to match",
+ "\"+\" means we are looking for one or more occurrences of this pattern",
+ "\"g\" means that it searhces the whole string",
+ "\"i\" means that we are ignoring the case(upper or lower) of what we are looking for",
+ "Let's try finding the word and in the string \"John and Alan went to the shop and got some milk\" by replacing the .+
in the currnet RegEx with something that will find the word \"and\" and count how many times it occurs"
+ ],
+ "tests":[
+ "assert(test==2, 'You\\'re RegEx should have found two occurances of the word \"and\"');",
+ "assert(editor.getValue().match(/\\/and\\+\\/gi/), 'You should have used this RegEx to find the word \"and\"');"
+ ],
+ "challengeSeed":[
+ "var test = (function(){",
+ " var testString = \"John and Alan went to the shop and got some milk\";",
+ "",
+ "//Do Not Modify Above",
+ "",
+ " var expression = /.+/gi;",
+ "",
+ "//Do Not Modify Below",
+ "",
+ " return(testString.match(expression).length);",
+ "})();(function(){return(test);})();"
+ ],
+ "challengeType": 1
+ },
+ {
+ "id":"cf1111c1c12feddfaeb7bdef",
+ "name":"Finding Numbers",
+ "dashedName":"waypoint-finding-numbers",
+ "difficulty":"9.985",
+ "description":[
+ "",
+ "We can use special selectors in RegEx to select a particular type of value",
+ "One such selector is the digit selector \\d
which is used to grab the numbers in a string",
+ "It is used like this:",
+ "/\\d+/g
",
+ ""
+ ],
+ "tests":[
+ "assert(test === 2, 'Your RegEx should have found two numbers in the testString');",
+ "assert(editor.getValue().match(/\\/\\\\d\\+\\//gi), 'You should be using the following expression /\\d+/gi to find the numbers in the testString');"
+ ],
+ "challengeSeed":[
+ "var test = (function(){",
+ " var testString = \"There's 3 cats but 4 dogs.\"",
+ "",
+ "//Do Not Modify Above",
+ "",
+ " var expression = /.+/gi;",
+ "",
+ "//Do Not Modify Below",
+ "",
+ " return(testString.match(expression).length);",
+ "})();(function(){return(test);})();"
+ ],
+ "challengeType": 1
+ },
+ {
+ "id":"cf1111c1c12feddfaeb8bdef",
+ "name":"Finding WhiteSpace",
+ "dashedName":"waypoint-finding-whitespace",
+ "difficulty":"9.987",
+ "description":[
+ "",
+ "We can also use selectors like \\s
to find spaces in a string",
+ "It is used like this:",
+ "/\\s+/g
",
+ ""
+ ],
+ "tests":[
+ "assert(test === 7, 'Your RegEx should have found seven spaces in the testString');",
+ "assert(editor.getValue().match(/\\/\\\\s\\+\\//gi), 'You should be using the following expression /\\s+/gi to find the spaces in the testString');"
+ ],
+ "challengeSeed":[
+ "var test = (function(){",
+ " var testString = \"How many spaces are there in this sentance.\";",
+ "",
+ "//Do Not Modify Above",
+ "",
+ " var expression = /.+/gi;",
+ "",
+ "//Do Not Modify Below",
+ "",
+ " return(testString.match(expression).length);",
+ "})();(function(){return(test);})();"
+ ],
+ "challengeType": 1
}
]
}
diff --git a/seed/jobs.json b/seed/jobs.json
index 3ba4fad93e..5850dc8aba 100644
--- a/seed/jobs.json
+++ b/seed/jobs.json
@@ -1,30 +1,47 @@
[
{
"id": "bd7167d8c441cbafaeb5bdef",
+ "email": "Ada_Gerlach@gmail.com",
+ "phone": "1-140-557-0727",
"company": "Livestream",
+ "country": "Singapore",
+ "city": "Morar berg",
+ "state": "South Dakota",
"position": "Junior Backend Developer (Node.js)",
- "logoUrl": "https://s3.amazonaws.com/prod-heroku/greenhouse_job_boards/logos/000/001/189/resized/livestream_logo-rgb_standard-cc718e67ce1a0f6fa400f609bdefe605.png?1429547161",
- "postingUrl": "https://boards.greenhouse.io/livestream/jobs/59458?t=ek25h0#.VWeTk1xVhBc?source=freecodecamp.com"
+ "logo": "https://s3.amazonaws.com/prod-heroku/greenhouse_job_boards/logos/000/001/189/resized/livestream_logo-rgb_standard-cc718e67ce1a0f6fa400f609bdefe605.png?1429547161",
+ "description": "Live life one inhalation and one exhalation at a time. May you be healthy. Let the muscles in your neck and shoulders relax. May you be safe. Reflect on the fragility and preciousness of life. Empty your mind; be formless, shapeless like water. May you be at peace. Take a deep breath. You can do what you set out to do; yes, you can. You can do what you set out to do; yes, you can. Watch each breath appear and disappear, just breathing. Give yourself a break. Live life one inhalation and one exhalation at a time. Give yourself a break. Just acknowledge what's there and let be. You can get through this. Open your heart to change, forgiveness and lovingkindness. Love is the first seed of the soul. It will be ok. Impermanence and change is a powerful teacher and teaching. Bring love into your heart, into your breath and into your being. Briefly notice any emotions, thoughts or sensations that may be driving fear and anxiety and let them be. This discomfort will pass. Bring love into your heart, into your breath and into your being. Take a deep breath. Reflect on the fragility and preciousness of life."
},
{
"id": "bd7167d8c442cbafaeb5bdef",
+ "email": "Ada_Gerlach@gmail.com",
"company": "Adobe",
+ "country": "Singapore",
+ "city": "Morar berg",
+ "state": "South Dakota",
"position": "Junior JavaScript Engineer",
- "logoUrl": "http://cdn-3.famouslogos.us/images/adobe-logo.jpg",
- "postingUrl": "https://adobe.taleo.net/careersection/2/jobdetail.ftl?job=32619&lang=en"
+ "logo": "http://cdn-3.famouslogos.us/images/adobe-logo.jpg",
+ "description": "Live life one inhalation and one exhalation at a time. May you be healthy. Let the muscles in your neck and shoulders relax. May you be safe. Reflect on the fragility and preciousness of life. Empty your mind; be formless, shapeless like water. May you be at peace. Take a deep breath. You can do what you set out to do; yes, you can. You can do what you set out to do; yes, you can. Watch each breath appear and disappear, just breathing. Give yourself a break. Live life one inhalation and one exhalation at a time. Give yourself a break. Just acknowledge what's there and let be. You can get through this. Open your heart to change, forgiveness and lovingkindness. Love is the first seed of the soul. It will be ok. Impermanence and change is a powerful teacher and teaching. Bring love into your heart, into your breath and into your being. Briefly notice any emotions, thoughts or sensations that may be driving fear and anxiety and let them be. This discomfort will pass. Bring love into your heart, into your breath and into your being. Take a deep breath. Reflect on the fragility and preciousness of life."
},
{
"id": "bd7167d8c443cbafaeb5bdef",
+ "phone": "1-140-557-0727",
"company": "Bookspan",
+ "country": "Singapore",
+ "city": "Morar berg",
+ "state": "South Dakota",
"position": "Full Stack JavaScript Developer (Junior)",
- "logoUrl": "https://tm-prod.global.ssl.fastly.net/uploaded/companies/227/small_logo.png?v=db9dbe",
- "postingUrl": "http://bookspan.theresumator.com/apply/10190b666b74087b537f4659756f7c5679000704722064232c1d2e3b2b102501310437/Fullstack-Javascript-Developer-junior?source=freecodecamp.com&sid=zvi9YD9OcHwoDZNgM3XI9uPszGvqxJo6eHf"
+ "logo": "https://tm-prod.global.ssl.fastly.net/uploaded/companies/227/small_logo.png?v=db9dbe",
+ "description": "Live life one inhalation and one exhalation at a time. May you be healthy. Let the muscles in your neck and shoulders relax. May you be safe. Reflect on the fragility and preciousness of life. Empty your mind; be formless, shapeless like water. May you be at peace. Take a deep breath. You can do what you set out to do; yes, you can. You can do what you set out to do; yes, you can. Watch each breath appear and disappear, just breathing. Give yourself a break. Live life one inhalation and one exhalation at a time. Give yourself a break. Just acknowledge what's there and let be. You can get through this. Open your heart to change, forgiveness and lovingkindness. Love is the first seed of the soul. It will be ok. Impermanence and change is a powerful teacher and teaching. Bring love into your heart, into your breath and into your being. Briefly notice any emotions, thoughts or sensations that may be driving fear and anxiety and let them be. This discomfort will pass. Bring love into your heart, into your breath and into your being. Take a deep breath. Reflect on the fragility and preciousness of life."
},
{
"id": "bd7167d8c444cbafaeb5bdef",
+ "email": "Ada_Gerlach@gmail.com",
"company": "Good Eggs",
+ "country": "Singapore",
+ "city": "Morar berg",
+ "state": "South Dakota",
"position": "Full Stack Developer",
- "logoUrl": "https://d1qb2nb5cznatu.cloudfront.net/startups/i/72165-64efbd521cdfe3357c811758f5436e7d-medium_jpg.jpg",
- "postingUrl": "http://www.jobscore.com/jobs2/goodeggs/full-stack-developer/cQ_hd-0USr4Om7eJe4iefn?Board=freecodecamp.com"
+ "logo": "https://d1qb2nb5cznatu.cloudfront.net/startups/i/72165-64efbd521cdfe3357c811758f5436e7d-medium_jpg.jpg",
+ "description": "Live life one inhalation and one exhalation at a time. May you be healthy. Let the muscles in your neck and shoulders relax. May you be safe. Reflect on the fragility and preciousness of life. Empty your mind; be formless, shapeless like water. May you be at peace. Take a deep breath. You can do what you set out to do; yes, you can. You can do what you set out to do; yes, you can. Watch each breath appear and disappear, just breathing. Give yourself a break. Live life one inhalation and one exhalation at a time. Give yourself a break. Just acknowledge what's there and let be. You can get through this. Open your heart to change, forgiveness and lovingkindness. Love is the first seed of the soul. It will be ok. Impermanence and change is a powerful teacher and teaching. Bring love into your heart, into your breath and into your being. Briefly notice any emotions, thoughts or sensations that may be driving fear and anxiety and let them be. This discomfort will pass. Bring love into your heart, into your breath and into your being. Take a deep breath. Reflect on the fragility and preciousness of life."
}
]
diff --git a/server/boot/a-react.js b/server/boot/a-react.js
index cf4bb86d43..9cf7d06f69 100644
--- a/server/boot/a-react.js
+++ b/server/boot/a-react.js
@@ -1,11 +1,12 @@
import React from 'react';
import Router from 'react-router';
+import Fetchr from 'fetchr';
import Location from 'react-router/lib/Location';
import debugFactory from 'debug';
import { app$ } from '../../common/app';
import { RenderToString } from 'thundercats-react';
-const debug = debugFactory('freecc:servereact');
+const debug = debugFactory('freecc:react-server');
// add routes here as they slowly get reactified
// remove their individual controllers
@@ -25,6 +26,7 @@ export default function reactSubRouter(app) {
app.use(router);
function serveReactApp(req, res, next) {
+ const services = new Fetchr({ req });
const location = new Location(req.path, req.query);
// returns a router wrapped app
@@ -42,7 +44,7 @@ export default function reactSubRouter(app) {
// prefetches data and sets up it up for current state
debug('rendering to string');
return RenderToString(
- AppCat(),
+ AppCat(null, services),
React.createElement(Router, initialState)
);
})
diff --git a/server/boot/a-services.js b/server/boot/a-services.js
index 3cb288a99d..9c2607c7b9 100644
--- a/server/boot/a-services.js
+++ b/server/boot/a-services.js
@@ -1,8 +1,15 @@
import Fetchr from 'fetchr';
import getHikesService from '../services/hikes';
+import getJobServices from '../services/job';
+import getUserServices from '../services/user';
export default function bootServices(app) {
const hikesService = getHikesService(app);
+ const jobServices = getJobServices(app);
+ const userServices = getUserServices(app);
+
Fetchr.registerFetcher(hikesService);
+ Fetchr.registerFetcher(jobServices);
+ Fetchr.registerFetcher(userServices);
app.use('/services', Fetchr.middleware());
}
diff --git a/server/boot/challenge.js b/server/boot/challenge.js
index cf89399296..8a74822b34 100644
--- a/server/boot/challenge.js
+++ b/server/boot/challenge.js
@@ -121,6 +121,7 @@ module.exports = function(app) {
var challengeId = String(req.user.currentChallenge.challengeId);
var challengeBlock = req.user.currentChallenge.challengeBlock;
+ // TODO(berks) fix index call here
var indexOfChallenge = challengeMapWithIds[challengeBlock]
.indexOf(challengeId);
diff --git a/server/boot/nonprofits.js b/server/boot/nonprofits.js
index 23bf2d979e..1155c49fa6 100644
--- a/server/boot/nonprofits.js
+++ b/server/boot/nonprofits.js
@@ -1,3 +1,4 @@
+var Rx = require('rx');
var debug = require('debug')('freecc:nonprofits');
var observeMethod = require('../utils/rx').observeMethod;
var unDasherize = require('../utils').unDasherize;
@@ -15,18 +16,19 @@ module.exports = function(app) {
app.use(router);
function nonprofitsDirectory(req, res, next) {
- var sum = 0;
- findNonprofits({}).subscribe(
- function(nonprofits) {
- nonprofits = nonprofits.sort(function(a, b) {
- return b.moneySaved - a.moneySaved;
- });
- totalSavings = function() {
- for(i = 0; i < nonprofits.length; i++) {
- sum += nonprofits[i].moneySaved;
- }
- return sum;
- }();
+ findNonprofits({
+ order: 'moneySaved DESC'
+ })
+ .flatMap(
+ (nonprofits = []) => {
+ // turn array of nonprofits into observable array
+ return Rx.Observable.from(nonprofits)
+ .pluck('moneySaved')
+ .reduce((sum, moneySaved = 0) => sum + moneySaved, 0);
+ },
+ (nonprofits = [], totalSavings) => ({ nonprofits, totalSavings })
+ )
+ .subscribe(({ nonprofits, totalSavings }) => {
res.render('nonprofits/directory', {
title: 'Nonprofits we help',
nonprofits: nonprofits,
@@ -78,8 +80,6 @@ module.exports = function(app) {
}
}
-
-
res.render('nonprofits/show', {
dashedName: dashedNameFull,
title: nonprofit.name,
diff --git a/server/debug-entry.js b/server/debug-entry.js
index f0a88e9337..0d04431c3e 100644
--- a/server/debug-entry.js
+++ b/server/debug-entry.js
@@ -1,4 +1,5 @@
+// use this file with runners like node-debug
+// or mocha.
require('babel/register');
var app = require('./server');
-
app.start();
diff --git a/server/production-start.js b/server/production-start.js
new file mode 100644
index 0000000000..79fbab6f54
--- /dev/null
+++ b/server/production-start.js
@@ -0,0 +1,31 @@
+// this ensures node understands the future
+require('babel/register');
+
+var startTime = Date.now();
+var timeoutHandler;
+// this is where server starts booting up
+var app = require('./server');
+console.log('waiting for db to connect');
+
+
+var onConnect = function() {
+ console.log('db connected in %s ms', Date.now() - startTime);
+ if (timeoutHandler) {
+ clearTimeout(timeoutHandler);
+ }
+ app.start();
+};
+
+var timeoutHandler = setTimeout(function() {
+ var message =
+ 'db did not after ' +
+ (Date.now() - startTime) +
+ ' ms connect crashing hard';
+
+ console.log(message);
+ // purposely shutdown server
+ // pm2 should restart this in production
+ throw new Error(message);
+}, 5000);
+
+app.dataSources.db.on('connected', onConnect);
diff --git a/server/server.js b/server/server.js
index 34c686ec9f..796c23a1ff 100755
--- a/server/server.js
+++ b/server/server.js
@@ -2,8 +2,7 @@ require('dotenv').load();
var pmx = require('pmx');
pmx.init();
-var R = require('ramda'),
- assign = require('lodash').assign,
+var assign = require('lodash').assign,
loopback = require('loopback'),
boot = require('loopback-boot'),
accepts = require('accepts'),
@@ -145,7 +144,7 @@ app.use(helmet.csp({
'*.d3js.org',
'https://cdn.inspectlet.com/inspectlet.js',
'http://cdn.inspectlet.com/inspectlet.js',
- 'http://www.freecodecamp.org'
+ 'http://beta.freecodecamp.com'
].concat(trusted),
'connect-src': [
'vimeo.com'
@@ -199,7 +198,6 @@ app.use(
})
);
-var startTime = Date.now();
boot(app, {
appRootDir: __dirname,
dev: process.env.NODE_ENV
@@ -249,7 +247,7 @@ var passportOptions = {
}
};
-R.keys(passportProviders).map(function(strategy) {
+Object.keys(passportProviders).map(function(strategy) {
var config = passportProviders[strategy];
config.session = config.session !== false;
passportConfigurator.configureProvider(
@@ -310,8 +308,6 @@ if (process.env.NODE_ENV === 'development') {
});
}
-module.exports = app;
-
app.start = function() {
app.listen(app.get('port'), function() {
app.emit('started');
@@ -323,34 +319,12 @@ app.start = function() {
});
};
+module.exports = app;
+
// start the server if `$ node server.js`
+// in production use `$npm start-production`
+// or `$node server/production` to start the server
+// and wait for DB handshake
if (require.main === module) {
- if (process.env.NODE_ENV === 'production') {
- var timeoutHandler;
- console.log('waiting for db to connect');
-
- var onConnect = function() {
- console.log('db connected in %s ms', Date.now() - startTime);
- if (timeoutHandler) {
- clearTimeout(timeoutHandler);
- }
- app.start();
- };
-
- var timeoutHandler = setTimeout(function() {
- var message =
- 'db did not after ' +
- (Date.now() - startTime) +
- ' ms connect crashing hard';
-
- console.log(message);
- // purposely shutdown server
- // pm2 should restart this in production
- throw new Error(message);
- }, 5000);
-
- app.dataSources.db.on('connected', onConnect);
- } else {
- app.start();
- }
+ app.start();
}
diff --git a/server/services/job.js b/server/services/job.js
new file mode 100644
index 0000000000..8c38a3661a
--- /dev/null
+++ b/server/services/job.js
@@ -0,0 +1,12 @@
+export default function getJobServices(app) {
+ const { Job } = app.models;
+
+ return {
+ name: 'job',
+ read: (req, resource, params, config, cb) => {
+ Job.find({}, (err, jobs) => {
+ cb(err, jobs);
+ });
+ }
+ };
+}
diff --git a/server/services/user.js b/server/services/user.js
new file mode 100644
index 0000000000..5f293bfee0
--- /dev/null
+++ b/server/services/user.js
@@ -0,0 +1,30 @@
+import debugFactory from 'debug';
+import assign from 'object.assign';
+
+const censor = '**********************:P********';
+const debug = debugFactory('freecc:services:user');
+const protectedUserFields = {
+ id: censor,
+ password: censor,
+ profiles: censor
+};
+
+export default function userServices(/* app */) {
+ return {
+ name: 'user',
+ read: (req, resource, params, config, cb) => {
+ let { user } = req;
+ if (user) {
+ debug('user is signed in');
+ // Zalgo!!!
+ return process.nextTick(() => {
+ cb(null, assign({}, user.toJSON(), protectedUserFields));
+ });
+ }
+ debug('user is not signed in');
+ return process.nextTick(() => {
+ cb(null, {});
+ });
+ }
+ };
+}
diff --git a/server/views/coursewares/showJS.jade b/server/views/coursewares/showJS.jade
index 9583a8672b..5c7d86f10d 100644
--- a/server/views/coursewares/showJS.jade
+++ b/server/views/coursewares/showJS.jade
@@ -1,88 +1,105 @@
extends ../layout-wide
block content
- script(src='/js/lib/codemirror/lib/codemirror.js')
- script(src='/js/lib/codemirror/addon/edit/closebrackets.js')
- script(src='/js/lib/codemirror/addon/edit/matchbrackets.js')
- script(src='/js/lib/codemirror/addon/lint/lint.js')
- script(src='/js/lib/codemirror/addon/lint/javascript-lint.js')
- script(src='/bower_components/jshint/dist/jshint.js')
- script(src='/js/lib/chai/chai.js')
+ script(type='text/javascript', src='/js/lib/codemirror/lib/codemirror.js')
+ script(type='text/javascript', src='/js/lib/codemirror/addon/edit/closebrackets.js')
+ script(type='text/javascript', src='/js/lib/codemirror/addon/edit/matchbrackets.js')
+ script(type='text/javascript', src='/js/lib/codemirror/addon/lint/lint.js')
+ script(type='text/javascript', src='/js/lib/codemirror/addon/lint/javascript-lint.js')
+ script(type='text/javascript', src='/bower_components/jshint/dist/jshint.js')
+ script(type='text/javascript', src='/js/lib/chai/chai.js')
link(rel='stylesheet', href='/js/lib/codemirror/lib/codemirror.css')
link(rel='stylesheet', href='/js/lib/codemirror/addon/lint/lint.css')
link(rel='stylesheet', href='/js/lib/codemirror/theme/monokai.css')
link(rel="stylesheet", href="//fonts.googleapis.com/css?family=Ubuntu+Mono")
- script(src='/js/lib/codemirror/mode/javascript/javascript.js')
- script(src='/js/lib/jailed/jailed.js')
- script(src='/js/lib/coursewares/sandbox.js')
- .row
- .col-xs-12.col-sm-12.col-md-4.bonfire-top
+ script(type='text/javascript', src='/js/lib/codemirror/mode/javascript/javascript.js')
+ script(type='text/javascript', src='/js/lib/jailed/jailed.js')
+ script(type='text/javascript', src='/js/lib/coursewares/sandbox.js')
+ .row(ng-controller="pairedWithController")
+ .col-xs-12.col-sm-12.col-md-4.col-lg-3
.scroll-locker
- #testCreatePanel
- h1.text-center= name
- .well
- .row
+ #testCreatePanel.well
+ h3.text-center.negative-10= name
+ .row
+ .col-xs-12
+ .bonfire-instructions
+ for sentence in details
+ p.wrappable.negative-10!= sentence
+ .negative-bottom-margin-30
+ #MDN-links
+ p.negative-10 Here are some helpful links:
+ for link, index in MDNlinks
+ .negative-10
+ ul: li: a(href="" + link, target="_blank") !{MDNkeys[index]}
+ if (user)
+ form.form-horizontal(novalidate='novalidate', name='completedWithForm')
+ .form-group.text-center.negative-10
.col-xs-12
- .bonfire-instructions
- p.wrappable= brief
- #brief-instructions
- #more-info.btn.btn-primary.btn-block.btn-primary-ghost
- span.ion-arrow-down-b
- | More information
- #long-instructions.row.hide
- .col-xs-12
- for sentence in details
- p.wrappable!= sentence
- #less-info.btn.btn-primary.btn-block.btn-primary-ghost
- span.ion-arrow-up-b
- | Less information
- #submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter)
- .button-spacer
- .btn-group.input-group.btn-group-justified
- label.btn.btn-success#trigger-help-modal
- i.fa.fa-medkit
- | Help
- label.btn.btn-success#trigger-pair-modal
- i.fa.fa-user-plus
- | Pair
- label.btn.btn-success#trigger-issue-modal
- i.fa.fa-bug
- | Bug
- .spacer
- form.code
- .form-group.codeMirrorView
- textarea#codeOutput(style='display: none;')
- br
- #testSuite
- br
- script(type="text/javascript").
- var tests = !{JSON.stringify(tests)};
- var challengeSeed = !{JSON.stringify(challengeSeed)};
- var challenge_Id = !{JSON.stringify(challengeId)};
- var challenge_Name = !{JSON.stringify(name)};
- var challengeType = !{JSON.stringify(challengeType)};
- var started = Math.floor(Date.now());
-
+ // extra field to distract password tools like lastpass from injecting css into our username field
+ label.negative-10.btn.btn-primary.btn-block#submitButton
+ i.fa.fa-play
+ | Run code (ctrl + enter)
+ .button-spacer
+ .btn-group.input-group.btn-group-justified
+ label.btn.btn-success#trigger-reset-modal
+ i.fa.fa-refresh
+ | Reset
+ label.btn.btn-success#trigger-help-modal
+ i.fa.fa-medkit
+ | Help
+ label.btn.btn-success#trigger-issue-modal
+ i.fa.fa-bug
+ | Bug
+ .button-spacer
+ form.code
+ .form-group.codeMirrorView
+ textarea#codeOutput(style='display: none;')
+ br
+ #testSuite.negative-10
+ br
+ script(type="text/javascript").
+ var tests = !{JSON.stringify(tests)};
+ var challengeSeed = !{JSON.stringify(challengeSeed)};
+ var challenge_Id = !{JSON.stringify(challengeId)};
+ var challenge_Name = !{JSON.stringify(name)};
+ var started = Math.floor(Date.now());
+ var challengeType = !{JSON.stringify(challengeType)};
+ var _ = R;
+ var dashed = !{JSON.stringify(dashedName)};
.col-xs-12.col-sm-12.col-md-8
#mainEditorPanel
form.code
.form-group.codeMirrorView
textarea#codeEditor(autofocus=true, style='display: none;')
- script(src='/js/lib/coursewares/coursewaresJSFramework_0.0.5.js')
+ script(src='/js/lib/coursewares/coursewaresJSFramework_0.0.6.js')
#complete-courseware-dialog.modal(tabindex='-1')
.modal-dialog.animated.zoomIn.fast-animation
.modal-content
.modal-header.challenge-list-header= compliment
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
- .modal-body(ng-controller="pairedWithController")
+ .modal-body
.text-center
.animated.zoomInDown.delay-half
span.completion-icon.ion-checkmark-circled.text-primary
if (user)
- a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf, ng-disabled='completedWithForm.$invalid && existingUser.length > 0') Go to my next challenge (ctrl + enter)
- if (points && points > 2)
- a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript" target="_blank")
+ a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf) Go to my next challenge (ctrl + enter)
+ if (user.progressTimestamps.length > 2)
+ a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
i.fa.fa-twitter
= phrase
else
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
+ #reset-modal.modal(tabindex='-1')
+ .modal-dialog.animated.fadeInUp.fast-animation
+ .modal-content
+ .modal-header.challenge-list-header Clear your code?
+ a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
+ .modal-body
+ h3 This will restore your code editor to its original state.
+ a.btn.btn-lg.btn-info.btn-block#reset-button(href='#', data-dismiss='modal', aria-hidden='true') Clear my code
+ a.btn.btn-lg.btn-primary.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
include ../partials/challenge-modals
+ script.
+ var MDNlinks = !{JSON.stringify(MDNlinks)};
+ if (!MDNlinks.length) {
+ $('#MDN-links').addClass('collapse');
+ }
diff --git a/webpack.config.js b/webpack.config.js
index 68091d74e5..83121c4c8e 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,7 +1,6 @@
var path = require('path');
module.exports = {
- devtool: 'inline-source-map',
entry: './client',
output: {
filename: 'bundle.js',