Merge branch 'staging' into fb-share
This commit is contained in:
@ -1,2 +1,12 @@
|
|||||||
We're getting a lot of duplicate issues and bug reports that just aren't reporting actual bugs.
|
We're getting a lot of duplicate issues and bug reports that just aren't reporting actual bugs.
|
||||||
So, before you submit your issue, please read the [Help I've Found a Bug](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Help-I've-Found-a-Bug) wiki page.
|
So, before you submit your issue, please read the [Help I've Found a Bug](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Help-I've-Found-a-Bug) wiki page.
|
||||||
|
|
||||||
|
We welcome pull requests from Free Code Camp campers (our students) and seasoned JavaScript developers alike! Follow these steps to contribute:
|
||||||
|
|
||||||
|
1. Check our [public Waffle Board](https://waffle.io/freecodecamp/freecodecamp).
|
||||||
|
2. Pick an issue that nobody has claimed and start working on it. If your issue isn't on the board, open an issue. If you think you can fix it yourself, start working on it. Feel free to ask for help in our [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp).
|
||||||
|
3. Fork the project ([Need help with forking a project?](https://help.github.com/articles/fork-a-repo/)). You'll do all of your work on your forked copy.
|
||||||
|
4. Create a branch specific to the issue or feature you are working on. Push your work to that branch. ([Need help with branching?](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches))
|
||||||
|
5. Name the branch something like `fix/xxx` or `feature/xxx` where `xxx` is a short description of the changes or feature you are attempting to add. For example `fix/email-login` whould be a branch where I fix something specific to email login.
|
||||||
|
6. You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [Free Code Camp's JavaScript Style Guide](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Free-Code-Camp-JavaScript-Style-Guide) (you can find a summory of those rules [here](https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/.eslintrc). Please do not ignore any linting errors, as they are meant to **help** you and to ensure a clean and simple code base. Make sure none of your JavaScript is longer than 80 characters per line.
|
||||||
|
7. Once your code is ready, submit a pull request from your branch to Free Code Camp's `staging` branch. We'll do a quick code review and give you feedback, then iterate from there. It may also be helpful to read about git [rebasing](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/git-rebase).
|
||||||
|
15
README.md
15
README.md
@ -1,4 +1,4 @@
|
|||||||
<img src="https://s3.amazonaws.com/freecodecamp/wide-social-banner.png">
|

|
||||||
|
|
||||||
[](https://waffle.io/freecodecamp/freecodecamp/metrics)
|
[](https://waffle.io/freecodecamp/freecodecamp/metrics)
|
||||||
|
|
||||||
@ -35,10 +35,9 @@ We welcome pull requests from Free Code Camp campers (our students) and seasoned
|
|||||||
2. Pick an issue that nobody has claimed and start working on it. If your issue isn't on the board, open an issue. If you think you can fix it yourself, start working on it. Feel free to ask for help in our [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp).
|
2. Pick an issue that nobody has claimed and start working on it. If your issue isn't on the board, open an issue. If you think you can fix it yourself, start working on it. Feel free to ask for help in our [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp).
|
||||||
3. Fork the project ([Need help with forking a project?](https://help.github.com/articles/fork-a-repo/)). You'll do all of your work on your forked copy.
|
3. Fork the project ([Need help with forking a project?](https://help.github.com/articles/fork-a-repo/)). You'll do all of your work on your forked copy.
|
||||||
4. Create a branch specific to the issue or feature you are working on. Push your work to that branch. ([Need help with branching?](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches))
|
4. Create a branch specific to the issue or feature you are working on. Push your work to that branch. ([Need help with branching?](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches))
|
||||||
5. Name the branch something like `user-xxx` where user is your username and xxx is the issue number you are addressing.
|
5. Name the branch something like `fix/xxx` or `feature/xxx` where `xxx` is a short description of the changes or feature you are attempting to add. For example `fix/email-login` whould be a branch where I fix something specific to email login.
|
||||||
6. You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [AirBnB's JavaScript Style Guide](https://github.com/airbnb/javascript). Please do not ignore any linting errors, as they are meant to **help** you. Make sure none of your JavaScript is longer than 80 characters per line.
|
6. You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [Free Code Camp's JavaScript Style Guide](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Free-Code-Camp-JavaScript-Style-Guide) (you can find a summory of those rules [here](https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/.eslintrc). Please do not ignore any linting errors, as they are meant to **help** you and to ensure a clean and simple code base. Make sure none of your JavaScript is longer than 80 characters per line.
|
||||||
7. Once your code is ready, submit a pull request from your branch to Free Code Camp's `staging` branch. We'll do a quick code review and give you feedback, then iterate from there.
|
7. Once your code is ready, submit a pull request from your branch to Free Code Camp's `staging` branch. We'll do a quick code review and give you feedback, then iterate from there. It may also be helpful to read about git [rebasing](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/git-rebase).
|
||||||
8. Once we accept one of your pull requests, one of the project owners (currently @quincylarson, @terakilobyte, and @berkeleytrue) will add you to our camper contributor group.
|
|
||||||
|
|
||||||
Prerequisites
|
Prerequisites
|
||||||
-------------
|
-------------
|
||||||
@ -70,10 +69,9 @@ touch .env
|
|||||||
npm install -g gulp
|
npm install -g gulp
|
||||||
```
|
```
|
||||||
|
|
||||||
Edit your .env file with the following API keys accordingly (if you only use email login, only the MONGOHQ_URL, SESSION_SECRET, MANDRILL_USER and MANDRILL_PASSWORD fields are necessary. Keep in mind if you want to use more services you'll have to get your own API keys for those services.
|
Edit your `.env` file with the following API keys accordingly (if you only use email login, only the `MONGOHQ_URL`, `SESSION_SECRET`, `MANDRILL_USER` and `MANDRILL_PASSWORD` fields are necessary. Keep in mind if you want to use more services you'll have to get your own API keys for those services.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
MONGOHQ_URL='mongodb://localhost:27017/freecodecamp'
|
MONGOHQ_URL='mongodb://localhost:27017/freecodecamp'
|
||||||
|
|
||||||
FACEBOOK_ID=stuff
|
FACEBOOK_ID=stuff
|
||||||
@ -106,11 +104,9 @@ COOKIE_SECRET='this is a secret'
|
|||||||
|
|
||||||
PEER=stuff
|
PEER=stuff
|
||||||
DEBUG=true
|
DEBUG=true
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
||||||
# Start the mongo server
|
# Start the mongo server
|
||||||
mongod
|
mongod
|
||||||
|
|
||||||
@ -124,7 +120,6 @@ node seed/
|
|||||||
|
|
||||||
# start the application
|
# start the application
|
||||||
gulp
|
gulp
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
License
|
License
|
||||||
|
@ -200,7 +200,7 @@ var myCodeMirror = editor;
|
|||||||
editor.on('keyup', function() {
|
editor.on('keyup', function() {
|
||||||
clearTimeout(codeStorage.updateTimeoutId);
|
clearTimeout(codeStorage.updateTimeoutId);
|
||||||
codeStorage.updateTimeoutId = setTimeout(
|
codeStorage.updateTimeoutId = setTimeout(
|
||||||
codeStorage.updateStorage,
|
codeStorage.updateStorage.bind(codeStorage),
|
||||||
codeStorage.updateWait
|
codeStorage.updateWait
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -421,7 +421,8 @@ function showCompletion() {
|
|||||||
);
|
);
|
||||||
var bonfireSolution = myCodeMirror.getValue();
|
var bonfireSolution = myCodeMirror.getValue();
|
||||||
var didCompleteWith = $('#completed-with').val() || null;
|
var didCompleteWith = $('#completed-with').val() || null;
|
||||||
$('#complete-courseware-dialog').modal('show').focus();
|
$('#complete-courseware-dialog').modal('show');
|
||||||
|
$('#complete-courseware-dialog .modal-header').click();
|
||||||
$('#submit-challenge').click(function(e) {
|
$('#submit-challenge').click(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
@ -66,10 +66,26 @@ $(document).ready(function() {
|
|||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#search-issue').unbind('click');
|
||||||
|
$('#search-issue').on('click', function() {
|
||||||
|
var queryIssue = window.location.href.toString();
|
||||||
|
window.open('https://github.com/FreeCodeCamp/FreeCodeCamp/issues?q=is:issue is:all '+ queryIssue.substr(queryIssue.lastIndexOf('challenges/') + 11).replace('/', ''), '_blank');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#help-ive-found-a-bug-wiki-article').unbind('click');
|
||||||
|
$('#help-ive-found-a-bug-wiki-article').on('click', function() {
|
||||||
|
var queryIssue = window.location.href.toString();
|
||||||
|
window.open("https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Help-I've-Found-a-Bug", '_blank');
|
||||||
|
});
|
||||||
|
|
||||||
$('#report-issue').unbind('click');
|
$('#report-issue').unbind('click');
|
||||||
$('#report-issue').on('click', function() {
|
$('#report-issue').on('click', function() {
|
||||||
|
var textMessage = 'https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge ' + window.location.href + ' has an issue.';
|
||||||
|
textMessage += ' User Agent is: <code>' + navigator.userAgent + '</code>.';
|
||||||
|
textMessage += ' Please describe how to reproduce this issue, and include links to screenshots if possible.%0A%0A';
|
||||||
|
textMessage = textMessage.replace(';', ','); //GitHub cuts User Agent text because of ';' symbol so I just replace it with ','
|
||||||
$('#issue-modal').modal('hide');
|
$('#issue-modal').modal('hide');
|
||||||
window.open('https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge '+ window.location.href +' has an issue. Please describe how to reproduce it, and include links to screenshots if possible.', '_blank')
|
window.open(textMessage, '_blank');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#completed-courseware').unbind('click');
|
$('#completed-courseware').unbind('click');
|
||||||
|
10
package.json
10
package.json
@ -14,16 +14,6 @@
|
|||||||
"test": "mocha --compilers js:babel/register"
|
"test": "mocha --compilers js:babel/register"
|
||||||
},
|
},
|
||||||
"license": "(BSD-3-Clause AND CC-BY-SA-4.0)",
|
"license": "(BSD-3-Clause AND CC-BY-SA-4.0)",
|
||||||
"contributors": [
|
|
||||||
{
|
|
||||||
"name": "Quincy Larson",
|
|
||||||
"url": "https://github.com/QuincyLarson"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Nathan Leniz",
|
|
||||||
"url": "https://github.com/terakilobyte"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"accepts": "~1.2.5",
|
"accepts": "~1.2.5",
|
||||||
"async": "~0.9.0",
|
"async": "~0.9.0",
|
||||||
|
@ -80,10 +80,10 @@
|
|||||||
"sym([1, 2, 3], [5, 2, 1, 4]);"
|
"sym([1, 2, 3], [5, 2, 1, 4]);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(sym([1, 2, 3], [5, 2, 1, 4]), [3, 5, 4], 'should return an array of unique values');",
|
"assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4]), [3, 5, 4], 'should return an array of unique values');",
|
||||||
"assert.deepEqual(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'should return the symmetric difference of the given arrays');",
|
"assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'should return the symmetric difference of the given arrays');",
|
||||||
"assert.deepEqual(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'should return an array of unique values');",
|
"assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'should return an array of unique values');",
|
||||||
"assert.deepEqual(sym([1, 1]), [1], 'should return an array of unique values');"
|
"assert.sameMembers(sym([1, 1]), [1], 'should return an array of unique values');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.reduce()",
|
"Array.reduce()",
|
||||||
|
@ -28,9 +28,9 @@
|
|||||||
"title":"Using typeof",
|
"title":"Using typeof",
|
||||||
"difficulty":0,
|
"difficulty":0,
|
||||||
"description":[
|
"description":[
|
||||||
"<code>typeof</code> is a useful method that we can use to check the type of a variable.",
|
"You can use <code>typeof</code> to check the <code>data structure</code>, or type, of a variable.",
|
||||||
"One thing to be careful of is that an array has the type objects.",
|
"Note that in JavaScript, arrays are technically a type of object.",
|
||||||
"Try using each of these to see the types they have.",
|
"Try using <code>typeof</code> on each of the following to see which types they have.",
|
||||||
"<code>console.log(typeof(\"\"));</code>",
|
"<code>console.log(typeof(\"\"));</code>",
|
||||||
"<code>console.log(typeof(0));</code>",
|
"<code>console.log(typeof(0));</code>",
|
||||||
"<code>console.log(typeof([]));</code>",
|
"<code>console.log(typeof([]));</code>",
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
"Run the following command in a Cloud9 terminal prompt tab: <code>npm install grunt-contrib-imagemin --save-dev && npm install --save-dev && heroku login</code>. At this point, the terminal will prompt you to log in to Heroku from the command line.",
|
"Run the following command in a Cloud9 terminal prompt tab: <code>npm install grunt-contrib-imagemin --save-dev && npm install --save-dev && heroku login</code>. At this point, the terminal will prompt you to log in to Heroku from the command line.",
|
||||||
"Now run <code>yo angular-fullstack:heroku</code>. You can choose a name for your Heroku project, or Heroku will create a random one for you. You can choose whether you want to deploy to servers the US or the EU.",
|
"Now run <code>yo angular-fullstack:heroku</code>. You can choose a name for your Heroku project, or Heroku will create a random one for you. You can choose whether you want to deploy to servers the US or the EU.",
|
||||||
"Set the config flag for your Heroku environment and add MongoLab for your MongoDB instance by running the following command: <code>cd ~/workspace/dist && heroku config:set NODE_ENV=production && heroku addons:create mongolab</code>.",
|
"Set the config flag for your Heroku environment and add MongoLab for your MongoDB instance by running the following command: <code>cd ~/workspace/dist && heroku config:set NODE_ENV=production && heroku addons:create mongolab</code>.",
|
||||||
"As you build your app, you should frequently commit changes to your codebase. Make sure you're in the <code>~/workspace</code> directory by running <code>cd ~/workspace</code>. Then you can this code to stage the changes to your changes and commit them: <code>git commit -am \"your commit message\"</code>. Note that you should replace \"your commit message\" with a short summary of the changes you made to your code, such as \"added a records controller and corresponding routes\".",
|
"As you build your app, you should frequently commit changes to your codebase. Make sure you're in the <code>~/workspace</code> directory by running <code>cd ~/workspace</code>. Then you can use this code to stage the changes to your changes and commit them: <code>git commit -am \"your commit message\"</code>. Note that you should replace \"your commit message\" with a short summary of the changes you made to your code, such as \"added a records controller and corresponding routes\".",
|
||||||
"You can push these new commits to GitHub by running <code>git push origin master</code>, and to Heroku by running <code>grunt --force && grunt buildcontrol:heroku</code>.",
|
"You can push these new commits to GitHub by running <code>git push origin master</code>, and to Heroku by running <code>grunt --force && grunt buildcontrol:heroku</code>.",
|
||||||
"If you need further guidance on using Yeoman Angular-Fullstack Generator, check out: <a href='https://github.com/clnhll/guidetobasejumps' target='_blank'>https://github.com/clnhll/guidetobasejumps</a>.",
|
"If you need further guidance on using Yeoman Angular-Fullstack Generator, check out: <a href='https://github.com/clnhll/guidetobasejumps' target='_blank'>https://github.com/clnhll/guidetobasejumps</a>.",
|
||||||
"Now you're ready to move on to your first Basejump. Click the \"I've completed this challenge\" and move on."
|
"Now you're ready to move on to your first Basejump. Click the \"I've completed this challenge\" and move on."
|
||||||
|
@ -90,7 +90,8 @@
|
|||||||
"expect(factorialize(5)).to.be.a(\"Number\");",
|
"expect(factorialize(5)).to.be.a(\"Number\");",
|
||||||
"expect(factorialize(5)).to.equal(120);",
|
"expect(factorialize(5)).to.equal(120);",
|
||||||
"expect(factorialize(10)).to.equal(3628800);",
|
"expect(factorialize(10)).to.equal(3628800);",
|
||||||
"expect(factorialize(20)).to.equal(2432902008176640000);"
|
"expect(factorialize(20)).to.equal(2432902008176640000);",
|
||||||
|
"expect(factorialize(0)).to.equal(1);"
|
||||||
],
|
],
|
||||||
"difficulty": "1.02",
|
"difficulty": "1.02",
|
||||||
"description": [
|
"description": [
|
||||||
@ -530,11 +531,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "adf08ec01beb4f99fc7a68f2",
|
"id": "adf08ec01beb4f99fc7a68f2",
|
||||||
"title": "Falsey Bouncer",
|
"title": "Falsy Bouncer",
|
||||||
"difficulty": "1.50",
|
"difficulty": "1.50",
|
||||||
"description": [
|
"description": [
|
||||||
"Remove all falsey values from an array.",
|
"Remove all falsy values from an array.",
|
||||||
"Falsey values in javascript are false, null, 0, \"\", undefined, and NaN.",
|
"Falsy values in javascript are false, null, 0, \"\", undefined, and NaN.",
|
||||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck. Write your own code."
|
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -546,9 +547,9 @@
|
|||||||
"bouncer([7, 'ate', '', false, 9]);"
|
"bouncer([7, 'ate', '', false, 9]);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(bouncer([7, 'ate', '', false, 9]), [7, 'ate', 9], 'should remove falsey values');",
|
"assert.deepEqual(bouncer([7, 'ate', '', false, 9]), [7, 'ate', 9], 'should remove falsy values');",
|
||||||
"assert.deepEqual(bouncer(['a', 'b', 'c']), ['a', 'b', 'c'], 'should return full array if no falsey elements');",
|
"assert.deepEqual(bouncer(['a', 'b', 'c']), ['a', 'b', 'c'], 'should return full array if no falsy elements');",
|
||||||
"assert.deepEqual(bouncer([false, null, 0]), [], 'should return empty array if all elements are falsey');"
|
"assert.deepEqual(bouncer([false, null, 0, NaN, undefined, '']), [], 'should return empty array if all elements are falsy');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Boolean Objects",
|
"Boolean Objects",
|
||||||
@ -572,8 +573,8 @@
|
|||||||
"title": "Where art thou",
|
"title": "Where art thou",
|
||||||
"difficulty": "1.55",
|
"difficulty": "1.55",
|
||||||
"description": [
|
"description": [
|
||||||
"Make a function that looks through an array (first argument) and returns an array of all objects that have equivalent property and value pair (second argument).",
|
"Make a function that looks through an array of objects (first argument) and returns an array of all objects that have matching property and value pairs (second argument). Each property and value pair of the source object has to be present in the object from the collection if it is to be included in the returned array.",
|
||||||
"For example, if the first argument is <code>[{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }]</code>, and the second argument is <code>{ last: 'Capulet' }</code>, then you must return the the third object from the array (the first argument), because it contains the property and it's value, that was passed on as the second argument.",
|
"For example, if the first argument is <code>[{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }]</code>, and the second argument is <code>{ last: 'Capulet' }</code>, then you must return the third object from the array (the first argument), because it contains the property and it's value, that was passed on as the second argument.",
|
||||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck. Write your own code."
|
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
|
@ -221,7 +221,7 @@
|
|||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(lastLetterOfLastName === \"e\", 'lastLetterOfLastName should be \"e\"');",
|
"assert(lastLetterOfLastName === \"e\", 'lastLetterOfLastName should be \"e\"');",
|
||||||
"assert(editor.getValue().match(/\\.length/g), 'You have to use <code>.length</code> to get the last letter');"
|
"assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use <code>.length</code> to get the last letter');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var firstName = \"Ada\";",
|
"var firstName = \"Ada\";",
|
||||||
@ -249,11 +249,11 @@
|
|||||||
"In order to get the last letter of a string, you can subtract one from the string's length.",
|
"In order to get the last letter of a string, you can subtract one from the string's length.",
|
||||||
"For example, you can get the value of the third-to-last letter of the <code>var firstName = \"Charles\"</code> string by using <code>firstName[firstName.length - 3]</code>.",
|
"For example, you can get the value of the third-to-last letter of the <code>var firstName = \"Charles\"</code> string by using <code>firstName[firstName.length - 3]</code>.",
|
||||||
"Use <code>bracket notation</code> to find the second-to-last character in the <code>lastName</code> string.",
|
"Use <code>bracket notation</code> to find the second-to-last character in the <code>lastName</code> string.",
|
||||||
"Try looking at the <code>lastLetterOfLastName</code> variable declaration if you get stuck."
|
"Try looking at the <code>thirdToLastLetterOfFirstName</code> variable declaration if you get stuck."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(secondToLastLetterOfLastName === 'c', 'secondToLastLetterOfLastName should be \"c\".');",
|
"assert(secondToLastLetterOfLastName === 'c', 'secondToLastLetterOfLastName should be \"c\".');",
|
||||||
"assert(editor.getValue().match(/\\.length/g), 'You have to use .length to get the third last letter.');"
|
"assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use .length to get the second last letter.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var firstName = \"Ada\";",
|
"var firstName = \"Ada\";",
|
||||||
@ -283,7 +283,7 @@
|
|||||||
"Replace the <code>0</code> with the correct number so you can get the result mentioned in the comment."
|
"Replace the <code>0</code> with the correct number so you can get the result mentioned in the comment."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert((function(){if(sum === 20 && editor.getValue().match(/\\+/g)){return true;}else{return false;}})(), 'Make the variable <code>sum</code> equal 20');"
|
"assert((function(){if(sum === 20 && editor.getValue().match(/\\+/g).length >= 2){return true;}else{return false;}})(), 'Make the variable <code>sum</code> equal 20.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var sum = 10 + 0; //make this equal to 20 by changing the 0 into the appropriate number.",
|
"var sum = 10 + 0; //make this equal to 20 by changing the 0 into the appropriate number.",
|
||||||
@ -352,7 +352,7 @@
|
|||||||
"Replace the <code>0</code> with the correct number so you can get the result mentioned in the comment."
|
"Replace the <code>0</code> with the correct number so you can get the result mentioned in the comment."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert((function(){if(quotient === 2 && editor.getValue().match(/\\//g)){return true;}else{return false;}})(), 'Make the variable <code>quotient</code> equal 2.');"
|
"assert((function(){if(quotient === 2 && editor.getValue().match(/var\\s*?quotient\\s*?\\=\\s*?\\d+\\s*?\\/\\s*?\\d+\\s*?;/g)){return true;}else{return false;}})(), 'Make the variable <code>quotient</code> equal 2.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var quotient = 66 / 0; //make this equal to 2 by changing the 0 into the appropriate number.",
|
"var quotient = 66 / 0; //make this equal to 2 by changing the 0 into the appropriate number.",
|
||||||
@ -422,7 +422,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"With JavaScript <code>array</code> variables, we can store several pieces of data in one place.",
|
"With JavaScript <code>array</code> variables, we can store several pieces of data in one place.",
|
||||||
"You start an array declaration with an opening bracket, end it with a closing bracket, and put a comma between each entry, like this: <code>var sandwich = [\"peanut butter\", \"jelly\", \"bread\"]</code>.",
|
"You start an array declaration with an opening bracket, end it with a closing bracket, and put a comma between each entry, like this: <code>var sandwich = [\"peanut butter\", \"jelly\", \"bread\"]</code>.",
|
||||||
"Now let's create a new array called <code>myArray</code> that contains both a <code>string</code> and a <code>number</code>.",
|
"Now let's create a new array called <code>myArray</code> that contains both a <code>string</code> and a <code>number</code> (in that order).",
|
||||||
"Refer to the comments if you get stuck."
|
"Refer to the comments if you get stuck."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
@ -604,7 +604,7 @@
|
|||||||
"difficulty": "9.9817",
|
"difficulty": "9.9817",
|
||||||
"description": [
|
"description": [
|
||||||
"<code>pop()</code> always removes the last element of an array. What if you want to remove the first? That's where <code>.shift()</code> comes in.",
|
"<code>pop()</code> always removes the last element of an array. What if you want to remove the first? That's where <code>.shift()</code> comes in.",
|
||||||
"Take the myArray array and <code>shift()</code> the first value off of it."
|
"Take the myArray array and <code>shift()</code> the first value off of it. Set <code>myRemoved</code> to the first value of <code>myArray</code> using <code>shift()</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert((function(d){if(d[0] == 23 && d[1][0] == 'dog' && d[1][1] == 3 && d[2] == undefined){return true;}else{return false;}})(myArray), 'myArray should only have the last two values left([23, [\"dog\", 3]])');",
|
"assert((function(d){if(d[0] == 23 && d[1][0] == 'dog' && d[1][1] == 3 && d[2] == undefined){return true;}else{return false;}})(myArray), 'myArray should only have the last two values left([23, [\"dog\", 3]])');",
|
||||||
@ -638,7 +638,7 @@
|
|||||||
"Let's take the code we had last time and <code>unshift</code>this value to the start: <code>\"Paul\" </code>"
|
"Let's take the code we had last time and <code>unshift</code>this value to the start: <code>\"Paul\" </code>"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert((function(d){if(d[0].toLowerCase() == 'paul' && d[1] == 23 && d[2][0] != undefined && d[2][0] == 'dog' && d[2][1] != undefined && d[2][1] == 3){return true;}else{return false;}})(myArray), 'myArray should now have [\"Paul\", 23, [\"dog\", 3]])');"
|
"assert((function(d){if(typeof(d[0]) === \"string\" && d[0].toLowerCase() == 'paul' && d[1] == 23 && d[2][0] != undefined && d[2][0] == 'dog' && d[2][1] != undefined && d[2][1] == 3){return true;}else{return false;}})(myArray), '<code>myArray</code> should now have [\"Paul\", 23, [\"dog\", 3]]).');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
|
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
|
||||||
@ -824,8 +824,15 @@
|
|||||||
" ourArray.push(i);",
|
" ourArray.push(i);",
|
||||||
"}",
|
"}",
|
||||||
"var myArray = [];",
|
"var myArray = [];",
|
||||||
"//Push the numbers zero through four to myArray using a \"for loop\" like above.",
|
|
||||||
"",
|
"",
|
||||||
|
"// Only change code below this line.",
|
||||||
|
"",
|
||||||
|
"// Push the numbers zero through four to myArray using a \"for loop\" like above.",
|
||||||
|
"",
|
||||||
|
"// Only change code above this line.",
|
||||||
|
"// We use this function to show you the value of your variable in your output box.",
|
||||||
|
"// You'll learn about functions soon.",
|
||||||
|
"if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}",
|
||||||
""
|
""
|
||||||
],
|
],
|
||||||
"type": "waypoint",
|
"type": "waypoint",
|
||||||
@ -852,8 +859,14 @@
|
|||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var myArray = [];",
|
"var myArray = [];",
|
||||||
"//Push the numbers zero through four to myArray",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
|
"// Push the numbers zero through four to myArray using a \"while loop\".",
|
||||||
|
"",
|
||||||
|
"// Only change code above this line.",
|
||||||
|
"// We use this function to show you the value of your variable in your output box.",
|
||||||
|
"// You'll learn about functions soon.",
|
||||||
|
"if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}",
|
||||||
""
|
""
|
||||||
],
|
],
|
||||||
"type": "waypoint",
|
"type": "waypoint",
|
||||||
@ -936,6 +949,7 @@
|
|||||||
"tests":[
|
"tests":[
|
||||||
"assert(myFunction() >= min, 'The random number that\\'s generated by myFunction should be greater than or equal to the minimum number');",
|
"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(myFunction() <= max, 'The random number that\\'s generated by myFunction should be less than or equal to the maximum number');",
|
||||||
|
"assert(myFunction() % 1 === 0 , 'The random number that\\'s generated by myFunction should be an integer');",
|
||||||
"assert((function(){if(editor.getValue().match(/max/g).length >= 2 && editor.getValue().match(/min/g).length >= 2 && 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');"
|
"assert((function(){if(editor.getValue().match(/max/g).length >= 2 && editor.getValue().match(/min/g).length >= 2 && 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":[
|
"challengeSeed":[
|
||||||
@ -973,23 +987,25 @@
|
|||||||
"Create an <code>if-else statement</code> to return <code>heads</code> if the flip var is zero, or else return <code>tails</code> if it's not."
|
"Create an <code>if-else statement</code> to return <code>heads</code> if the flip var is zero, or else return <code>tails</code> if it's not."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert((function(){if(myFunction() === \"heads\" || myFunction() === \"tails\"){return true;}else{return false;}})(), 'myFunction should either return heads or tails');",
|
"assert((function(){var result = myFunction();if(result === 'heads' || result === 'tails'){return true;} else {return false;}})(), '<code>myFunction</code> should either return <code>heads</code> or <code>tails</code>.');",
|
||||||
"assert(editor.getValue().match(/if/g).length >= 3, 'You should have created a new if statement');",
|
"assert((function(){var result = myFunction();if(result === 'heads' && flip === 0 || result === 'tails' && flip !== 0){return true;} else {return false;}})(), '<code>myFunction</code> should return <code>heads</code> when flip equals 0 and <code>tails</code> when flip equals 1.');",
|
||||||
"assert(editor.getValue().match(/else/g).length >= 2, 'You should have created a new else statement');"
|
"assert(editor.getValue().match(/if/g).length >= 4, '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":[
|
"challengeSeed":[
|
||||||
|
"var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;",
|
||||||
"function myFunction(){",
|
"function myFunction(){",
|
||||||
" var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;",
|
|
||||||
" // Create an if-else statement here to return \"heads\" if flip is 0. Otherwise return \"tails\".",
|
" // Create an if-else statement here to return \"heads\" if flip is 0. Otherwise return \"tails\".",
|
||||||
"",
|
"",
|
||||||
" // Only change code below this line.",
|
" // Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
"",
|
||||||
|
" // Only change code above this line.",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"// Only change code above this line.",
|
|
||||||
"// We use this function to show you the value of your variable in your output box.",
|
"// We use this function to show you the value of your variable in your output box.",
|
||||||
"(function(){return myFunction();})();"
|
"var result = myFunction();if(typeof(flip) !== \"undefined\" && typeof(flip) === \"number\" && typeof(result) !== \"undefined\" && typeof(result) === \"string\"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}"
|
||||||
],
|
],
|
||||||
"type": "waypoint",
|
"type": "waypoint",
|
||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
@ -1006,7 +1022,7 @@
|
|||||||
"<code>g</code> means that we want to search the entire string for this pattern instead of just the first match.",
|
"<code>g</code> means that we want to search the entire string for this pattern instead of just the first match.",
|
||||||
"<code>i</code> means that we want to ignore the case (uppercase or lowercase) when searching for the pattern.",
|
"<code>i</code> means that we want to ignore the case (uppercase or lowercase) when searching for the pattern.",
|
||||||
"<code>Regular expressions</code> are written by surrounding the pattern with a <code>/</code> symbol.",
|
"<code>Regular expressions</code> are written by surrounding the pattern with a <code>/</code> symbol.",
|
||||||
"Let's try selecting all the occurrences of the word <code>and</code> in the string <code>George Boole and Alan Turing went to the shop and got some milk</code>. We can do this by replacing the <code>...</code> part of our regular expression with the current <code>regular expression</code> with the word <code>and</code>."
|
"Let's try selecting all the occurrences of the word <code>and</code> in the string <code>George Boole and Alan Turing went to the shop and got some milk</code>. We can do this by replacing the <code>.</code> part of our regular expression with the current <code>regular expression</code> with the word <code>and</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(test==2, 'Your <code>regular expression</code> should find two occurrences of the word <code>and</code>');",
|
"assert(test==2, 'Your <code>regular expression</code> should find two occurrences of the word <code>and</code>');",
|
||||||
@ -1093,7 +1109,7 @@
|
|||||||
"title": "Invert Regular Expression Matches with JavaScript",
|
"title": "Invert Regular Expression Matches with JavaScript",
|
||||||
"difficulty":"9.987",
|
"difficulty":"9.987",
|
||||||
"description":[
|
"description":[
|
||||||
"Use <code>/\\S/gi;</code> to match everything that isn't a space in the string.",
|
"Use <code>/\\S/gi</code> to match everything that isn't a space in the string.",
|
||||||
"You can invert any match by using the uppercase version of the selector <code>\\s</code> versus <code>\\S</code> for example."
|
"You can invert any match by using the uppercase version of the selector <code>\\s</code> versus <code>\\S</code> for example."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
|
@ -909,19 +909,11 @@
|
|||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
||||||
"<style>",
|
"<style>",
|
||||||
" .red-text {",
|
|
||||||
" color: red;",
|
|
||||||
" }",
|
|
||||||
"",
|
"",
|
||||||
" h2 {",
|
" h2 {",
|
||||||
" font-family: Lobster, Monospace;",
|
" font-family: Lobster, Monospace;",
|
||||||
" }",
|
" }",
|
||||||
"",
|
"",
|
||||||
" p {",
|
|
||||||
" font-size: 16px;",
|
|
||||||
" font-family: Monospace;",
|
|
||||||
" }",
|
|
||||||
"",
|
|
||||||
" .thick-green-border {",
|
" .thick-green-border {",
|
||||||
" border-color: green;",
|
" border-color: green;",
|
||||||
" border-width: 10px;",
|
" border-width: 10px;",
|
||||||
@ -929,17 +921,12 @@
|
|||||||
" border-radius: 50%;",
|
" border-radius: 50%;",
|
||||||
" }",
|
" }",
|
||||||
"",
|
"",
|
||||||
" .smaller-image {",
|
|
||||||
" width: 100px;",
|
|
||||||
" }",
|
|
||||||
"</style>",
|
"</style>",
|
||||||
"",
|
"",
|
||||||
"<div class=\"container-fluid\">",
|
"<div class=\"container-fluid\">",
|
||||||
" <h2 class=\"red-text text-center\">CatPhotoApp</h2>",
|
" <h2 class=\"text-primary text-center\">CatPhotoApp</h2>",
|
||||||
"",
|
"",
|
||||||
" <p>Click here for <a href=\"#\">cat photos</a>.</p>",
|
" <a href=\"#\"><img class=\"img-responsive thick-green-border\" src=\"https://bit.ly/fcc-relaxing-cat\"></a>",
|
||||||
"",
|
|
||||||
" <a href=\"#\"><img class=\"smaller-image thick-green-border\" src=\"https://bit.ly/fcc-relaxing-cat\"></a>",
|
|
||||||
"",
|
"",
|
||||||
" <img src=\"http://bit.ly/fcc-running-cats\" class=\"img-responsive\">",
|
" <img src=\"http://bit.ly/fcc-running-cats\" class=\"img-responsive\">",
|
||||||
" <div class=\"row\">",
|
" <div class=\"row\">",
|
||||||
@ -1949,8 +1936,8 @@
|
|||||||
"Give the well on the left the id of <code>left-well</code>. Give the well on the right the <code>id</code> of <code>right-well</code>."
|
"Give the well on the left the id of <code>left-well</code>. Give the well on the right the <code>id</code> of <code>right-well</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"#left-well\") && $(\"#left-well\").length > 0, 'Give your left <code>well</code> the id of <code>left-well</code>.')",
|
"assert($(\".col-xs-6\").children(\"#left-well\") && $(\".col-xs-6\").children(\"#left-well\").length > 0, 'Give your left <code>well</code> the id of <code>left-well</code>.')",
|
||||||
"assert($(\"#right-well\") && $(\"#right-well\").length > 0, 'Give your right <code>well</code> the id of <code>right-well</code>.')"
|
"assert($(\".col-xs-6\").children(\"#right-well\") && $(\".col-xs-6\").children(\"#right-well\").length > 0, 'Give your right <code>well</code> the id of <code>right-well</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<div class=\"container-fluid\">",
|
"<div class=\"container-fluid\">",
|
||||||
@ -2046,12 +2033,12 @@
|
|||||||
"Give each of your buttons a unique id like, starting with <code>target1</code> and ending with <code>target6</code>."
|
"Give each of your buttons a unique id like, starting with <code>target1</code> and ending with <code>target6</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"#target1\") && $(\"#target1\").length > 0, 'One <code>button</code> element should have the id <code>target1</code>.')",
|
"assert($(\"#left-well\").children(\"#target1\") && $(\"#left-well\").children(\"#target1\").length > 0, 'One <code>button</code> element should have the id <code>target1</code>.')",
|
||||||
"assert($(\"#target2\") && $(\"#target2\").length > 0, 'One <code>button</code> element should have the id <code>target2</code>.')",
|
"assert($(\"#left-well\").children(\"#target2\") && $(\"#left-well\").children(\"#target2\").length > 0, 'One <code>button</code> element should have the id <code>target2</code>.')",
|
||||||
"assert($(\"#target3\") && $(\"#target3\").length > 0, 'One <code>button</code> element should have the id <code>target3</code>.')",
|
"assert($(\"#left-well\").children(\"#target3\") && $(\"#left-well\").children(\"#target3\").length > 0, 'One <code>button</code> element should have the id <code>target3</code>.')",
|
||||||
"assert($(\"#target4\") && $(\"#target4\").length > 0, 'One <code>button</code> element should have the id <code>target4</code>.')",
|
"assert($(\"#right-well\").children(\"#target4\") && $(\"#right-well\").children(\"#target4\").length > 0, 'One <code>button</code> element should have the id <code>target4</code>.')",
|
||||||
"assert($(\"#target5\") && $(\"#target5\").length > 0, 'One <code>button</code> element should have the id <code>target5</code>.')",
|
"assert($(\"#right-well\").children(\"#target5\") && $(\"#right-well\").children(\"#target5\").length > 0, 'One <code>button</code> element should have the id <code>target5</code>.')",
|
||||||
"assert($(\"#target6\") && $(\"#target6\").length > 0, 'One <code>button</code> element should have the id <code>target6</code>.')"
|
"assert($(\"#right-well\").children(\"#target6\") && $(\"#right-well\").children(\"#target6\").length > 0, 'One <code>button</code> element should have the id <code>target6</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<div class=\"container-fluid\">",
|
"<div class=\"container-fluid\">",
|
||||||
|
@ -871,8 +871,8 @@
|
|||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"img\").hasClass(\"smaller-image\"), 'Your <code>img</code> element should have the class <code>smaller-image</code>.')",
|
"assert($(\"img\").hasClass(\"smaller-image\"), 'Your <code>img</code> element should have the class <code>smaller-image</code>.')",
|
||||||
"assert($(\"img\").hasClass(\"thick-green-border\"), 'Your <code>img</code> element should have the class <code>thick-green-border</code>.')",
|
"assert($(\"img\").hasClass(\"thick-green-border\"), 'Your <code>img</code> element should have the class <code>thick-green-border</code>.')",
|
||||||
"assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\")), 'Give your image a border width of <code>10px</code>.')",
|
"assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\"), 10) === 10, 'Give your image a border width of <code>10px</code>.')",
|
||||||
"assert(new RegExp(\"solid\", \"gi\").test(editor), 'Give your image a border style of <code>solid</code>.')",
|
"assert($(\"img\").css(\"border-right-style\") === \"solid\", 'Give your image a border style of <code>solid</code>.')",
|
||||||
"assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'The border around your <code>img</code> element should be green.')"
|
"assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'The border around your <code>img</code> element should be green.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -1747,9 +1747,8 @@
|
|||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"form\") && $(\"form\").children(\"input\") && $(\"form\").children(\"input\").length > 0, 'Nest your text input element within a <code>form</code> element.')",
|
"assert($(\"form\") && $(\"form\").children(\"input\") && $(\"form\").children(\"input\").length > 0, 'Nest your text input element within a <code>form</code> element.')",
|
||||||
"assert($(\"form\").attr(\"action\"), 'Your <code>form</code> element should have an <code>action</code> attribute.')",
|
"assert($(\"form\").attr(\"action\") === \"/submit-cat-photo\", 'Make sure your <code>form</code> has an <code>action</code> attribute which is set to <code>/submit-cat-photo</code>.')",
|
||||||
"assert(editor.match(/<\\/form>/g) && editor.match(/<form/g) && editor.match(/<\\/form>/g).length === editor.match(/<form/g).length, 'Make sure your <code>form</code> element has a closing tag.')",
|
"assert(editor.match(/<\\/form>/g) && editor.match(/<form/g) && editor.match(/<\\/form>/g).length === editor.match(/<form/g).length, 'Make sure your <code>form</code> element has a closing tag.')"
|
||||||
"assert(editor.match(/\\/submit-cat-photo/ig), 'Make sure your <code>form</code> action is set to <code>/submit-cat-photo</code>.')"
|
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
||||||
@ -1998,8 +1997,8 @@
|
|||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($('input[type=\"radio\"]').length > 1, 'Your page should have two radio button elements.')",
|
"assert($('input[type=\"radio\"]').length > 1, 'Your page should have two radio button elements.')",
|
||||||
"assert($('input[type=\"radio\"]:nth-child(1)').attr('name') === 'indoor-outdoor', 'Give your radio buttons the <code>name</code> attribute of <code>indoor-outdoor</code>.')",
|
"assert($('label > input[type=\"radio\"]').filter(\"[name='indoor-outdoor']\").length > 1, 'Give your radio buttons the <code>name</code> attribute of <code>indoor-outdoor</code>.')",
|
||||||
"assert($(\"label\").length > 1, 'Each of your two radio button elements should be nested in a <code>label</code> element.')",
|
"assert($('label > input[type=\"radio\"]:only-child').length > 1, 'Each of your two radio button elements should be nested in its own <code>label</code> element.')",
|
||||||
"assert(editor.match(/<\\/label>/g) && editor.match(/<label/g) && editor.match(/<\\/label>/g).length === editor.match(/<label/g).length, 'Make sure each of your <code>label</code> elements has a closing tag.')",
|
"assert(editor.match(/<\\/label>/g) && editor.match(/<label/g) && editor.match(/<\\/label>/g).length === editor.match(/<label/g).length, 'Make sure each of your <code>label</code> elements has a closing tag.')",
|
||||||
"assert($(\"label\").text().match(/indoor/gi), 'One of your radio buttons should have the label <code>indoor</code>.')",
|
"assert($(\"label\").text().match(/indoor/gi), 'One of your radio buttons should have the label <code>indoor</code>.')",
|
||||||
"assert($(\"label\").text().match(/outdoor/gi), 'One of your radio buttons should have the label <code>outdoor</code>.')"
|
"assert($(\"label\").text().match(/outdoor/gi), 'One of your radio buttons should have the label <code>outdoor</code>.')"
|
||||||
@ -2091,9 +2090,9 @@
|
|||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($('input[type=\"checkbox\"]').length > 2, 'Your page should have three checkbox elements.')",
|
"assert($('input[type=\"checkbox\"]').length > 2, 'Your page should have three checkbox elements.')",
|
||||||
"assert($('label:has(input[type=\"checkbox\"])').length > 2, 'Each of your three checkbox elements should be nested in its own <code>label</code> element.')",
|
"assert($('label > input[type=\"checkbox\"]:only-child').length > 2, 'Each of your three checkbox elements should be nested in its own <code>label</code> element.')",
|
||||||
"assert(editor.match(/<\\/label>/g) && editor.match(/<label/g) && editor.match(/<\\/label>/g).length === editor.match(/<label/g).length, \"Make sure each of your <code>label</code> elements has a closing tag.\")",
|
"assert(editor.match(/<\\/label>/g) && editor.match(/<label/g) && editor.match(/<\\/label>/g).length === editor.match(/<label/g).length, \"Make sure each of your <code>label</code> elements has a closing tag.\")",
|
||||||
"assert($('input[type=\"checkbox\"]:nth-child(1)').attr(\"name\") === \"personality\", 'Give your checkboxes buttons the <code>name</code> attribute of <code>personality</code>.')"
|
"assert($('label > input[type=\"checkbox\"]').filter(\"[name='personality']\").length > 2, 'Give your checkboxes the <code>name</code> attribute of <code>personality</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
||||||
@ -2843,10 +2842,10 @@
|
|||||||
"Give the green box a <code>padding</code> of <code>40px</code> on its top and left side, but only <code>20px</code> on its bottom and right side."
|
"Give the green box a <code>padding</code> of <code>40px</code> on its top and left side, but only <code>20px</code> on its bottom and right side."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\".green-box\").css(\"padding-top\") === \"40px\", 'Your <code>green-box</code> class should give the top of elements <code>40px</code> of <code>padding</code>.')",
|
"assert($(\".green-box\").css(\"padding-top\") === \"40px\", 'Your <code>green-box</code> class should give the top of the elements <code>40px</code> of <code>padding</code>.')",
|
||||||
"assert($(\".green-box\").css(\"padding-left\") === \"40px\", 'Your <code>green-box</code> class should give the left of elements <code>40px</code> of <code>padding</code>.')",
|
"assert($(\".green-box\").css(\"padding-left\") === \"40px\", 'Your <code>green-box</code> class should give the left of the elements <code>40px</code> of <code>padding</code>.')",
|
||||||
"assert($(\".green-box\").css(\"padding-right\") === \"20px\", 'Your <code>green-box</code> class should give the right of elements <code>20px</code> of <code>padding</code>.')",
|
"assert($(\".green-box\").css(\"padding-right\") === \"20px\", 'Your <code>green-box</code> class should give the right of the elements <code>20px</code> of <code>padding</code>.')",
|
||||||
"assert($(\".green-box\").css(\"padding-bottom\") === \"20px\", 'Your <code>green-box</code> class should give the bottom of elements <code>20px</code> of <code>padding</code>.')"
|
"assert($(\".green-box\").css(\"padding-bottom\") === \"20px\", 'Your <code>green-box</code> class should give the bottom of the elements <code>20px</code> of <code>padding</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<style>",
|
"<style>",
|
||||||
|
@ -161,8 +161,8 @@
|
|||||||
"Here's how you'd make the <code>button</code> element with the id <code>target6</code> fade out: <code>$(\"#target6\").addClass(\"animated fadeOut\")</code>."
|
"Here's how you'd make the <code>button</code> element with the id <code>target6</code> fade out: <code>$(\"#target6\").addClass(\"animated fadeOut\")</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"#target3\").hasClass(\"animated\"), 'Select the <code>button</code>element with the <code>id</code> of <code>target3</code> and use the jQuery <code>addClass()</code> function to give it the class of <code>animated</code>.');",
|
"assert($(\"#target3\").hasClass(\"animated\"), 'Select the <code>button</code>element with the <code>id</code> of <code>target3</code> and use the jQuery <code>addClass()</code> function to give it the class of <code>animated</code>.')",
|
||||||
"assert($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\"), 'Target the element with the id <code>target3</code> and use the jQuery <code>addClass()</code> function to give it the class <code>fadeOut</code>.')",
|
"assert(($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\")) && editor.match(/\\$\\(.#target3.\\)/g), 'Target the element with the id <code>target3</code> and use the jQuery <code>addClass()</code> function to give it the class <code>fadeOut</code>.')",
|
||||||
"assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')"
|
"assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -263,9 +263,9 @@
|
|||||||
"Use the <code>addClass()</code> jQuery function to give the element one new class for each selector: <code>animated</code>, <code>shake</code>, and <code>btn-primary</code>."
|
"Use the <code>addClass()</code> jQuery function to give the element one new class for each selector: <code>animated</code>, <code>shake</code>, and <code>btn-primary</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(editor.match(/\\$\\(.*button/g), 'Use the <code>$(\"button\")</code> selector.')",
|
"assert((editor.match(/\\$\\(\\'button\\'/g) || editor.match(/\\$\\(\"button\"/g)), 'Use the <code>$(\"button\")</code> selector.')",
|
||||||
"assert(editor.match(/\\$\\(.*\\.btn/g), 'Use the <code>$(\".btn\")</code> selector.')",
|
"assert((editor.match(/\\$\\(\\'\\.btn\\'/g) || editor.match(/\\$\\(\"\\.btn\"/g)), 'Use the <code>$(\".btn\")</code> selector.')",
|
||||||
"assert(editor.match(/\\$\\(.*#target1/g), 'Use the <code>$(\"#target1\")</code> selector.')",
|
"assert((editor.match(/\\$\\(\\'#target1\\'/g) || editor.match(/\\$\\(\"#target1\"/g)), 'Use the <code>$(\"#target1\")</code> selector.')",
|
||||||
"assert(editor.match(/addClass/g) && editor.match(/addClass/g).length > 2, 'Only add one class with each of your three selectors.')",
|
"assert(editor.match(/addClass/g) && editor.match(/addClass/g).length > 2, 'Only add one class with each of your three selectors.')",
|
||||||
"assert($(\"#target1\").hasClass(\"animated\") && $(\"#target1\").hasClass(\"shake\") && $(\"#target1\").hasClass(\"btn-primary\"), 'Your <code>#target1</code> element should have the classes <code>animated</code>‚ <code>shake</code> and <code>btn-primary</code>.')",
|
"assert($(\"#target1\").hasClass(\"animated\") && $(\"#target1\").hasClass(\"shake\") && $(\"#target1\").hasClass(\"btn-primary\"), 'Your <code>#target1</code> element should have the classes <code>animated</code>‚ <code>shake</code> and <code>btn-primary</code>.')",
|
||||||
"assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')"
|
"assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')"
|
||||||
@ -310,12 +310,13 @@
|
|||||||
"difficulty": 3.07,
|
"difficulty": 3.07,
|
||||||
"description": [
|
"description": [
|
||||||
"In the same way you can add classes to an element with jQuery's <code>addClass()</code> function, you can remove them with jQuery's <code>removeClass()</code> function.",
|
"In the same way you can add classes to an element with jQuery's <code>addClass()</code> function, you can remove them with jQuery's <code>removeClass()</code> function.",
|
||||||
"Let's remove the <code>btn-default</code> class from all of our <code>button</code> elements.",
|
"Here's how you would do this for a specific button, add <code>$(\"#target2\").removeClass(\"btn-default\");</code>",
|
||||||
"Here's how you would do this for a specific button, add <code>$(\"#target2\").removeClass(\"btn-default\");</code>"
|
"Let's remove the <code>btn-default</code> class from all of our <code>button</code> elements."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\".btn-default\").length === 0, 'Remove the <code>btn-default</code> class from all of your <code>button</code> elements.')",
|
"assert($(\".btn-default\").length === 0, 'Remove the <code>btn-default</code> class from all of your <code>button</code> elements.')",
|
||||||
"assert(editor.match(/btn btn-default/g), 'Only use jQuery to remove this class from the element.')"
|
"assert(editor.match(/btn btn-default/g), 'Only use jQuery to remove this class from the element.')",
|
||||||
|
"assert(editor.match(/\\.[\\v\\s]*removeClass[\\s\\v]*\\([\\s\\v]*('|\")\\s*btn-default\\s*('|\")[\\s\\v]*\\)/gm), 'Only remove the <code>btn-default</code> class.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"fccss",
|
"fccss",
|
||||||
@ -360,11 +361,11 @@
|
|||||||
"difficulty": 3.08,
|
"difficulty": 3.08,
|
||||||
"description": [
|
"description": [
|
||||||
"We can also change the CSS of an HTML element directly with jQuery.",
|
"We can also change the CSS of an HTML element directly with jQuery.",
|
||||||
"Delete your jQuery selectors, leaving an empty <code>document ready function</code>.",
|
|
||||||
"Select <code>target1</code> and change its color to red.",
|
|
||||||
"jQuery has a function called <code>.css()</code> that allows you to change the CSS of an element.",
|
"jQuery has a function called <code>.css()</code> that allows you to change the CSS of an element.",
|
||||||
"Here's how we would change its color to blue: <code>$(\"#target1\").css(\"color\", \"blue\");</code>",
|
"Here's how we would change its color to blue: <code>$(\"#target1\").css(\"color\", \"blue\");</code>",
|
||||||
"This is slightly different from a normal CSS declaration, because the CSS property and its value are in quotes, and separated with a comma instead of a colon."
|
"This is slightly different from a normal CSS declaration, because the CSS property and its value are in quotes, and separated with a comma instead of a colon.",
|
||||||
|
"Delete your jQuery selectors, leaving an empty <code>document ready function</code>.",
|
||||||
|
"Select <code>target1</code> and change its color to red."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"#target1\").css(\"color\") === 'rgb(255, 0, 0)', 'Your <code>target1</code> element should have red text.')",
|
"assert($(\"#target1\").css(\"color\") === 'rgb(255, 0, 0)', 'Your <code>target1</code> element should have red text.')",
|
||||||
@ -622,13 +623,13 @@
|
|||||||
"Every HTML element has a <code>parent</code> element from which it <code>inherits</code> properties.",
|
"Every HTML element has a <code>parent</code> element from which it <code>inherits</code> properties.",
|
||||||
"For example, your <code>jQuery Playground</code> <code>h3</code> element has the parent element of <code><div class=\"container-fluid\"></code>, which itself has the parent <code>body</code>.",
|
"For example, your <code>jQuery Playground</code> <code>h3</code> element has the parent element of <code><div class=\"container-fluid\"></code>, which itself has the parent <code>body</code>.",
|
||||||
"jQuery has a function called <code>parent()</code> that allows you to access the parent of whichever element you've selected.",
|
"jQuery has a function called <code>parent()</code> that allows you to access the parent of whichever element you've selected.",
|
||||||
"Give the parent of the <code>#target1</code> element background-color of red.",
|
"Here's an example of how you would use the <code>parent()</code> function if you wanted to give the parent element of the <code>left-well</code> element a background color of blue: <code>$(\"#left-well\").parent().css(\"background-color\", \"blue\")</code>",
|
||||||
"Here's an example of how you would use the <code>parent()</code> function: <code>$(\"#left-well\").parent().css(\"background-color\", \"blue\")</code>",
|
"Give the parent of the <code>#target1</code> element a background-color of red."
|
||||||
"Note: Please do not use this example in the challenge; it will target the incorrect element."
|
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"#left-well\").css(\"background-color\") === 'red' || $(\"#left-well\").css(\"background-color\") === 'rgb(255, 0, 0)' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#ff0000' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#f00', 'Your <code>left-well</code> element should have a red background.')",
|
"assert($(\"#left-well\").css(\"background-color\") === 'red' || $(\"#left-well\").css(\"background-color\") === 'rgb(255, 0, 0)' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#ff0000' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#f00', 'Your <code>left-well</code> element should have a red background.')",
|
||||||
"assert(editor.match(/\\.parent\\(\\)\\.css/g), 'You should use the <code>parent()</code> function to modify this element.')",
|
"assert(editor.match(/\\.parent\\(\\)\\.css/g), 'You should use the <code>.parent()</code> function to modify this element.')",
|
||||||
|
"assert((editor.match(/\\$\\(\\'#target1\\'\\)\\.parent/g) || editor.match(/\\$\\(\"#target1\"\\)\\.parent/g)), 'The <code>.parent()</code> method should be called on the <code>#target1</code> element.')",
|
||||||
"assert(editor.match(/<div class=\"well\" id=\"left-well\">/g), 'Only use jQuery to add these classes to the element.')"
|
"assert(editor.match(/<div class=\"well\" id=\"left-well\">/g), 'Only use jQuery to add these classes to the element.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -678,11 +679,11 @@
|
|||||||
"Many HTML elements have <code>children</code> elements from which they <code>inherit</code> their properties.",
|
"Many HTML elements have <code>children</code> elements from which they <code>inherit</code> their properties.",
|
||||||
"For example, every HTML element is a child of your <code>body</code> element, and your \"jQuery Playground\" <code>h3</code> element is a child of your <code><div class=\"container-fluid\"></code> element.",
|
"For example, every HTML element is a child of your <code>body</code> element, and your \"jQuery Playground\" <code>h3</code> element is a child of your <code><div class=\"container-fluid\"></code> element.",
|
||||||
"jQuery has a function called <code>children()</code> that allows you to access the children of whichever element you've selected.",
|
"jQuery has a function called <code>children()</code> that allows you to access the children of whichever element you've selected.",
|
||||||
"Give all the children of your <code>#right-well</code> element a color of green.",
|
"Here's an example of how you would use the <code>children()</code> function to give the children of your <code>left-well</code> element the background color of blue: <code>$(\"#left-well\").children().css(\"color\", \"blue\")</code>",
|
||||||
"Here's an example of how you would use the <code>children()</code> function: <code>$(\"#left-well\").children().css(\"color\", \"blue\")</code>"
|
"Give all the children of your <code>#right-well</code> element a color of green."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"#target6\").css(\"color\") === 'rgb(0, 128, 0)', 'Your <code>target6</code> element should have green text.')",
|
"assert($(\"#right-well\").children().css(\"color\") === 'rgb(0, 128, 0)', 'All children of <code>#right-well</code> should have green text.')",
|
||||||
"assert(editor.match(/\\.children\\(\\)\\.css/g), 'You should use the <code>children()</code> function to modify these elements.')",
|
"assert(editor.match(/\\.children\\(\\)\\.css/g), 'You should use the <code>children()</code> function to modify these elements.')",
|
||||||
"assert(editor.match(/<div class=\"well\" id=\"right-well\">/g), 'Only use jQuery to add these classes to the element.')"
|
"assert(editor.match(/<div class=\"well\" id=\"right-well\">/g), 'Only use jQuery to add these classes to the element.')"
|
||||||
],
|
],
|
||||||
@ -734,8 +735,8 @@
|
|||||||
"You've seen why id attributes are so convenient for targeting with jQuery selectors. But you won't always have such neat ids to work with.",
|
"You've seen why id attributes are so convenient for targeting with jQuery selectors. But you won't always have such neat ids to work with.",
|
||||||
"Fortunately, jQuery has some other tricks for targeting the right elements.",
|
"Fortunately, jQuery has some other tricks for targeting the right elements.",
|
||||||
"jQuery uses CSS Selectors to target elements. <code>target:nth-child(n)</code> css selector allows you to select all the nth element with the target class or element type.",
|
"jQuery uses CSS Selectors to target elements. <code>target:nth-child(n)</code> css selector allows you to select all the nth element with the target class or element type.",
|
||||||
"Make the second child in each of your well elements bounce.",
|
"Here's how you would give the third element in each well bounce: <code>$(\".target:nth-child(3)\").addClass(\"animated bounce\");</code>",
|
||||||
"Here's how you would give the third element in each well bounce: <code>$(\".target:nth-child(3)\").addClass(\"animated bounce\");</code>"
|
"Make the second child in each of your well elements bounce."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\".target:nth-child(2)\").hasClass(\"animated\") && $(\".target:nth-child(2)\").hasClass(\"bounce\"), 'The second element in each of your <code>well</code> elements should bounce.')",
|
"assert($(\".target:nth-child(2)\").hasClass(\"animated\") && $(\".target:nth-child(2)\").hasClass(\"bounce\"), 'The second element in each of your <code>well</code> elements should bounce.')",
|
||||||
|
@ -177,11 +177,13 @@
|
|||||||
"Note that you can resize the c9.io's windows by dragging their borders.",
|
"Note that you can resize the c9.io's windows by dragging their borders.",
|
||||||
"Make sure that you are always in your project's \"workspace\" directory. You can always navigate back to this directory by running this command: <code>cd ~/workspace</code>.",
|
"Make sure that you are always in your project's \"workspace\" directory. You can always navigate back to this directory by running this command: <code>cd ~/workspace</code>.",
|
||||||
"You can view this Node School module's source code on GitHub at <a href='https://github.com/azat-co/expressworks'>https://github.com/azat-co/expressworks</a>.",
|
"You can view this Node School module's source code on GitHub at <a href='https://github.com/azat-co/expressworks'>https://github.com/azat-co/expressworks</a>.",
|
||||||
"Complete \"Hello World\"",
|
"Complete \"Hello World!\"",
|
||||||
|
"Complete \"Static\"",
|
||||||
"Complete \"Jade\"",
|
"Complete \"Jade\"",
|
||||||
"Complete \"Good Old Form\"",
|
"Complete \"Good Old Form\"",
|
||||||
"Complete \"Stylish CSS\"",
|
"Complete \"Stylish CSS\"",
|
||||||
"Complete \"Session and Cookie\"",
|
"Complete \"Param Pam Pam\"",
|
||||||
|
"Complete \"What's In Query\"",
|
||||||
"Complete \"JSON Me\"",
|
"Complete \"JSON Me\"",
|
||||||
"Once you've completed these steps, move on to our next challenge."
|
"Once you've completed these steps, move on to our next challenge."
|
||||||
],
|
],
|
||||||
|
@ -236,7 +236,7 @@
|
|||||||
"filter is a useful method that can filter out values that don't match a certain criteria",
|
"filter is a useful method that can filter out values that don't match a certain criteria",
|
||||||
"Let's remove all the values greater than five",
|
"Let's remove all the values greater than five",
|
||||||
"<code>array = array.filter(function(val) {</code>",
|
"<code>array = array.filter(function(val) {</code>",
|
||||||
"<code>  return val<4;</code>",
|
"<code>  return val <= 5;</code>",
|
||||||
"<code>});</code>"
|
"<code>});</code>"
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
"title": "Trigger on click Events with jQuery",
|
"title": "Trigger on click Events with jQuery",
|
||||||
"difficulty": 3.19,
|
"difficulty": 3.19,
|
||||||
"description": [
|
"description": [
|
||||||
|
"With jQuery we are able to get data from APIs via Ajax",
|
||||||
|
"This data normally comes in the form of JSON",
|
||||||
|
"Let's get the <code>Get Message</code> button to set the text of a div",
|
||||||
|
"We will later use this to display the result of out API request",
|
||||||
"<code>$(\"#getMessage\").on(\"click\", function(){</code>",
|
"<code>$(\"#getMessage\").on(\"click\", function(){</code>",
|
||||||
"<code>  $(\".message\").html(\"Here is the message\");</code>",
|
"<code>  $(\".message\").html(\"Here is the message\");</code>",
|
||||||
"<code>});</code>"
|
"<code>});</code>"
|
||||||
@ -48,10 +52,60 @@
|
|||||||
"challengeType": 0,
|
"challengeType": 0,
|
||||||
"type": "waypoint"
|
"type": "waypoint"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "bad87fee1348bd9aebc08726",
|
||||||
|
"title": "Learn JSON Syntax",
|
||||||
|
"description": [
|
||||||
|
"JSON stands for \"JavaScript Object Notation\". It\"s how you create objects in JavaScript.",
|
||||||
|
"JSON is a series of \"key-value pairs\". Everything on the left of the colon (<code>:</code>) is the \"key\" you use to unlock the \"value\" on the right of the colon."
|
||||||
|
],
|
||||||
|
"tests": [
|
||||||
|
"assert(typeof data != \"undefined\", \"Whoops! It looks like you deleted the <code>data</code> variable!\");",
|
||||||
|
"assert(typeof getAnId != \"undefined\", \"Whoops! It looks like you deleted the <code>getAnId</code> function!\");",
|
||||||
|
"assert(data[0]['id'] === getAnId(), \"The duntion getFirstId should return the id of the first element in the array\");"
|
||||||
|
],
|
||||||
|
"challengeSeed": [
|
||||||
|
"fccss",
|
||||||
|
"var data = [",
|
||||||
|
" {",
|
||||||
|
" \"id\": 0,",
|
||||||
|
" \"imageLink\": \"http://rs611.pbsrc.com/albums/tt194/allypopper423/Funny-Cat-Green-Avacado.jpg~c200\",",
|
||||||
|
" \"codeNames\": [",
|
||||||
|
" \"Juggernaut\",",
|
||||||
|
" \"Mrs. Wallace\",",
|
||||||
|
" \"Buttercup\"",
|
||||||
|
" ]",
|
||||||
|
" },",
|
||||||
|
" {",
|
||||||
|
" \"id\": 1,",
|
||||||
|
" \"imageLink\": \"http://cdn.grumpycats.com/wp-content/uploads/2012/09/GC-Gravatar-copy.png\",",
|
||||||
|
" \"codeNames\": [",
|
||||||
|
" \"Oscar\",",
|
||||||
|
" \"Scrooge\",",
|
||||||
|
" \"Tyrion\"",
|
||||||
|
" ]",
|
||||||
|
" },",
|
||||||
|
" {",
|
||||||
|
" \"id\": 2,",
|
||||||
|
" \"imageLink\": \"http://www.kittenspet.com/wp-content/uploads/2012/08/cat_with_funny_face_3-200x200.jpg\",",
|
||||||
|
" \"codeNames\": [",
|
||||||
|
" \"The Doctor\",",
|
||||||
|
" \"Loki\",",
|
||||||
|
" \"Joker\"",
|
||||||
|
" ]",
|
||||||
|
" }",
|
||||||
|
"]",
|
||||||
|
"function getAnId(){",
|
||||||
|
" return();",
|
||||||
|
"}",
|
||||||
|
"fcces"
|
||||||
|
],
|
||||||
|
"challengeType": 0,
|
||||||
|
"type": "waypoint"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "bad87fee1348bd9aeca08826",
|
"id": "bad87fee1348bd9aeca08826",
|
||||||
"title": "Learn how JSON works",
|
"title": "Displaying JSON data in HTML",
|
||||||
"difficulty": 3.19,
|
"difficulty": 3.19,
|
||||||
"description": [
|
"description": [
|
||||||
"JSON stands for \"JavaScript Object Notation\". It\"s how you create objects in JavaScript.",
|
"JSON stands for \"JavaScript Object Notation\". It\"s how you create objects in JavaScript.",
|
||||||
@ -272,52 +326,6 @@
|
|||||||
"type": "waypoint"
|
"type": "waypoint"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad87fee1348bd9aebc08726",
|
|
||||||
"title": "Learn how JSON Works",
|
|
||||||
"description": [
|
|
||||||
"JSON stands for \"JavaScript Object Notation\". It\"s how you create objects in JavaScript.",
|
|
||||||
"JSON is a series of \"key-value pairs\". Everything on the left of the colon (<code>:</code>) is the \"key\" you use to unlock the \"value\" on the right of the colon."
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"[",
|
|
||||||
" {",
|
|
||||||
" \"id\": 0,",
|
|
||||||
" \"imageLink\": \"http://rs611.pbsrc.com/albums/tt194/allypopper423/Funny-Cat-Green-Avacado.jpg~c200\",",
|
|
||||||
" \"codeNames\": [",
|
|
||||||
" \"Juggernaut\",",
|
|
||||||
" \"Mrs. Wallace\",",
|
|
||||||
" \"Buttercup\"",
|
|
||||||
" ]",
|
|
||||||
" },",
|
|
||||||
" {",
|
|
||||||
" \"id\": 1,",
|
|
||||||
" \"imageLink\": \"http://cdn.grumpycats.com/wp-content/uploads/2012/09/GC-Gravatar-copy.png\",",
|
|
||||||
" \"codeNames\": [",
|
|
||||||
" \"Oscar\",",
|
|
||||||
" \"Scrooge\",",
|
|
||||||
" \"Tyrion\"",
|
|
||||||
" ]",
|
|
||||||
" },",
|
|
||||||
" {",
|
|
||||||
" \"id\": 2,",
|
|
||||||
" \"imageLink\": \"http://www.kittenspet.com/wp-content/uploads/2012/08/cat_with_funny_face_3-200x200.jpg\",",
|
|
||||||
" \"codeNames\": [",
|
|
||||||
" \"The Doctor\",",
|
|
||||||
" \"Loki\",",
|
|
||||||
" \"Joker\"",
|
|
||||||
" ]",
|
|
||||||
" }",
|
|
||||||
"]"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": "bad87fee1348bd9aebc08826",
|
"id": "bad87fee1348bd9aebc08826",
|
||||||
"title": "Get Data from an URL Using jQuery",
|
"title": "Get Data from an URL Using jQuery",
|
||||||
|
@ -49,7 +49,7 @@ block content
|
|||||||
var userLoggedIn = true;
|
var userLoggedIn = true;
|
||||||
else
|
else
|
||||||
.button-spacer
|
.button-spacer
|
||||||
a.btn.signup-btn.btn-block.btn-block.negative-15(href='/login') Sign in so you can save your progress
|
a.btn.signup-btn.btn-block.btn-block(href='/login') Sign in so you can save your progress
|
||||||
script.
|
script.
|
||||||
var userLoggedIn = false;
|
var userLoggedIn = false;
|
||||||
.button-spacer
|
.button-spacer
|
||||||
|
@ -74,7 +74,7 @@ block content
|
|||||||
.col-xs-10.col-xs-offset-1.col-sm-8.col-sm-offset-2.col-md-8.col-md-offset-2.animated.fadeIn
|
.col-xs-10.col-xs-offset-1.col-sm-8.col-sm-offset-2.col-md-8.col-md-offset-2.animated.fadeIn
|
||||||
// extra field to distract password tools like lastpass from injecting css into our username field
|
// extra field to distract password tools like lastpass from injecting css into our username field
|
||||||
input.form-control(ng-show="false")
|
input.form-control(ng-show="false")
|
||||||
if (challengeType === 3)
|
if (challengeType === "3")
|
||||||
input.form-control#public-url(type='url', name="solutionUrl", placeholder="http://codepen.io/your-pen-here", autofocus, required, ng-minlength="10", ng-model="deploymentUrl")
|
input.form-control#public-url(type='url', name="solutionUrl", placeholder="http://codepen.io/your-pen-here", autofocus, required, ng-minlength="10", ng-model="deploymentUrl")
|
||||||
else
|
else
|
||||||
input.form-control#public-url(type='url', name="solutionUrl", placeholder="http://yourapp.com", autofocus, required, ng-minlength="10", ng-model="deploymentUrl")
|
input.form-control#public-url(type='url', name="solutionUrl", placeholder="http://yourapp.com", autofocus, required, ng-minlength="10", ng-model="deploymentUrl")
|
||||||
|
@ -18,8 +18,9 @@
|
|||||||
.modal-header.challenge-list-header Did you find a bug?
|
.modal-header.challenge-list-header Did you find a bug?
|
||||||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||||
.modal-body.text-center
|
.modal-body.text-center
|
||||||
h3 This will open our GitHub Issues page.
|
h3 Before you submit a new issue, read "Help I've Found a Bug" and browse other issues with this challenge.
|
||||||
h3 Please tell us how to reproduce the bug and link us to screenshots if possible.
|
a.btn.btn-lg.btn-success.btn-block#help-ive-found-a-bug-wiki-article(name='_csrf', value=_csrf) Read "Help I've Found a Bug"
|
||||||
|
a.btn.btn-lg.btn-success.btn-block#search-issue(name='_csrf', value=_csrf) Browse other issues with this challenge
|
||||||
a.btn.btn-lg.btn-primary.btn-block#report-issue(name='_csrf', value=_csrf) Create my GitHub issue
|
a.btn.btn-lg.btn-primary.btn-block#report-issue(name='_csrf', value=_csrf) Create my GitHub issue
|
||||||
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user