Merge pull request #9112 from FreeCodeCamp/staging

Release staging into Master
This commit is contained in:
Quincy Larson
2016-06-12 11:48:16 -07:00
committed by GitHub
5 changed files with 38 additions and 39 deletions

View File

@ -1693,7 +1693,7 @@
"var myArray = [1,2,3];\nvar myData = myArray[0];"
],
"tests": [
"assert((function(){if(typeof myArray != 'undefined' && typeof myData != 'undefined' && myArray[0] == myData){return true;}else{return false;}})(), 'message: The variable <code>myData</code> should equal the first value of <code>myArray</code>.');"
"assert((function(){if(typeof myArray != 'undefined' && typeof myData != 'undefined' && myArray[0] === myData){return true;}else{return false;}})(), 'message: The variable <code>myData</code> should equal the first value of <code>myArray</code>.');"
],
"type": "waypoint",
"challengeType": 1,
@ -2783,7 +2783,7 @@
"assert(testNotEqual(12) === \"Not Equal\", 'message: <code>testNotEqual(12)</code> should return \"Not Equal\"');",
"assert(testNotEqual(\"12\") === \"Not Equal\", 'message: <code>testNotEqual(\"12\")</code> should return \"Not Equal\"');",
"assert(testNotEqual(\"bob\") === \"Not Equal\", 'message: <code>testNotEqual(\"bob\")</code> should return \"Not Equal\"');",
"assert(code.match(/val\\s*!=\\s*\\d+/g).length > 0, 'message: You should use the <code>!=</code> operator');"
"assert(code.match(/(?!!==)!=/), 'message: You should use the <code>!=</code> operator');"
],
"type": "waypoint",
"challengeType": 1,
@ -3280,7 +3280,7 @@
"Order is important in <code>if</code>, <code>else if</code> statements.",
"The loop is executed from top to bottom so you will want to be careful of what statement comes first.",
"Take these two functions as an example.",
"Heres the first:",
"Here's the first:",
"<blockquote>function foo(x) {<br> if (x < 1) {<br> return \"Less than one\";<br> } else if (x < 2) {<br> return \"Less than two\";<br> } else {<br> return \"Greater than or equal to two\";<br> }<br>}</blockquote>",
"And the second just switches the order of the statements:",
"<blockquote>function bar(x) {<br> if (x < 2) {<br> return \"Less than two\";<br> } else if (x < 1) {<br> return \"Less than one\";<br> } else {<br> return \"Greater than or equal to two\";<br> }<br>}</blockquote>",
@ -4502,6 +4502,7 @@
"For the given <code>id</code> in <code>collection</code>:",
"If <code>value</code> is non-blank (<code>value !== \"\"</code>) and <code>prop</code> is not <code>\"tracks\"</code> then update or set the <code>value</code> for the <code>prop</code>.",
"If the <code>prop</code> is <code>\"tracks\"</code> and <code>value</code> is non-blank, push the <code>value</code> onto the end of the <code>tracks</code> array.",
"If <code>\"tracks\"</code> is non-existent before you update it, create an empty array before pushing a track to it.",
"If <code>value</code> is blank, delete that <code>prop</code>.",
"Always return the entire collection object.",
"<strong>Note</strong><br>Don't forget to use <code>bracket notation</code> when <a href=\"accessing-objects-properties-with-variables\" target=\"_blank\">accessing object properties with variables</a>."

View File

@ -713,7 +713,7 @@
"description": [
"Font size is controlled by the <code>font-size</code> CSS property, like this:",
"<blockquote>h1 {<br>&nbsp;&nbsp;font-size: 30px;<br>}</blockquote>",
"Create a second <code>p</code> element with the following kitty ipsum text: <code>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</code>",
"Create a second <code>p</code> element after the existing <code>p</code> element with the following kitty ipsum text: <code>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</code>",
"Inside the same <code>&#60;style&#62;</code> tag that contains your <code>red-text</code> class, create an entry for <code>p</code> elements and set the <code>font-size</code> to 16 pixels (<code>16px</code>).",
"<strong>Note</strong><br>Due to browser implementation differences, you may need to be at 100% zoom to pass the tests on this challenge.",
"Also, please do not add a class attribute to your new <code>p</code> element."

View File

@ -12,8 +12,6 @@ const log = debug('fcc:react-server');
// add routes here as they slowly get reactified
// remove their individual controllers
const routes = [
'/jobs',
'/jobs/*',
'/videos',
'/videos/*'
];

View File

@ -66,7 +66,7 @@ function getIdsForCert$(id, Challenge) {
// getFormatedDate(challengeMap: Object, challengeId: String) => String, throws
function getFormatedDate(challengeMap, challengeId) {
return moment(challengeMap[challengeId].completedDate)
.format('MMM Do, YYYY');
.format('MMMM D, YYYY');
}
// sendCertifiedEmail(

View File

@ -188,8 +188,8 @@ module.exports = function(app) {
flashIfNotVerified,
getSettings
);
router.get('/vote1', vote1);
router.get('/vote2', vote2);
// router.get('/vote1', vote1);
// router.get('/vote2', vote2);
// Ensure these are the last routes!
router.get(
@ -432,7 +432,7 @@ module.exports = function(app) {
certViews[certType],
{
username: user.username,
date: moment(new Date(completedDate)).format('MMMM, Do YYYY'),
date: moment(new Date(completedDate)).format('MMMM D, YYYY'),
name: user.name
}
);
@ -579,33 +579,33 @@ module.exports = function(app) {
});
}
function vote1(req, res, next) {
if (req.user) {
req.user.tshirtVote = 1;
req.user.save(function(err) {
if (err) { return next(err); }
req.flash('success', { msg: 'Thanks for voting!' });
return res.redirect('/map');
});
} else {
req.flash('error', { msg: 'You must be signed in to vote.' });
res.redirect('/map');
}
}
function vote2(req, res, next) {
if (req.user) {
req.user.tshirtVote = 2;
req.user.save(function(err) {
if (err) { return next(err); }
req.flash('success', { msg: 'Thanks for voting!' });
return res.redirect('/map');
});
} else {
req.flash('error', {msg: 'You must be signed in to vote.'});
res.redirect('/map');
}
}
// function vote1(req, res, next) {
// if (req.user) {
// req.user.tshirtVote = 1;
// req.user.save(function(err) {
// if (err) { return next(err); }
//
// req.flash('success', { msg: 'Thanks for voting!' });
// return res.redirect('/map');
// });
// } else {
// req.flash('error', { msg: 'You must be signed in to vote.' });
// res.redirect('/map');
// }
// }
//
// function vote2(req, res, next) {
// if (req.user) {
// req.user.tshirtVote = 2;
// req.user.save(function(err) {
// if (err) { return next(err); }
//
// req.flash('success', { msg: 'Thanks for voting!' });
// return res.redirect('/map');
// });
// } else {
// req.flash('error', {msg: 'You must be signed in to vote.'});
// res.redirect('/map');
// }
// }
};