make one page profile with bonfire solution urls
This commit is contained in:
@ -7,6 +7,6 @@ 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 `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.
|
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` would 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.
|
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 summary 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).
|
7. Once your code is ready, submit a [pull request](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Pull-Request-Contribute) 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).
|
||||||
|
14
README.md
14
README.md
@ -7,7 +7,7 @@
|
|||||||
Welcome to Free Code Camp's open source codebase!
|
Welcome to Free Code Camp's open source codebase!
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
Free Code Camp is an open-source community of busy people who learn to code, then build projects for nonprofits.
|
Free Code Camp is an open-source community of busy people who learn to code and build projects for nonprofits.
|
||||||
|
|
||||||
Our campers (students) start by working through our free, self-paced, browser-based curriculum. Next, they build several practice projects. Finally, we pair two campers together with a stakeholder from a nonprofit organization, and help them build the solution the nonprofit has requested.
|
Our campers (students) start by working through our free, self-paced, browser-based curriculum. Next, they build several practice projects. Finally, we pair two campers together with a stakeholder from a nonprofit organization, and help them build the solution the nonprofit has requested.
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ This code is running live at [FreeCodeCamp.com](http://www.FreeCodeCamp.com). We
|
|||||||
Wiki
|
Wiki
|
||||||
------------
|
------------
|
||||||
|
|
||||||
We would love your help expanding our [wiki](https://github.com/freecodecamp/freecodecamp/wiki) with more information about learning to code and getting a coding job.
|
We would love your help expanding our [wiki](https://github.com/freecodecamp/freecodecamp/wiki). Our goal is to become a great resource for people learning to code, building local coding communities, and applying for coding jobs.
|
||||||
|
|
||||||
Contributing
|
Contributing
|
||||||
------------
|
------------
|
||||||
@ -35,9 +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 `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.
|
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` would 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.
|
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 summary 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).
|
7. Once your code is ready, submit a [pull request](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Pull-Request-Contribute) 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).
|
||||||
|
|
||||||
Prerequisites
|
Prerequisites
|
||||||
-------------
|
-------------
|
||||||
@ -110,8 +110,8 @@ DEBUG=true
|
|||||||
# Start the mongo server
|
# Start the mongo server
|
||||||
mongod
|
mongod
|
||||||
|
|
||||||
# Create your mongo database.
|
# Create your mongo database.
|
||||||
# Type "mongo" in your terminal to access the mongo shell
|
# Type "mongo" in your terminal to access the mongo shell
|
||||||
use freecodecamp
|
use freecodecamp
|
||||||
# Exit the mongo shell with control + d
|
# Exit the mongo shell with control + d
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
"moment": "~2.10.2",
|
"moment": "~2.10.2",
|
||||||
"angular-bootstrap": "~0.13.0",
|
"angular-bootstrap": "~0.13.0",
|
||||||
"ramda": "~0.13.0",
|
"ramda": "~0.13.0",
|
||||||
"jshint": "~2.7.0"
|
"jshint": "~2.7.0",
|
||||||
|
"lightbox2": "~2.8.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
2
client/es6-shims.js
Normal file
2
client/es6-shims.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
require('object.assign').shim();
|
||||||
|
require('es6-map/implement');
|
@ -1,9 +1,10 @@
|
|||||||
|
import unused from './es6-shims'; // eslint-disable-line
|
||||||
import Rx from 'rx';
|
import Rx from 'rx';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Fetchr from 'fetchr';
|
import Fetchr from 'fetchr';
|
||||||
import debugFactory from 'debug';
|
import debugFactory from 'debug';
|
||||||
import { Router } from 'react-router';
|
import { Router } from 'react-router';
|
||||||
import { history } from 'react-router/lib/BrowserHistory';
|
import { createLocation, createHistory } from 'history';
|
||||||
import { hydrate } from 'thundercats';
|
import { hydrate } from 'thundercats';
|
||||||
import { Render } from 'thundercats-react';
|
import { Render } from 'thundercats-react';
|
||||||
|
|
||||||
@ -17,21 +18,29 @@ const services = new Fetchr({
|
|||||||
});
|
});
|
||||||
|
|
||||||
Rx.config.longStackSupport = !!debug.enabled;
|
Rx.config.longStackSupport = !!debug.enabled;
|
||||||
|
const history = createHistory();
|
||||||
|
const appLocation = createLocation(
|
||||||
|
location.pathname + location.search
|
||||||
|
);
|
||||||
// returns an observable
|
// returns an observable
|
||||||
app$(history)
|
app$({ history, location: appLocation })
|
||||||
.flatMap(
|
.flatMap(
|
||||||
({ AppCat }) => {
|
({ AppCat }) => {
|
||||||
|
// instantiate the cat with service
|
||||||
const appCat = AppCat(null, services);
|
const appCat = AppCat(null, services);
|
||||||
|
// hydrate the stores
|
||||||
return hydrate(appCat, catState)
|
return hydrate(appCat, catState)
|
||||||
.map(() => appCat);
|
.map(() => appCat);
|
||||||
},
|
},
|
||||||
({ initialState }, appCat) => ({ initialState, appCat })
|
// not using nextLocation at the moment but will be used for
|
||||||
|
// redirects in the future
|
||||||
|
({ nextLocation, props }, appCat) => ({ nextLocation, props, appCat })
|
||||||
)
|
)
|
||||||
.flatMap(({ initialState, appCat }) => {
|
.flatMap(({ props, appCat }) => {
|
||||||
|
props.history = history;
|
||||||
return Render(
|
return Render(
|
||||||
appCat,
|
appCat,
|
||||||
React.createElement(Router, initialState),
|
React.createElement(Router, props),
|
||||||
DOMContianer
|
DOMContianer
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
@border-radius-small: 3px;
|
@border-radius-small: 3px;
|
||||||
|
|
||||||
//** Global color for active items (e.g., navs or dropdowns).
|
//** Global color for active items (e.g., navs or dropdowns).
|
||||||
@component-active-color: #eee;
|
@component-active-color: @gray-lighter;
|
||||||
//** Global background color for active items (e.g., navs or dropdowns).
|
//** Global background color for active items (e.g., navs or dropdowns).
|
||||||
@component-active-bg: @brand-primary;
|
@component-active-bg: @brand-primary;
|
||||||
|
|
||||||
@ -145,26 +145,26 @@
|
|||||||
@btn-font-weight: normal;
|
@btn-font-weight: normal;
|
||||||
|
|
||||||
@btn-default-color: #333;
|
@btn-default-color: #333;
|
||||||
@btn-default-bg: #eee;
|
@btn-default-bg: @gray-lighter;
|
||||||
@btn-default-border: #ccc;
|
@btn-default-border: #ccc;
|
||||||
|
|
||||||
@btn-primary-color: #eee;
|
@btn-primary-color: @gray-lighter;
|
||||||
@btn-primary-bg: @brand-primary;
|
@btn-primary-bg: @brand-primary;
|
||||||
@btn-primary-border: darken(@btn-primary-bg, 5%);
|
@btn-primary-border: darken(@btn-primary-bg, 5%);
|
||||||
|
|
||||||
@btn-success-color: #eee;
|
@btn-success-color: @gray-lighter;
|
||||||
@btn-success-bg: @brand-success;
|
@btn-success-bg: @brand-success;
|
||||||
@btn-success-border: darken(@btn-success-bg, 5%);
|
@btn-success-border: darken(@btn-success-bg, 5%);
|
||||||
|
|
||||||
@btn-info-color: #eee;
|
@btn-info-color: @gray-lighter;
|
||||||
@btn-info-bg: @brand-info;
|
@btn-info-bg: @brand-info;
|
||||||
@btn-info-border: darken(@btn-info-bg, 5%);
|
@btn-info-border: darken(@btn-info-bg, 5%);
|
||||||
|
|
||||||
@btn-warning-color: #eee;
|
@btn-warning-color: @gray-lighter;
|
||||||
@btn-warning-bg: @brand-warning;
|
@btn-warning-bg: @brand-warning;
|
||||||
@btn-warning-border: darken(@btn-warning-bg, 5%);
|
@btn-warning-border: darken(@btn-warning-bg, 5%);
|
||||||
|
|
||||||
@btn-danger-color: #eee;
|
@btn-danger-color: @gray-lighter;
|
||||||
@btn-danger-bg: @brand-danger;
|
@btn-danger-bg: @brand-danger;
|
||||||
@btn-danger-border: darken(@btn-danger-bg, 5%);
|
@btn-danger-border: darken(@btn-danger-bg, 5%);
|
||||||
|
|
||||||
@ -176,7 +176,7 @@
|
|||||||
//##
|
//##
|
||||||
|
|
||||||
//** `<input>` background color
|
//** `<input>` background color
|
||||||
@input-bg: #eee;
|
@input-bg: @gray-lighter;
|
||||||
//** `<input disabled>` background color
|
//** `<input disabled>` background color
|
||||||
@input-bg-disabled: @gray-lighter;
|
@input-bg-disabled: @gray-lighter;
|
||||||
|
|
||||||
@ -223,7 +223,7 @@
|
|||||||
//## Dropdown menu container and contents.
|
//## Dropdown menu container and contents.
|
||||||
|
|
||||||
//** Background for the dropdown menu.
|
//** Background for the dropdown menu.
|
||||||
@dropdown-bg: #eee;
|
@dropdown-bg: @gray-lighter;
|
||||||
//** Dropdown menu `border-color`.
|
//** Dropdown menu `border-color`.
|
||||||
@dropdown-border: rgba(0,0,0,.15);
|
@dropdown-border: rgba(0,0,0,.15);
|
||||||
//** Dropdown menu `border-color` **for IE8**.
|
//** Dropdown menu `border-color` **for IE8**.
|
||||||
@ -359,10 +359,10 @@
|
|||||||
@navbar-default-border: darken(@navbar-default-bg, 6.5%);
|
@navbar-default-border: darken(@navbar-default-bg, 6.5%);
|
||||||
|
|
||||||
// Navbar links
|
// Navbar links
|
||||||
@navbar-default-link-color: #eee;
|
@navbar-default-link-color: @gray-lighter;
|
||||||
@navbar-default-link-hover-color: #4a2b0f;
|
@navbar-default-link-hover-color: #4a2b0f;
|
||||||
@navbar-default-link-hover-bg: #eee;
|
@navbar-default-link-hover-bg: @gray-lighter;
|
||||||
@navbar-default-link-active-color: #eee;
|
@navbar-default-link-active-color: @gray-lighter;
|
||||||
@navbar-default-link-active-bg: darken(@navbar-default-bg, 6.5%);
|
@navbar-default-link-active-bg: darken(@navbar-default-bg, 6.5%);
|
||||||
@navbar-default-link-disabled-color: #ccc;
|
@navbar-default-link-disabled-color: #ccc;
|
||||||
@navbar-default-link-disabled-bg: transparent;
|
@navbar-default-link-disabled-bg: transparent;
|
||||||
@ -386,7 +386,7 @@
|
|||||||
|
|
||||||
// Inverted navbar links
|
// Inverted navbar links
|
||||||
@navbar-inverse-link-color: @gray-light;
|
@navbar-inverse-link-color: @gray-light;
|
||||||
@navbar-inverse-link-hover-color: #eee;
|
@navbar-inverse-link-hover-color: @gray-lighter;
|
||||||
@navbar-inverse-link-hover-bg: transparent;
|
@navbar-inverse-link-hover-bg: transparent;
|
||||||
@navbar-inverse-link-active-color: @navbar-inverse-link-hover-color;
|
@navbar-inverse-link-active-color: @navbar-inverse-link-hover-color;
|
||||||
@navbar-inverse-link-active-bg: darken(@navbar-inverse-bg, 10%);
|
@navbar-inverse-link-active-bg: darken(@navbar-inverse-bg, 10%);
|
||||||
@ -395,12 +395,12 @@
|
|||||||
|
|
||||||
// Inverted navbar brand label
|
// Inverted navbar brand label
|
||||||
@navbar-inverse-brand-color: @navbar-inverse-link-color;
|
@navbar-inverse-brand-color: @navbar-inverse-link-color;
|
||||||
@navbar-inverse-brand-hover-color: #eee;
|
@navbar-inverse-brand-hover-color: @gray-lighter;
|
||||||
@navbar-inverse-brand-hover-bg: transparent;
|
@navbar-inverse-brand-hover-bg: transparent;
|
||||||
|
|
||||||
// Inverted navbar toggle
|
// Inverted navbar toggle
|
||||||
@navbar-inverse-toggle-hover-bg: #333;
|
@navbar-inverse-toggle-hover-bg: #333;
|
||||||
@navbar-inverse-toggle-icon-bar-bg: #eee;
|
@navbar-inverse-toggle-icon-bar-bg: @gray-lighter;
|
||||||
@navbar-inverse-toggle-border-color: #333;
|
@navbar-inverse-toggle-border-color: #333;
|
||||||
|
|
||||||
|
|
||||||
@ -415,7 +415,7 @@
|
|||||||
@nav-disabled-link-color: @gray-light;
|
@nav-disabled-link-color: @gray-light;
|
||||||
@nav-disabled-link-hover-color: @gray-light;
|
@nav-disabled-link-hover-color: @gray-light;
|
||||||
|
|
||||||
@nav-open-link-hover-color: #eee;
|
@nav-open-link-hover-color: @gray-lighter;
|
||||||
|
|
||||||
//== Tabs
|
//== Tabs
|
||||||
@nav-tabs-border-color: #ddd;
|
@nav-tabs-border-color: #ddd;
|
||||||
@ -440,19 +440,19 @@
|
|||||||
//##
|
//##
|
||||||
|
|
||||||
@pagination-color: @link-color;
|
@pagination-color: @link-color;
|
||||||
@pagination-bg: #eee;
|
@pagination-bg: @gray-lighter;
|
||||||
@pagination-border: #ddd;
|
@pagination-border: #ddd;
|
||||||
|
|
||||||
@pagination-hover-color: @link-hover-color;
|
@pagination-hover-color: @link-hover-color;
|
||||||
@pagination-hover-bg: @gray-lighter;
|
@pagination-hover-bg: @gray-lighter;
|
||||||
@pagination-hover-border: #ddd;
|
@pagination-hover-border: #ddd;
|
||||||
|
|
||||||
@pagination-active-color: #eee;
|
@pagination-active-color: @gray-lighter;
|
||||||
@pagination-active-bg: @brand-primary;
|
@pagination-active-bg: @brand-primary;
|
||||||
@pagination-active-border: @brand-primary;
|
@pagination-active-border: @brand-primary;
|
||||||
|
|
||||||
@pagination-disabled-color: @gray-light;
|
@pagination-disabled-color: @gray-light;
|
||||||
@pagination-disabled-bg: #eee;
|
@pagination-disabled-bg: @gray-lighter;
|
||||||
@pagination-disabled-border: #ddd;
|
@pagination-disabled-border: #ddd;
|
||||||
|
|
||||||
|
|
||||||
@ -511,7 +511,7 @@
|
|||||||
//** Tooltip max width
|
//** Tooltip max width
|
||||||
@tooltip-max-width: 200px;
|
@tooltip-max-width: 200px;
|
||||||
//** Tooltip text color
|
//** Tooltip text color
|
||||||
@tooltip-color: #eee;
|
@tooltip-color: @gray-lighter;
|
||||||
//** Tooltip background color
|
//** Tooltip background color
|
||||||
@tooltip-bg: #000;
|
@tooltip-bg: #000;
|
||||||
@tooltip-opacity: .9;
|
@tooltip-opacity: .9;
|
||||||
@ -527,7 +527,7 @@
|
|||||||
//##
|
//##
|
||||||
|
|
||||||
//** Popover body background color
|
//** Popover body background color
|
||||||
@popover-bg: #eee;
|
@popover-bg: @gray-lighter;
|
||||||
//** Popover maximum width
|
//** Popover maximum width
|
||||||
@popover-max-width: 276px;
|
@popover-max-width: 276px;
|
||||||
//** Popover border color
|
//** Popover border color
|
||||||
@ -541,7 +541,7 @@
|
|||||||
//** Popover arrow width
|
//** Popover arrow width
|
||||||
@popover-arrow-width: 10px;
|
@popover-arrow-width: 10px;
|
||||||
//** Popover arrow color
|
//** Popover arrow color
|
||||||
@popover-arrow-color: #eee;
|
@popover-arrow-color: @gray-lighter;
|
||||||
@popover-arrow-color: @popover-bg;
|
@popover-arrow-color: @popover-bg;
|
||||||
|
|
||||||
//** Popover outer arrow width
|
//** Popover outer arrow width
|
||||||
@ -570,9 +570,9 @@
|
|||||||
@label-danger-bg: @brand-danger;
|
@label-danger-bg: @brand-danger;
|
||||||
|
|
||||||
//** Default label text color
|
//** Default label text color
|
||||||
@label-color: #eee;
|
@label-color: @gray-lighter;
|
||||||
//** Default text color of a linked label
|
//** Default text color of a linked label
|
||||||
@label-link-hover-color: #eee;
|
@label-link-hover-color: @gray-lighter;
|
||||||
|
|
||||||
|
|
||||||
//== Modals
|
//== Modals
|
||||||
@ -588,7 +588,7 @@
|
|||||||
@modal-title-line-height: @line-height-base;
|
@modal-title-line-height: @line-height-base;
|
||||||
|
|
||||||
//** Background color of modal content area
|
//** Background color of modal content area
|
||||||
@modal-content-bg: #eee;
|
@modal-content-bg: @gray-lighter;
|
||||||
//** Modal content border color
|
//** Modal content border color
|
||||||
@modal-content-border-color: rgba(0,0,0,.2);
|
@modal-content-border-color: rgba(0,0,0,.2);
|
||||||
//** Modal content border color **for IE8**
|
//** Modal content border color **for IE8**
|
||||||
@ -640,7 +640,7 @@
|
|||||||
//** Background color of the whole progress component
|
//** Background color of the whole progress component
|
||||||
@progress-bg: #f5f5f5;
|
@progress-bg: #f5f5f5;
|
||||||
//** Progress bar text color
|
//** Progress bar text color
|
||||||
@progress-bar-color: #eee;
|
@progress-bar-color: @gray-lighter;
|
||||||
|
|
||||||
//** Variable for setting rounded corners on progress bar.
|
//** Variable for setting rounded corners on progress bar.
|
||||||
@progress-border-radius: @border-radius-base;
|
@progress-border-radius: @border-radius-base;
|
||||||
@ -662,7 +662,7 @@
|
|||||||
//##
|
//##
|
||||||
|
|
||||||
//** Background color on `.list-group-item`
|
//** Background color on `.list-group-item`
|
||||||
@list-group-bg: #eee;
|
@list-group-bg: @gray-lighter;
|
||||||
//** `.list-group-item` border color
|
//** `.list-group-item` border color
|
||||||
@list-group-border: #ddd;
|
@list-group-border: #ddd;
|
||||||
//** List group border radius
|
//** List group border radius
|
||||||
@ -695,7 +695,7 @@
|
|||||||
//
|
//
|
||||||
//##
|
//##
|
||||||
|
|
||||||
@panel-bg: #eee;
|
@panel-bg: @gray-lighter;
|
||||||
@panel-body-padding: 15px;
|
@panel-body-padding: 15px;
|
||||||
@panel-heading-padding: 10px 15px;
|
@panel-heading-padding: 10px 15px;
|
||||||
@panel-footer-padding: @panel-heading-padding;
|
@panel-footer-padding: @panel-heading-padding;
|
||||||
@ -709,7 +709,7 @@
|
|||||||
@panel-default-border: #ddd;
|
@panel-default-border: #ddd;
|
||||||
@panel-default-heading-bg: #f5f5f5;
|
@panel-default-heading-bg: #f5f5f5;
|
||||||
|
|
||||||
@panel-primary-text: #eee;
|
@panel-primary-text: @gray-lighter;
|
||||||
@panel-primary-border: @brand-primary;
|
@panel-primary-border: @brand-primary;
|
||||||
@panel-primary-heading-bg: @brand-primary;
|
@panel-primary-heading-bg: @brand-primary;
|
||||||
|
|
||||||
@ -717,7 +717,7 @@
|
|||||||
@panel-success-border: @state-success-border;
|
@panel-success-border: @state-success-border;
|
||||||
@panel-success-heading-bg: @state-success-bg;
|
@panel-success-heading-bg: @state-success-bg;
|
||||||
|
|
||||||
@panel-info-text: #eee;
|
@panel-info-text: @gray-lighter;
|
||||||
@panel-info-border: darken(#4a2b0f, 5%);
|
@panel-info-border: darken(#4a2b0f, 5%);
|
||||||
@panel-info-heading-bg: #4a2b0f;
|
@panel-info-heading-bg: #4a2b0f;
|
||||||
|
|
||||||
@ -761,15 +761,15 @@
|
|||||||
//
|
//
|
||||||
//##
|
//##
|
||||||
|
|
||||||
@badge-color: #eee;
|
@badge-color: @gray-lighter;
|
||||||
//** Linked badge text color on hover
|
//** Linked badge text color on hover
|
||||||
@badge-link-hover-color: #eee;
|
@badge-link-hover-color: @gray-lighter;
|
||||||
@badge-bg: @gray-light;
|
@badge-bg: @gray-light;
|
||||||
|
|
||||||
//** Badge text color in active nav link
|
//** Badge text color in active nav link
|
||||||
@badge-active-color: @link-color;
|
@badge-active-color: @link-color;
|
||||||
//** Badge background color in active nav link
|
//** Badge background color in active nav link
|
||||||
@badge-active-bg: #eee;
|
@badge-active-bg: @gray-lighter;
|
||||||
|
|
||||||
@badge-font-weight: bold;
|
@badge-font-weight: bold;
|
||||||
@badge-line-height: 1;
|
@badge-line-height: 1;
|
||||||
@ -798,15 +798,15 @@
|
|||||||
|
|
||||||
@carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6);
|
@carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6);
|
||||||
|
|
||||||
@carousel-control-color: #eee;
|
@carousel-control-color: @gray-lighter;
|
||||||
@carousel-control-width: 15%;
|
@carousel-control-width: 15%;
|
||||||
@carousel-control-opacity: .5;
|
@carousel-control-opacity: .5;
|
||||||
@carousel-control-font-size: 20px;
|
@carousel-control-font-size: 20px;
|
||||||
|
|
||||||
@carousel-indicator-active-bg: #eee;
|
@carousel-indicator-active-bg: @gray-lighter;
|
||||||
@carousel-indicator-border-color: #eee;
|
@carousel-indicator-border-color: @gray-lighter;
|
||||||
|
|
||||||
@carousel-caption-color: #eee;
|
@carousel-caption-color: @gray-lighter;
|
||||||
|
|
||||||
|
|
||||||
//== Close
|
//== Close
|
||||||
@ -815,7 +815,7 @@
|
|||||||
|
|
||||||
@close-font-weight: bold;
|
@close-font-weight: bold;
|
||||||
@close-color: #000;
|
@close-color: #000;
|
||||||
@close-text-shadow: 0 1px 0 #eee;
|
@close-text-shadow: 0 1px 0 @gray-lighter;
|
||||||
|
|
||||||
|
|
||||||
//== Code
|
//== Code
|
||||||
@ -825,7 +825,7 @@
|
|||||||
@code-color: #c7254e;
|
@code-color: #c7254e;
|
||||||
@code-bg: #f9f2f4;
|
@code-bg: #f9f2f4;
|
||||||
|
|
||||||
@kbd-color: #eee;
|
@kbd-color: @gray-lighter;
|
||||||
@kbd-bg: #333;
|
@kbd-bg: #333;
|
||||||
|
|
||||||
@pre-bg: #f5f5f5;
|
@pre-bg: #f5f5f5;
|
||||||
|
@ -37,8 +37,7 @@ html {
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type=checkbox]
|
input[type=checkbox] {
|
||||||
{
|
|
||||||
/* Double-sized Checkboxes */
|
/* Double-sized Checkboxes */
|
||||||
-ms-transform: scale(2); /* IE */
|
-ms-transform: scale(2); /* IE */
|
||||||
-moz-transform: scale(2); /* FF */
|
-moz-transform: scale(2); /* FF */
|
||||||
@ -48,7 +47,7 @@ input[type=checkbox]
|
|||||||
}
|
}
|
||||||
|
|
||||||
body.full-screen-body-background {
|
body.full-screen-body-background {
|
||||||
background-color: #eeeeee;
|
background-color: @gray-lighter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -101,24 +100,10 @@ h1, h2, h3, h4, h5, h6, p, li {
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.three-by-three {
|
|
||||||
height: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.darker-background {
|
|
||||||
background-color: #dedede;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**/
|
|
||||||
|
|
||||||
.btn-cta {
|
.btn-cta {
|
||||||
font-size: 40px;
|
font-size: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nonprofit-cta {
|
|
||||||
font-size: 28px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn, .shadow {
|
.btn, .shadow {
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
-webkit-box-shadow: 2px 4px 1px rgba(0, 0, 0, 0.3);
|
-webkit-box-shadow: 2px 4px 1px rgba(0, 0, 0, 0.3);
|
||||||
@ -142,25 +127,6 @@ ul {
|
|||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img-center {
|
|
||||||
margin:0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.centered-iframe {
|
|
||||||
display:block;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 767px) {
|
|
||||||
.landing-panel-body {
|
|
||||||
padding-left: 40px;
|
|
||||||
padding-right: 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing-panel-heading {
|
|
||||||
font-size: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-heading {
|
.panel-heading {
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
}
|
}
|
||||||
@ -175,14 +141,6 @@ ul {
|
|||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.five-pixel-break {
|
|
||||||
height: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fifteen-pixel-break {
|
|
||||||
height: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-height {
|
.nav-height {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
border: none;
|
border: none;
|
||||||
@ -193,55 +151,34 @@ ul {
|
|||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.completion-icon{
|
.completion-icon {
|
||||||
font-size: 150px;
|
font-size: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.responsive-container { position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden; }
|
|
||||||
.responsive-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
|
||||||
|
|
||||||
.positive-10 {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.positive-15-bottom {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.positive-15 {
|
.positive-15 {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.negative-45 {
|
.positive-15-bottom {
|
||||||
margin-top: -45px;
|
margin-bottom: 15px;
|
||||||
margin-bottom: -45px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.negative-55 {
|
.positive-10 {
|
||||||
margin-top: -55px;
|
margin-top: 10px;
|
||||||
margin-bottom: -55px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.negative-10 {
|
.positive-5 {
|
||||||
margin-top: -10px;
|
margin-top: 5px;
|
||||||
}
|
|
||||||
|
|
||||||
.negative-28 {
|
|
||||||
margin-top: -28px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.negative-35 {
|
|
||||||
margin-top: -35px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.negative-30 {
|
|
||||||
margin-top: -30px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.negative-5 {
|
.negative-5 {
|
||||||
margin-top: -5px;
|
margin-top: -5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.negative-10 {
|
||||||
|
margin-top: -10px;
|
||||||
|
}
|
||||||
|
|
||||||
.negative-15 {
|
.negative-15 {
|
||||||
margin-top: -15px;
|
margin-top: -15px;
|
||||||
}
|
}
|
||||||
@ -250,14 +187,35 @@ ul {
|
|||||||
margin-top: -20px;
|
margin-top: -20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.negative-bottom-margin-30 {
|
.negative-28 {
|
||||||
|
margin-top: -28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.negative-30 {
|
||||||
|
margin-top: -30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.negative-30-bottom {
|
||||||
margin-bottom: -30px;
|
margin-bottom: -30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.negative-35 {
|
||||||
|
margin-top: -35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.negative-55 {
|
||||||
|
margin-top: -55px;
|
||||||
|
margin-bottom: -55px;
|
||||||
|
}
|
||||||
|
|
||||||
.large-p {
|
.large-p {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.map-p {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.large-li {
|
.large-li {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
@ -270,36 +228,11 @@ ul {
|
|||||||
color: @brand-success;
|
color: @brand-success;
|
||||||
}
|
}
|
||||||
|
|
||||||
.delay-1 {
|
|
||||||
-webkit-animation-delay: 1s;
|
|
||||||
animation-delay: 1s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.delay-2 {
|
|
||||||
-webkit-animation-delay: 2s;
|
|
||||||
animation-delay: 2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.delay-4 {
|
|
||||||
-webkit-animation-delay: 4s;
|
|
||||||
animation-delay: 4s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.delay-10 {
|
|
||||||
-webkit-animation-delay: 10s;
|
|
||||||
animation-delay: 10s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fast-animation {
|
.fast-animation {
|
||||||
-webkit-animation-duration: 0.5s;
|
-webkit-animation-duration: 0.5s;
|
||||||
animation-duration: 0.5s;
|
animation-duration: 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slow-animation {
|
|
||||||
-webkit-animation-duration: 1.5s;
|
|
||||||
animation-duration: 1.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.disabled {
|
.disabled {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
@ -310,10 +243,6 @@ ul {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-container {
|
|
||||||
height: 120px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-logo {
|
.nav-logo {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
margin-top: -10px;
|
margin-top: -10px;
|
||||||
@ -329,7 +258,7 @@ ul {
|
|||||||
}
|
}
|
||||||
@media (max-width: 991px) and (min-width: 768px) {
|
@media (max-width: 991px) and (min-width: 768px) {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right:0;
|
right: 0;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
@ -346,8 +275,8 @@ ul {
|
|||||||
|
|
||||||
.thin-progress-bar {
|
.thin-progress-bar {
|
||||||
height: 8px;
|
height: 8px;
|
||||||
margin-top:3px;
|
margin-top: 3px;
|
||||||
margin-bottom:0px;
|
margin-bottom: 0px;
|
||||||
width: 60%;
|
width: 60%;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
@ -357,8 +286,8 @@ ul {
|
|||||||
margin-bottom: -6px;
|
margin-bottom: -6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.strikethrough {
|
.lb-container {
|
||||||
text-decoration: line-through;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-social {
|
.btn-social {
|
||||||
@ -377,7 +306,7 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.navbar-nav > li > a {
|
.navbar-nav > li > a {
|
||||||
color: #eee;
|
color: @gray-lighter;
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #4a2b0f;
|
color: #4a2b0f;
|
||||||
}
|
}
|
||||||
@ -396,11 +325,6 @@ ul {
|
|||||||
font-size: 63px;
|
font-size: 63px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scroll-lock {
|
|
||||||
overflow: hidden;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.signup-btn.btn {
|
.signup-btn.btn {
|
||||||
background-color: #ffac33;
|
background-color: #ffac33;
|
||||||
background-image: linear-gradient(#ffcc4d, #ffac33);
|
background-image: linear-gradient(#ffcc4d, #ffac33);
|
||||||
@ -421,41 +345,9 @@ ul {
|
|||||||
background-image: none;
|
background-image: none;
|
||||||
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
|
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
.profile-image {
|
|
||||||
border-radius: 5px;
|
|
||||||
width: 200px;
|
|
||||||
height: 200px;
|
|
||||||
padding-left: 5px;
|
|
||||||
padding-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.team-member {
|
*, *:before, *:after {
|
||||||
height: 420px;
|
box-sizing: border-box !important;
|
||||||
}
|
|
||||||
|
|
||||||
*, *:before, *:after {box-sizing: border-box !important;}
|
|
||||||
|
|
||||||
.masonry-row {
|
|
||||||
-moz-column-width: 18em;
|
|
||||||
-webkit-column-width: 18em;
|
|
||||||
-moz-column-gap: 1em;
|
|
||||||
-webkit-column-gap:1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.masonry-block {
|
|
||||||
display: inline-block;
|
|
||||||
padding: .25rem;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.masonry-relative {
|
|
||||||
position:relative;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.next-challenge-button {
|
|
||||||
max-width: 1500px;
|
|
||||||
margin:0 auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-big {
|
.btn-big {
|
||||||
@ -505,13 +397,13 @@ thead {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.navbar-nav a {
|
.navbar-nav a {
|
||||||
color: #eee;
|
color: @gray-lighter;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
margin-top: -5px;
|
margin-top: -5px;
|
||||||
margin-bottom: -5px;
|
margin-bottom: -5px;
|
||||||
}
|
}
|
||||||
.navbar-toggle {
|
.navbar-toggle {
|
||||||
color: #eee;
|
color: @gray-lighter;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-right {
|
.navbar-right {
|
||||||
@ -520,16 +412,11 @@ thead {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.signup-btn-nav {
|
.signup-btn-nav {
|
||||||
margin-top:-2px !important;
|
margin-top: -2px !important;
|
||||||
padding-top: 10px !important;
|
padding-top: 10px !important;
|
||||||
padding-bottom: 10px !important;
|
padding-bottom: 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nameline {
|
|
||||||
margin-top: -5px;
|
|
||||||
font-size: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.public-profile-img {
|
.public-profile-img {
|
||||||
height: 200px;
|
height: 200px;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
@ -543,23 +430,6 @@ thead {
|
|||||||
border-color: #78FA89;
|
border-color: #78FA89;
|
||||||
}
|
}
|
||||||
|
|
||||||
.desktop-narrow {
|
|
||||||
@media (min-width: 767px) {
|
|
||||||
marign: 0 auto;
|
|
||||||
width: 80%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.min650 {
|
|
||||||
min-height: 630px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.portfolio-image {
|
|
||||||
height: 225px;
|
|
||||||
width: 300px;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flat-top {
|
.flat-top {
|
||||||
margin-top: -5px;
|
margin-top: -5px;
|
||||||
}
|
}
|
||||||
@ -573,7 +443,7 @@ thead {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.points-on-top {
|
.points-on-top {
|
||||||
color: #eee;
|
color: @gray-lighter;
|
||||||
font-size: 35px;
|
font-size: 35px;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
width: 60%;
|
width: 60%;
|
||||||
@ -642,7 +512,7 @@ thead {
|
|||||||
|
|
||||||
.challenge-list-header {
|
.challenge-list-header {
|
||||||
background-color: #215f1e;
|
background-color: #215f1e;
|
||||||
color: #eee;
|
color: @gray-lighter;
|
||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: -30px;
|
margin-bottom: -30px;
|
||||||
@ -650,19 +520,8 @@ thead {
|
|||||||
padding-left: 50px;
|
padding-left: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.all-list-header {
|
|
||||||
background-color: #4A2B0F;
|
|
||||||
color: #eee;
|
|
||||||
font-size: 36px;
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: -30px;
|
|
||||||
border-radius: 5px 5px 0px 0px;
|
|
||||||
padding-left: 50px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.closing-x {
|
.closing-x {
|
||||||
color: #eee;
|
color: @gray-lighter;
|
||||||
font-size: 50px;
|
font-size: 50px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
@ -678,7 +537,7 @@ thead {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
a {
|
a {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
color: #eee;
|
color: @gray-lighter;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
@ -687,7 +546,7 @@ thead {
|
|||||||
padding-bottom: 12px;
|
padding-bottom: 12px;
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #4a2b0f;
|
color: #4a2b0f;
|
||||||
background-color: #eee;
|
background-color: @gray-lighter;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -702,19 +561,6 @@ thead {
|
|||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jquery-exercises-well {
|
|
||||||
text-align: left;
|
|
||||||
height: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#exercise-directory {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#current-exercise {
|
|
||||||
text-size: 250px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bonfire-instructions {
|
.bonfire-instructions {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
@ -770,10 +616,6 @@ form.code span {
|
|||||||
padding-bottom: 0px;
|
padding-bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-bonfire {
|
|
||||||
height: 100%
|
|
||||||
}
|
|
||||||
|
|
||||||
div.CodeMirror-scroll {
|
div.CodeMirror-scroll {
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
}
|
}
|
||||||
@ -812,11 +654,6 @@ iframe.iphone {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.nonprofit-help-select-text-height {
|
|
||||||
font-size: 40px;
|
|
||||||
padding-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// To adjust right margin, negative values bring the image closer to the edge of the screen
|
// To adjust right margin, negative values bring the image closer to the edge of the screen
|
||||||
.iphone-position {
|
.iphone-position {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -829,25 +666,6 @@ iframe.iphone {
|
|||||||
min-height: 650px;
|
min-height: 650px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is used to give icons text for screen readers to read out, without needing the text to actually appear.
|
|
||||||
.icon-lock{
|
|
||||||
font-size: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats-text {
|
|
||||||
font-size: 26px;
|
|
||||||
line-height: 150%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.github-and-twitter-button-text {
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gitter-imbed {
|
|
||||||
height: 100%;
|
|
||||||
margin-bottom: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary-ghost {
|
.btn-primary-ghost {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: @brand-primary;
|
color: @brand-primary;
|
||||||
@ -908,7 +726,7 @@ iframe.iphone {
|
|||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
text-align:left;
|
text-align: left;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -918,38 +736,11 @@ iframe.iphone {
|
|||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tight-h3 {
|
|
||||||
margin-top: -4px;
|
|
||||||
margin-bottom: -4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.story-list {
|
.story-list {
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.big-ion-up-arrow {
|
|
||||||
font-size: 45px;
|
|
||||||
margin-top: -10px;
|
|
||||||
margin-bottom: -15px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.big-ion-up-arrow #upvote, #reply-to-main-post {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.story-up-votes {
|
|
||||||
padding-top: 0px;
|
|
||||||
margin-left: -5px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.img-story-post {
|
|
||||||
max-width: 110px;
|
|
||||||
max-height: 110px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-spacer {
|
.button-spacer {
|
||||||
padding: 5px 0 2px 0;
|
padding: 5px 0 2px 0;
|
||||||
}
|
}
|
||||||
@ -1057,11 +848,7 @@ hr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cal-heatmap-container {
|
.cal-heatmap-container {
|
||||||
background-color: #EEEEEE;
|
background-color: @gray-lighter;
|
||||||
}
|
|
||||||
|
|
||||||
.checkbox-table label {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.interested-camper-image {
|
.interested-camper-image {
|
||||||
@ -1070,16 +857,6 @@ hr {
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.svg-challenge-map {
|
|
||||||
fill: #333;
|
|
||||||
height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.news-number {
|
|
||||||
font-size: 30px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mobile-story-image {
|
.mobile-story-image {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -1101,10 +878,6 @@ hr {
|
|||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.same-line {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.padded-ionic-icon {
|
.padded-ionic-icon {
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
}
|
}
|
||||||
@ -1142,10 +915,6 @@ hr {
|
|||||||
|
|
||||||
// Calculator styles
|
// Calculator styles
|
||||||
|
|
||||||
.initially-hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chart rect {
|
.chart rect {
|
||||||
fill: steelblue;
|
fill: steelblue;
|
||||||
}
|
}
|
||||||
|
143
client/main.js
143
client/main.js
@ -1,14 +1,45 @@
|
|||||||
|
var mapShareKey = 'map-shares';
|
||||||
|
var lastCompleted = typeof lastCompleted !== 'undefined' ?
|
||||||
|
lastCompleted :
|
||||||
|
'';
|
||||||
|
|
||||||
|
function getMapShares() {
|
||||||
|
var alreadyShared = JSON.parse(localStorage.getItem(mapShareKey) || '[]');
|
||||||
|
if (!alreadyShared || !Array.isArray(alreadyShared)) {
|
||||||
|
localStorage.setItem(mapShareKey, JSON.stringify([]));
|
||||||
|
alreadyShared = [];
|
||||||
|
}
|
||||||
|
return alreadyShared;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setMapShare(id) {
|
||||||
|
var alreadyShared = getMapShares();
|
||||||
|
var found = false;
|
||||||
|
alreadyShared.forEach(function(_id) {
|
||||||
|
if (_id === id) {
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!found) {
|
||||||
|
alreadyShared.push(id);
|
||||||
|
}
|
||||||
|
localStorage.setItem(mapShareKey, JSON.stringify(alreadyShared));
|
||||||
|
return alreadyShared;
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var challengeName = typeof challengeName !== undefined ? challengeName : 'Untitled';
|
|
||||||
|
var challengeName = typeof challengeName !== 'undefined' ?
|
||||||
|
challengeName :
|
||||||
|
'Untitled';
|
||||||
|
|
||||||
if (challengeName) {
|
if (challengeName) {
|
||||||
ga('send', 'event', 'Challenge', 'load', challengeName);
|
ga('send', 'event', 'Challenge', 'load', challengeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
if (typeof editor !== 'undefined') {
|
||||||
if (typeof editor !== 'undefined') {
|
$('#reset-button').on('click', resetEditor);
|
||||||
$('#reset-button').on('click', resetEditor);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var CSRF_HEADER = 'X-CSRF-Token';
|
var CSRF_HEADER = 'X-CSRF-Token';
|
||||||
|
|
||||||
@ -69,23 +100,61 @@ $(document).ready(function() {
|
|||||||
$('#search-issue').unbind('click');
|
$('#search-issue').unbind('click');
|
||||||
$('#search-issue').on('click', function() {
|
$('#search-issue').on('click', function() {
|
||||||
var queryIssue = window.location.href.toString();
|
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');
|
window.open('https://github.com/FreeCodeCamp/FreeCodeCamp/issues?q=' +
|
||||||
|
'is:issue is:all ' + (challenge_Name || challengeName) + ' OR ' +
|
||||||
|
queryIssue.substr(queryIssue.lastIndexOf('challenges/') + 11)
|
||||||
|
.replace('/', ''), '_blank');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#help-ive-found-a-bug-wiki-article').unbind('click');
|
$('#help-ive-found-a-bug-wiki-article').unbind('click');
|
||||||
$('#help-ive-found-a-bug-wiki-article').on('click', function() {
|
$('#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');
|
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.';
|
var textMessage = [
|
||||||
textMessage += ' User Agent is: <code>' + navigator.userAgent + '</code>.';
|
'Challenge [',
|
||||||
textMessage += ' Please describe how to reproduce this issue, and include links to screenshots if possible.%0A%0A';
|
(challenge_Name || challengeName || window.location.href),
|
||||||
textMessage = textMessage.replace(';', ','); //GitHub cuts User Agent text because of ';' symbol so I just replace it with ','
|
'](',
|
||||||
|
window.location.href,
|
||||||
|
') has an issue.\n',
|
||||||
|
'User Agent is: <code>',
|
||||||
|
navigator.userAgent,
|
||||||
|
'</code>.\n',
|
||||||
|
'Please describe how to reproduce this issue, and include ',
|
||||||
|
'links to screenshots if possible.\n\n'
|
||||||
|
].join('');
|
||||||
|
|
||||||
|
if (editor.getValue().trim()) {
|
||||||
|
var type;
|
||||||
|
switch (challengeType) {
|
||||||
|
case challengeTypes.HTML_CSS_JQ:
|
||||||
|
type = 'html';
|
||||||
|
break;
|
||||||
|
case challengeTypes.JAVASCRIPT:
|
||||||
|
type = 'javascript';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
type = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
textMessage += [
|
||||||
|
'My code:\n```',
|
||||||
|
type,
|
||||||
|
'\n',
|
||||||
|
editor.getValue(),
|
||||||
|
'\n```\n\n'
|
||||||
|
].join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
textMessage = encodeURIComponent(textMessage);
|
||||||
|
|
||||||
$('#issue-modal').modal('hide');
|
$('#issue-modal').modal('hide');
|
||||||
window.open(textMessage, '_blank');
|
window.open(
|
||||||
|
'https://github.com/freecodecamp/freecodecamp/issues/new?&body=' +
|
||||||
|
textMessage, '_blank'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#completed-courseware').unbind('click');
|
$('#completed-courseware').unbind('click');
|
||||||
@ -141,7 +210,7 @@ $(document).ready(function() {
|
|||||||
}).success(
|
}).success(
|
||||||
function(res) {
|
function(res) {
|
||||||
if (res) {
|
if (res) {
|
||||||
window.location.href = '/challenges/next-challenge';
|
window.location.href = '/challenges/next-challenge?id=' + challenge_Id;
|
||||||
}
|
}
|
||||||
}).fail(
|
}).fail(
|
||||||
function() {
|
function() {
|
||||||
@ -164,7 +233,7 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
}).success(
|
}).success(
|
||||||
function() {
|
function() {
|
||||||
window.location.href = '/challenges/next-challenge';
|
window.location.href = '/challenges/next-challenge?id=' + challenge_Id;
|
||||||
}).fail(
|
}).fail(
|
||||||
function() {
|
function() {
|
||||||
window.location.href = '/challenges';
|
window.location.href = '/challenges';
|
||||||
@ -187,25 +256,19 @@ $(document).ready(function() {
|
|||||||
verified: false
|
verified: false
|
||||||
}
|
}
|
||||||
}).success(function() {
|
}).success(function() {
|
||||||
window.location.href = '/challenges/next-challenge';
|
window.location.href = '/challenges/next-challenge?id=' + challenge_Id;
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
window.location.replace(window.location.href);
|
window.location.replace(window.location.href);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case challengeTypes.BONFIRE:
|
case challengeTypes.BONFIRE:
|
||||||
window.location.href = '/challenges/next-challenge';
|
window.location.href = '/challenges/next-challenge?id=' + challenge_Id;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.next-challenge-button').unbind('click');
|
|
||||||
$('.next-challenge-button').on('click', function() {
|
|
||||||
l = location.pathname.split('/');
|
|
||||||
window.location = '/challenges/' + (parseInt(l[l.length - 1]) + 1);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#complete-courseware-dialog').on('hidden.bs.modal', function() {
|
$('#complete-courseware-dialog').on('hidden.bs.modal', function() {
|
||||||
editor.focus();
|
editor.focus();
|
||||||
});
|
});
|
||||||
@ -349,6 +412,40 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// map sharing
|
||||||
|
var alreadyShared = getMapShares();
|
||||||
|
|
||||||
|
if (lastCompleted && alreadyShared.indexOf(lastCompleted) === -1) {
|
||||||
|
$('div[id="' + lastCompleted + '"]')
|
||||||
|
.parent()
|
||||||
|
.parent()
|
||||||
|
.removeClass('hidden');
|
||||||
|
}
|
||||||
|
|
||||||
|
// on map view
|
||||||
|
$('.map-challenge-block-share').on('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var challengeBlockName = $(this).children().attr('id');
|
||||||
|
var challengeBlockEscapedName = challengeBlockName.replace(/\s/, '%20');
|
||||||
|
var username = typeof window.username !== 'undefined' ?
|
||||||
|
window.username :
|
||||||
|
'';
|
||||||
|
|
||||||
|
var link = 'https://www.facebook.com/dialog/feed?' +
|
||||||
|
'app_id=1644598365767721' +
|
||||||
|
'&display=page&' +
|
||||||
|
'caption=I%20just%20completed%20the%20' +
|
||||||
|
challengeBlockEscapedName +
|
||||||
|
'%20section%20on%20Free%20Code%20Camp%2E' +
|
||||||
|
'&link=http%3A%2F%2Ffreecodecamp%2Ecom%2F' +
|
||||||
|
username +
|
||||||
|
'&redirect_uri=http%3A%2F%2Ffreecodecamp%2Ecom%2Fmap';
|
||||||
|
|
||||||
|
setMapShare(challengeBlockName);
|
||||||
|
window.location.href = link;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function defCheck(a){
|
function defCheck(a){
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
import Rx from 'rx';
|
import Rx from 'rx';
|
||||||
import assign from 'object.assign';
|
import { match } from 'react-router';
|
||||||
import { Router } from 'react-router';
|
|
||||||
import App from './App.jsx';
|
import App from './App.jsx';
|
||||||
import AppCat from './Cat';
|
import AppCat from './Cat';
|
||||||
|
|
||||||
import childRoutes from './routes';
|
import childRoutes from './routes';
|
||||||
|
|
||||||
const router$ = Rx.Observable.fromNodeCallback(Router.run, Router);
|
const route$ = Rx.Observable.fromNodeCallback(match);
|
||||||
|
|
||||||
const routes = assign({ components: App }, childRoutes);
|
const routes = Object.assign({ components: App }, childRoutes);
|
||||||
|
|
||||||
export default function app$(location) {
|
export default function app$({ location, history }) {
|
||||||
return router$(routes, location)
|
return route$({ routes, location, history })
|
||||||
.map(([initialState, transistion]) => {
|
.map(([nextLocation, props]) => {
|
||||||
return { initialState, transistion, AppCat };
|
return { nextLocation, props, AppCat };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Actions } from 'thundercats';
|
import { Actions } from 'thundercats';
|
||||||
import assign from 'object.assign';
|
|
||||||
import debugFactory from 'debug';
|
import debugFactory from 'debug';
|
||||||
|
|
||||||
const debug = debugFactory('freecc:hikes:actions');
|
const debug = debugFactory('freecc:hikes:actions');
|
||||||
@ -45,7 +44,7 @@ export default Actions({
|
|||||||
dashedName,
|
dashedName,
|
||||||
oldState.currentHike
|
oldState.currentHike
|
||||||
);
|
);
|
||||||
return assign({}, oldState, { currentHike });
|
return Object.assign({}, oldState, { currentHike });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
43
common/app/routes/Jobs/components/CreateJobModal.jsx
Normal file
43
common/app/routes/Jobs/components/CreateJobModal.jsx
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import React, { PropTypes } from 'react';
|
||||||
|
import { History } from 'react-router';
|
||||||
|
import { Button, Modal } from 'react-bootstrap';
|
||||||
|
|
||||||
|
export default React.createClass({
|
||||||
|
displayName: 'CreateJobsModal',
|
||||||
|
|
||||||
|
propTypes: {
|
||||||
|
onHide: PropTypes.func,
|
||||||
|
showModal: PropTypes.bool
|
||||||
|
},
|
||||||
|
|
||||||
|
mixins: [History],
|
||||||
|
|
||||||
|
goToNewJob(onHide) {
|
||||||
|
onHide();
|
||||||
|
this.history.pushState(null, '/jobs/new');
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
showModal,
|
||||||
|
onHide
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
onHide={ onHide }
|
||||||
|
show={ showModal }>
|
||||||
|
<Modal.Body>
|
||||||
|
<h4>Welcome to Free Code Camp's board</h4>
|
||||||
|
<p>We post jobs specifically target to our junior developers.</p>
|
||||||
|
<Button
|
||||||
|
block={ true }
|
||||||
|
className='signup-btn'
|
||||||
|
onClick={ () => this.goToNewJob(onHide) }>
|
||||||
|
Post a Job
|
||||||
|
</Button>
|
||||||
|
</Modal.Body>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
@ -1,23 +1,43 @@
|
|||||||
import React, { cloneElement, PropTypes } from 'react';
|
import React, { cloneElement, PropTypes } from 'react';
|
||||||
import { contain } from 'thundercats-react';
|
import { contain } from 'thundercats-react';
|
||||||
|
import { History } from 'react-router';
|
||||||
import { Button, Jumbotron, Row } from 'react-bootstrap';
|
import { Button, Jumbotron, Row } from 'react-bootstrap';
|
||||||
|
|
||||||
|
import CreateJobModal from './CreateJobModal.jsx';
|
||||||
import ListJobs from './List.jsx';
|
import ListJobs from './List.jsx';
|
||||||
|
|
||||||
export default contain(
|
export default contain(
|
||||||
{
|
{
|
||||||
store: 'jobsStore',
|
store: 'jobsStore',
|
||||||
fetchAction: 'jobActions.getJobs'
|
fetchAction: 'jobActions.getJobs',
|
||||||
|
actions: 'jobActions'
|
||||||
},
|
},
|
||||||
React.createClass({
|
React.createClass({
|
||||||
displayName: 'Jobs',
|
displayName: 'Jobs',
|
||||||
|
|
||||||
|
mixins: [History],
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
children: PropTypes.element,
|
children: PropTypes.element,
|
||||||
jobs: PropTypes.array
|
jobActions: PropTypes.object,
|
||||||
|
jobs: PropTypes.array,
|
||||||
|
showModal: PropTypes.bool
|
||||||
},
|
},
|
||||||
|
|
||||||
renderList(jobs) {
|
handleJobClick(id) {
|
||||||
|
const { jobActions } = this.props;
|
||||||
|
if (!id) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
jobActions.findJob(id);
|
||||||
|
this.history.pushState(null, `/jobs/${id}`);
|
||||||
|
},
|
||||||
|
|
||||||
|
renderList(handleJobClick, jobs) {
|
||||||
return (
|
return (
|
||||||
<ListJobs jobs={ jobs }/>
|
<ListJobs
|
||||||
|
handleClick={ handleJobClick }
|
||||||
|
jobs={ jobs }/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -32,7 +52,12 @@ export default contain(
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { children, jobs } = this.props;
|
const {
|
||||||
|
children,
|
||||||
|
jobs,
|
||||||
|
showModal,
|
||||||
|
jobActions
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@ -46,15 +71,19 @@ export default contain(
|
|||||||
</p>
|
</p>
|
||||||
<Button
|
<Button
|
||||||
bsSize='large'
|
bsSize='large'
|
||||||
className='signup-btn'>
|
className='signup-btn'
|
||||||
|
onClick={ jobActions.openModal }>
|
||||||
Try the first month 20% off!
|
Try the first month 20% off!
|
||||||
</Button>
|
</Button>
|
||||||
</Jumbotron>
|
</Jumbotron>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
{ this.renderChild(children, jobs) ||
|
{ this.renderChild(children, jobs) ||
|
||||||
this.renderList(jobs) }
|
this.renderList(this.handleJobClick, jobs) }
|
||||||
</Row>
|
</Row>
|
||||||
|
<CreateJobModal
|
||||||
|
onHide={ jobActions.closeModal }
|
||||||
|
showModal={ showModal } />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,81 +1,85 @@
|
|||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
import { contain } from 'thundercats-react';
|
|
||||||
import { PanelGroup, Thumbnail, Panel, Well } from 'react-bootstrap';
|
import { PanelGroup, Thumbnail, Panel, Well } from 'react-bootstrap';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
export default contain(
|
export default React.createClass({
|
||||||
{
|
displayName: 'ListJobs',
|
||||||
|
|
||||||
|
propTypes: {
|
||||||
|
handleClick: PropTypes.func,
|
||||||
|
jobs: PropTypes.array
|
||||||
},
|
},
|
||||||
React.createClass({
|
|
||||||
displayName: 'ListJobs',
|
|
||||||
|
|
||||||
propTypes: {
|
renderJobs(handleClick, jobs =[]) {
|
||||||
jobs: PropTypes.array
|
const thumbnailStyle = {
|
||||||
},
|
backgroundColor: 'white',
|
||||||
|
maxHeight: '100px',
|
||||||
|
maxWidth: '100px'
|
||||||
|
};
|
||||||
|
|
||||||
renderJobs(jobs =[]) {
|
return jobs.map((
|
||||||
const thumbnailStyle = {
|
{
|
||||||
backgroundColor: 'white',
|
id,
|
||||||
maxHeight: '100px',
|
company,
|
||||||
maxWidth: '100px'
|
position,
|
||||||
};
|
isHighlighted,
|
||||||
return jobs.map((
|
description,
|
||||||
{
|
logo,
|
||||||
id,
|
city,
|
||||||
company,
|
state,
|
||||||
position,
|
email,
|
||||||
description,
|
phone,
|
||||||
logo,
|
postedOn
|
||||||
city,
|
},
|
||||||
state,
|
index
|
||||||
email,
|
) => {
|
||||||
phone,
|
const header = (
|
||||||
postedOn
|
<div>
|
||||||
},
|
<h4 style={{ display: 'inline-block' }}>{ company }</h4>
|
||||||
index
|
<h5
|
||||||
) => {
|
className='pull-right hidden-xs hidden-md'
|
||||||
const header = (
|
style={{ display: 'inline-block' }}>
|
||||||
<div>
|
{ position }
|
||||||
<h4 style={{ display: 'inline-block' }}>{ company }</h4>
|
</h5>
|
||||||
<h5
|
</div>
|
||||||
className='pull-right hidden-xs hidden-md'
|
|
||||||
style={{ display: 'inline-block' }}>
|
|
||||||
{ position }
|
|
||||||
</h5>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
return (
|
|
||||||
<Panel
|
|
||||||
collapsible={ true }
|
|
||||||
eventKey={ index }
|
|
||||||
header={ header }
|
|
||||||
key={ id }>
|
|
||||||
<Well>
|
|
||||||
<Thumbnail
|
|
||||||
alt='200x200' src={ logo }
|
|
||||||
style={ thumbnailStyle } />
|
|
||||||
<Panel>
|
|
||||||
Position: { position }
|
|
||||||
Location: { city }, { state }
|
|
||||||
<br />
|
|
||||||
Contact: { email || phone || 'N/A' }
|
|
||||||
<br />
|
|
||||||
Posted On: { moment(postedOn).format('MMMM Do, YYYY') }
|
|
||||||
</Panel>
|
|
||||||
<p>{ description }</p>
|
|
||||||
</Well>
|
|
||||||
</Panel>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { jobs } = this.props;
|
|
||||||
return (
|
|
||||||
<PanelGroup>
|
|
||||||
{ this.renderJobs(jobs) }
|
|
||||||
</PanelGroup>
|
|
||||||
);
|
);
|
||||||
}
|
return (
|
||||||
})
|
<Panel
|
||||||
);
|
bsStyle={ isHighlighted ? 'warning' : 'default' }
|
||||||
|
collapsible={ true }
|
||||||
|
eventKey={ index }
|
||||||
|
header={ header }
|
||||||
|
key={ id }>
|
||||||
|
<Well>
|
||||||
|
<Thumbnail
|
||||||
|
alt={ company + 'company logo' }
|
||||||
|
src={ logo }
|
||||||
|
style={ thumbnailStyle } />
|
||||||
|
<Panel>
|
||||||
|
Position: { position }
|
||||||
|
Location: { city }, { state }
|
||||||
|
<br />
|
||||||
|
Contact: { email || phone || 'N/A' }
|
||||||
|
<br />
|
||||||
|
Posted On: { moment(postedOn).format('MMMM Do, YYYY') }
|
||||||
|
</Panel>
|
||||||
|
<p onClick={ () => handleClick(id) }>{ description }</p>
|
||||||
|
</Well>
|
||||||
|
</Panel>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
handleClick,
|
||||||
|
jobs
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PanelGroup>
|
||||||
|
{ this.renderJobs(handleClick, jobs) }
|
||||||
|
</PanelGroup>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
319
common/app/routes/Jobs/components/NewJob.jsx
Normal file
319
common/app/routes/Jobs/components/NewJob.jsx
Normal file
@ -0,0 +1,319 @@
|
|||||||
|
import React, { PropTypes } from 'react';
|
||||||
|
import { History } from 'react-router';
|
||||||
|
import { contain } from 'thundercats-react';
|
||||||
|
import debugFactory from 'debug';
|
||||||
|
import { getDefaults } from '../utils';
|
||||||
|
|
||||||
|
import {
|
||||||
|
inHTMLData,
|
||||||
|
uriInSingleQuotedAttr
|
||||||
|
} from 'xss-filters';
|
||||||
|
|
||||||
|
import {
|
||||||
|
Button,
|
||||||
|
Col,
|
||||||
|
Input,
|
||||||
|
Row,
|
||||||
|
Well
|
||||||
|
} from 'react-bootstrap';
|
||||||
|
|
||||||
|
import {
|
||||||
|
isAscii,
|
||||||
|
isEmail,
|
||||||
|
isMobilePhone,
|
||||||
|
isURL
|
||||||
|
} from 'validator';
|
||||||
|
|
||||||
|
const debug = debugFactory('freecc:jobs:newForm');
|
||||||
|
|
||||||
|
const checkValidity = [
|
||||||
|
'position',
|
||||||
|
'locale',
|
||||||
|
'description',
|
||||||
|
'email',
|
||||||
|
'phone',
|
||||||
|
'url',
|
||||||
|
'logo',
|
||||||
|
'name',
|
||||||
|
'highlight'
|
||||||
|
];
|
||||||
|
|
||||||
|
function formatValue(value, validator, type = 'string') {
|
||||||
|
const formated = getDefaults(type);
|
||||||
|
if (validator && type === 'string') {
|
||||||
|
formated.valid = validator(value);
|
||||||
|
}
|
||||||
|
if (value) {
|
||||||
|
formated.value = value;
|
||||||
|
formated.bsStyle = formated.valid ? 'success' : 'error';
|
||||||
|
}
|
||||||
|
return formated;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isValidURL(data) {
|
||||||
|
return isURL(data, { 'require_protocol': true });
|
||||||
|
}
|
||||||
|
|
||||||
|
function isValidPhone(data) {
|
||||||
|
return isMobilePhone(data, 'en-US');
|
||||||
|
}
|
||||||
|
|
||||||
|
export default contain({
|
||||||
|
actions: 'jobActions',
|
||||||
|
store: 'jobsStore',
|
||||||
|
map({ form = {} }) {
|
||||||
|
const {
|
||||||
|
position,
|
||||||
|
locale,
|
||||||
|
description,
|
||||||
|
email,
|
||||||
|
phone,
|
||||||
|
url,
|
||||||
|
logo,
|
||||||
|
name,
|
||||||
|
highlight
|
||||||
|
} = form;
|
||||||
|
return {
|
||||||
|
position: formatValue(position, isAscii),
|
||||||
|
locale: formatValue(locale, isAscii),
|
||||||
|
description: formatValue(description, isAscii),
|
||||||
|
email: formatValue(email, isEmail),
|
||||||
|
phone: formatValue(phone, isValidPhone),
|
||||||
|
url: formatValue(url, isValidURL),
|
||||||
|
logo: formatValue(logo, isValidURL),
|
||||||
|
name: formatValue(name, isAscii),
|
||||||
|
highlight: formatValue(highlight, null, 'bool')
|
||||||
|
};
|
||||||
|
},
|
||||||
|
subscribeOnWillMount() {
|
||||||
|
return typeof window !== 'undefined';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
React.createClass({
|
||||||
|
displayName: 'NewJob',
|
||||||
|
|
||||||
|
propTypes: {
|
||||||
|
jobActions: PropTypes.object,
|
||||||
|
position: PropTypes.object,
|
||||||
|
locale: PropTypes.object,
|
||||||
|
description: PropTypes.object,
|
||||||
|
email: PropTypes.object,
|
||||||
|
phone: PropTypes.object,
|
||||||
|
url: PropTypes.object,
|
||||||
|
logo: PropTypes.object,
|
||||||
|
name: PropTypes.object,
|
||||||
|
highlight: PropTypes.object
|
||||||
|
},
|
||||||
|
|
||||||
|
mixins: [History],
|
||||||
|
|
||||||
|
handleSubmit(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
const props = this.props;
|
||||||
|
let valid = true;
|
||||||
|
checkValidity.forEach((prop) => {
|
||||||
|
// if value exist, check if it is valid
|
||||||
|
if (props[prop].value && props[prop].type !== 'boolean') {
|
||||||
|
valid = valid && !!props[prop].valid;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!valid) {
|
||||||
|
debug('form not valid');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
position,
|
||||||
|
locale,
|
||||||
|
description,
|
||||||
|
email,
|
||||||
|
phone,
|
||||||
|
url,
|
||||||
|
logo,
|
||||||
|
name,
|
||||||
|
highlight,
|
||||||
|
jobActions
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
// sanitize user output
|
||||||
|
const jobValues = {
|
||||||
|
position: inHTMLData(position.value),
|
||||||
|
location: inHTMLData(locale.value),
|
||||||
|
description: inHTMLData(description.value),
|
||||||
|
email: inHTMLData(email.value),
|
||||||
|
phone: inHTMLData(phone.value),
|
||||||
|
url: uriInSingleQuotedAttr(url.value),
|
||||||
|
logo: uriInSingleQuotedAttr(logo.value),
|
||||||
|
name: inHTMLData(name.value),
|
||||||
|
highlight: !!highlight.value
|
||||||
|
};
|
||||||
|
|
||||||
|
const job = Object.keys(jobValues).reduce((accu, prop) => {
|
||||||
|
if (jobValues[prop]) {
|
||||||
|
accu[prop] = jobValues[prop];
|
||||||
|
}
|
||||||
|
return accu;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
job.postedOn = new Date();
|
||||||
|
debug('job sanitized', job);
|
||||||
|
jobActions.saveForm(job);
|
||||||
|
|
||||||
|
this.history.pushState(null, '/jobs/new/preview');
|
||||||
|
},
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
const { jobActions } = this.props;
|
||||||
|
jobActions.getSavedForm();
|
||||||
|
},
|
||||||
|
|
||||||
|
handleChange(name, { target: { value } }) {
|
||||||
|
const { jobActions: { handleForm } } = this.props;
|
||||||
|
handleForm({ [name]: value });
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
position,
|
||||||
|
locale,
|
||||||
|
description,
|
||||||
|
email,
|
||||||
|
phone,
|
||||||
|
url,
|
||||||
|
logo,
|
||||||
|
name,
|
||||||
|
highlight,
|
||||||
|
jobActions: { handleForm }
|
||||||
|
} = this.props;
|
||||||
|
const { handleChange } = this;
|
||||||
|
const labelClass = 'col-sm-offset-1 col-sm-2';
|
||||||
|
const inputClass = 'col-sm-6';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Row>
|
||||||
|
<Col>
|
||||||
|
<Well className='text-center'>
|
||||||
|
<h1>Create Your Job Post</h1>
|
||||||
|
<form
|
||||||
|
className='form-horizontal'
|
||||||
|
onSubmit={ this.handleSubmit }>
|
||||||
|
|
||||||
|
<div className='spacer'>
|
||||||
|
<h2>Job Information</h2>
|
||||||
|
</div>
|
||||||
|
<Input
|
||||||
|
bsStyle={ position.bsStyle }
|
||||||
|
label='Position'
|
||||||
|
labelClassName={ labelClass }
|
||||||
|
onChange={ (e) => handleChange('position', e) }
|
||||||
|
placeholder='Position'
|
||||||
|
type='text'
|
||||||
|
value={ position.value }
|
||||||
|
wrapperClassName={ inputClass } />
|
||||||
|
<Input
|
||||||
|
bsStyle={ locale.bsStyle }
|
||||||
|
label='Location'
|
||||||
|
labelClassName={ labelClass }
|
||||||
|
onChange={ (e) => handleChange('locale', e) }
|
||||||
|
placeholder='Location'
|
||||||
|
type='text'
|
||||||
|
value={ locale.value }
|
||||||
|
wrapperClassName={ inputClass } />
|
||||||
|
<Input
|
||||||
|
bsStyle={ description.bsStyle }
|
||||||
|
label='Description'
|
||||||
|
labelClassName={ labelClass }
|
||||||
|
onChange={ (e) => handleChange('description', e) }
|
||||||
|
placeholder='Description'
|
||||||
|
rows='10'
|
||||||
|
type='textarea'
|
||||||
|
value={ description.value }
|
||||||
|
wrapperClassName={ inputClass } />
|
||||||
|
|
||||||
|
<div className='divider'>
|
||||||
|
<h2>Company Information</h2>
|
||||||
|
</div>
|
||||||
|
<Input
|
||||||
|
bsStyle={ name.bsStyle }
|
||||||
|
label='Company Name'
|
||||||
|
labelClassName={ labelClass }
|
||||||
|
onChange={ (e) => handleChange('name', e) }
|
||||||
|
placeholder='Foo, INC'
|
||||||
|
type='text'
|
||||||
|
value={ name.value }
|
||||||
|
wrapperClassName={ inputClass } />
|
||||||
|
<Input
|
||||||
|
bsStyle={ email.bsStyle }
|
||||||
|
label='Email'
|
||||||
|
labelClassName={ labelClass }
|
||||||
|
onChange={ (e) => handleChange('email', e) }
|
||||||
|
placeholder='Email'
|
||||||
|
type='email'
|
||||||
|
value={ email.value }
|
||||||
|
wrapperClassName={ inputClass } />
|
||||||
|
<Input
|
||||||
|
bsStyle={ phone.bsStyle }
|
||||||
|
label='Phone'
|
||||||
|
labelClassName={ labelClass }
|
||||||
|
onChange={ (e) => handleChange('phone', e) }
|
||||||
|
placeholder='555-123-1234'
|
||||||
|
type='tel'
|
||||||
|
value={ phone.value }
|
||||||
|
wrapperClassName={ inputClass } />
|
||||||
|
<Input
|
||||||
|
bsStyle={ url.bsStyle }
|
||||||
|
label='URL'
|
||||||
|
labelClassName={ labelClass }
|
||||||
|
onChange={ (e) => handleChange('url', e) }
|
||||||
|
placeholder='http://freecatphotoapp.com'
|
||||||
|
type='url'
|
||||||
|
value={ url.value }
|
||||||
|
wrapperClassName={ inputClass } />
|
||||||
|
<Input
|
||||||
|
bsStyle={ logo.bsStyle }
|
||||||
|
label='Logo'
|
||||||
|
labelClassName={ labelClass }
|
||||||
|
onChange={ (e) => handleChange('logo', e) }
|
||||||
|
placeholder='http://freecatphotoapp.com/logo.png'
|
||||||
|
type='url'
|
||||||
|
value={ logo.value }
|
||||||
|
wrapperClassName={ inputClass } />
|
||||||
|
|
||||||
|
<div className='divider'>
|
||||||
|
<h2>Make it stand out</h2>
|
||||||
|
</div>
|
||||||
|
<Input
|
||||||
|
checked={ highlight.value }
|
||||||
|
label='Highlight your ad'
|
||||||
|
labelClassName={ 'col-sm-offset-1 col-sm-6'}
|
||||||
|
onChange={
|
||||||
|
({ target: { checked } }) => handleForm({
|
||||||
|
highlight: !!checked
|
||||||
|
})
|
||||||
|
}
|
||||||
|
type='checkbox' />
|
||||||
|
<div className='spacer' />
|
||||||
|
<Row>
|
||||||
|
<Col
|
||||||
|
lg={ 6 }
|
||||||
|
lgOffset={ 3 }>
|
||||||
|
<Button
|
||||||
|
block={ true }
|
||||||
|
bsSize='large'
|
||||||
|
bsStyle='primary'
|
||||||
|
type='submit'>
|
||||||
|
Preview My Ad
|
||||||
|
</Button>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</form>
|
||||||
|
</Well>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
14
common/app/routes/Jobs/components/Preview.jsx
Normal file
14
common/app/routes/Jobs/components/Preview.jsx
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// import React, { PropTypes } from 'react';
|
||||||
|
import { contain } from 'thundercats-react';
|
||||||
|
import ShowJob from './ShowJob.jsx';
|
||||||
|
|
||||||
|
export default contain(
|
||||||
|
{
|
||||||
|
store: 'JobsStore',
|
||||||
|
actions: 'JobActions',
|
||||||
|
map({ form: job = {} }) {
|
||||||
|
return { job };
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ShowJob
|
||||||
|
);
|
@ -1,59 +1,24 @@
|
|||||||
import React, { PropTypes } from 'react';
|
import { contain } from 'thundercats-react';
|
||||||
import { Thumbnail, Panel, Well } from 'react-bootstrap';
|
import ShowJob from './ShowJob.jsx';
|
||||||
import moment from 'moment';
|
|
||||||
|
|
||||||
const thumbnailStyle = {
|
export default contain(
|
||||||
backgroundColor: 'white',
|
{
|
||||||
maxHeight: '100px',
|
store: 'jobsStore',
|
||||||
maxWidth: '100px'
|
fetchAction: 'jobActions.getJob',
|
||||||
};
|
map({ currentJob }) {
|
||||||
export default React.createClass({
|
return { job: currentJob };
|
||||||
displayName: 'ShowJob',
|
},
|
||||||
propTypes: {
|
getPayload({ params: { id }, job = {} }) {
|
||||||
job: PropTypes.object
|
return {
|
||||||
|
id,
|
||||||
|
isPrimed: job.id === id
|
||||||
|
};
|
||||||
|
},
|
||||||
|
// using es6 destructuring
|
||||||
|
shouldContainerFetch({ job = {} }, { params: { id } }
|
||||||
|
) {
|
||||||
|
return job.id !== id;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
ShowJob
|
||||||
renderHeader({ company, position }) {
|
);
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h4 style={{ display: 'inline-block' }}>{ company }</h4>
|
|
||||||
<h5
|
|
||||||
className='pull-right hidden-xs hidden-md'
|
|
||||||
style={{ display: 'inline-block' }}>
|
|
||||||
{ position }
|
|
||||||
</h5>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { job } = this.props;
|
|
||||||
const {
|
|
||||||
logo,
|
|
||||||
position,
|
|
||||||
city,
|
|
||||||
state,
|
|
||||||
email,
|
|
||||||
phone,
|
|
||||||
postedOn,
|
|
||||||
description
|
|
||||||
} = job;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Well>
|
|
||||||
<Thumbnail
|
|
||||||
alt='200x200' src={ logo }
|
|
||||||
style={ thumbnailStyle } />
|
|
||||||
<Panel>
|
|
||||||
Position: { position }
|
|
||||||
Location: { city }, { state }
|
|
||||||
<br />
|
|
||||||
Contact: { email || phone || 'N/A' }
|
|
||||||
<br />
|
|
||||||
Posted On: { moment(postedOn).format('MMMM Do, YYYY') }
|
|
||||||
</Panel>
|
|
||||||
<p>{ description }</p>
|
|
||||||
</Well>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
67
common/app/routes/Jobs/components/ShowJob.jsx
Normal file
67
common/app/routes/Jobs/components/ShowJob.jsx
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
import React, { PropTypes } from 'react';
|
||||||
|
import { Row, Thumbnail, Panel, Well } from 'react-bootstrap';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
|
const thumbnailStyle = {
|
||||||
|
backgroundColor: 'white',
|
||||||
|
maxHeight: '100px',
|
||||||
|
maxWidth: '100px'
|
||||||
|
};
|
||||||
|
|
||||||
|
export default React.createClass({
|
||||||
|
displayName: 'ShowJob',
|
||||||
|
propTypes: {
|
||||||
|
job: PropTypes.object,
|
||||||
|
params: PropTypes.object
|
||||||
|
},
|
||||||
|
|
||||||
|
renderHeader({ company, position }) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<h4 style={{ display: 'inline-block' }}>{ company }</h4>
|
||||||
|
<h5
|
||||||
|
className='pull-right hidden-xs hidden-md'
|
||||||
|
style={{ display: 'inline-block' }}>
|
||||||
|
{ position }
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { job = {} } = this.props;
|
||||||
|
const {
|
||||||
|
logo,
|
||||||
|
position,
|
||||||
|
city,
|
||||||
|
company,
|
||||||
|
state,
|
||||||
|
email,
|
||||||
|
phone,
|
||||||
|
postedOn,
|
||||||
|
description
|
||||||
|
} = job;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Row>
|
||||||
|
<Well>
|
||||||
|
<Thumbnail
|
||||||
|
alt={ company + 'company logo' }
|
||||||
|
src={ logo }
|
||||||
|
style={ thumbnailStyle } />
|
||||||
|
<Panel>
|
||||||
|
Position: { position }
|
||||||
|
Location: { city }, { state }
|
||||||
|
<br />
|
||||||
|
Contact: { email || phone || 'N/A' }
|
||||||
|
<br />
|
||||||
|
Posted On: { moment(postedOn).format('MMMM Do, YYYY') }
|
||||||
|
</Panel>
|
||||||
|
<p>{ description }</p>
|
||||||
|
</Well>
|
||||||
|
</Row>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
@ -1,27 +1,104 @@
|
|||||||
import { Actions } from 'thundercats';
|
import { Actions } from 'thundercats';
|
||||||
|
import store from 'store';
|
||||||
import debugFactory from 'debug';
|
import debugFactory from 'debug';
|
||||||
|
|
||||||
const debug = debugFactory('freecc:jobs:actions');
|
const debug = debugFactory('freecc:jobs:actions');
|
||||||
|
const assign = Object.assign;
|
||||||
|
|
||||||
export default Actions({
|
export default Actions({
|
||||||
setJobs: null,
|
setJobs: null,
|
||||||
getJob(id) {
|
// findJob assumes that the job is already in the list of jobs
|
||||||
return { id };
|
findJob(id) {
|
||||||
|
return oldState => {
|
||||||
|
const { currentJob = {}, jobs = [] } = oldState;
|
||||||
|
// currentJob already set
|
||||||
|
// do nothing
|
||||||
|
if (currentJob.id === id) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const foundJob = jobs.reduce((newJob, job) => {
|
||||||
|
if (job.id === id) {
|
||||||
|
return job;
|
||||||
|
}
|
||||||
|
return newJob;
|
||||||
|
}, null);
|
||||||
|
|
||||||
|
// if no job found this will be null which is a op noop
|
||||||
|
return foundJob ?
|
||||||
|
assign({}, oldState, { currentJob: foundJob }) :
|
||||||
|
null;
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
setError: null,
|
||||||
|
getJob: null,
|
||||||
getJobs(params) {
|
getJobs(params) {
|
||||||
return { params };
|
return { params };
|
||||||
|
},
|
||||||
|
openModal() {
|
||||||
|
return { showModal: true };
|
||||||
|
},
|
||||||
|
closeModal() {
|
||||||
|
return { showModal: false };
|
||||||
|
},
|
||||||
|
handleForm(value) {
|
||||||
|
return {
|
||||||
|
transform(oldState) {
|
||||||
|
const { form } = oldState;
|
||||||
|
const newState = assign({}, oldState);
|
||||||
|
newState.form = assign(
|
||||||
|
{},
|
||||||
|
form,
|
||||||
|
value
|
||||||
|
);
|
||||||
|
return newState;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
saveForm: null,
|
||||||
|
getSavedForm: null,
|
||||||
|
setForm(form) {
|
||||||
|
return { form };
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.refs({ displayName: 'JobActions' })
|
.refs({ displayName: 'JobActions' })
|
||||||
.init(({ instance: jobActions, args: [services] }) => {
|
.init(({ instance: jobActions, args: [services] }) => {
|
||||||
jobActions.getJobs.subscribe(() => {
|
jobActions.getJobs.subscribe(() => {
|
||||||
services.read('job', null, null, (err, jobs) => {
|
services.read('jobs', null, null, (err, jobs) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
debug('job services experienced an issue', err);
|
debug('job services experienced an issue', err);
|
||||||
jobActions.setJobs({ jobs: [] });
|
return jobActions.setError({ err });
|
||||||
}
|
}
|
||||||
jobActions.setJobs({ jobs });
|
jobActions.setJobs({ jobs });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
jobActions.getJob.subscribe(({ id, isPrimed }) => {
|
||||||
|
// job is already set, do nothing.
|
||||||
|
if (isPrimed) {
|
||||||
|
debug('job is primed');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
services.read('jobs', { id }, null, (err, job) => {
|
||||||
|
if (err) {
|
||||||
|
debug('job services experienced an issue', err);
|
||||||
|
return jobActions.setError({ err });
|
||||||
|
}
|
||||||
|
if (job) {
|
||||||
|
jobActions.setJobs({ currentJob: job });
|
||||||
|
}
|
||||||
|
jobActions.setJobs({});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
jobActions.saveForm.subscribe((form) => {
|
||||||
|
store.set('newJob', form);
|
||||||
|
});
|
||||||
|
|
||||||
|
jobActions.getSavedForm.subscribe(() => {
|
||||||
|
const job = store.get('newJob');
|
||||||
|
if (job && !Array.isArray(job) && typeof job === 'object') {
|
||||||
|
jobActions.setForm(job);
|
||||||
|
}
|
||||||
|
});
|
||||||
return jobActions;
|
return jobActions;
|
||||||
});
|
});
|
||||||
|
@ -1,10 +1,30 @@
|
|||||||
import { Store } from 'thundercats';
|
import { Store } from 'thundercats';
|
||||||
|
|
||||||
const { setter } = Store;
|
const {
|
||||||
|
createRegistrar,
|
||||||
|
setter,
|
||||||
|
transformer
|
||||||
|
} = Store;
|
||||||
|
|
||||||
export default Store()
|
export default Store({ showModal: false })
|
||||||
.refs({ displayName: 'JobsStore' })
|
.refs({ displayName: 'JobsStore' })
|
||||||
.init(({ instance: jobsStore, args: [cat] }) => {
|
.init(({ instance: jobsStore, args: [cat] }) => {
|
||||||
let jobActions = cat.getActions('JobActions');
|
const {
|
||||||
jobsStore.register(setter(jobActions.setJobs));
|
setJobs,
|
||||||
|
findJob,
|
||||||
|
setError,
|
||||||
|
openModal,
|
||||||
|
closeModal,
|
||||||
|
handleForm,
|
||||||
|
setForm
|
||||||
|
} = cat.getActions('JobActions');
|
||||||
|
const register = createRegistrar(jobsStore);
|
||||||
|
register(setter(setJobs));
|
||||||
|
register(setter(setError));
|
||||||
|
register(setter(openModal));
|
||||||
|
register(setter(closeModal));
|
||||||
|
register(setter(setForm));
|
||||||
|
|
||||||
|
register(transformer(findJob));
|
||||||
|
register(handleForm);
|
||||||
});
|
});
|
||||||
|
@ -1,14 +1,26 @@
|
|||||||
import Jobs from './components/Jobs.jsx';
|
import Jobs from './components/Jobs.jsx';
|
||||||
|
import NewJob from './components/NewJob.jsx';
|
||||||
|
import Show from './components/Show.jsx';
|
||||||
|
import Preview from './components/Preview.jsx';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* show: /jobs
|
* index: /jobs list jobs
|
||||||
* showOne: /jobs/:id
|
* show: /jobs/:id show one job
|
||||||
* edit /jobs/:id
|
* create /jobs/new create a new job
|
||||||
* delete /jobs/:id
|
|
||||||
* createOne /jobs/new
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: 'jobs',
|
childRoutes: [{
|
||||||
component: Jobs
|
path: '/jobs',
|
||||||
|
component: Jobs
|
||||||
|
}, {
|
||||||
|
path: 'jobs/new',
|
||||||
|
component: NewJob
|
||||||
|
}, {
|
||||||
|
path: 'jobs/new/preview',
|
||||||
|
component: Preview
|
||||||
|
}, {
|
||||||
|
path: 'jobs/:id',
|
||||||
|
component: Show
|
||||||
|
}]
|
||||||
};
|
};
|
||||||
|
22
common/app/routes/Jobs/utils.js
Normal file
22
common/app/routes/Jobs/utils.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
const defaults = {
|
||||||
|
'string': {
|
||||||
|
value: '',
|
||||||
|
valid: false,
|
||||||
|
pristine: true,
|
||||||
|
type: 'string'
|
||||||
|
},
|
||||||
|
bool: {
|
||||||
|
value: false,
|
||||||
|
type: 'boolean'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export function getDefaults(type, value) {
|
||||||
|
if (!type) {
|
||||||
|
return defaults['string'];
|
||||||
|
}
|
||||||
|
if (value) {
|
||||||
|
return Object.assign({}, defaults[type], { value });
|
||||||
|
}
|
||||||
|
return Object.assign({}, defaults[type]);
|
||||||
|
}
|
@ -3,12 +3,8 @@ import Hikes from './Hikes';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/',
|
path: '/',
|
||||||
getChildRoutes(locationState, cb) {
|
childRoutes: [
|
||||||
setTimeout(() => {
|
Jobs,
|
||||||
cb(null, [
|
Hikes
|
||||||
Jobs,
|
]
|
||||||
Hikes
|
|
||||||
]);
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "job",
|
"name": "job",
|
||||||
"base": "PersistedModel",
|
"base": "PersistedModel",
|
||||||
|
"strict": true,
|
||||||
"idInjection": true,
|
"idInjection": true,
|
||||||
"trackChanges": false,
|
"trackChanges": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -29,6 +30,9 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"country": {
|
"country": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@ -38,7 +42,7 @@
|
|||||||
"description": {
|
"description": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"isApproverd": {
|
"isApproved": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"isHighlighted": {
|
"isHighlighted": {
|
||||||
|
@ -34,10 +34,6 @@
|
|||||||
"description": {
|
"description": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"originalStoryAuthorEmail": {
|
|
||||||
"type": "string",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
"rank": {
|
"rank": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"default": 0
|
"default": 0
|
||||||
|
@ -161,6 +161,9 @@
|
|||||||
"rand": {
|
"rand": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"index": true
|
"index": true
|
||||||
|
},
|
||||||
|
"tshirtVote": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"validations": [],
|
"validations": [],
|
||||||
|
143
gulpfile.js
143
gulpfile.js
@ -1,3 +1,6 @@
|
|||||||
|
// enable debug for gulp
|
||||||
|
process.env.DEBUG = process.env.DEBUG || 'freecc:*';
|
||||||
|
|
||||||
require('babel-core/register');
|
require('babel-core/register');
|
||||||
var Rx = require('rx'),
|
var Rx = require('rx'),
|
||||||
gulp = require('gulp'),
|
gulp = require('gulp'),
|
||||||
@ -6,6 +9,7 @@ var Rx = require('rx'),
|
|||||||
// utils
|
// utils
|
||||||
plumber = require('gulp-plumber'),
|
plumber = require('gulp-plumber'),
|
||||||
notify = require('gulp-notify'),
|
notify = require('gulp-notify'),
|
||||||
|
gutil = require('gulp-util'),
|
||||||
reduce = require('gulp-reduce-file'),
|
reduce = require('gulp-reduce-file'),
|
||||||
sortKeys = require('sort-keys'),
|
sortKeys = require('sort-keys'),
|
||||||
debug = require('debug')('freecc:gulp'),
|
debug = require('debug')('freecc:gulp'),
|
||||||
@ -25,6 +29,7 @@ var Rx = require('rx'),
|
|||||||
// rev
|
// rev
|
||||||
rev = require('gulp-rev'),
|
rev = require('gulp-rev'),
|
||||||
revReplace = require('gulp-rev-replace'),
|
revReplace = require('gulp-rev-replace'),
|
||||||
|
revDel = require('rev-del'),
|
||||||
|
|
||||||
// lint
|
// lint
|
||||||
jsonlint = require('gulp-jsonlint'),
|
jsonlint = require('gulp-jsonlint'),
|
||||||
@ -33,6 +38,7 @@ var Rx = require('rx'),
|
|||||||
|
|
||||||
Rx.config.longStackSupport = true;
|
Rx.config.longStackSupport = true;
|
||||||
|
|
||||||
|
var __DEV__ = process.env.NODE_ENV !== 'production';
|
||||||
var reloadDelay = 1000;
|
var reloadDelay = 1000;
|
||||||
var reload = sync.reload;
|
var reload = sync.reload;
|
||||||
var paths = {
|
var paths = {
|
||||||
@ -43,6 +49,8 @@ var paths = {
|
|||||||
'!public/js/bundle*',
|
'!public/js/bundle*',
|
||||||
'node_modules/',
|
'node_modules/',
|
||||||
'client/',
|
'client/',
|
||||||
|
'seed',
|
||||||
|
'server/manifests/*.json',
|
||||||
'server/rev-manifest.json'
|
'server/rev-manifest.json'
|
||||||
],
|
],
|
||||||
|
|
||||||
@ -67,8 +75,7 @@ var paths = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
dependents: [
|
dependents: [
|
||||||
'client/commonFramework.js',
|
'client/commonFramework.js'
|
||||||
'client/sandbox.js'
|
|
||||||
],
|
],
|
||||||
|
|
||||||
less: './client/less/main.less',
|
less: './client/less/main.less',
|
||||||
@ -107,11 +114,22 @@ function errorHandler() {
|
|||||||
this.emit('end');
|
this.emit('end');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function delRev(dest, manifestName) {
|
||||||
|
// in production do not delete old revisions
|
||||||
|
if (!__DEV__) {
|
||||||
|
return gutil.noop();
|
||||||
|
}
|
||||||
|
return revDel({
|
||||||
|
oldManifest: path.join(paths.manifest, manifestName),
|
||||||
|
dest: dest
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
gulp.task('serve', function(cb) {
|
gulp.task('serve', function(cb) {
|
||||||
var called = false;
|
var called = false;
|
||||||
nodemon({
|
nodemon({
|
||||||
script: paths.server,
|
script: paths.server,
|
||||||
ext: '.js .json',
|
ext: '.jsx .js .json',
|
||||||
ignore: paths.serverIgnore,
|
ignore: paths.serverIgnore,
|
||||||
exec: path.join(__dirname, 'node_modules/.bin/babel-node'),
|
exec: path.join(__dirname, 'node_modules/.bin/babel-node'),
|
||||||
env: {
|
env: {
|
||||||
@ -143,7 +161,7 @@ var syncDepenedents = [
|
|||||||
'js',
|
'js',
|
||||||
'less',
|
'less',
|
||||||
'dependents',
|
'dependents',
|
||||||
'pack-client',
|
'pack-watch',
|
||||||
'build-manifest'
|
'build-manifest'
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -173,6 +191,9 @@ gulp.task('lint-json', function() {
|
|||||||
gulp.task('test-challenges', ['lint-json']);
|
gulp.task('test-challenges', ['lint-json']);
|
||||||
|
|
||||||
gulp.task('pack-client', function() {
|
gulp.task('pack-client', function() {
|
||||||
|
var manifestName = 'react-manifest.json';
|
||||||
|
var dest = webpackConfig.output.path;
|
||||||
|
|
||||||
return gulp.src(webpackConfig.entry)
|
return gulp.src(webpackConfig.entry)
|
||||||
.pipe(plumber({ errorHandler: errorHandler }))
|
.pipe(plumber({ errorHandler: errorHandler }))
|
||||||
.pipe(webpack(Object.assign(
|
.pipe(webpack(Object.assign(
|
||||||
@ -180,30 +201,73 @@ gulp.task('pack-client', function() {
|
|||||||
webpackConfig,
|
webpackConfig,
|
||||||
webpackOptions
|
webpackOptions
|
||||||
)))
|
)))
|
||||||
.pipe(gulp.dest(webpackConfig.output.path))
|
.pipe(gulp.dest(dest))
|
||||||
.pipe(rev())
|
.pipe(rev())
|
||||||
// copy files to public
|
// copy files to public
|
||||||
.pipe(gulp.dest(webpackConfig.output.path))
|
.pipe(gulp.dest(dest))
|
||||||
// create and merge manifest
|
// create manifest
|
||||||
.pipe(rev.manifest('react-manifest.json'))
|
.pipe(rev.manifest(manifestName))
|
||||||
|
// delete old rev
|
||||||
|
.pipe(delRev(
|
||||||
|
dest,
|
||||||
|
manifestName
|
||||||
|
))
|
||||||
.pipe(gulp.dest(paths.manifest));
|
.pipe(gulp.dest(paths.manifest));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('pack-watch', function() {
|
var defaultStatsOptions = {
|
||||||
return gulp.src(webpackConfig.entry)
|
colors: gutil.colors.supportsColor,
|
||||||
|
hash: false,
|
||||||
|
timings: false,
|
||||||
|
chunks: false,
|
||||||
|
chunkModules: false,
|
||||||
|
modules: false,
|
||||||
|
children: true,
|
||||||
|
version: true,
|
||||||
|
cached: false,
|
||||||
|
cachedAssets: false,
|
||||||
|
reasons: false,
|
||||||
|
source: false,
|
||||||
|
errorDetails: false
|
||||||
|
};
|
||||||
|
|
||||||
|
gulp.task('pack-watch', function(cb) {
|
||||||
|
var called = false;
|
||||||
|
gulp.src(webpackConfig.entry)
|
||||||
.pipe(plumber({ errorHandler: errorHandler }))
|
.pipe(plumber({ errorHandler: errorHandler }))
|
||||||
.pipe(webpack(Object.assign(
|
.pipe(webpack(Object.assign(
|
||||||
{},
|
{},
|
||||||
webpackConfig,
|
webpackConfig,
|
||||||
webpackOptions,
|
webpackOptions,
|
||||||
{ watch: true }
|
{ watch: true }
|
||||||
)))
|
), null, function(notUsed, stats) {
|
||||||
.pipe(gulp.dest(webpackConfig.output.path))
|
if (stats) {
|
||||||
|
gutil.log(stats.toString(defaultStatsOptions));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!called) {
|
||||||
|
debug('webpack watch completed');
|
||||||
|
called = true;
|
||||||
|
cb();
|
||||||
|
}
|
||||||
|
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest(webpackConfig.output.path));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('pack-watch-manifest', function() {
|
||||||
|
var manifestName = 'react-manifest.json';
|
||||||
|
var dest = webpackConfig.output.path;
|
||||||
|
return gulp.src(dest + '/bundle.js')
|
||||||
.pipe(rev())
|
.pipe(rev())
|
||||||
// copy files to public
|
// copy files to public
|
||||||
.pipe(gulp.dest(webpackConfig.output.path))
|
.pipe(gulp.dest(dest))
|
||||||
// create manifest
|
// create manifest
|
||||||
.pipe(rev.manifest('react-manifest.json'))
|
.pipe(rev.manifest(manifestName))
|
||||||
|
.pipe(delRev(
|
||||||
|
dest,
|
||||||
|
manifestName
|
||||||
|
))
|
||||||
.pipe(gulp.dest(paths.manifest));
|
.pipe(gulp.dest(paths.manifest));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -217,32 +281,45 @@ gulp.task('pack-node', function() {
|
|||||||
gulp.task('pack', ['pack-client', 'pack-node']);
|
gulp.task('pack', ['pack-client', 'pack-node']);
|
||||||
|
|
||||||
gulp.task('less', function() {
|
gulp.task('less', function() {
|
||||||
|
var manifestName = 'css-manifest.json';
|
||||||
|
var dest = paths.css;
|
||||||
return gulp.src(paths.less)
|
return gulp.src(paths.less)
|
||||||
.pipe(plumber({ errorHandler: errorHandler }))
|
.pipe(plumber({ errorHandler: errorHandler }))
|
||||||
// copile
|
// copile
|
||||||
.pipe(less({
|
.pipe(less({
|
||||||
paths: [ path.join(__dirname, 'less', 'includes') ]
|
paths: [ path.join(__dirname, 'less', 'includes') ]
|
||||||
}))
|
}))
|
||||||
.pipe(gulp.dest(paths.css))
|
.pipe(gulp.dest(dest))
|
||||||
// add revision
|
// add revision
|
||||||
.pipe(rev())
|
.pipe(rev())
|
||||||
// copy files to public
|
// copy files to public
|
||||||
.pipe(gulp.dest(paths.css))
|
.pipe(gulp.dest(dest))
|
||||||
// create and merge manifest
|
// create and merge manifest
|
||||||
.pipe(rev.manifest('css-manifest.json'))
|
.pipe(rev.manifest(manifestName))
|
||||||
|
.pipe(delRev(
|
||||||
|
dest,
|
||||||
|
manifestName
|
||||||
|
))
|
||||||
.pipe(gulp.dest(paths.manifest));
|
.pipe(gulp.dest(paths.manifest));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('js', function() {
|
gulp.task('js', function() {
|
||||||
|
var manifestName = 'js-manifest.json';
|
||||||
|
var dest = paths.publicJs;
|
||||||
|
|
||||||
return gulp.src(paths.js)
|
return gulp.src(paths.js)
|
||||||
.pipe(plumber({ errorHandler: errorHandler }))
|
.pipe(plumber({ errorHandler: errorHandler }))
|
||||||
.pipe(gulp.dest(paths.publicJs))
|
.pipe(gulp.dest(dest))
|
||||||
// create registry file
|
// create registry file
|
||||||
.pipe(rev())
|
.pipe(rev())
|
||||||
// copy revisioned assets to dest
|
// copy revisioned assets to dest
|
||||||
.pipe(gulp.dest(paths.publicJs))
|
.pipe(gulp.dest(dest))
|
||||||
// create manifest file
|
// create manifest file
|
||||||
.pipe(rev.manifest('js-manifest.json'))
|
.pipe(rev.manifest(manifestName))
|
||||||
|
.pipe(delRev(
|
||||||
|
dest,
|
||||||
|
manifestName
|
||||||
|
))
|
||||||
// copy manifest file to dest
|
// copy manifest file to dest
|
||||||
.pipe(gulp.dest(paths.manifest));
|
.pipe(gulp.dest(paths.manifest));
|
||||||
});
|
});
|
||||||
@ -250,6 +327,9 @@ gulp.task('js', function() {
|
|||||||
// commonFramework depend on iFrameScripts
|
// commonFramework depend on iFrameScripts
|
||||||
// sandbox depends on plugin
|
// sandbox depends on plugin
|
||||||
gulp.task('dependents', ['js'], function() {
|
gulp.task('dependents', ['js'], function() {
|
||||||
|
var manifestName = 'dependents-manifest.json';
|
||||||
|
var dest = paths.publicJs;
|
||||||
|
|
||||||
var manifest = gulp.src(
|
var manifest = gulp.src(
|
||||||
path.join(__dirname, paths.manifest, 'js-manifest.json')
|
path.join(__dirname, paths.manifest, 'js-manifest.json')
|
||||||
);
|
);
|
||||||
@ -257,9 +337,14 @@ gulp.task('dependents', ['js'], function() {
|
|||||||
return gulp.src(paths.dependents)
|
return gulp.src(paths.dependents)
|
||||||
.pipe(plumber({ errorHandler: errorHandler }))
|
.pipe(plumber({ errorHandler: errorHandler }))
|
||||||
.pipe(revReplace({ manifest: manifest }))
|
.pipe(revReplace({ manifest: manifest }))
|
||||||
|
.pipe(gulp.dest(dest))
|
||||||
.pipe(rev())
|
.pipe(rev())
|
||||||
.pipe(gulp.dest(paths.publicJs))
|
.pipe(gulp.dest(dest))
|
||||||
.pipe(rev.manifest('dependents-manifest.json'))
|
.pipe(rev.manifest(manifestName))
|
||||||
|
.pipe(delRev(
|
||||||
|
dest,
|
||||||
|
manifestName
|
||||||
|
))
|
||||||
.pipe(gulp.dest(paths.manifest));
|
.pipe(gulp.dest(paths.manifest));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -301,7 +386,9 @@ var watchDependents = [
|
|||||||
'dependents',
|
'dependents',
|
||||||
'serve',
|
'serve',
|
||||||
'sync',
|
'sync',
|
||||||
'build-manifest'
|
'build-manifest',
|
||||||
|
'pack-watch',
|
||||||
|
'pack-watch-manifest'
|
||||||
];
|
];
|
||||||
|
|
||||||
gulp.task('watch', watchDependents, function() {
|
gulp.task('watch', watchDependents, function() {
|
||||||
@ -311,7 +398,15 @@ gulp.task('watch', watchDependents, function() {
|
|||||||
gulp.watch(paths.js, ['js', 'dependents']);
|
gulp.watch(paths.js, ['js', 'dependents']);
|
||||||
gulp.watch(paths.dependents, ['dependents']);
|
gulp.watch(paths.dependents, ['dependents']);
|
||||||
gulp.watch(paths.manifest + '/*.json', ['build-manifest-watch']);
|
gulp.watch(paths.manifest + '/*.json', ['build-manifest-watch']);
|
||||||
|
gulp.watch(webpackConfig.output.path + '/bundle.js', ['pack-watch-manifest']);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('default', ['less', 'serve', 'sync', 'watch', 'pack-watch']);
|
gulp.task('default', [
|
||||||
|
'less',
|
||||||
|
'serve',
|
||||||
|
'pack-watch',
|
||||||
|
'pack-watch-manifest',
|
||||||
|
'watch',
|
||||||
|
'sync'
|
||||||
|
]);
|
||||||
|
|
||||||
|
24
package.json
24
package.json
@ -17,9 +17,9 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"accepts": "~1.2.5",
|
"accepts": "~1.2.5",
|
||||||
"async": "~0.9.0",
|
"async": "~0.9.0",
|
||||||
"babel": "5.6.14",
|
"babel": "5.8.23",
|
||||||
"babel-core": "5.6.15",
|
"babel-core": "5.8.23",
|
||||||
"babel-eslint": "^4.0.5",
|
"babel-eslint": "4.1.1",
|
||||||
"babel-loader": "5.2.2",
|
"babel-loader": "5.2.2",
|
||||||
"bcrypt-nodejs": "~0.0.3",
|
"bcrypt-nodejs": "~0.0.3",
|
||||||
"body-parser": "^1.13.2",
|
"body-parser": "^1.13.2",
|
||||||
@ -36,6 +36,7 @@
|
|||||||
"dedent": "^0.4.0",
|
"dedent": "^0.4.0",
|
||||||
"dotenv": "~0.4.0",
|
"dotenv": "~0.4.0",
|
||||||
"errorhandler": "~1.3.0",
|
"errorhandler": "~1.3.0",
|
||||||
|
"es6-map": "^0.1.1",
|
||||||
"eslint": "^1.1.0",
|
"eslint": "^1.1.0",
|
||||||
"eslint-plugin-react": "^3.2.1",
|
"eslint-plugin-react": "^3.2.1",
|
||||||
"express": "~4.10.4",
|
"express": "~4.10.4",
|
||||||
@ -53,13 +54,14 @@
|
|||||||
"gulp-reduce-file": "0.0.1",
|
"gulp-reduce-file": "0.0.1",
|
||||||
"gulp-rev": "^6.0.1",
|
"gulp-rev": "^6.0.1",
|
||||||
"gulp-rev-replace": "^0.4.2",
|
"gulp-rev-replace": "^0.4.2",
|
||||||
|
"gulp-util": "^3.0.6",
|
||||||
"gulp-webpack": "^1.5.0",
|
"gulp-webpack": "^1.5.0",
|
||||||
"helmet": "~0.9.0",
|
"helmet": "~0.9.0",
|
||||||
"helmet-csp": "^0.2.3",
|
"helmet-csp": "^0.2.3",
|
||||||
|
"history": "^1.9.0",
|
||||||
"jade": "~1.8.0",
|
"jade": "~1.8.0",
|
||||||
"json-loader": "^0.5.2",
|
"json-loader": "^0.5.2",
|
||||||
"less": "~1.7.5",
|
"less": "~2.5.1",
|
||||||
"less-middleware": "~2.0.1",
|
|
||||||
"lodash": "^3.9.3",
|
"lodash": "^3.9.3",
|
||||||
"loopback": "https://github.com/FreeCodeCamp/loopback.git#fix/no-password",
|
"loopback": "https://github.com/FreeCodeCamp/loopback.git#fix/no-password",
|
||||||
"loopback-boot": "2.8.2",
|
"loopback-boot": "2.8.2",
|
||||||
@ -85,33 +87,33 @@
|
|||||||
"pmx": "^0.3.16",
|
"pmx": "^0.3.16",
|
||||||
"ramda": "~0.10.0",
|
"ramda": "~0.10.0",
|
||||||
"react": "^0.13.3",
|
"react": "^0.13.3",
|
||||||
"react-bootstrap": "^0.23.7",
|
"react-bootstrap": "~0.23.7",
|
||||||
"react-motion": "~0.1.0",
|
"react-motion": "~0.1.0",
|
||||||
"react-router": "https://github.com/BerkeleyTrue/react-router#freecodecamp",
|
"react-router": "^1.0.0-rc1",
|
||||||
"react-vimeo": "^0.0.3",
|
"react-vimeo": "^0.0.3",
|
||||||
"request": "~2.53.0",
|
"request": "~2.53.0",
|
||||||
|
"rev-del": "^1.0.5",
|
||||||
"rx": "^2.5.3",
|
"rx": "^2.5.3",
|
||||||
"sanitize-html": "~1.6.1",
|
"sanitize-html": "~1.6.1",
|
||||||
"sort-keys": "^1.1.1",
|
"sort-keys": "^1.1.1",
|
||||||
"source-map-support": "^0.3.2",
|
"source-map-support": "^0.3.2",
|
||||||
|
"store": "https://github.com/berkeleytrue/store.js.git#feature/noop-server",
|
||||||
"thundercats": "^2.1.0",
|
"thundercats": "^2.1.0",
|
||||||
"thundercats-react": "^0.1.0",
|
"thundercats-react": "^0.1.0",
|
||||||
"twit": "~1.1.20",
|
"twit": "~1.1.20",
|
||||||
"uglify-js": "~2.4.15",
|
"uglify-js": "~2.4.15",
|
||||||
"validator": "~3.22.1",
|
"validator": "^3.22.1",
|
||||||
"webpack": "^1.9.12",
|
"webpack": "^1.9.12",
|
||||||
|
"xss-filters": "^1.2.6",
|
||||||
"yui": "~3.18.1"
|
"yui": "~3.18.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-eslint": "^3.1.7",
|
|
||||||
"blessed": "~0.0.37",
|
"blessed": "~0.0.37",
|
||||||
"bower-main-files": "~0.0.4",
|
"bower-main-files": "~0.0.4",
|
||||||
"browser-sync": "~1.8.1",
|
"browser-sync": "~1.8.1",
|
||||||
"browserify": "^10.2.4",
|
"browserify": "^10.2.4",
|
||||||
"chai": "~1.10.0",
|
"chai": "~1.10.0",
|
||||||
"envify": "^3.4.0",
|
"envify": "^3.4.0",
|
||||||
"eslint": "^0.21.2",
|
|
||||||
"eslint-plugin-react": "^2.3.0",
|
|
||||||
"gulp": "~3.8.8",
|
"gulp": "~3.8.8",
|
||||||
"gulp-eslint": "~0.9.0",
|
"gulp-eslint": "~0.9.0",
|
||||||
"gulp-inject": "~1.0.2",
|
"gulp-inject": "~1.0.2",
|
||||||
|
9
public/css/lato.css
Normal file
9
public/css/lato.css
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: "Lato";
|
||||||
|
src: url(/fonts/Lato-Regular.ttf) format("truetype");
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Lato Light";
|
||||||
|
src: url(/fonts/Lato-Light.ttf) format("truetype");
|
||||||
|
}
|
9
public/css/ubuntu.css
Normal file
9
public/css/ubuntu.css
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: "Ubuntu";
|
||||||
|
src: url(/fonts/Ubuntu-Regular.ttf) format("truetype");
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Ubuntu Mono";
|
||||||
|
src: url(/fonts/UbuntuMono-Regular.ttf) format("truetype");
|
||||||
|
}
|
0
public/fonts/Lato-Light.ttf
Executable file → Normal file
0
public/fonts/Lato-Light.ttf
Executable file → Normal file
BIN
public/fonts/Lato-Regular.ttf
Normal file
BIN
public/fonts/Lato-Regular.ttf
Normal file
Binary file not shown.
BIN
public/fonts/Ubuntu-Regular.ttf
Normal file
BIN
public/fonts/Ubuntu-Regular.ttf
Normal file
Binary file not shown.
BIN
public/fonts/UbuntuMono-Regular.ttf
Normal file
BIN
public/fonts/UbuntuMono-Regular.ttf
Normal file
Binary file not shown.
0
public/fonts/ionicons.eot
Executable file → Normal file
0
public/fonts/ionicons.eot
Executable file → Normal file
0
public/fonts/ionicons.svg
Executable file → Normal file
0
public/fonts/ionicons.svg
Executable file → Normal file
Before Width: | Height: | Size: 326 KiB After Width: | Height: | Size: 326 KiB |
0
public/fonts/ionicons.ttf
Executable file → Normal file
0
public/fonts/ionicons.ttf
Executable file → Normal file
0
public/fonts/ionicons.woff
Executable file → Normal file
0
public/fonts/ionicons.woff
Executable file → Normal file
@ -1,93 +1,95 @@
|
|||||||
// MDN Links
|
/**
|
||||||
|
* MDN Links
|
||||||
|
*
|
||||||
|
* These links are for Bonfires. Each key/value pair is used to render a Bonfire with appropriate links.
|
||||||
|
* The text of the key is what the link text will be, e.g. <a href="https://developer ...">Global Array Object</a>
|
||||||
|
* General convention is to use the page title of the MDN reference page.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
/* These links are for Bonfires. Each key/value pair is used to render a Bonfire with appropriate links.
|
var links = {
|
||||||
|
|
||||||
|
|
||||||
The text of the key is what the link text will be, e.g. <a href="https://developer ...">Global Array Object</a>
|
|
||||||
General convention is to use the page title of the MDN reference page.
|
|
||||||
*/
|
|
||||||
var links =
|
|
||||||
{
|
|
||||||
// ========= NON MDN REFS
|
// ========= NON MDN REFS
|
||||||
"Currying": "https://leanpub.com/javascript-allonge/read#pabc",
|
"Currying": "https://leanpub.com/javascript-allonge/read#pabc",
|
||||||
"Smallest Common Multiple": "https://www.mathsisfun.com/least-common-multiple.html",
|
"Smallest Common Multiple": "https://www.mathsisfun.com/least-common-multiple.html",
|
||||||
"Permutations": "https://www.mathsisfun.com/combinatorics/combinations-permutations.html",
|
"Permutations": "https://www.mathsisfun.com/combinatorics/combinations-permutations.html",
|
||||||
"HTML Entities": "http://dev.w3.org/html5/html-author/charref",
|
"HTML Entities": "http://dev.w3.org/html5/html-author/charref",
|
||||||
"Symmetric Difference": "https://www.youtube.com/watch?v=PxffSUQRkG4",
|
"Symmetric Difference": "https://www.youtube.com/watch?v=PxffSUQRkG4",
|
||||||
|
"Roman Numerals": "http://www.mathsisfun.com/roman-numerals.html",
|
||||||
|
|
||||||
// ========= GLOBAL OBJECTS
|
// ========= GLOBAL OBJECTS
|
||||||
"Global Array Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
|
"Global Array Object": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
|
||||||
"Global Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
|
"Global Object": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
|
||||||
"Global String Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
|
"Global String Object": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
|
||||||
"Boolean Objects" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
|
"Boolean Objects": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
|
||||||
"RegExp" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
|
"RegExp": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
|
||||||
"Global Function Object": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
|
"Global Function Object": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
|
||||||
"Arguments object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments",
|
"Arguments object": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments",
|
||||||
"Closures": "https://developer.mozilla.org/en-US/docs/" +
|
"Closures": "https://developer.mozilla.org/en-US/docs/" +
|
||||||
"Web/JavaScript/Closures",
|
"Web/JavaScript/Closures",
|
||||||
|
|
||||||
// ========= GLOBAL OBJECT METHODS
|
// ========= GLOBAL OBJECT METHODS
|
||||||
"parseInt()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt",
|
"parseInt()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt",
|
||||||
|
|
||||||
|
|
||||||
// ========= PROPERTIES/MISC
|
// ========= PROPERTIES/MISC
|
||||||
"String.length" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length",
|
"String.length": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length",
|
||||||
|
|
||||||
|
|
||||||
// ========== OBJECT METHODS
|
// ========== OBJECT METHODS
|
||||||
"Object.getOwnPropertyNames()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames",
|
"Object.getOwnPropertyNames()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames",
|
||||||
"Object.keys()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys",
|
"Object.keys()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys",
|
||||||
"Object.hasOwnProperty()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty",
|
"Object.hasOwnProperty()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty",
|
||||||
|
|
||||||
|
|
||||||
// ======== STRING METHODS
|
// ======== STRING METHODS
|
||||||
"String.charAt()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt",
|
"String.charAt()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt",
|
||||||
"String.charCodeAt()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt",
|
"String.charCodeAt()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt",
|
||||||
"String.concat()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat",
|
"String.concat()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat",
|
||||||
"String.indexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf",
|
"String.indexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf",
|
||||||
"String.fromCharCode()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode",
|
"String.fromCharCode()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode",
|
||||||
"String.lastIndexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf",
|
"String.lastIndexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf",
|
||||||
"String.match()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match",
|
"String.match()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match",
|
||||||
"String.replace()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace",
|
"String.replace()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace",
|
||||||
"String.slice()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice",
|
"String.slice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice",
|
||||||
"String.split()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split",
|
"String.split()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split",
|
||||||
"String.substring()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring",
|
"String.substring()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring",
|
||||||
"String.substr()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr",
|
"String.substr()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr",
|
||||||
"String.toLowerCase()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase",
|
"String.toLowerCase()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase",
|
||||||
"String.toString()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toString",
|
"String.toString()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toString",
|
||||||
"String.toUpperCase()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase",
|
"String.toUpperCase()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase",
|
||||||
// ======== ARRAY METHODS
|
|
||||||
"Array.concat()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat",
|
|
||||||
"Array.every()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every",
|
|
||||||
"Array.filter()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter",
|
|
||||||
"Array.forEach()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach",
|
|
||||||
"Array.indexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf",
|
|
||||||
"Array.isArray()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray",
|
|
||||||
"Array.join()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join",
|
|
||||||
"Array.lastIndexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf",
|
|
||||||
"Array.map()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map",
|
|
||||||
"Array.pop()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop",
|
|
||||||
"Array.push()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push",
|
|
||||||
"Array.reduce()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce",
|
|
||||||
"Array.reverse()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse",
|
|
||||||
"Array.shift()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift",
|
|
||||||
"Array.slice()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice",
|
|
||||||
"Array.some()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some",
|
|
||||||
"Array.sort()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort",
|
|
||||||
"Array.splice()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice",
|
|
||||||
"Array.toString()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString",
|
|
||||||
|
|
||||||
// ======== MATH METHODS
|
// ======== ARRAY METHODS
|
||||||
"Math.max()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max",
|
"Array.concat()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat",
|
||||||
"Math.min()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min",
|
"Array.every()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every",
|
||||||
"Math.pow()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow",
|
"Array.filter()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter",
|
||||||
"Remainder" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Remainder_(.25)",
|
"Array.forEach()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach",
|
||||||
|
"Array.indexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf",
|
||||||
|
"Array.isArray()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray",
|
||||||
|
"Array.join()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join",
|
||||||
|
"Array.lastIndexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf",
|
||||||
|
"Array.map()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map",
|
||||||
|
"Array.pop()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop",
|
||||||
|
"Array.push()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push",
|
||||||
|
"Array.reduce()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce",
|
||||||
|
"Array.reverse()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse",
|
||||||
|
"Array.shift()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift",
|
||||||
|
"Array.slice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice",
|
||||||
|
"Array.some()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some",
|
||||||
|
"Array.sort()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort",
|
||||||
|
"Array.splice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice",
|
||||||
|
"Array.toString()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString",
|
||||||
|
|
||||||
// ======== GENERAL JAVASCRIPT REFERENCES
|
// ======== MATH METHODS
|
||||||
"Arithmetic Operators" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators",
|
"Math.max()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max",
|
||||||
"Comparison Operators" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators",
|
"Math.min()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min",
|
||||||
"Details of the Object Model" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model",
|
"Math.pow()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow",
|
||||||
|
"Remainder": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Remainder_(.25)",
|
||||||
|
|
||||||
|
// ======== GENERAL JAVASCRIPT REFERENCES
|
||||||
|
"Arithmetic Operators": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators",
|
||||||
|
"Comparison Operators": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators",
|
||||||
|
"Details of the Object Model": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model",
|
||||||
"For Loops": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for"
|
"For Loops": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for"
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = links;
|
module.exports = links;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"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. Try to pair program. 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. Try to pair program. Write your own code."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(telephoneCheck(\"555-555-5555\")).to.be.a(\"boolean\");",
|
"assert.isBoolean(telephoneCheck(\"555-555-5555\"), 'should return a boolean.');",
|
||||||
"assert.deepEqual(telephoneCheck(\"1 555-555-5555\"), true);",
|
"assert.deepEqual(telephoneCheck(\"1 555-555-5555\"), true);",
|
||||||
"assert.deepEqual(telephoneCheck(\"1 (555) 555-5555\"), true);",
|
"assert.deepEqual(telephoneCheck(\"1 (555) 555-5555\"), true);",
|
||||||
"assert.deepEqual(telephoneCheck(\"5555555555\"), true);",
|
"assert.deepEqual(telephoneCheck(\"5555555555\"), true);",
|
||||||
@ -134,9 +134,9 @@
|
|||||||
"drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);"
|
"drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]])).to.be.a('array');",
|
"assert.isArray(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), 'should return an array.');",
|
||||||
"expect(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])).to.be.a('string');",
|
"assert.isString(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'should return a string.');",
|
||||||
"expect(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])).to.be.a('string');",
|
"assert.isString(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'should return a string.');",
|
||||||
"assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['QUARTER', 0.50]], 'return correct change');",
|
"assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['QUARTER', 0.50]], 'return correct change');",
|
||||||
"assert.deepEqual(drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04] ], 'return correct change with multiple coins and bills');",
|
"assert.deepEqual(drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04] ], 'return correct change with multiple coins and bills');",
|
||||||
"assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'Insufficient Funds', 'insufficient funds');",
|
"assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'Insufficient Funds', 'insufficient funds');",
|
||||||
@ -190,8 +190,8 @@
|
|||||||
"inventory(curInv, newInv);"
|
"inventory(curInv, newInv);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])).to.be.a('array');",
|
"assert.isArray(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), 'should return an array.');",
|
||||||
"assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6);",
|
"assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6, 'should return an array with a length of 6.');",
|
||||||
"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]);",
|
"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]);",
|
||||||
"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]);",
|
"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]);",
|
||||||
"assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']]);",
|
"assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']]);",
|
||||||
@ -230,13 +230,13 @@
|
|||||||
"permAlone('aab');"
|
"permAlone('aab');"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(permAlone('aab')).to.be.a('number');",
|
"assert.isNumber(permAlone('aab'), 'should return a \"number\".');",
|
||||||
"expect(permAlone('aab')).to.equal(2);",
|
"assert.strictEqual(permAlone('aab'), 2, 'should return 2.');",
|
||||||
"expect(permAlone('aaa')).to.equal(0);",
|
"assert.strictEqual(permAlone('aaa'), 0, 'should return 0.');",
|
||||||
"expect(permAlone('aabb')).to.equal(8);",
|
"assert.strictEqual(permAlone('aabb'), 8, 'should return 8.');",
|
||||||
"expect(permAlone('abcdefa')).to.equal(3600);",
|
"assert.strictEqual(permAlone('abcdefa'), 3600, 'should return 3600.');",
|
||||||
"expect(permAlone('abfdefa')).to.equal(2640);",
|
"assert.strictEqual(permAlone('abfdefa'), 2640, 'should return 2640.');",
|
||||||
"expect(permAlone('zzzzzzzz')).to.equal(0);"
|
"assert.strictEqual(permAlone('zzzzzzzz'), 0, 'should return 0.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Permutations",
|
"Permutations",
|
||||||
|
@ -13,11 +13,11 @@
|
|||||||
"If you don't already have Cloud 9 account, create one now at <a href='http://c9.io' target='_blank'>http://c9.io</a>.",
|
"If you don't already have Cloud 9 account, create one now at <a href='http://c9.io' target='_blank'>http://c9.io</a>.",
|
||||||
"Now let's get your development environment ready for a new Angular-Fullstack application provided by Yeoman.",
|
"Now let's get your development environment ready for a new Angular-Fullstack application provided by Yeoman.",
|
||||||
"Open up <a href='http://c9.io' target='_blank'>http://c9.io</a> and sign in to your account.",
|
"Open up <a href='http://c9.io' target='_blank'>http://c9.io</a> and sign in to your account.",
|
||||||
"Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
|
"Click on the \"+\" icon at the top right of the c9.io page to create a new workspace.",
|
||||||
"Give your workspace a name.",
|
"Give your workspace a name and an optional description.",
|
||||||
"Choose Node.js in the selection area below the name field.",
|
"Choose Node.js in the selection area below the name field.",
|
||||||
"Click the Create button. Then click into your new workspace.",
|
"Click the \"Create workspace\" button.",
|
||||||
"In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
|
"Once C9 builds and loads your workspace, you should see a terminal window in the lower right hand corner. In this window use the following commands. You don't need to know what these mean at this point.",
|
||||||
"Never run this command on your local machine. But in your Cloud 9 terminal window, run: <code>rm -rf * && echo \"export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/v0.10.35/lib/node_modules\" >> ~/.bashrc && source ~/.bashrc && npm install -g yo grunt grunt-cli generator-angular-fullstack && yo angular-fullstack</code>",
|
"Never run this command on your local machine. But in your Cloud 9 terminal window, run: <code>rm -rf * && echo \"export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/v0.10.35/lib/node_modules\" >> ~/.bashrc && source ~/.bashrc && npm install -g yo grunt grunt-cli generator-angular-fullstack && yo angular-fullstack</code>",
|
||||||
"Yeoman will prompt you to answer some questions. Answer them like this:",
|
"Yeoman will prompt you to answer some questions. Answer them like this:",
|
||||||
"What would you like to write scripts with? <span class='text-success'>JavaScript</span>",
|
"What would you like to write scripts with? <span class='text-success'>JavaScript</span>",
|
||||||
@ -79,14 +79,14 @@
|
|||||||
"<span class='text-info'>User Story:</span> As an authenticated user, I can see the aggregate results of my polls.",
|
"<span class='text-info'>User Story:</span> As an authenticated user, I can see the aggregate results of my polls.",
|
||||||
"<span class='text-info'>User Story:</span> As an authenticated user, I can delete polls that I decide I don't want anymore.",
|
"<span class='text-info'>User Story:</span> As an authenticated user, I can delete polls that I decide I don't want anymore.",
|
||||||
"<span class='text-info'>User Story:</span> As an authenticated user, I can create a poll with any number of possible items.",
|
"<span class='text-info'>User Story:</span> As an authenticated user, I can create a poll with any number of possible items.",
|
||||||
"<span class='text-info'>Bonus User Story:</span> As an unauthenticated user, I can see everyone's polls, but I can't vote on anything.",
|
"<span class='text-info'>Bonus User Story:</span> As an unauthenticated or authenticated user, I can see and vote on everyone's polls.",
|
||||||
"<span class='text-info'>Bonus User Story:</span> As an unauthenticated or authenticated user, I can see the results of polls in chart form. (This could be implemented using Chart.js or Google Charts.)",
|
"<span class='text-info'>Bonus User Story:</span> As an unauthenticated or authenticated user, I can see the results of polls in chart form. (This could be implemented using Chart.js or Google Charts.)",
|
||||||
"<span class='text-info'>Bonus User Story:</span> As an authenticated user, if I don't like the options on a poll, I can create a new option.",
|
"<span class='text-info'>Bonus User Story:</span> As an authenticated user, if I don't like the options on a poll, I can create a new option.",
|
||||||
"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>.",
|
||||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it.",
|
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your Heroku project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_HEROKU_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "basejumps",
|
"type": "basejump",
|
||||||
"challengeType": 4,
|
"challengeType": 4,
|
||||||
"tests": [],
|
"tests": [],
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -118,9 +118,9 @@
|
|||||||
"<span class='text-info'>Hint:</span> Try using the <a href='https://www.yelp.com/developers/documentation/v2/overview' target='_blank'>Yelp API</a> to find venues in the cities your users search for.",
|
"<span class='text-info'>Hint:</span> Try using the <a href='https://www.yelp.com/developers/documentation/v2/overview' target='_blank'>Yelp API</a> to find venues in the cities your users search for.",
|
||||||
"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>.",
|
||||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it.",
|
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your Heroku project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_HEROKU_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "basejumps",
|
"type": "basejump",
|
||||||
"challengeType": 4,
|
"challengeType": 4,
|
||||||
"tests": [],
|
"tests": [],
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -151,9 +151,9 @@
|
|||||||
"<span class='text-info'>Bonus User Story:</span> As a user, I can see changes in real-time when any other user adds or removes a stock.",
|
"<span class='text-info'>Bonus User Story:</span> As a user, I can see changes in real-time when any other user adds or removes a stock.",
|
||||||
"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>.",
|
||||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it.",
|
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your Heroku project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_HEROKU_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "basejumps",
|
"type": "basejump",
|
||||||
"challengeType": 4,
|
"challengeType": 4,
|
||||||
"tests": [],
|
"tests": [],
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -184,9 +184,9 @@
|
|||||||
"<span class='text-info'>Bonus User Story:</span> As an authenticated user, I can propose a trade and wait for the other user to accept the trade.",
|
"<span class='text-info'>Bonus User Story:</span> As an authenticated user, I can propose a trade and wait for the other user to accept the trade.",
|
||||||
"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>.",
|
||||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it.",
|
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your Heroku project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_HEROKU_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "basejumps",
|
"type": "basejump",
|
||||||
"challengeType": 4,
|
"challengeType": 4,
|
||||||
"tests": [],
|
"tests": [],
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -220,9 +220,9 @@
|
|||||||
"<span class='text-info'>Hint:</span> <a href='http://masonry.desandro.com/' target='_blank'>Masonry.js</a> is a library that allows for Pinterest-style image grids.",
|
"<span class='text-info'>Hint:</span> <a href='http://masonry.desandro.com/' target='_blank'>Masonry.js</a> is a library that allows for Pinterest-style image grids.",
|
||||||
"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>.",
|
||||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it.",
|
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your Heroku project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_HEROKU_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "basejumps",
|
"type": "basejump",
|
||||||
"challengeType": 4,
|
"challengeType": 4,
|
||||||
"tests": [],
|
"tests": [],
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Basic Algorithm Scripting",
|
"name": "Basic Algorithm Scripting",
|
||||||
"order": 0.006,
|
"order": 0.007,
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "ad7123c8c441eddfaeb5bdef",
|
"id": "ad7123c8c441eddfaeb5bdef",
|
||||||
@ -8,13 +8,13 @@
|
|||||||
"difficulty": "0",
|
"difficulty": "0",
|
||||||
"description": [
|
"description": [
|
||||||
"Your goal is to fix the failing test.",
|
"Your goal is to fix the failing test.",
|
||||||
"First, run all the tests by clicking \"Run code\" or by pressing Control + Enter.",
|
"First, run all the tests by clicking \"Run tests\" or by pressing Control + Enter.",
|
||||||
"The failing test is in red. Fix the code so that all tests pass. Then you can move on to the next Bonfire.",
|
"The failing test is in red. Fix the code so that all tests pass. Then you can move on to the next Bonfire.",
|
||||||
"Make this function return true no matter what."
|
"Make this function return true no matter what."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(meetBonfire()).to.be.a(\"boolean\");",
|
"assert(typeof(meetBonfire()) === \"boolean\", 'The result should be a Boolean value of true or false.');",
|
||||||
"expect(meetBonfire()).to.be.true;"
|
"assert(meetBonfire() === true, 'Your <code>meetBonfire()</code> function should return <code>true</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"function meetBonfire(argument) {",
|
"function meetBonfire(argument) {",
|
||||||
@ -46,23 +46,23 @@
|
|||||||
"title": "Reverse a String",
|
"title": "Reverse a String",
|
||||||
"difficulty": "1.01",
|
"difficulty": "1.01",
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(reverseString('hello')).to.be.a('String');",
|
"assert(typeof(reverseString(\"hello\")) === \"string\", '<code>reverseString()</code> should return a string.');",
|
||||||
"expect(reverseString('hello')).to.equal('olleh');",
|
"assert(reverseString(\"hello\") === \"olleh\", '<code>\"hello\"</code> should become <code>\"olleh\"</code>.');",
|
||||||
"expect(reverseString('Howdy')).to.equal('ydwoH');",
|
"assert(reverseString(\"Howdy\") === \"ydwoH\", '<code>\"Howdy\"</code> should become <code>\"ydwoH\"</code>.');",
|
||||||
"expect(reverseString('Greetings from Earth')).to.equal('htraE morf sgniteerG');"
|
"assert(reverseString(\"Greetings from Earth\") === \"htraE morf sgniteerG\", '<code>\"Greetings from Earth\"</code> should return <code>\"htraE morf sgniteerG\"</code>.');"
|
||||||
],
|
],
|
||||||
"description": [
|
"description": [
|
||||||
"Reverse the provided string.",
|
"Reverse the provided string.",
|
||||||
"You may need to turn the string into an array before you can reverse it.",
|
"You may need to turn the string into an array before you can reverse it.",
|
||||||
"Your result must be a string.",
|
"Your result must be a string.",
|
||||||
"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": [
|
||||||
"function reverseString(str) {",
|
"function reverseString(str) {",
|
||||||
" return str;",
|
" return str;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"reverseString('hello');"
|
"reverseString(\"hello\", \"\");"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Global String Object",
|
"Global String Object",
|
||||||
@ -87,26 +87,26 @@
|
|||||||
"id": "a302f7aae1aa3152a5b413bc",
|
"id": "a302f7aae1aa3152a5b413bc",
|
||||||
"title": "Factorialize a Number",
|
"title": "Factorialize a Number",
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(factorialize(5)).to.be.a(\"Number\");",
|
"assert(typeof(factorialize(5)) === \"number\", '<code>factorialize()</code> should return a number.');",
|
||||||
"expect(factorialize(5)).to.equal(120);",
|
"assert(factorialize(5) === 120, '<code>5</code> should return <code>120</code>.');",
|
||||||
"expect(factorialize(10)).to.equal(3628800);",
|
"assert(factorialize(10) === 3628800, '<code>10</code> should return <code>3,628,800</code>.');",
|
||||||
"expect(factorialize(20)).to.equal(2432902008176640000);",
|
"assert(factorialize(20) === 2432902008176640000, '<code>20</code> should return <code>2,432,902,008,176,640,000</code>.');",
|
||||||
"expect(factorialize(0)).to.equal(1);"
|
"assert(factorialize(0) === 1, '<code>0</code> should return 1.');"
|
||||||
],
|
],
|
||||||
"difficulty": "1.02",
|
"difficulty": "1.02",
|
||||||
"description": [
|
"description": [
|
||||||
"Return the factorial of the provided integer.",
|
"Return the factorial of the provided integer.",
|
||||||
"If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.",
|
"If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.",
|
||||||
"Factorials are often represented with the shorthand notation n!",
|
"Factorials are often represented with the shorthand notation <code>n!</code>",
|
||||||
"For example: 5! = 1 * 2 * 3 * 4 * 5 = 120f",
|
"For example: <code>5! = 1 * 2 * 3 * 4 * 5 = 120</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."
|
"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": [
|
||||||
"function factorialize(num) {",
|
"function factorialize(num) {",
|
||||||
" return num;",
|
" return num;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"factorialize(5);"
|
"factorialize(5, '');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Arithmetic Operators"
|
"Arithmetic Operators"
|
||||||
@ -133,20 +133,20 @@
|
|||||||
"A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.",
|
"A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.",
|
||||||
"You'll need to remove punctuation and turn everything lower case in order to check for palindromes.",
|
"You'll need to remove punctuation and turn everything lower case in order to check for palindromes.",
|
||||||
"We'll pass strings with varying formats, such as \"racecar\", \"RaceCar\", and \"race CAR\" among others.",
|
"We'll pass strings with varying formats, such as \"racecar\", \"RaceCar\", and \"race CAR\" among others.",
|
||||||
"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."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(palindrome(\"eye\")).to.be.a(\"boolean\");",
|
"assert(typeof(palindrome(\"eye\")) === \"boolean\", '<code>palindrome()<code> should return a boolean.');",
|
||||||
"assert.deepEqual(palindrome(\"eye\"), true);",
|
"assert(palindrome(\"eye\") === true, '<code>\"eye\"</code> should return true.');",
|
||||||
"assert.deepEqual(palindrome(\"race car\"), true);",
|
"assert(palindrome(\"race car\") === true, '<code>\"race car\"</code> should return true.');",
|
||||||
"assert.deepEqual(palindrome(\"not a palindrome\"), false);",
|
"assert(palindrome(\"not a palindrome\") === false, '<code>\"not a palindrome\"</code> should return false.');",
|
||||||
"assert.deepEqual(palindrome(\"A man, a plan, a canal. Panama\"), true);",
|
"assert(palindrome(\"A man, a plan, a canal. Panama\") === true, '<code>\"A man, a plan, a canal. Panama\"</code> should return true.');",
|
||||||
"assert.deepEqual(palindrome(\"never odd or even\"), true);",
|
"assert(palindrome(\"never odd or even\") === true, '<code>\"never odd or even\"</code> should return true.');",
|
||||||
"assert.deepEqual(palindrome(\"nope\"), false);",
|
"assert(palindrome(\"nope\") === false, '<code>\"nope\"</code> should return false.');",
|
||||||
"assert.deepEqual(palindrome(\"almostomla\"), false);",
|
"assert(palindrome(\"almostomla\") === false, '<code>\"almostomla\"</code> should return false.');",
|
||||||
"assert.deepEqual(palindrome(\"My age is 0, 0 si ega ym.\"), true);",
|
"assert(palindrome(\"My age is 0, 0 si ega ym.\") === true, '<code>\"My age is 0, 0 si ega ym.\"</code> should return true.');",
|
||||||
"assert.deepEqual(palindrome(\"I'm 23 non 32 m'I?\"), true);",
|
"assert(palindrome(\"1 eye for of 1 eye.\") === false, '<code>\"1 eye for of 1 eye.\"</code> should return false.');",
|
||||||
"assert.deepEqual(palindrome(\"1 eye for of 1 eye.\"), false);"
|
"assert(palindrome(\"0_0 (: /-\\ :) 0-0\") === true, '<code>\"0_0 (: /-\\\\ :) 0-0\"</code> should return true.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"function palindrome(str) {",
|
"function palindrome(str) {",
|
||||||
@ -182,22 +182,22 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"Return the length of the longest word in the provided sentence.",
|
"Return the length of the longest word in the provided sentence.",
|
||||||
"Your response should be a number.",
|
"Your response should be a number.",
|
||||||
"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": [
|
||||||
"function findLongestWord(str) {",
|
"function findLongestWord(str) {",
|
||||||
" return str.length;",
|
" return str.length;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"findLongestWord('The quick brown fox jumped over the lazy dog');"
|
"findLongestWord(\"The quick brown fox jumped over the lazy dog\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(findLongestWord('The quick brown fox jumped over the lazy dog')).to.be.a('Number');",
|
"assert(typeof(findLongestWord(\"The quick brown fox jumped over the lazy dog\")) === \"number\", '<code>findLongestWord()</code> should return a number.');",
|
||||||
"expect(findLongestWord('The quick brown fox jumped over the lazy dog')).to.equal(6);",
|
"assert(findLongestWord(\"The quick brown fox jumped over the lazy dog\") === 6, '<code>\"The quick brown fox jumped over the lazy dog\"</code> should return <code>6</code>.');",
|
||||||
"expect(findLongestWord('May the force be with you')).to.equal(5);",
|
"assert(findLongestWord(\"May the force be with you\") === 5, '<code>\"May the force be with you\"</code> should return <code>5</code>.');",
|
||||||
"expect(findLongestWord('Google do a barrel roll')).to.equal(6);",
|
"assert(findLongestWord(\"Google do a barrel roll\") === 6, '<code>\"Google do a barrel roll\"</code> should return <code>6</code>.');",
|
||||||
"expect(findLongestWord('What is the average airspeed velocity of an unladen swallow')).to.equal(8);",
|
"assert(findLongestWord(\"What is the average airspeed velocity of an unladen swallow\") === 8, '<code>\"What is the average airspeed velocity of an unladen swallow\"</code> should return <code>8</code>.');",
|
||||||
"expect(findLongestWord('What if we try a super-long word such as otorhinolaryngology')).to.equal(19);"
|
"assert(findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\") === 19, '<code>\"What if we try a super-long word such as otorhinolaryngology\"</code> should return <code>19</code>.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"String.split()",
|
"String.split()",
|
||||||
@ -221,22 +221,22 @@
|
|||||||
"title": "Title Case a Sentence",
|
"title": "Title Case a Sentence",
|
||||||
"difficulty": "1.05",
|
"difficulty": "1.05",
|
||||||
"description": [
|
"description": [
|
||||||
"Return the provided string with the first letter of each word capitalized.",
|
"Return the provided string with the first letter of each word capitalized. Make sure the rest of the word is in lower case.",
|
||||||
"For the purpose of this exercise, you should also capitalize connecting words like 'the' and 'of'.",
|
"For the purpose of this exercise, you should also capitalize connecting words like \"the\" and \"of\".",
|
||||||
"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": [
|
||||||
"function titleCase(str) {",
|
"function titleCase(str) {",
|
||||||
" return str;",
|
" return str;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"titleCase(\"I'm a little tea pot\");"
|
"titleCase(\"I'm a little tea pot\", \"\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(titleCase(\"I'm a little tea pot\")).to.be.a('String');",
|
"assert(typeof(titleCase(\"I'm a little tea pot\")) === \"string\", '<code>titleCase()</code> should return a string.');",
|
||||||
"expect(titleCase(\"I'm a little tea pot\")).to.equal(\"I'm A Little Tea Pot\");",
|
"assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", '<code>\"I'm a little tea pot\"</code> should return <code>\"I'm A Little Tea Pot\"</code>.');",
|
||||||
"expect(titleCase(\"sHoRt AnD sToUt\")).to.equal(\"Short And Stout\");",
|
"assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", '<code>\"sHoRt AnD sToUt\"</code> should return <code>\"Short And Stout\"</code>.');",
|
||||||
"expect(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\")).to.equal(\"Here Is My Handle Here Is My Spout\");"
|
"assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", '<code>\"HERE IS MY HANDLE HERE IS MY SPOUT\"</code> should return <code>\"Here Is My Handle Here Is My Spout\"</code>');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"String.charAt()"
|
"String.charAt()"
|
||||||
@ -262,7 +262,7 @@
|
|||||||
"Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.",
|
"Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.",
|
||||||
"Remember, you can iterate through an array with a simple for loop, and access each member with array syntax arr[i] .",
|
"Remember, you can iterate through an array with a simple for loop, and access each member with array syntax arr[i] .",
|
||||||
"If you are writing your own Chai.js tests, be sure to use a deep equal statement instead of an equal statement when comparing arrays.",
|
"If you are writing your own Chai.js tests, be sure to use a deep equal statement instead of an equal statement when comparing arrays.",
|
||||||
"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": [
|
||||||
"function largestOfFour(arr) {",
|
"function largestOfFour(arr) {",
|
||||||
@ -270,12 +270,12 @@
|
|||||||
" return arr;",
|
" return arr;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);"
|
"largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]], \"\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect( largestOfFour( [[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]) ).to.be.a('array');",
|
"assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]).constructor === Array, '<code>largestOfFour()</code> should return an array.');",
|
||||||
"assert.deepEqual( largestOfFour( [[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]), [27,5,39,1001], 'arrays should match.');",
|
"assert.deepEqual(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]), [27,5,39,1001], '<code>[[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]</code> should return <code>[27,5,39,1001]</code>.');",
|
||||||
"assert.deepEqual( largestOfFour( [[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]), [9,35,97,1000000], 'arrays should match.');"
|
"assert.deepEqual(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]), [9,35,97,1000000], '<code>[[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]</code> should return <code>[9, 35, 97, 1000000]</code>.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Comparison Operators"
|
"Comparison Operators"
|
||||||
@ -299,7 +299,7 @@
|
|||||||
"difficulty": "1.07",
|
"difficulty": "1.07",
|
||||||
"description": [
|
"description": [
|
||||||
"Check if a string (first argument) ends with the given target string (second argument).",
|
"Check if a string (first argument) ends with the given target string (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": [
|
||||||
"function end(str, target) {",
|
"function end(str, target) {",
|
||||||
@ -308,14 +308,14 @@
|
|||||||
" return str;",
|
" return str;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"end('Bastian', 'n');"
|
"end(\"Bastian\", \"n\", \"\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.strictEqual(end('Bastian', 'n'), true, 'should equal true if target equals end of string');",
|
"assert(end(\"Bastian\", \"n\") === true, '<code>\"Bastian\", \"n\"</code> should return true.');",
|
||||||
"assert.strictEqual(end('Connor', 'n'), false, 'should equal false if target does not equal end of string');",
|
"assert(end(\"Connor\", \"n\") === false, '<code>\"Connor\", \"n\"</code> should return false.');",
|
||||||
"assert.strictEqual(end('Walking on water and developing software from a specification are easy if both are frozen.', 'specification'), false, 'should equal false if target does not equal end of string');",
|
"assert(end(\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\") === false, '<code>\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\")</code> should return false.');",
|
||||||
"assert.strictEqual(end('He has to give me a new name', 'name'), true, 'should equal true if target equals end of string');",
|
"assert(end(\"He has to give me a new name\", \"name\") === true, '<code>\"He has to give me a new name\", \"name\"</code> should return true.');",
|
||||||
"assert.strictEqual(end('If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing', 'mountain'), false, 'should equal false if target does not equal end of string');"
|
"assert(end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, '<code>\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\"</code> should return false.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"String.substr()"
|
"String.substr()"
|
||||||
@ -339,7 +339,7 @@
|
|||||||
"difficulty": "1.08",
|
"difficulty": "1.08",
|
||||||
"description": [
|
"description": [
|
||||||
"Repeat a given string (first argument) n times (second argument). Return an empty string if n is a negative number.",
|
"Repeat a given string (first argument) n times (second argument). Return an empty string if n is a negative number.",
|
||||||
"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": [
|
||||||
"function repeat(str, num) {",
|
"function repeat(str, num) {",
|
||||||
@ -347,12 +347,12 @@
|
|||||||
" return str;",
|
" return str;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"repeat('abc', 3);"
|
"repeat(\"abc\", 3, \"\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.strictEqual(repeat('*', 3), '***', 'should repeat a string n times');",
|
"assert(repeat(\"*\", 3) === \"***\", '<code>\"*\", 3</code> should return <code>\"***\"</code>.');",
|
||||||
"assert.strictEqual(repeat('abc', 3), 'abcabcabc', 'should repeat a string n times');",
|
"assert(repeat(\"abc\", 3) === \"abcabcabc\", '<code>\"abc\", 3</code> should return <code>\"abcabcabc\"</code>.');",
|
||||||
"assert.strictEqual(repeat('abc', -2), '', 'should return an empty string for negative numbers');"
|
"assert(repeat(\"abc\", -2) === \"\", '<code>\"abc\", -2</code> should return <code>\"\"</code>.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Global String Object"
|
"Global String Object"
|
||||||
@ -375,9 +375,9 @@
|
|||||||
"title": "Truncate a string",
|
"title": "Truncate a string",
|
||||||
"difficulty": "1.09",
|
"difficulty": "1.09",
|
||||||
"description": [
|
"description": [
|
||||||
"Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending.",
|
"Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a \"...\" ending.",
|
||||||
"Note that the three dots at the end add to the string length.",
|
"Note that the three dots at the end add to the string length.",
|
||||||
"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": [
|
||||||
"function truncate(str, num) {",
|
"function truncate(str, num) {",
|
||||||
@ -385,13 +385,13 @@
|
|||||||
" return str;",
|
" return str;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"truncate('A-tisket a-tasket A green and yellow basket', 11);"
|
"truncate(\"A-tisket a-tasket A green and yellow basket\", 11, \"\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(truncate('A-tisket a-tasket A green and yellow basket', 11)).to.eqls('A-tisket...');",
|
"assert(truncate(\"A-tisket a-tasket A green and yellow basket\", 11) === \"A-tisket...\", '<code>\"A-tisket a-tasket A green and yellow basket\", 1</code> should return <code>\"A-tisket...\"</code>.');",
|
||||||
"expect(truncate('Peter Piper picked a peck of pickled peppers', 14)).to.eqls('Peter Piper...');",
|
"assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", '<code>\"Peter Piper picked a peck of pickled peppers\", 14</code> should return <code>\"Peter Piper...\"</code>.');",
|
||||||
"assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length) === 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is = length');",
|
"assert(truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length) === \"A-tisket a-tasket A green and yellow basket\", '<code>\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length)</code> should return <code>\"A-tisket a-tasket A green and yellow basket\"</code>.');",
|
||||||
"assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2), 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is < length');"
|
"assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2) === 'A-tisket a-tasket A green and yellow basket', '<code>\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2</code> should return <code>\"A-tisket a-tasket A green and yellow basket\"</code>.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"String.slice()"
|
"String.slice()"
|
||||||
@ -415,7 +415,7 @@
|
|||||||
"difficulty": "1.10",
|
"difficulty": "1.10",
|
||||||
"description": [
|
"description": [
|
||||||
"Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.",
|
"Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.",
|
||||||
"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": [
|
||||||
"function chunk(arr, size) {",
|
"function chunk(arr, size) {",
|
||||||
@ -423,13 +423,13 @@
|
|||||||
" return arr;",
|
" return arr;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"chunk(['a', 'b', 'c', 'd'], 2);"
|
"chunk([\"a\", \"b\", \"c\", \"d\"], 2, \"\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(chunk(['a', 'b', 'c', 'd'], 2), [['a', 'b'], ['c', 'd']], 'should return chunked arrays');",
|
"assert.deepEqual(chunk([\"a\", \"b\", \"c\", \"d\"], 2), [[\"a\", \"b\"], [\"c\", \"d\"]], '<code>[\"a\", \"b\", \"c\", \"d\"], 2</code> should return <code>[[\"a\", \"b\"], [\"c\", \"d\"]]</code>.');",
|
||||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'should return chunked arrays');",
|
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], '<code>[0, 1, 2, 3, 4, 5]</code> should return <code>[[0, 1, 2], [3, 4, 5]]</code>.');",
|
||||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'should return chunked arrays');",
|
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], '<code>[0, 1, 2, 3, 4, 5], 2</code> should return <code>[[0, 1], [2, 3], [4, 5]]</code>.');",
|
||||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'should return the last chunk as remaining elements');"
|
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], '<code>[0, 1, 2, 3, 4, 5], 4</code> should return <code>[[0, 1, 2, 3], [4, 5]]</code>.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.push()"
|
"Array.push()"
|
||||||
@ -453,7 +453,7 @@
|
|||||||
"difficulty": "1.11",
|
"difficulty": "1.11",
|
||||||
"description": [
|
"description": [
|
||||||
"Return the remaining elements of an array after chopping off n elements from the head.",
|
"Return the remaining elements of an array after chopping off n elements from the head.",
|
||||||
"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": [
|
||||||
"function slasher(arr, howMany) {",
|
"function slasher(arr, howMany) {",
|
||||||
@ -461,12 +461,12 @@
|
|||||||
" return arr;",
|
" return arr;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"slasher([1, 2, 3], 2);"
|
"slasher([1, 2, 3], 2, \"\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(slasher([1, 2, 3], 2), [3], 'should drop the first two elements');",
|
"assert.deepEqual(slasher([1, 2, 3], 2), [3], '<code>slasher([1, 2, 3], 2)</code> should return <code>[3]</code>.');",
|
||||||
"assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'should return all elements');",
|
"assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], '<code>slasher([1, 2, 3], 0)</code> should return <code>[1, 2, 3]</code>.');",
|
||||||
"assert.deepEqual(slasher([1, 2, 3], 9), [], 'should return an empty array');"
|
"assert.deepEqual(slasher([1, 2, 3], 9), [], '<code>slasher([1, 2, 3], 9)</code> should return <code>[]</code>.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.slice()",
|
"Array.slice()",
|
||||||
@ -491,27 +491,27 @@
|
|||||||
"difficulty": "1.12",
|
"difficulty": "1.12",
|
||||||
"description": [
|
"description": [
|
||||||
"Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.",
|
"Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.",
|
||||||
"For example, ['hello', 'Hello'], should return true because all of the letters in the second string are present in the first, ignoring case.",
|
"For example, <code>[\"hello\", \"Hello\"]</code>, should return true because all of the letters in the second string are present in the first, ignoring case.",
|
||||||
"The arguments ['hello', 'hey'] should return false because the string 'hello' does not contain a 'y'.",
|
"The arguments <code>[\"hello\", \"hey\"]</code> should return false because the string \"hello\" does not contain a \"y\".",
|
||||||
"Lastly, ['Alien', 'line'], should return true because all of the letters in 'line' are present in 'Alien'.",
|
"Lastly, <code>[\"Alien\", \"line\"]</code>, should return true because all of the letters in \"line\" are present in \"Alien\".",
|
||||||
"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": [
|
||||||
"function mutation(arr) {",
|
"function mutation(arr) {",
|
||||||
" return arr;",
|
" return arr;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"mutation(['hello', 'hey']);"
|
"mutation([\"hello\", \"hey\"], \"\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(mutation(['hello', 'hey'])).to.be.false;",
|
"assert(mutation([\"hello\", \"hey\"]) === false, '<code>[\"hello\", \"hey\"]</code> should return false.');",
|
||||||
"expect(mutation(['hello', 'Hello'])).to.be.true;",
|
"assert(mutation([\"hello\", \"Hello\"]) === true, '<code>[\"hello\", \"Hello\"]</code> should return true.');",
|
||||||
"expect(mutation(['zyxwvutsrqponmlkjihgfedcba', 'qrstu'])).to.be.true;",
|
"assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, '<code>[\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]</code> should return true.');",
|
||||||
"expect(mutation(['Mary', 'Army'])).to.be.true;",
|
"assert(mutation([\"Mary\", \"Army\"]) === true, '<code>[\"Mary\", \"Army\"]</code> should return true.');",
|
||||||
"expect(mutation(['Mary', 'Aarmy'])).to.be.true;",
|
"assert(mutation([\"Mary\", \"Aarmy\"]) === true, '<code>[\"Mary\", \"Aarmy\"]</code> should return true.');",
|
||||||
"expect(mutation(['Alien', 'line'])).to.be.true;",
|
"assert(mutation([\"Alien\", \"line\"]) === true, '<code>[\"Alien\", \"line\"]</code> should return true.');",
|
||||||
"expect(mutation(['floor', 'for'])).to.be.true;",
|
"assert(mutation([\"floor\", \"for\"]) === true, '<code>[\"floor\", \"for\"]</code> should return true.');",
|
||||||
"expect(mutation(['hello', 'neo'])).to.be.false;"
|
"assert(mutation([\"hello\", \"neo\"]) === false, '<code>[\"hello\", \"neo\"]</code> should return false.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.indexOf()"
|
"Array.indexOf()"
|
||||||
@ -536,7 +536,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"Remove all falsy values from an array.",
|
"Remove all falsy values from an array.",
|
||||||
"Falsy 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": [
|
||||||
"function bouncer(arr) {",
|
"function bouncer(arr) {",
|
||||||
@ -544,12 +544,12 @@
|
|||||||
" return arr;",
|
" return arr;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"bouncer([7, 'ate', '', false, 9]);"
|
"bouncer([7, \"ate\", \"\", false, 9], \"\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(bouncer([7, 'ate', '', false, 9]), [7, 'ate', 9], 'should remove falsy values');",
|
"assert.deepEqual(bouncer([7, \"ate\", \"\", false, 9]), [7, \"ate\", 9], '<code>[7, \"ate\", \"\", false, 9]</code> should return <code>[7, \"ate\", 9]</code>.');",
|
||||||
"assert.deepEqual(bouncer(['a', 'b', 'c']), ['a', 'b', 'c'], 'should return full array if no falsy elements');",
|
"assert.deepEqual(bouncer([\"a\", \"b\", \"c\"]), [\"a\", \"b\", \"c\"], '<code>[\"a\", \"b\", \"c\"]</code> should return <code>[\"a\", \"b\", \"c\"]</code>.');",
|
||||||
"assert.deepEqual(bouncer([false, null, 0, NaN, undefined, '']), [], 'should return empty array if all elements are falsy');"
|
"assert.deepEqual(bouncer([false, null, 0, NaN, undefined, '']), [], '<code>[false, null, 0]</code> should return <code>[]</code>.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Boolean Objects",
|
"Boolean Objects",
|
||||||
@ -568,55 +568,13 @@
|
|||||||
"namePt": "",
|
"namePt": "",
|
||||||
"descriptionPt": []
|
"descriptionPt": []
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "a8e512fbe388ac2f9198f0fa",
|
|
||||||
"title": "Where art thou",
|
|
||||||
"difficulty": "1.55",
|
|
||||||
"description": [
|
|
||||||
"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 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."
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"function where(collection, source) {",
|
|
||||||
" var arr = [];",
|
|
||||||
" // What's in a name?",
|
|
||||||
" return arr;",
|
|
||||||
"}",
|
|
||||||
"",
|
|
||||||
"where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });"
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
"assert.deepEqual(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'should return an array of objects');",
|
|
||||||
"assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'should return with multiples');",
|
|
||||||
"assert.deepEqual(where([{ 'a': 1, 'b': 2 }, { 'a': 1 }, { 'a': 1, 'b': 2, 'c': 2 }], { 'a': 1, 'b': 2 }), [{ 'a': 1, 'b': 2 }, { 'a': 1, 'b': 2, 'c': 2 }], 'should return two objects in array');",
|
|
||||||
"assert.deepEqual(where([{ 'a': 5 }, { 'a': 5 }, { 'a': 5, 'b': 10 }], { 'a': 5, 'b': 10 }), [{ 'a': 5, 'b': 10 }], 'should return a single object in array');"
|
|
||||||
],
|
|
||||||
"MDNlinks": [
|
|
||||||
"Global Object",
|
|
||||||
"Object.hasOwnProperty()",
|
|
||||||
"Object.keys()"
|
|
||||||
],
|
|
||||||
"type": "bonfire",
|
|
||||||
"challengeType": 5,
|
|
||||||
"nameCn": "",
|
|
||||||
"descriptionCn": [],
|
|
||||||
"nameFr": "",
|
|
||||||
"descriptionFr": [],
|
|
||||||
"nameRu": "",
|
|
||||||
"descriptionRu": [],
|
|
||||||
"nameEs": "",
|
|
||||||
"descriptionEs": [],
|
|
||||||
"namePt": "",
|
|
||||||
"descriptionPt": []
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "a39963a4c10bc8b4d4f06d7e",
|
"id": "a39963a4c10bc8b4d4f06d7e",
|
||||||
"title": "Seek and Destroy",
|
"title": "Seek and Destroy",
|
||||||
"difficulty": "1.60",
|
"difficulty": "1.60",
|
||||||
"description": [
|
"description": [
|
||||||
"You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.",
|
"You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.",
|
||||||
"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": [
|
||||||
"function destroyer(arr) {",
|
"function destroyer(arr) {",
|
||||||
@ -624,14 +582,14 @@
|
|||||||
" return arr;",
|
" return arr;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"destroyer([1, 2, 3, 1, 2, 3], 2, 3);"
|
"destroyer([1, 2, 3, 1, 2, 3], 2, 3, \"\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], 'should remove correct values from an array');",
|
"assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], '<code>[1, 2, 3, 1, 2, 3], 2, 3</code> should return <code>[1, 1]</code>.');",
|
||||||
"assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], 'should remove correct values from an array');",
|
"assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], '<code>[1, 2, 3, 5, 1, 2, 3], 2, 3</code> should return <code>[1, 5, 1]</code>.');",
|
||||||
"assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], 'should accept more than two additional arguments');",
|
"assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], '<code>[3, 5, 1, 2, 2], 2, 3, 5</code> should return <code>[1]</code>.');",
|
||||||
"assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], 'should remove correct values from an array');",
|
"assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], '<code>[2, 3, 2, 3], 2, 3</code> should return <code>[]</code>.');",
|
||||||
"assert.deepEqual(destroyer(['tree', 'hamburger', 53], 'tree', 53), ['hamburger'], 'should handle NaN-elements');"
|
"assert.deepEqual(destroyer([\"tree\", \"hamburger\", 53], \"tree\", 53), [\"hamburger\"], '<code>[\"tree\", \"hamburger\", 53], \"tree\", 53)</code> should return <code>[\"hamburger\"]</code>.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Arguments object",
|
"Arguments object",
|
||||||
@ -657,7 +615,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).",
|
"Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).",
|
||||||
"For example, where([1,2,3,4], 1.5) should return 1 because it is greater than 1 (0th index), but less than 2 (1st index).",
|
"For example, where([1,2,3,4], 1.5) should return 1 because it is greater than 1 (0th index), but less than 2 (1st index).",
|
||||||
"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": [
|
||||||
"function where(arr, num) {",
|
"function where(arr, num) {",
|
||||||
@ -665,18 +623,18 @@
|
|||||||
" return num;",
|
" return num;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"where([40, 60], 50);"
|
"where([40, 60], 50, \"\");"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.sort()"
|
"Array.sort()"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.strictEqual(where([10, 20, 30, 40, 50], 35), 3, '35 should be placed at index 3');",
|
"assert(where([10, 20, 30, 40, 50], 35) === 3, '<code>[10, 20, 30, 40, 50], 35</code> should return <code>3</code>.');",
|
||||||
"assert.strictEqual(where([10, 20, 30, 40, 50], 30), 2, '30 should be placed at index 2');",
|
"assert(where([10, 20, 30, 40, 50], 30) === 2, '<code>[10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.');",
|
||||||
"assert.strictEqual(where([40, 60], 50), 1, '50 should be placed at index 1');",
|
"assert(where([40, 60], 50) === 1, '<code>[40, 60,], 50</code> should return <code>1</code>.');",
|
||||||
"assert.strictEqual(where([5, 3, 20, 3], 3), 0, '3 should be placed at index 0');",
|
"assert(where([5, 3, 20, 3], 3) === 0, '<code>[5, 3, 20, 3], 3</code> should return <code>0</code>.');",
|
||||||
"assert.strictEqual(where([2, 20, 10], 1), 0, '1 should be placed at index 0');",
|
"assert(where([2, 20, 10], 1) === 0, '<code>[2, 20, 10], 1</code> should return <code>0</code>.');",
|
||||||
"assert.strictEqual(where([2, 5, 10], 15), 3, '15 should be placed at index 3');"
|
"assert(where([2, 5, 10], 15) === 3, '<code>[2, 5, 10], 15</code> should return <code>3</code>.');"
|
||||||
],
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(editor.getValue().match(/(\\/\\/)...../g), 'Create a <code>//</code> style comment that contains at least five letters');",
|
"assert(editor.getValue().match(/(\\/\\/)...../g), 'Create a <code>//</code> style comment that contains at least five letters');",
|
||||||
"assert(editor.getValue().match(/(\\/\\*)...../g), 'Create a <code>/* */</code> style comment that contains at least five letters.');",
|
"assert(editor.getValue().match(/(\\/\\*)[\\w\\W]{5,}(?=\\*\\/)/gm), 'Create a <code>/* */</code> style comment that contains at least five letters.');",
|
||||||
"assert(editor.getValue().match(/(\\*\\/)/g), 'Make sure that you close the comment with a <code>*/</code>');"
|
"assert(editor.getValue().match(/(\\*\\/)/g), 'Make sure that you close the comment with a <code>*/</code>');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
@ -42,7 +42,7 @@
|
|||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"function welcomeToBooleans() {",
|
"function welcomeToBooleans() {",
|
||||||
"",
|
"",
|
||||||
"// don't change code above here",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
" return false;",
|
" return false;",
|
||||||
"",
|
"",
|
||||||
@ -66,7 +66,7 @@
|
|||||||
"Look at the <code>ourName</code> example if you get stuck."
|
"Look at the <code>ourName</code> example if you get stuck."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert((function(){/**/if(typeof(myName) !== \"undefined\" && typeof(myName) === \"string\" && myName.length > 0){return true;}else{return false;}/**/})(), 'myName should be a string that contains at least one character in it');"
|
"assert((function(){if(typeof(myName) !== \"undefined\" && typeof(myName) === \"string\" && myName.length > 0){return true;}else{return false;}})(), '<code>myName</code> should be a string that contains at least one character in it.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"// var ourName = \"Free Code Camp\";",
|
"// var ourName = \"Free Code Camp\";",
|
||||||
@ -90,11 +90,11 @@
|
|||||||
"Now let's create two new string variables: <code>myFirstName</code>and <code>myLastName</code> and assign them the values of your first and last name, respectively."
|
"Now let's create two new string variables: <code>myFirstName</code>and <code>myLastName</code> and assign them the values of your first and last name, respectively."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert((function(){if(typeof(myFirstName) !== \"undefined\" && typeof(myFirstName) === \"string\" && myFirstName.length > 0){return true;}else{return false;}})(), 'myFirstName should be a string with a least one character in it');",
|
"assert((function(){if(typeof(myFirstName) !== \"undefined\" && typeof(myFirstName) === \"string\" && myFirstName.length > 0){return true;}else{return false;}})(), '<code>myFirstName</code> should be a string with at least one character in it.');",
|
||||||
"assert((function(){if(typeof(myLastName) !== \"undefined\" && typeof(myLastName) === \"string\" && myLastName.length > 0){return true;}else{return false;}})(), 'myLastName should be a string with a least one character in it');"
|
"assert((function(){if(typeof(myLastName) !== \"undefined\" && typeof(myLastName) === \"string\" && myLastName.length > 0){return true;}else{return false;}})(), '<code>myLastName</code> should be a string with at least one character in it.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"// name = \"Alan Turing\";",
|
"// var name = \"Alan Turing\";",
|
||||||
"// var firstName = \"Alan\";",
|
"// var firstName = \"Alan\";",
|
||||||
"// var lastName = \"Turing\";",
|
"// var lastName = \"Turing\";",
|
||||||
"",
|
"",
|
||||||
@ -112,13 +112,13 @@
|
|||||||
"title": "Check the Length Property of a String Variable",
|
"title": "Check the Length Property of a String Variable",
|
||||||
"difficulty": "9.9809",
|
"difficulty": "9.9809",
|
||||||
"description": [
|
"description": [
|
||||||
"<code>data structures</code> have <code>properties</code>. For example, <code>strings</code> have a property called <code>.length</code> that will tell you how many characters are in the string.",
|
"<code>Data structures</code> have <code>properties</code>. For example, <code>strings</code> have a property called <code>.length</code> that will tell you how many characters are in the string.",
|
||||||
"For example, if we created a variable <code>var firstName = \"Charles\"</code>, we could find out how long the string \"Charles\" is by using the <code>firstName.length</code> property.",
|
"For example, if we created a variable <code>var firstName = \"Charles\"</code>, we could find out how long the string \"Charles\" is by using the <code>firstName.length</code> property.",
|
||||||
"Use the <code>.length</code> property to count the number of characters in the <code>lastName</code> variable."
|
"Use the <code>.length</code> property to count the number of characters in the <code>lastName</code> variable."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert((function(){if(typeof(lastNameLength) !== \"undefined\" && typeof(lastNameLength) === \"number\" && lastNameLength === 8){return true;}else{return false;}})(), 'lastNameLength should be equal to eight.');",
|
"assert((function(){if(typeof(lastNameLength) !== \"undefined\" && typeof(lastNameLength) === \"number\" && lastNameLength === 8){return true;}else{return false;}})(), '<code>lastNameLength</code> should be equal to eight.');",
|
||||||
"assert((function(){if(editor.getValue().match(/\\.length/gi) && editor.getValue().match(/\\.length/gi).length >= 2 && editor.getValue().match(/var lastNameLength \\= 0;/gi) && editor.getValue().match(/var lastNameLength \\= 0;/gi).length >= 1){return true;}else{return false;}})(), 'You should be getting the length of <code>lastName</code> by using <code>.length</code> like this: <code>lastName.length</code>');"
|
"assert((function(){if(editor.getValue().match(/\\.length/gi) && editor.getValue().match(/\\.length/gi).length >= 2 && editor.getValue().match(/var lastNameLength \\= 0;/gi) && editor.getValue().match(/var lastNameLength \\= 0;/gi).length >= 1){return true;}else{return false;}})(), 'You should be getting the length of <code>lastName</code> by using <code>.length</code> like this: <code>lastName.length</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var firstNameLength = 0;",
|
"var firstNameLength = 0;",
|
||||||
@ -129,7 +129,7 @@
|
|||||||
"",
|
"",
|
||||||
"var lastName = \"Lovelace\";",
|
"var lastName = \"Lovelace\";",
|
||||||
"",
|
"",
|
||||||
"// don't change code above here",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
"lastNameLength = lastName;",
|
"lastNameLength = lastName;",
|
||||||
"",
|
"",
|
||||||
@ -155,7 +155,7 @@
|
|||||||
"Try looking at the <code>firstLetterOfFirstName</code> variable declaration if you get stuck."
|
"Try looking at the <code>firstLetterOfFirstName</code> variable declaration if you get stuck."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert((function(){if(typeof(firstLetterOfLastName) !== \"undefined\" && editor.getValue().match(/\\[0\\]/gi) && typeof(firstLetterOfLastName) === \"string\" && firstLetterOfLastName === \"L\"){return true;}else{return false;}})(), 'The first letter of firstLetterOfLastName should be a L');"
|
"assert((function(){if(typeof(firstLetterOfLastName) !== \"undefined\" && editor.getValue().match(/\\[0\\]/gi) && typeof(firstLetterOfLastName) === \"string\" && firstLetterOfLastName === \"L\"){return true;}else{return false;}})(), 'The first letter of <code>firstLetterOfLastName</code> should be a <code>\"L\"</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var firstLetterOfFirstName = \"\";",
|
"var firstLetterOfFirstName = \"\";",
|
||||||
@ -189,7 +189,7 @@
|
|||||||
"Try looking at the <code>secondLetterOfFirstName</code> variable declaration if you get stuck."
|
"Try looking at the <code>secondLetterOfFirstName</code> variable declaration if you get stuck."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(thirdLetterOfLastName === 'v', 'The third letter of lastName should be a \"v\"');"
|
"assert(thirdLetterOfLastName === 'v', 'The third letter of <code>lastName</code> should be a <code>\"v\"</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var firstName = \"Ada\";",
|
"var firstName = \"Ada\";",
|
||||||
@ -220,8 +220,8 @@
|
|||||||
"Try looking at the <code>lastLetterOfFirstName</code> variable declaration if you get stuck."
|
"Try looking at the <code>lastLetterOfFirstName</code> variable declaration if you get stuck."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(lastLetterOfLastName === \"e\", 'lastLetterOfLastName should be \"e\"');",
|
"assert(lastLetterOfLastName === \"e\", '<code>lastLetterOfLastName</code> should be <code>\"e\"</code>.');",
|
||||||
"assert(editor.getValue().match(/\\.length/g).length === 2, '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\";",
|
||||||
@ -252,7 +252,7 @@
|
|||||||
"Try looking at the <code>thirdToLastLetterOfFirstName</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', '<code>secondToLastLetterOfLastName</code> should be <code>\"c\"</code>.');",
|
||||||
"assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use .length to get the second last letter.');"
|
"assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use .length to get the second last letter.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -302,11 +302,11 @@
|
|||||||
"difficulty": "9.98142",
|
"difficulty": "9.98142",
|
||||||
"description": [
|
"description": [
|
||||||
"We can also subtract one number from another.",
|
"We can also subtract one number from another.",
|
||||||
"JavaScript uses use the <code>-</code> symbol for subtraction.",
|
"JavaScript uses the <code>-</code> symbol for subtraction.",
|
||||||
"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(difference === 12 && editor.getValue().match(/\\-/g)){return true;}else{return false;}})(), 'Make the variable <code>difference</code> equal 12');"
|
"assert((function(){if(difference === 12 && editor.getValue().match(/\\-/g)){return true;}else{return false;}})(), 'Make the variable <code>difference</code> equal 12.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var difference = 45 - 0; //make this equal to 12 by changing the 0 into the appropriate number.",
|
"var difference = 45 - 0; //make this equal to 12 by changing the 0 into the appropriate number.",
|
||||||
@ -325,14 +325,14 @@
|
|||||||
"difficulty": "9.98143",
|
"difficulty": "9.98143",
|
||||||
"description": [
|
"description": [
|
||||||
"We can also multiply one number by another.",
|
"We can also multiply one number by another.",
|
||||||
"JavaScript uses use the <code>*</code> symbol for multiplication.",
|
"JavaScript uses the <code>*</code> symbol for multiplication.",
|
||||||
"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(product === 80 && editor.getValue().match(/\\*/g)){return true;}else{return false;}})(), 'Make the variable <code>product</code> equal 80.');"
|
"assert((function(){if(product === 80 && editor.getValue().match(/\\*/g)){return true;}else{return false;}})(), 'Make the variable <code>product</code> equal 80.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var product = 8 * 0; //make this equal to 80 by changing the 0 into the appropriate number.",
|
"var product = 8 * 0; // Make this equal to 80 by changing the 0 into the appropriate number.",
|
||||||
"",
|
"",
|
||||||
"// 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.",
|
||||||
@ -348,7 +348,7 @@
|
|||||||
"difficulty": "9.9814",
|
"difficulty": "9.9814",
|
||||||
"description": [
|
"description": [
|
||||||
"We can also divide one number by another.",
|
"We can also divide one number by another.",
|
||||||
"JavaScript uses use the <code>/</code> symbol for division.",
|
"JavaScript uses the <code>/</code> symbol for division.",
|
||||||
"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": [
|
||||||
@ -421,17 +421,17 @@
|
|||||||
"difficulty": "9.9816",
|
"difficulty": "9.9816",
|
||||||
"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 square bracket, end it with a closing square 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> (in that order).",
|
"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 commented code in the text editor if you get stuck."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(typeof(myArray) == 'object', 'myArray should be an array');",
|
"assert(typeof(myArray) == 'object', '<code>myArray</code> should be an <code>array</code>.');",
|
||||||
"assert(typeof(myArray[0]) !== 'undefined' && typeof(myArray[0]) == 'string', 'The first item in myArray should be a string');",
|
"assert(typeof(myArray[0]) !== 'undefined' && typeof(myArray[0]) == 'string', 'The first item in <code>myArray</code> should be a <code>string</code>.');",
|
||||||
"assert(typeof(myArray[1]) !== 'undefined' && typeof(myArray[1]) == 'number', 'The second item in myArray should be a number');"
|
"assert(typeof(myArray[1]) !== 'undefined' && typeof(myArray[1]) == 'number', 'The second item in <code>myArray</code> should be a <code>number</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"//var array = [\"John\", 23];",
|
"// var array = [\"John\", 23];",
|
||||||
"",
|
"",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
@ -450,7 +450,7 @@
|
|||||||
"title": "Nest one Array within Another Array",
|
"title": "Nest one Array within Another Array",
|
||||||
"difficulty":"9.98161",
|
"difficulty":"9.98161",
|
||||||
"description":[
|
"description":[
|
||||||
"You can also nest arrays within other arrays, like this: <code>[[\"Bulls\", 43]]</code>.",
|
"You can also nest arrays within other arrays, like this: <code>[[\"Bulls\", 23]]</code>.",
|
||||||
"Let's now go create a nested array called <code>myArray</code>."
|
"Let's now go create a nested array called <code>myArray</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
@ -484,11 +484,11 @@
|
|||||||
"Create a variable called <code>myData</code> and set it to equal the first value of <code>myArray</code>."
|
"Create a variable called <code>myData</code> and set it to equal the first value of <code>myArray</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert((function(){if(typeof(myArray) != 'undefined' && typeof(myData) != 'undefined' && myArray[0] == myData){return true;}else{return false;}})(), 'The variable <code>myData</code> should equal the first value of myArray');"
|
"assert((function(){if(typeof(myArray) != 'undefined' && typeof(myData) != 'undefined' && myArray[0] == myData){return true;}else{return false;}})(), 'The variable <code>myData</code> should equal the first value of <code>myArray</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"//var ourArray = [1,2,3];",
|
"// var ourArray = [1,2,3];",
|
||||||
"//var ourData = ourArray[0]; // equals 1",
|
"// var ourData = ourArray[0]; // equals 1",
|
||||||
"",
|
"",
|
||||||
"var myArray = [1,2,3];",
|
"var myArray = [1,2,3];",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
@ -514,13 +514,13 @@
|
|||||||
"Now modify the data stored at index 0 of <code>myArray</code> to the value of 3."
|
"Now modify the data stored at index 0 of <code>myArray</code> to the value of 3."
|
||||||
],
|
],
|
||||||
"tests":[
|
"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(typeof(myArray) != 'undefined' && myArray[0] == 3 && myArray[1] == 2 && myArray[2] == 3){return true;}else{return false;}})(), '<code>myArray</code> should now be [3,2,3].');",
|
||||||
"assert((function(){if(editor.getValue().match(/myArray\\[0\\]\\s?=\\s?/g)){return true;}else{return false;}})(), 'You should be using correct index to modify the value in myArray');"
|
"assert((function(){if(editor.getValue().match(/myArray\\[0\\]\\s?=\\s?/g)){return true;}else{return false;}})(), 'You should be using correct index to modify the value in <code>myArray</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var ourArray = [1,2,3];",
|
"var ourArray = [1,2,3];",
|
||||||
"ourArray[1] = 3;",
|
"ourArray[1] = 3;",
|
||||||
"// ourArray[1] now equals [1,3,3].",
|
"// ourArray now equals [1,3,3].",
|
||||||
"var myArray = [1,2,3];",
|
"var myArray = [1,2,3];",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
@ -541,18 +541,18 @@
|
|||||||
"Another way to change the data in an array is with the <code>.pop()</code> function.",
|
"Another way to change the data in an array is with the <code>.pop()</code> function.",
|
||||||
"<code>.pop()</code>is used to \"pop\" a value off of the end of an array. We can retrieve this value by performing <code>pop()</code> in a variable declaration.",
|
"<code>.pop()</code>is used to \"pop\" a value off of the end of an array. We can retrieve this value by performing <code>pop()</code> in a variable declaration.",
|
||||||
"Any type of variable can be \"popped\" off of an array.",
|
"Any type of variable can be \"popped\" off of an array.",
|
||||||
"Use the <code>.pop()</code> function to remove the last item from myArray."
|
"Use the <code>.pop()</code> function to remove the last item from <code>myArray</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert((function(d){if(d[0] == 'John' && d[1] == 23 && d[2] == undefined){return true;}else{return false;}})(myArray), 'myArray should only have the first two values left([\"John\", 23])');",
|
"assert((function(d){if(d[0] == 'John' && d[1] == 23 && d[2] == undefined){return true;}else{return false;}})(myArray), '<code>myArray</code> should only have the first two values left([\"John\", 23]).');",
|
||||||
"assert((function(d){if(d[0] == 'cat' && d[1] == 2 && d[2] == undefined){return true;}else{return false;}})(removed), 'myArray should only have the first two values left([\"cat\"], 2)');"
|
"assert((function(d){if(d[0] == 'cat' && d[1] == 2 && d[2] == undefined){return true;}else{return false;}})(removed), '<code>removed</code> should only have the first two values left([\"cat\"], 2).');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"//var numbers = [1,2,3];",
|
"// var numbers = [1,2,3];",
|
||||||
"//console.log(numbers); // logs [1,2,3]",
|
"// console.log(numbers); // logs [1,2,3]",
|
||||||
"//var removed = numbers.pop();",
|
"// var removed = numbers.pop();",
|
||||||
"//console.log(numbers); // logs [1,2]",
|
"// console.log(numbers); // logs [1,2]",
|
||||||
"//console.log(removed); // logs 3",
|
"// console.log(removed); // logs 3",
|
||||||
"",
|
"",
|
||||||
"var myArray = [\"John\", 23, [\"cat\", 2]];",
|
"var myArray = [\"John\", 23, [\"cat\", 2]];",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
@ -573,20 +573,20 @@
|
|||||||
"difficulty": "9.9818",
|
"difficulty": "9.9818",
|
||||||
"description": [
|
"description": [
|
||||||
"Not only can you <code>pop()</code> data off of the end of an array, you can also <code>push()</code> data onto the end of an array.",
|
"Not only can you <code>pop()</code> data off of the end of an array, you can also <code>push()</code> data onto the end of an array.",
|
||||||
"Take the myArray array and <code>push()</code> this value to the end of it: <code>[\"dog\", 3]</code>."
|
"Take the <code>myArray</code> array and <code>push()</code> this value to the end of it: <code>[\"dog\", 3]</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert((function(d){if(d[2] != undefined && d[0] == 'John' && d[1] == 23 && d[2][0] == 'dog' && d[2][1] == 3 && d[2].length == 2){return true;}else{return false;}})(myArray), 'myArray should only have the first two values left([\"John\", 23, [\"dog\", 3]])');"
|
"assert((function(d){if(d[2] != undefined && d[0] == 'John' && d[1] == 23 && d[2][0] == 'dog' && d[2][1] == 3 && d[2].length == 2){return true;}else{return false;}})(myArray), '<code>myArray</code> should only have the first two values left([\"John\", 23, [\"dog\", 3]]).');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
|
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
|
||||||
"ourArray.pop();",
|
"ourArray.pop();",
|
||||||
"ourArray.push([\"happy\", \"joy\"]);",
|
"ourArray.push([\"happy\", \"joy\"]);",
|
||||||
"// ourArray now equals [\"Stimpson\", \"J\", [\"happy\", \"joy\"]]",
|
"// ourArray now equals [\"Stimpson\", \"J\", [\"happy\", \"joy\"]].",
|
||||||
"",
|
"",
|
||||||
"var myArray = [\"John\", 23, [\"cat\", 2]];",
|
"var myArray = [\"John\", 23, [\"cat\", 2]];",
|
||||||
"myArray.pop();",
|
"myArray.pop();",
|
||||||
"//Add a [\"dog\", 3] to the end of myArray using push()",
|
"// Add a [\"dog\", 3] to the end of myArray using push().",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
@ -604,21 +604,21 @@
|
|||||||
"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. Set <code>myRemoved</code> to the first value of <code>myArray</code> using <code>shift()</code>."
|
"Take the <code>myArray</code> 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), '<code>myArray</code> should only have the last two values left([23, [\"dog\", 3]]).');",
|
||||||
"assert((function(d){if(d === 'John' && typeof(myRemoved) === 'string'){return true;}else{return false;}})(myRemoved), 'myRemoved should contain \"John\"');"
|
"assert((function(d){if(d === 'John' && typeof(myRemoved) === 'string'){return true;}else{return false;}})(myRemoved), '<code>myRemoved</code> should contain <code>\"John\"</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
|
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
|
||||||
"ourRemoved = ourArray.shift();",
|
"ourRemoved = ourArray.shift();",
|
||||||
"// ourArray now equals [\"J\", [\"cat\"]]",
|
"// ourArray now equals [\"J\", [\"cat\"]].",
|
||||||
"",
|
"",
|
||||||
"var myArray = [\"John\", 23, [\"dog\", 3]];",
|
"var myArray = [\"John\", 23, [\"dog\", 3]];",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
"var myRemoved = myArray; // This should be [\"John\"] and myArray should now be [23, [\"dog\", 3]]",
|
"var myRemoved = myArray; // This should be [\"John\"] and myArray should now be [23, [\"dog\", 3]].",
|
||||||
"",
|
"",
|
||||||
"// Only change code above this line.",
|
"// Only change code above this line.",
|
||||||
"",
|
"",
|
||||||
@ -634,8 +634,8 @@
|
|||||||
"title": "Manipulate Arrays With unshift()",
|
"title": "Manipulate Arrays With unshift()",
|
||||||
"difficulty": "9.9818",
|
"difficulty": "9.9818",
|
||||||
"description": [
|
"description": [
|
||||||
"Now that we've learned how to <code>shift</code>things from the start of the array, we need to learn how to <code>unshift</code>stuff back to the start",
|
"Now that we've learned how to <code>shift</code>things from the start of the array, we need to learn how to <code>unshift</code>stuff back to the start.",
|
||||||
"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(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]]).');"
|
"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]]).');"
|
||||||
@ -643,13 +643,14 @@
|
|||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
|
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
|
||||||
"ourArray.shift();",
|
"ourArray.shift();",
|
||||||
"ourArray.unshift([\"happy\", \"joy\"]);",
|
"// ourArray now equals [\"J\", [\"cat\"]]",
|
||||||
"// ourArray now equals [[\"happy\", \"joy\"], \"J\", [\"cat\"]]",
|
"ourArray.unshift(\"happy\");",
|
||||||
|
"// ourArray now equals [\"happy\", \"J\", [\"cat\"]]",
|
||||||
"",
|
"",
|
||||||
"var myArray = [\"John\", 23, [\"dog\", 3]];",
|
"var myArray = [\"John\", 23, [\"dog\", 3]];",
|
||||||
"myArray.shift();",
|
"myArray.shift();",
|
||||||
"",
|
"",
|
||||||
"// Add \"Paul\" to the start of myArray",
|
"// Add \"Paul\" to the start of myArray.",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
@ -666,26 +667,27 @@
|
|||||||
"title": "Write Reusable JavaScript with Functions",
|
"title": "Write Reusable JavaScript with Functions",
|
||||||
"difficulty":"9.9819",
|
"difficulty":"9.9819",
|
||||||
"description":[
|
"description":[
|
||||||
"In JavaScript, we can divide up our code into reusable parts called <code>functions</code>.",
|
"In JavaScript, we can divide up our code into reusable parts called functions.",
|
||||||
"Here's an example of a function:",
|
"Here's an example of a function:",
|
||||||
"<code>function functionName (a, b) {</code>",
|
"<code>function functionName(a, b) {</code>",
|
||||||
"<code>  return a + b;</code>",
|
"<code>  return a + b;</code>",
|
||||||
"<code>}</code>",
|
"<code>}</code>",
|
||||||
"We can \"call\" our function like this: <code>functionName();</code>, and it will run and return its <code>return</code> value to us.",
|
"After writing the above lines in our code, we can then pass values to our function and the result following the <code>return</code> statement will be returned.",
|
||||||
"Create and call a function called <code>myFunction</code> that returns the sum of a and b."
|
"For example, we can pass numbers <code>4</code> and <code>2</code> by “calling” the function later in our code like this: <code>functionName(4, 2)</code>.",
|
||||||
|
"In this example, the function will return the number <code>6</code> as this is the result of <code>4 + 2</code>.",
|
||||||
|
"Create and call a function called <code>myFunction</code> that returns the sum of <code>a</code> and <code>b</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert((function(){if(typeof(f) !== \"undefined\" && typeof(f) === \"number\" && f === a + b && editor.getValue().match(/return/gi).length >= 1 && editor.getValue().match(/a/gi).length >= 1 && editor.getValue().match(/b/gi).length >= 1 && editor.getValue().match(/\\+/gi).length >= 1){return true;}else{return false;}})(), 'Your function should return the value of a + b');"
|
"assert((function(){if(typeof(f) !== \"undefined\" && f === a + b){return true;}else{return false;}})(), 'Your function should return the value of a + b');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var a = 4;",
|
"var a = 4;",
|
||||||
"var b = 5;",
|
"var b = 5;",
|
||||||
"",
|
"",
|
||||||
"ourFunction = function() {",
|
"function ourFunction(a, b) {",
|
||||||
" return a - b;",
|
" return a - b;",
|
||||||
"};",
|
"}",
|
||||||
"",
|
"",
|
||||||
"// Don't modify above this line",
|
|
||||||
"// Create a function called myFunction that returns the value of a plus b.",
|
"// Create a function called myFunction that returns the value of a plus b.",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
@ -719,23 +721,23 @@
|
|||||||
"<code>};</code>",
|
"<code>};</code>",
|
||||||
"</code>",
|
"</code>",
|
||||||
"Objects are useful for storing data in a structured way, and can represent real world objects, like a cat.",
|
"Objects are useful for storing data in a structured way, and can represent real world objects, like a cat.",
|
||||||
"Let's try to make an Object that represents a dog called myDog which contains the properties 'name' (String), 'legs' (Number), 'tails' (Number) and 'friends' (Array)!"
|
"Let's try to make an object that represents a dog called <code>myDog</code> which contains the properties <code>'name'</code> (String), <code>'legs'</code> (Number), <code>'tails'</code> (Number) and <code>'friends'</code> (Array)!"
|
||||||
],
|
],
|
||||||
"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(\"name\") && z.name !== undefined && typeof(z.name) === \"string\"){return true;}else{return false;}})(myDog), '<code>myDog</code> should contain the property <code>name</code> and it should be a <code>string</code>.');",
|
||||||
"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(\"legs\") && z.legs !== undefined && typeof(z.legs) === \"number\"){return true;}else{return false;}})(myDog), '<code>myDog</code> should contain the property <code>legs</code> and it should be a <code>number</code>.');",
|
||||||
"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(\"tails\") && z.tails !== undefined && typeof(z.tails) === \"number\"){return true;}else{return false;}})(myDog), '<code>myDog</code> should contain the property <code>tails</code> and it should be a <code>number</code>.');",
|
||||||
"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');"
|
"assert((function(z){if(z.hasOwnProperty(\"friends\") && z.friends !== undefined && Array.isArray(z.friends)){return true;}else{return false;}})(myDog), '<code>myDog</code> should contain the property <code>friends</code> and it should be an <code>array</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"//var ourDog = {",
|
"// var ourDog = {",
|
||||||
"// \"name\": \"Camper\",",
|
"// \"name\": \"Camper\",",
|
||||||
"// \"legs\": 4,",
|
"// \"legs\": 4,",
|
||||||
"// \"tails\": 1,",
|
"// \"tails\": 1,",
|
||||||
"// \"friends\": [\"everything!\"]",
|
"// \"friends\": [\"everything!\"]",
|
||||||
"//};",
|
"// };",
|
||||||
"",
|
"",
|
||||||
"// add the name(string), legs(number), tails(number) and friends(array) properties to myDog.",
|
"// Add the name (string), legs (number), tails (number) and friends (array) properties to myDog.",
|
||||||
"// You can set them to whatever you want.",
|
"// You can set them to whatever you want.",
|
||||||
"",
|
"",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
@ -761,11 +763,11 @@
|
|||||||
"<code>myObject.myProperty = \"myValue\";</code>",
|
"<code>myObject.myProperty = \"myValue\";</code>",
|
||||||
"We can also delete them like this:",
|
"We can also delete them like this:",
|
||||||
"<code>delete myObject.myProperty;</code>",
|
"<code>delete myObject.myProperty;</code>",
|
||||||
"Let's add the property \"bark\", and delete the property \"tails\"."
|
"Let's add the property <code>\"bark\"</code>, and delete the property <code>\"tails\"</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(myDog.bark !== undefined, 'Add the property \"bark\" to myDog.');",
|
"assert(myDog.bark !== undefined, 'Add the property <code>\"bark\"</code> to <code>myDog</code>.');",
|
||||||
"assert(myDog.tails === undefined, 'Delete the property \"tails\" from myDog.');"
|
"assert(myDog.tails === undefined, 'Delete the property <code>\"tails\"</code> from <code>myDog</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"// var ourDog = {",
|
"// var ourDog = {",
|
||||||
@ -815,8 +817,8 @@
|
|||||||
"Let's try getting a for loop to work by pushing values to an array."
|
"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(editor.getValue().match(/for/g), 'You should be using a <code>for</code> loop for this.');",
|
||||||
"assert.deepEqual(myArray, [0,1,2,3,4], 'myArray should equal [0,1,2,3,4]');"
|
"assert.deepEqual(myArray, [0,1,2,3,4], '<code>myArray</code> should equal [0,1,2,3,4].');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"ourArray = [];",
|
"ourArray = [];",
|
||||||
@ -854,8 +856,8 @@
|
|||||||
"Let's try getting a while loop to work by pushing values to an array."
|
"Let's try getting a while 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(editor.getValue().match(/while/g), 'You should be using a <code>while</code> loop for this.');",
|
||||||
"assert.deepEqual(myArray, [0,1,2,3,4], 'myArray should equal [0,1,2,3,4]');"
|
"assert.deepEqual(myArray, [0,1,2,3,4], '<code>myArray</code> should equal [0,1,2,3,4].');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var myArray = [];",
|
"var myArray = [];",
|
||||||
@ -882,18 +884,18 @@
|
|||||||
"Use <code>Math.random()</code> to get <code>myFunction</code> to return a random number."
|
"Use <code>Math.random()</code> to get <code>myFunction</code> to return a random number."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(typeof(myFunction()) === \"number\", 'myFunction should return a random number');",
|
"assert(typeof(myFunction()) === \"number\", '<code>myFunction</code> should return a random number.');",
|
||||||
"assert((myFunction()+''). match(/\\./g), 'The number returned by myFunction should be a decimal');",
|
"assert((myFunction()+''). match(/\\./g), 'The number returned by <code>myFunction</code> 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');"
|
"assert(editor.getValue().match(/Math\\.random/g).length >= 2, 'You should be using <code>Math.random</code> to generate the random decimal number.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"function myFunction() {",
|
"function myFunction() {",
|
||||||
" //Change the 0 to Math.random()",
|
" // Change the 0 to Math.random().",
|
||||||
" // Only change code below this line.",
|
" // Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
" return 0;",
|
" return 0;",
|
||||||
"",
|
"",
|
||||||
"// 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.",
|
||||||
@ -908,21 +910,21 @@
|
|||||||
"difficulty":"9.9828",
|
"difficulty":"9.9828",
|
||||||
"description":[
|
"description":[
|
||||||
"It's great that we can create random decimal numbers, but it's even more useful if we use it to generate a random whole number.",
|
"It's great that we can create random decimal numbers, but it's even more useful if we use it to generate a random whole number.",
|
||||||
"To achieve this we can multiply the random number by ten and use the <code>Math.floor()</code> to convert the decimal number to a whole number.",
|
"To achieve this we can multiply the random number by ten and use the <code>Math.floor()</code> to convert the decimal number to the nearest less than or equal whole number.",
|
||||||
"This technique gives us a whole number between zero and nine.",
|
"This technique gives us a whole number between zero and nine.",
|
||||||
"Example:",
|
"Example:",
|
||||||
"<code>Math.floor(Math.random()*10);</code>",
|
"<code>Math.floor(Math.random()*10);</code>",
|
||||||
"Let's give this technique a go now."
|
"Let's give this technique a go now."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(typeof(myFunction()) === \"number\", 'The result of myFunction should be a number');",
|
"assert(typeof(myFunction()) === \"number\", 'The result of <code>myFunction</code> should be a number.');",
|
||||||
"assert(editor.getValue().match(/Math.random/g), 'You should be using Math.random to create a random 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 by 10 to make it a number that\\'s greater than zero');",
|
"assert(editor.getValue().match(/\\(\\s*?Math.random\\s*?\\(\\s*?\\)\\s*?\\*\\s*?10\\s*?\\)/g) || editor.getValue().match(/\\(\\s*?10\\s*?\\*\\s*?Math.random\\s*?\\(\\s*?\\)\\s*?\\)/g), 'You should have multiplied the result of <code>Math.random</code> by 10 to make it a number that\\'s between zero and nine.');",
|
||||||
"assert(editor.getValue().match(/Math.floor/g), 'You should use Math.floor to remove the decimal part of the number');"
|
"assert(editor.getValue().match(/Math.floor/g), 'You should use <code>Math.floor</code> to remove the decimal part of the number.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"function myFunction(){",
|
"function myFunction(){",
|
||||||
" // Make myFunction return a random number betweenzero and nine> instead of a decimal",
|
" // Make myFunction return a random number between zero and nine instead of a decimal.",
|
||||||
"",
|
"",
|
||||||
" // Only change code below this line.",
|
" // Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
@ -944,7 +946,7 @@
|
|||||||
"description":[
|
"description":[
|
||||||
"We can use a certain mathematical expression to get a random number between two numbers.",
|
"We can use a certain mathematical expression to get a random number between two numbers.",
|
||||||
"<code>Math.floor(Math.random() * (max - min + 1)) + min</code>",
|
"<code>Math.floor(Math.random() * (max - min + 1)) + min</code>",
|
||||||
"By using this we can control the output of a random number."
|
"By using this, we can control the output of a random number."
|
||||||
],
|
],
|
||||||
"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');",
|
||||||
@ -971,20 +973,19 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c12feddfaeb3bdef",
|
"id":"cf1111c1c12feddfaeb3bdef",
|
||||||
"title": "Use Conditional Logic with If-Else Statements",
|
"title": "Use Conditional Logic with If and Else Statements",
|
||||||
"difficulty":"9.983",
|
"difficulty":"9.983",
|
||||||
"description":[
|
"description":[
|
||||||
"We can use if statements in JavaScript to only execute code if a certain condition is met.",
|
"We can use <code>if</code> statements in JavaScript to only execute code if a certain condition is met.",
|
||||||
"if statements require some sort of boolean condition to evaluate.",
|
"<code>if</code> statements require some sort of boolean condition to evaluate.",
|
||||||
"Example:",
|
"For example:",
|
||||||
"<code> if (1 === 2) {</code>",
|
"<code> if (1 === 2) {</code>",
|
||||||
"<code>  return true;</code>",
|
"<code>  return true;</code>",
|
||||||
"<code>}</code>",
|
"<code>} else {</code>",
|
||||||
"<code>else {</code>",
|
|
||||||
"<code>  return false;</code>",
|
"<code>  return false;</code>",
|
||||||
"<code>}</code>",
|
"<code>}</code>",
|
||||||
"Let's use <code>if</code> and <code>else</code> statements to make a coin-flip game.",
|
"Let's use <code>if</code> and <code>else</code> statements to make a coin-flip game.",
|
||||||
"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 <code>if</code> and <code>else</code> statements to return the string <code>\"heads\"</code> if the flip variable is zero, or else return the string <code>\"tails\"</code> if the flip variable is not zero."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"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((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>.');",
|
||||||
@ -1021,17 +1022,17 @@
|
|||||||
"<code>the</code> is the pattern we want to match.",
|
"<code>the</code> is the pattern we want to match.",
|
||||||
"<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 <code>/</code> symbols.",
|
||||||
"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>Ada Lovelace and Charles Babbage designed the first computer and the software that would have run on it</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>.');",
|
||||||
"assert(editor.getValue().match(/\\/and\\/gi/), 'You should have used <code>regular expressions</code> to find the word <code>and</code>');"
|
"assert(editor.getValue().match(/\\/and\\/gi/), 'You should have used <code>regular expressions</code> to find the word <code>and</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var test = (function() {",
|
"var test = (function() {",
|
||||||
" var testString = \"George Boole and Alan Turing went to the shop and got some milk\";",
|
" var testString = \"Ada Lovelace and Charles Babbage designed the first computer and the software that would have run on it.\";",
|
||||||
" var expressionToGetMilk = /milk/gi;",
|
" var expressionToGetSoftware = /software/gi;",
|
||||||
" // Only change code below this line.",
|
" // Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
" var expression = /./gi;",
|
" var expression = /./gi;",
|
||||||
@ -1051,12 +1052,13 @@
|
|||||||
"description":[
|
"description":[
|
||||||
"We can use special selectors in <code>Regular Expressions</code> to select a particular type of value.",
|
"We can use special selectors in <code>Regular Expressions</code> to select a particular type of value.",
|
||||||
"One such selector is the digit selector <code>\\d</code> which is used to grab the numbers in a string.",
|
"One such selector is the digit selector <code>\\d</code> which is used to grab the numbers in a string.",
|
||||||
"It is used like this: <code>/\\d+/g</code>.",
|
"It is used like this: <code>/\\d/g</code>.",
|
||||||
"Use the <code>\\d</code> selector to select the number of numbers in the string."
|
"For numbers this is often written as <code>/\\d+/g</code>, where the <code>+</code> following the digit selector allows this regular expression to match multi-digit numbers.",
|
||||||
|
"Use the <code>\\d</code> selector to select the number of numbers in the string, allowing for the possibility of multi-digit numbers."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(test === 2, 'Your RegEx should have found two numbers in the testString');",
|
"assert(test === 2, 'Your RegEx should have found two numbers in the <code>testString</code>.');",
|
||||||
"assert(editor.getValue().match(/\\/\\\\d\\+\\//gi), 'You should be using the following expression /\\\\d+/gi to find the numbers in the testString');"
|
"assert(editor.getValue().match(/\\/\\\\d\\+\\//gi), 'You should be using the following expression <code>/\\\\d+/gi</code> to find the numbers in the <code>testString</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var test = (function() {",
|
"var test = (function() {",
|
||||||
@ -1086,7 +1088,7 @@
|
|||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(test === 7, 'Your RegEx should have found seven spaces in the <code>testString</code>.');",
|
"assert(test === 7, 'Your RegEx should have found seven spaces in the <code>testString</code>.');",
|
||||||
"assert(editor.getValue().match(/\\/\\\\s\\+\\//gi), 'You should be using the following expression /\\\\s+/gi to find the spaces in the <code>testString</code>.');"
|
"assert(editor.getValue().match(/\\/\\\\s\\+\\//gi), 'You should be using the following expression <code>/\\\\s+/gi</code> to find the spaces in the <code>testString</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var test = (function(){",
|
"var test = (function(){",
|
||||||
@ -1140,7 +1142,7 @@
|
|||||||
"We are now going to try and combine some of the stuff we've just learned and create the logic for a slot machine game.",
|
"We are now going to try and combine some of the stuff we've just learned and create the logic for a slot machine game.",
|
||||||
"For this we will need to generate three random numbers between <code>1</code> and <code>3</code> to represent the possible values of each individual slot.",
|
"For this we will need to generate three random numbers between <code>1</code> and <code>3</code> to represent the possible values of each individual slot.",
|
||||||
"Store the three random numbers in <code>slotOne</code>, <code>slotTwo</code> and <code>slotThree</code>.",
|
"Store the three random numbers in <code>slotOne</code>, <code>slotTwo</code> and <code>slotThree</code>.",
|
||||||
"Generate the random numbers by using the system we used earlier:",
|
"Generate the random numbers by using the system we used earlier (an explanation of the formula can be found <a href=\"https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Waypoint-Generate-Random-Whole-Numbers-within-a-Range#explanation\">here</a>):",
|
||||||
"<code>Math.floor(Math.random() * (3 - 1 + 1)) + 1;</code>"
|
"<code>Math.floor(Math.random() * (3 - 1 + 1)) + 1;</code>"
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
@ -1301,7 +1303,7 @@
|
|||||||
"<code>}</code>"
|
"<code>}</code>"
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert((function(){var data = runSlots();if(data === null){return true}else{if(data[0] === data[1] && data[1] === data[2]){return true;}else{return false;}}})(), 'If all three of our random numbers are the same we should return that number. Otherwise we should return null.')"
|
"assert((function(){var data = runSlots();if(data === null){return true}else{if(data[0] === data[1] && data[1] === data[2]){return true;}else{return false;}}})(), 'If all three of our random numbers are the same we should return that number. Otherwise we should return <code>null</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"fccss",
|
"fccss",
|
||||||
@ -1459,8 +1461,8 @@
|
|||||||
"Use the above selector to display each number in its corresponding slot."
|
"Use the above selector to display each number in its corresponding slot."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert((function(){runSlots();if($($(\".slot\")[0]).html().replace(/\\s/gi, \"\") !== \"\" && $($(\".slot\")[1]).html().replace(/\\s/gi, \"\") !== \"\" && $($(\".slot\")[2]).html().replace(/\\s/gi, \"\") !== \"\"){return true;}else{return false;}})(), 'You should be displaying the result of the slot numbers in the corresponding slots')",
|
"assert((function(){runSlots();if($($(\".slot\")[0]).html().replace(/\\s/gi, \"\") !== \"\" && $($(\".slot\")[1]).html().replace(/\\s/gi, \"\") !== \"\" && $($(\".slot\")[2]).html().replace(/\\s/gi, \"\") !== \"\"){return true;}else{return false;}})(), 'You should be displaying the result of the slot numbers in the corresponding slots.')",
|
||||||
"assert((function(){if(editor.match( /\\$\\(\\$\\(\\\"\\.slot\\\"\\)\\[\\d\\]\\)/gi )){if(editor.match( /\\$\\(\\$\\(\\\"\\.slot\\\"\\)\\[\\d\\]\\)/gi ).length >= 3 && editor.match( /\\.html\\(slotOne\\)/gi ) && editor.match( /\\.html\\(slotTwo\\)/gi ) && editor.match( /\\.html\\(slotThree\\)/gi )){return true;}else{return false;}}else{return false;}})(), 'You should have used the the selector given in the description to select each slot and assign it the value of slotOne, slotTwo and slotThree respectively')"
|
"assert((editor.match( /\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)/gi) && editor.match( /\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)/gi ).length >= 3 && editor.match( /\\.html\\(slotOne\\)/gi ) && editor.match( /\\.html\\(slotTwo\\)/gi ) && editor.match( /\\.html\\(slotThree\\)/gi )), 'You should have used the the selector given in the description to select each slot and assign it the value of <code>slotOne</code>, <code>slotTwo</code> and <code>slotThree</code> respectively.')"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"fccss",
|
"fccss",
|
||||||
@ -1624,13 +1626,13 @@
|
|||||||
"Set up all three slots like this, then click the \"Go\" button to play the slot machine."
|
"Set up all three slots like this, then click the \"Go\" button to play the slot machine."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert((editor.match(/\\$\\(\\$\\(\\'\\.slot\\'\\)\\[\\d\\]\\)\\.html\\(\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\);/gi) && editor.match(/\\$\\(\\$\\(\\'\\.slot\\'\\)\\[\\d\\]\\)\\.html\\(\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\);/gi).length >= 3) || (editor.match(/\\$\\(\\$\\(\\\"\\.slot\\\"\\)\\[\\d\\]\\)\\.html\\(\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\);/gi) && editor.match(/\\$\\(\\$\\(\\\"\\.slot\\\"\\)\\[\\d\\]\\)\\.html\\(\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\);/gi).length >= 3), 'Use the provided code three times. One for each slot')",
|
"assert((editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)\\.html\\(\\s*?\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\s*?\\);/gi) && editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)\\.html\\(\\s*?\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\s*?\\);/gi).length >= 3), 'Use the provided code three times. One for each slot.')",
|
||||||
"assert(editor.match(/\\$\\(\\$\\(\\'\\.slot\\'\\)\\[0\\]\\)/gi), 'You should have used <code>$('.slot')[0]</code> at least once')",
|
"assert(editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[0\\]\\s*?\\)/gi), 'You should have used <code>$('.slot')[0]</code> at least once.')",
|
||||||
"assert(editor.match(/\\$\\(\\$\\(\\'\\.slot\\'\\)\\[1\\]\\)/gi), 'You should have used <code>$('.slot')[1]</code> at least once')",
|
"assert(editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[1\\]\\s*?\\)/gi), 'You should have used <code>$('.slot')[1]</code> at least once.')",
|
||||||
"assert(editor.match(/\\$\\(\\$\\(\\'\\.slot\\'\\)\\[2\\]\\)/gi), 'You should have used <code>$('.slot')[2]</code> at least once')",
|
"assert(editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[2\\]\\s*?\\)/gi), 'You should have used <code>$('.slot')[2]</code> at least once.')",
|
||||||
"assert(editor.match(/slotOne/gi) && editor.match(/slotOne/gi).length >= 7, 'You should have used the slotOne value at least once')",
|
"assert(editor.match(/slotOne/gi) && editor.match(/slotOne/gi).length >= 7, 'You should have used the <code>slotOne</code> value at least once.')",
|
||||||
"assert(editor.match(/slotTwo/gi) && editor.match(/slotTwo/gi).length >= 8, 'You should have used the slotTwo value at least once')",
|
"assert(editor.match(/slotTwo/gi) && editor.match(/slotTwo/gi).length >= 8, 'You should have used the <code>slotTwo</code> value at least once.')",
|
||||||
"assert(editor.match(/slotThree/gi) && editor.match(/slotThree/gi).length >= 7, 'You should have used the slotThree value at least once')"
|
"assert(editor.match(/slotThree/gi) && editor.match(/slotThree/gi).length >= 7, 'You should have used the <code>slotThree</code> value at least once.')"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"fccss",
|
"fccss",
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
"Drag the windows around and press the buttons in the lower-right hand corner to change the orientation to suit your preference.",
|
"Drag the windows around and press the buttons in the lower-right hand corner to change the orientation to suit your preference.",
|
||||||
"Click the gear next to CSS. Then under the \"Add External CSS\" section, use the \"Quick-add\" select box to select Bootstrap. Then click \"Save & Close\".",
|
"Click the gear next to CSS. Then under the \"Add External CSS\" section, use the \"Quick-add\" select box to select Bootstrap. Then click \"Save & Close\".",
|
||||||
"Verify that bootstrap is active by adding the following code to your HTML: <code><h1 class='text-primary'>Hello CodePen!</h1></code>. The text's color should be Bootstrap blue.",
|
"Verify that bootstrap is active by adding the following code to your HTML: <code><h1 class='text-primary'>Hello CodePen!</h1></code>. The text's color should be Bootstrap blue.",
|
||||||
"Click the gear next to JavaScript. Click the \"Quick-add\" select box and choose jQuery (not jQuery UI). Then click \"Save & Close\".",
|
"Click the gear next to JavaScript. Click the \"Quick-add\" select box and choose jQuery (not jQuery UI).",
|
||||||
|
"Click the \"Quick-add\" select box again and choose Bootstrap. Then click \"Save & Close\".",
|
||||||
"Now add the following code to your JavaScript: <code>$(document).ready(function() { $('.text-primary').text('Hi CodePen!') });</code>. Click the \"Save\" button at the top. Your \"Hello CodePen!\" should change to \"Hi CodePen!\". This means that jQuery is working.",
|
"Now add the following code to your JavaScript: <code>$(document).ready(function() { $('.text-primary').text('Hi CodePen!') });</code>. Click the \"Save\" button at the top. Your \"Hello CodePen!\" should change to \"Hi CodePen!\". This means that jQuery is working.",
|
||||||
"You can use this CodePen that you've just created as a starting point for your Ziplines. Just click the \"fork\" button at the top of your CodePen and it will create a duplicate CodePen.",
|
"You can use this CodePen that you've just created as a starting point for your Ziplines. Just click the \"fork\" button at the top of your CodePen and it will create a duplicate CodePen.",
|
||||||
"Now you're ready for your first Zipline. Click the \"I've completed this challenge\" button."
|
"Now you're ready for your first Zipline. Click the \"I've completed this challenge\" button."
|
||||||
@ -28,8 +29,22 @@
|
|||||||
"descriptionCn": [],
|
"descriptionCn": [],
|
||||||
"nameFr": "",
|
"nameFr": "",
|
||||||
"descriptionFr": [],
|
"descriptionFr": [],
|
||||||
"nameRu": "",
|
"nameRu": "Приготовьтесь к Zipline'ам",
|
||||||
"descriptionRu": [],
|
"descriptionRu": [
|
||||||
|
"Теперь вы готовы приступить к Zipline'ам. Это задания по фронт-энд разработке, в них вы примените ранее изученные HTML, CSS, jQuery и JavaScript и создадите статические (не использующие базу данных) приложения.",
|
||||||
|
"Ни в коем случае не унывайте! Воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>, если что-то не получается.",
|
||||||
|
"Задания мы будем выполнять используя CodePen - популярный инструмент для создания и обмена статическими веб приложениями.",
|
||||||
|
"Перейдите по ссылке <a href='http://codepen.io' target='_blank'>http://codepen.io</a> и создайте аккаунт.",
|
||||||
|
"Нажмите на ваш аватар в правом верхнем углу, а затем в открывшемся меню на кнопку \"New pen\".",
|
||||||
|
"Выберите удобное расположение окон с помощью кнопок в правом нижнем углу, отрегулируйте их ширину.",
|
||||||
|
"Нажмите на звездочку рядом с CSS. Затем в секции \"Add External CSS\" выберите \"Quick-add\" и добавьте Bootstrap. Нажмите \"Save & Close\".",
|
||||||
|
"Проверьте, что Bootstrap подключен добавив следующий HTML код: <code><h1 class='text-primary'>Hello CodePen!</h1></code>. Цвет текста должен быть синим.",
|
||||||
|
"Нажмите на звездочку рядом с JavaScript. Нажмите \"Quick-add\" и выберите jQuery (не jQuery UI). Нажмите \"Save & Close\".",
|
||||||
|
"Снова нажмите на поле \"Quick-add\", выберите Bootstrap и затем нажмите \"Save & Close\".",
|
||||||
|
"Теперь добавьте следующий код в окошко JavaScript: <code>$(document).ready(function() { $('.text-primary').text('Hi CodePen!') });</code>. Нажмите на кнопку \"Save\" расположенную наверху. Текст \"Hello CodePen!\" должен измениться на \"Hi CodePen!\". Это значит что jQuery работает.",
|
||||||
|
"CodePen, который мы создали, можно использовать в качестве отправной точки для ваших Zipline'ов. Кликните кнопку \"fork\", чтобы создать копию текущего CodePen'a.",
|
||||||
|
"Все готово для первого Zipline'а. Жмите кнопку \"I've completed this challenge\"."
|
||||||
|
],
|
||||||
"nameEs": "",
|
"nameEs": "",
|
||||||
"descriptionEs": [],
|
"descriptionEs": [],
|
||||||
"namePt": "",
|
"namePt": "",
|
||||||
@ -56,7 +71,7 @@
|
|||||||
"Note that CodePen.io overrides the Window.open() function, so if you want to open windows using jquery, you will need to target invisible anchor elements like this one: <code><a target='_blank'></a></code>.",
|
"Note that CodePen.io overrides the Window.open() function, so if you want to open windows using jquery, you will need to target invisible anchor elements like this one: <code><a target='_blank'></a></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.",
|
"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.",
|
||||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "zipline",
|
"type": "zipline",
|
||||||
"challengeType": 3,
|
"challengeType": 3,
|
||||||
@ -65,8 +80,25 @@
|
|||||||
"descriptionCn": [],
|
"descriptionCn": [],
|
||||||
"nameFr": "",
|
"nameFr": "",
|
||||||
"descriptionFr": [],
|
"descriptionFr": [],
|
||||||
"nameRu": "",
|
"nameRu": "Создайте сайт-портфолио",
|
||||||
"descriptionRu": [],
|
"descriptionRu": [
|
||||||
|
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/ThiagoFerreir4/full/eNMxEp' target='_blank'>http://codepen.io/ThiagoFerreir4/full/eNMxEp</a>.",
|
||||||
|
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||||
|
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||||
|
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||||
|
"<span class='text-info'>Подсказка:</span> Если вы не хотите создавать портфолио с нуля, можете взять за основу этот простой Bootstrap шаблон: <a href='http://codepen.io/FreeCodeCamp/pen/mJNqQj/' target='_blank'>http://codepen.io/FreeCodeCamp/pen/mJNqQj</a>.",
|
||||||
|
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||||
|
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу получить доступ ко всей информации на странице просто прокрутив ее сверху вниз.",
|
||||||
|
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу нажать на различные кнопки и перейти к социальным страницам владельца портфолио.",
|
||||||
|
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу увидеть эскизы проектов, которые были созданы владельцем портфолио (используйте временную картинку если у вас пока нету собственных веб-страниц).",
|
||||||
|
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу перемещаться к различным частям страницы нажимая на соответствующие навигационные кнопки.",
|
||||||
|
"Не переживайте если вам пока нечего показать в портфолио - вы создадите несколько веб приложений в следующих заданиях, а затем вернетесь и обновите портфолио.",
|
||||||
|
"В сети существует много шаблонов для портфолио, но в этом задании вам необходимо создать собственную уникальную страницу. Использование Bootstrap сделает этот процесс намного проще.",
|
||||||
|
"Обратите внимание, что CodePen.io переопределяет функцию Window.open(), поэтому, если вы хотите открывать окна используя jQuery, необходимо будет адресовать невидимые якорные элементы, такие как этот: <code><a target='_blank'&rt;</a></code>.",
|
||||||
|
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||||
|
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||||
|
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
|
],
|
||||||
"nameEs": "",
|
"nameEs": "",
|
||||||
"descriptionEs": [],
|
"descriptionEs": [],
|
||||||
"namePt": "",
|
"namePt": "",
|
||||||
@ -88,7 +120,7 @@
|
|||||||
"Note that you can either put your quotes into an array and show them at random, or use an API to get quotes, such as <a href='http://forismatic.com/en/api/'>http://forismatic.com/en/api/</a>.",
|
"Note that you can either put your quotes into an array and show them at random, or use an API to get quotes, such as <a href='http://forismatic.com/en/api/'>http://forismatic.com/en/api/</a>.",
|
||||||
"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.",
|
"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.",
|
||||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "zipline",
|
"type": "zipline",
|
||||||
"challengeType": 3,
|
"challengeType": 3,
|
||||||
@ -97,8 +129,20 @@
|
|||||||
"descriptionCn": [],
|
"descriptionCn": [],
|
||||||
"nameFr": "",
|
"nameFr": "",
|
||||||
"descriptionFr": [],
|
"descriptionFr": [],
|
||||||
"nameRu": "",
|
"nameRu": "Создайте генератор случайных цитат",
|
||||||
"descriptionRu": [],
|
"descriptionRu": [
|
||||||
|
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/AdventureBear/full/vEoVMw' target='_blank'>http://codepen.io/AdventureBear/full/vEoVMw</a>.",
|
||||||
|
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||||
|
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||||
|
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||||
|
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||||
|
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу нажать на кнопку и получить случайную цитату.",
|
||||||
|
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу нажать на кнопку и опубликовать цитату в Twitter'e.",
|
||||||
|
"Цитаты можно добавить в массив и случайным образом выводить одну из них, либо можно воспользоваться соответствующим API, например <a href='http://forismatic.com/en/api/'>http://forismatic.com/en/api/</a>.",
|
||||||
|
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||||
|
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||||
|
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
|
],
|
||||||
"nameEs": "",
|
"nameEs": "",
|
||||||
"descriptionEs": [],
|
"descriptionEs": [],
|
||||||
"namePt": "",
|
"namePt": "",
|
||||||
@ -116,12 +160,12 @@
|
|||||||
"<span class='text-info'>Rule #3:</span> Reverse engineer the example project's functionality, and also feel free to personalize it.",
|
"<span class='text-info'>Rule #3:</span> Reverse engineer the example project's functionality, and also feel free to personalize it.",
|
||||||
"Here are the <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a> you must enable, and optional bonus user stories:",
|
"Here are the <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a> you must enable, and optional bonus user stories:",
|
||||||
"<span class='text-info'>User Story:</span> As a user, I can see the weather in my current location.",
|
"<span class='text-info'>User Story:</span> As a user, I can see the weather in my current location.",
|
||||||
"<span class='text-info'>Bonus User Story:</span> As a user, I can see an icon depending on the temperature..",
|
"<span class='text-info'>Bonus User Story:</span> As a user, I can see an icon depending on the weather.",
|
||||||
"<span class='text-info'>Bonus User Story:</span> As a user, I see a different background image depending on the temperature (e.g. snowy mountain, hot desert).",
|
"<span class='text-info'>Bonus User Story:</span> As a user, I see a different background image (e.g. snowy mountain, hot desert) depending on the weather.",
|
||||||
"<span class='text-info'>Bonus User Story:</span> As a user, I can push a button to toggle between Fahrenheit and Celsius.",
|
"<span class='text-info'>Bonus User Story:</span> As a user, I can push a button to toggle between Fahrenheit and Celsius.",
|
||||||
"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.",
|
"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.",
|
||||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "zipline",
|
"type": "zipline",
|
||||||
"challengeType": 3,
|
"challengeType": 3,
|
||||||
@ -130,8 +174,21 @@
|
|||||||
"descriptionCn": [],
|
"descriptionCn": [],
|
||||||
"nameFr": "",
|
"nameFr": "",
|
||||||
"descriptionFr": [],
|
"descriptionFr": [],
|
||||||
"nameRu": "",
|
"nameRu": "Покажите местную погоду",
|
||||||
"descriptionRu": [],
|
"descriptionRu": [
|
||||||
|
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/AdventureBear/full/yNBJRj' target='_blank'>http://codepen.io/AdventureBear/full/yNBJRj</a>.",
|
||||||
|
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||||
|
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||||
|
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||||
|
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||||
|
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу узнать погоду с учетом моего текущего местоположения.",
|
||||||
|
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу в зависимости от погоды видеть различные температурные значки.",
|
||||||
|
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу в зависимости от погоды видеть различные фоновые изображения (снежные горы, знойная пустыня).",
|
||||||
|
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу нажать на кнопку чтобы переключится между градусами по Цельсию или по Фаренгейту.",
|
||||||
|
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||||
|
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||||
|
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
|
],
|
||||||
"nameEs": "",
|
"nameEs": "",
|
||||||
"descriptionEs": [],
|
"descriptionEs": [],
|
||||||
"namePt": "",
|
"namePt": "",
|
||||||
@ -153,7 +210,7 @@
|
|||||||
"<span class='text-info'>Bonus User Story:</span> As a user, I can customize the length of each pomodoro.",
|
"<span class='text-info'>Bonus User Story:</span> As a user, I can customize the length of each pomodoro.",
|
||||||
"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.",
|
"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.",
|
||||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "zipline",
|
"type": "zipline",
|
||||||
"challengeType": 3,
|
"challengeType": 3,
|
||||||
@ -162,8 +219,20 @@
|
|||||||
"descriptionCn": [],
|
"descriptionCn": [],
|
||||||
"nameFr": "",
|
"nameFr": "",
|
||||||
"descriptionFr": [],
|
"descriptionFr": [],
|
||||||
"nameRu": "",
|
"nameRu": "Создайте таймер Pomodoro",
|
||||||
"descriptionRu": [],
|
"descriptionRu": [
|
||||||
|
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/GeoffStorbeck/full/RPbGxZ/' target='_blank'>http://codepen.io/GeoffStorbeck/full/RPbGxZ/</a>.",
|
||||||
|
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||||
|
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||||
|
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||||
|
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||||
|
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу запустить 25 минутную 'помидорку', по истечении которой таймер выключится.",
|
||||||
|
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу сбросить таймер для установки следующей 'помидорки'.",
|
||||||
|
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу выбирать длительность 'помидорки'.",
|
||||||
|
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||||
|
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||||
|
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
|
],
|
||||||
"nameEs": "",
|
"nameEs": "",
|
||||||
"descriptionEs": [],
|
"descriptionEs": [],
|
||||||
"namePt": "",
|
"namePt": "",
|
||||||
@ -190,7 +259,7 @@
|
|||||||
"<span class='text-info'>Hint:</span> Here's an array of the Twitch.tv usernames of people who regularly stream coding: <code>[\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]</code>",
|
"<span class='text-info'>Hint:</span> Here's an array of the Twitch.tv usernames of people who regularly stream coding: <code>[\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]</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.",
|
"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.",
|
||||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "zipline",
|
"type": "zipline",
|
||||||
"challengeType": 3,
|
"challengeType": 3,
|
||||||
@ -199,8 +268,25 @@
|
|||||||
"descriptionCn": [],
|
"descriptionCn": [],
|
||||||
"nameFr": "",
|
"nameFr": "",
|
||||||
"descriptionFr": [],
|
"descriptionFr": [],
|
||||||
"nameRu": "",
|
"nameRu": "Используйте Twitch.tv JSON API",
|
||||||
"descriptionRu": [],
|
"descriptionRu": [
|
||||||
|
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/GeoffStorbeck/full/GJKRxZ' target='_blank'>http://codepen.io/GeoffStorbeck/full/GJKRxZ</a>.",
|
||||||
|
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||||
|
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||||
|
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||||
|
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||||
|
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу увидеть идет ли в данный момент на Twitch.tv трансляция Free Code Camp.",
|
||||||
|
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу, кликнув на описание трансляции, перейти на канал Free Code Camp.",
|
||||||
|
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу видеть дополнительную информацию о текущей трансляции Free Code Camp.",
|
||||||
|
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу произвести поиск среди перечисленных каналов.",
|
||||||
|
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу видеть уведомление, если создатель канала закрыл свой аккаунт на Twitch.tv. Добавьте в массив имена пользователей brunofin и comster404, чтобы убедиться, что эта функция реализована правильно.",
|
||||||
|
"<span class='text-info'>Подсказка:</span> Пример запроса к Twitch.tv JSON API: <code>https://api.twitch.tv/kraken/streams/freecodecamp</code>.",
|
||||||
|
"<span class='text-info'>Подсказка:</span> Документацию об этом запросе можно найти по ссылке: <a href='https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel' target='_blank'>https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel</a>.",
|
||||||
|
"<span class='text-info'>Подсказка:</span> В этом массиве приведены имена пользователей, которые регулярно пишут код онлайн: <code>[\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"comster404\",\"brunofin\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]</code>",
|
||||||
|
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||||
|
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||||
|
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
|
],
|
||||||
"nameEs": "",
|
"nameEs": "",
|
||||||
"descriptionEs": [],
|
"descriptionEs": [],
|
||||||
"namePt": "",
|
"namePt": "",
|
||||||
|
@ -347,7 +347,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"Normally, your <code>button</code> elements are only as wide as the text that they contain. By making them block elements, your button will stretch to fill your page's entire horizontal space.",
|
"Normally, your <code>button</code> elements are only as wide as the text that they contain. By making them block elements, your button will stretch to fill your page's entire horizontal space.",
|
||||||
"This image illustrates the difference between <code>inline</code> elements and <code>block-level</code> elements:",
|
"This image illustrates the difference between <code>inline</code> elements and <code>block-level</code> elements:",
|
||||||
"<img class=\"img-responsive\" src=\"http://i.imgur.com/O32cDWE.png\" alt=\"An \"inline\" button is as small as the text it contains. In this image, it's centered. Below it is a \"block-level\" button, which stretches to fill the entire horizontal space.'>",
|
"<a href=\"http://i.imgur.com/O32cDWE.png\" data-lightbox=\"img-enlarge\"><img class=\"img-responsive\" src=\"http://i.imgur.com/O32cDWE.png\" title=\"Click to enlarge\" alt=\"An \"inline\" button is as small as the text it contains. In this image, it's centered. Below it is a \"block-level\" button, which stretches to fill the entire horizontal space.'></a>",
|
||||||
"Note that these buttons still need the <code>btn</code> class.",
|
"Note that these buttons still need the <code>btn</code> class.",
|
||||||
"Add Bootstrap's <code>btn-block</code> class to your Bootstrap button."
|
"Add Bootstrap's <code>btn-block</code> class to your Bootstrap button."
|
||||||
],
|
],
|
||||||
@ -700,7 +700,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a <code>div</code> element.",
|
"Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a <code>div</code> element.",
|
||||||
"Here's a diagram of how Bootstrap's 12-column grid layout works:",
|
"Here's a diagram of how Bootstrap's 12-column grid layout works:",
|
||||||
"<a href=\"http://i.imgur.com/FaYuui8.png\" target=\"_blank\"><img class=\"img-responsive\" src=\"http://i.imgur.com/FaYuui8.png\" alt=\"an image illustrating Bootstrap's grid system\"></a>",
|
"<a href=\"http://i.imgur.com/FaYuui8.png\" data-lightbox=\"img-enlarge\"><img class=\"img-responsive\" src=\"http://i.imgur.com/FaYuui8.png\" title=\"Click to enlarge\" alt=\"an image illustrating Bootstrap's grid system\"></a>",
|
||||||
"Note that in this illustration, the <code>col-md-*</code> class is being used. Here, <code>md</code> means medium, and <code>*</code> is a number specifying how many columns wide the element should be. In this case, the column width of an element on a medium-sized screen, such as a laptop, is being specified.",
|
"Note that in this illustration, the <code>col-md-*</code> class is being used. Here, <code>md</code> means medium, and <code>*</code> is a number specifying how many columns wide the element should be. In this case, the column width of an element on a medium-sized screen, such as a laptop, is being specified.",
|
||||||
"In the Cat Photo App that we're building, we'll use <code>col-xs-*</code>, where <code>xs</code> means extra small (like an extra-small mobile phone screen), and <code>*</code> is the number of columns specifying how many columns wide the element should be.",
|
"In the Cat Photo App that we're building, we'll use <code>col-xs-*</code>, where <code>xs</code> means extra small (like an extra-small mobile phone screen), and <code>*</code> is the number of columns specifying how many columns wide the element should be.",
|
||||||
"Put the <code>Like</code>, <code>Info</code> and <code>Delete</code> buttons side-by-side by nesting all three of them within one <code><div class=\"row\"></code> element, then each of them within a <code><div class=\"col-xs-4\"></code> element.",
|
"Put the <code>Like</code>, <code>Info</code> and <code>Delete</code> buttons side-by-side by nesting all three of them within one <code><div class=\"row\"></code> element, then each of them within a <code><div class=\"col-xs-4\"></code> element.",
|
||||||
@ -895,7 +895,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"You can use spans to create inline elements. Remember when we used the <code>btn-block</code> class to make the button fill the entire row?",
|
"You can use spans to create inline elements. Remember when we used the <code>btn-block</code> class to make the button fill the entire row?",
|
||||||
"This image illustrates the difference between <code>inline</code> elements and <code>block-level</code> elements:",
|
"This image illustrates the difference between <code>inline</code> elements and <code>block-level</code> elements:",
|
||||||
"<img class=\"img-responsive\" src=\"http://i.imgur.com/O32cDWE.png\" alt=\"An \"inline\" button is as small as the text it contains. In this image, it's centered. Below it is a \"block-level\" button, which stretches to fill the entire horizontal space.'>",
|
"<a href=\"http://i.imgur.com/O32cDWE.png\" data-lightbox=\"img-enlarge\"><img class=\"img-responsive\" src=\"http://i.imgur.com/O32cDWE.png\" title=\"Click to enlarge\" alt=\"An \"inline\" button is as small as the text it contains. In this image, it's centered. Below it is a \"block-level\" button, which stretches to fill the entire horizontal space.'></a>",
|
||||||
"By using the <code>span</code> element, you can put several elements together, and even style different parts of the same element differently.",
|
"By using the <code>span</code> element, you can put several elements together, and even style different parts of the same element differently.",
|
||||||
"Nest the word \"love\" in your \"Things cats love\" element below within a <code>span</code> element. Then give that <code>span</code> the class <code>text-danger</code> to make the text red.",
|
"Nest the word \"love\" in your \"Things cats love\" element below within a <code>span</code> element. Then give that <code>span</code> the class <code>text-danger</code> to make the text red.",
|
||||||
"Here's how you would do this with the \"Top 3 things cats hate\" element: <code><p>Top 3 things cats <span class = \"text-danger\">hate</span></p></code>"
|
"Here's how you would do this with the \"Top 3 things cats hate\" element: <code><p>Top 3 things cats <span class = \"text-danger\">hate</span></p></code>"
|
||||||
@ -984,7 +984,7 @@
|
|||||||
"We will make a simple heading for our Cat Photo App by putting them in the same row.",
|
"We will make a simple heading for our Cat Photo App by putting them in the same row.",
|
||||||
"Remember, Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a <code>div</code> element.",
|
"Remember, Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a <code>div</code> element.",
|
||||||
"Here's a diagram of how Bootstrap's 12-column grid layout works:",
|
"Here's a diagram of how Bootstrap's 12-column grid layout works:",
|
||||||
"<a href=\"http://i.imgur.com/FaYuui8.png\" target=\"_blank\"><img class=\"img-responsive\" src=\"http://i.imgur.com/FaYuui8.png\" alt=\"an image illustrating Bootstrap's grid system\"></a>",
|
"<a href=\"http://i.imgur.com/FaYuui8.png\" data-lightbox=\"img-enlarge\"><img class=\"img-responsive\" src=\"http://i.imgur.com/FaYuui8.png\" title=\"Click to enlarge\" alt=\"an image illustrating Bootstrap's grid system\"></a>",
|
||||||
"Note that in this illustration, the <code>col-md-*</code> class is being used. Here, <code>md</code> means medium, and <code>*</code> is a number specifying how many columns wide the element should be. In this case, the column width of an element on a medium-sized screen, such as a laptop, is being specified.",
|
"Note that in this illustration, the <code>col-md-*</code> class is being used. Here, <code>md</code> means medium, and <code>*</code> is a number specifying how many columns wide the element should be. In this case, the column width of an element on a medium-sized screen, such as a laptop, is being specified.",
|
||||||
"In the Cat Photo App that we're building, we'll use <code>col-xs-*</code>, where <code>xs</code> means extra small (like an extra-small mobile phone screen), and <code>*</code> is the number of columns specifying how many columns wide the element should be.",
|
"In the Cat Photo App that we're building, we'll use <code>col-xs-*</code>, where <code>xs</code> means extra small (like an extra-small mobile phone screen), and <code>*</code> is the number of columns specifying how many columns wide the element should be.",
|
||||||
"Nest your first image and your <code>h2</code> element within a single <code><div class=\"row\"></code> element. Nest your <code>h2</code> text within a <code><div class=\"col-xs-8\"></code> and your image in a <code><div class=\"col-xs-4\"></code> so that they are on the same line.",
|
"Nest your first image and your <code>h2</code> element within a single <code><div class=\"row\"></code> element. Nest your <code>h2</code> text within a <code><div class=\"col-xs-8\"></code> and your image in a <code><div class=\"col-xs-4\"></code> so that they are on the same line.",
|
||||||
@ -1159,9 +1159,9 @@
|
|||||||
"Use Font Awesome to add a <code>info-circle</code> icon to your info button and a <code>trash</code> icon to your delete button."
|
"Use Font Awesome to add a <code>info-circle</code> icon to your info button and a <code>trash</code> icon to your delete button."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"i\").hasClass(\"fa fa-trash\"), 'You should add a <code><i class=\"fa fa-trash\"></i></code> within your delete button element.')",
|
"assert($(\".btn-danger > i\").hasClass(\"fa fa-trash\"), 'You should add a <code><i class=\"fa fa-trash\"></i></code> within your delete button element.')",
|
||||||
"assert($(\"i\").hasClass(\"fa fa-info-circle\"), 'You should add a <code><i class=\"fa fa-info-circle\"></i></code> within your info button element.')",
|
"assert($(\".btn-info > i\").hasClass(\"fa fa-info-circle\"), 'You should add a <code><i class=\"fa fa-info-circle\"></i></code> within your info button element.')",
|
||||||
"assert(editor.match(/<\\/i>/g) && editor.match(/<\\/i/g).length > 2, 'Make sure each of your <code>i</code> elements has a closing tag.')"
|
"assert(editor.match(/<\\/i>/g) && editor.match(/<\\/i>/g).length > 2 && $(\".btn-primary > i\").hasClass(\"fa fa-thumbs-up\"), 'Make sure each of your <code>i</code> elements has a closing tag and <code><i class=\"fa fa-thumbs-up\"></i></code> is in your like button element.')"
|
||||||
],
|
],
|
||||||
"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\">",
|
||||||
@ -1722,7 +1722,7 @@
|
|||||||
"Create two <code>div</code> elements within your row, both with the class <code>col-xs-6</code>."
|
"Create two <code>div</code> elements within your row, both with the class <code>col-xs-6</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"div.row\").children(\"div.col-xs-6\").length > 1, 'Nest two <code>div class=\"col-xs-6\"</code> elements within your <code>div class=\"row\"</code> element.')",
|
"assert($(\"div.row > div.col-xs-6\").length > 1, 'Nest two <code>div class=\"col-xs-6\"</code> elements within your <code>div class=\"row\"</code> element.')",
|
||||||
"assert(editor.match(/<\\/div>/g) && editor.match(/<div/g) && editor.match(/<\\/div>/g).length === editor.match(/<div/g).length, 'Make sure all your <code>div</code> elements have closing tags.')"
|
"assert(editor.match(/<\\/div>/g) && editor.match(/<div/g) && editor.match(/<\\/div>/g).length === editor.match(/<div/g).length, 'Make sure all your <code>div</code> elements have closing tags.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -1756,8 +1756,8 @@
|
|||||||
"Nest one <code>div</code> element with the class <code>well</code> within each of your <code>col-xs-6</code> <code>div</code> elements."
|
"Nest one <code>div</code> element with the class <code>well</code> within each of your <code>col-xs-6</code> <code>div</code> elements."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"div\").length > 4, 'Add a <code>div</code> element with the class <code>well</code> inside each of your <code>div class=\"col-xs-6\" elements</code>')",
|
"assert($(\"div.col-xs-6\").not(\":has(>div.well)\").length < 1, 'Add a <code>div</code> element with the class <code>well</code> inside each of your <code>div</code> elements with the class <code>\"col-xs-6\"</code>')",
|
||||||
"assert($(\"div.col-xs-6 div.well\").length > 1, 'Nest both of your <code>div class=\"col-xs-6\"</code> elements within your <code>div class=\"row\"</code> element.')",
|
"assert($(\"div.row > div.col-xs-6\").length > 1, 'Nest both of your <code>div</code> elements with the class <code>\"col-xs-6\"</code> within your <code>div</code> element with the class <code>\"row\"</code>.')",
|
||||||
"assert(editor.match(/<\\/div>/g) && editor.match(/<div/g) && editor.match(/<\\/div>/g).length === editor.match(/<div/g).length, 'Make sure all your <code>div</code> elements have closing tags.')"
|
"assert(editor.match(/<\\/div>/g) && editor.match(/<div/g) && editor.match(/<\\/div>/g).length === editor.match(/<div/g).length, 'Make sure all your <code>div</code> elements have closing tags.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -1983,7 +1983,7 @@
|
|||||||
"Above your right-well, inside its <code>col-xs-6</code> <code>div</code> element, add a <code>h4</code> element with the text <code>#right-well</code>."
|
"Above your right-well, inside its <code>col-xs-6</code> <code>div</code> element, add a <code>h4</code> element with the text <code>#right-well</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\".col-xs-6\").children(\"h4\") && $(\".col-xs-6\").children(\"h4\").length > 1, 'Add an <code>h4</code> element to each of your <code><div class=\\\"col-xs-6\\\"></code> elements.');",
|
"assert($(\".col-xs-6\").children(\"h4\") && $(\".col-xs-6\").children(\"h4\").length > 1, 'Add an <code>h4</code> element to each of your <code><div class=\"col-xs-6\"></code> elements.');",
|
||||||
"assert(new RegExp(\"#left-well\",\"gi\").test($(\"h4\").text()), 'One <code>h4</code> element should have the text <code>#left-well</code>.');",
|
"assert(new RegExp(\"#left-well\",\"gi\").test($(\"h4\").text()), 'One <code>h4</code> element should have the text <code>#left-well</code>.');",
|
||||||
"assert(new RegExp(\"#right-well\",\"gi\").test($(\"h4\").text()), 'One <code>h4</code> element should have the text <code>#right-well</code>.');",
|
"assert(new RegExp(\"#right-well\",\"gi\").test($(\"h4\").text()), 'One <code>h4</code> element should have the text <code>#right-well</code>.');",
|
||||||
"assert(editor.match(/<\\/h4>/g) && editor.match(/<h4/g) && editor.match(/<\\/h4>/g).length === editor.match(/<h4/g).length, 'Make sure all your <code>h4</code> elements have closing tags.')"
|
"assert(editor.match(/<\\/h4>/g) && editor.match(/<h4/g) && editor.match(/<\\/h4>/g).length === editor.match(/<h4/g).length, 'Make sure all your <code>h4</code> elements have closing tags.')"
|
||||||
|
321
seed/challenges/getting-started.json
Normal file
321
seed/challenges/getting-started.json
Normal file
@ -0,0 +1,321 @@
|
|||||||
|
{
|
||||||
|
"name": "Get Started with Free Code Camp",
|
||||||
|
"order": 0.000,
|
||||||
|
"challenges": [
|
||||||
|
{
|
||||||
|
"id": "560add10cb82ac38a17513be",
|
||||||
|
"title": "Learn how Free Code Camp Works",
|
||||||
|
"difficulty": 0.00,
|
||||||
|
"challengeSeed": [],
|
||||||
|
"description": [
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/RlEk2IF.jpg",
|
||||||
|
"a picture of Free Code Camp's 4 benefits: Get connected, Learn JavaScript, Build your Portfolio, Help nonprofits",
|
||||||
|
"Welcome to Free Code Camp. We're an open source community of busy people who learn to code and help nonprofits.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/pYsTbjI.jpg",
|
||||||
|
"a screenshot of our curriculum alongside a screenshot of our chat room.",
|
||||||
|
"Learning to code is hard. To succeed, you'll need lots of practice and support. That's why we've created a rigorous curriculum and supportive community.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/D7Y5luw.jpg",
|
||||||
|
"A graph of the rate of job growth against growth in computer science degree graduates. There are 1.4 million jobs and only 400 million people to fill them.",
|
||||||
|
"There are thousands of coding jobs currently going unfilled, and the demand for coders grows every year. If you want a coding job, we can help prepare you to get one.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/dLx8nrg.jpg",
|
||||||
|
"An illustration showing that you will learn HTML5, CSS3, JavaScript, Databases, Git, Node.js, Angular.js and Agile.",
|
||||||
|
"First you'll work through our rigorous 800-hour curriculum learn technologies like HTML5, Node.js and databases. It's self-paced and 100% free.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/q4IjuCL.jpg",
|
||||||
|
"a screenshot of our Front End Development Certificate",
|
||||||
|
"About half way through our curriculum, you'll earn a verified Front End Development Certificate. If you can finish our entire curriculum, you'll earn a verified Full Stack Development Certificate.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/yXyxbDd.jpg",
|
||||||
|
"a screen shot of our nonprofit project directory.",
|
||||||
|
"Then you'll build several real-life projects for nonprofits. By the time you finish, you'll have a portfolio of real apps that people use every day.",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"type": "Waypoint",
|
||||||
|
"challengeType": 7,
|
||||||
|
"tests": [],
|
||||||
|
"nameCn": "",
|
||||||
|
"descriptionCn": [],
|
||||||
|
"nameFr": "",
|
||||||
|
"descriptionFr": [],
|
||||||
|
"nameRu": "",
|
||||||
|
"descriptionRu": [],
|
||||||
|
"nameEs": "",
|
||||||
|
"descriptionEs": [],
|
||||||
|
"namePt": "",
|
||||||
|
"descriptionPt": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "560add37cb82ac38a17513bf",
|
||||||
|
"title": "Create a GitHub Account and Join our Chat Rooms",
|
||||||
|
"difficulty": 0.01,
|
||||||
|
"challengeSeed": [],
|
||||||
|
"description": [
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/EAR7Lvh.jpg",
|
||||||
|
"a screenshot of our one of our Gitter chat rooms.",
|
||||||
|
"Now let's join Free Code Camp's chat rooms. You can come here any time of day to hang out, ask questions, or find another camper to pair program with. First you'll need a GitHub account.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/FEImaEN.gif",
|
||||||
|
"A gif showing you to click the link below to go to GitHub. Fill in the necessary fields and click submit.",
|
||||||
|
"Create an account with GitHub. Be sure to use your real email address - GitHub will keep this private.",
|
||||||
|
"https://github.com/join"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/ALN6zPK.gif",
|
||||||
|
"A gif showing you how to click the profile image in the upper right hand corner of GitHub. Upload a photo of yourself or you will continue to use the automatically generated pixel art. Then fill in the remaining form fields and click submit.",
|
||||||
|
"Click the pixel art in the upper right hand corner of GitHub, then choose settings. Upload a picture of yourself. A picture of your face works best. This is how your fellow campers will see you in our chat rooms, so put your best foot forward. You can add your city and your name if you want.",
|
||||||
|
"https://github.com/settings/profile"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/OXL3G3n.gif",
|
||||||
|
"Click the link below to navigate to Free Code Camp's open-source repository. In the upper right hand corner, you can click the \"star\" button to star this repository.",
|
||||||
|
"Go to Free Code Camp's open-source repository and \"star\" it. \"Starring\" is the GitHub equivalent of \"liking\" something.",
|
||||||
|
"https://github.com/freecodecamp/freecodecamp"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/EZHzKCV.gif",
|
||||||
|
"A gif showing you how to click the link below to go to our chat room and click the \"sign in with GitHub\" button. Then you can click into the text input field and type a message to your fellow campers.",
|
||||||
|
" Now that you have a GitHub account, you can join our main chat room by logging in with GitHub. Introduce yourself by saying \"Hello world!\". Tell your fellow campers how you found Free Code Camp. Also tell us why you want to learn to code.",
|
||||||
|
"https://gitter.im/FreeCodeCamp/FreeCodeCamp"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/Ecs5XAd.gif",
|
||||||
|
"A gif showing you how you can click the settings button in the upper right hand corner and modify your notification settings.",
|
||||||
|
"Our chat rooms are extremely active. You should change your settings so you're only notified if someone mentions you.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/T0bGJPe.gif",
|
||||||
|
"A gif showing how you can click on a user profile image to initiate a private message with that user.",
|
||||||
|
"Please note that all of our chat rooms are visible to the public. If you need to share sensitive information, such as an email address or phone number, do it in a private message.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/vDTMJSh.gif",
|
||||||
|
"A gif showing that you can tab back and forth between challenges and our chat rooms.",
|
||||||
|
"Keep our chat room open while you work through our challenges. That way, you can ask for help if you get stuck. You can also socialize with other campers when you feel like taking a break.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/SLQ27Gr.gif",
|
||||||
|
"A gif showing how you can click the link below to download a native chat room app for your computer.",
|
||||||
|
"You can also download the chat room app to your computer or phone.",
|
||||||
|
"https://gitter.im/apps"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"type": "Waypoint",
|
||||||
|
"challengeType": 7,
|
||||||
|
"tests": [],
|
||||||
|
"nameCn": "",
|
||||||
|
"descriptionCn": [],
|
||||||
|
"nameFr": "",
|
||||||
|
"descriptionFr": [],
|
||||||
|
"nameRu": "",
|
||||||
|
"descriptionRu": [],
|
||||||
|
"nameEs": "",
|
||||||
|
"descriptionEs": [],
|
||||||
|
"namePt": "",
|
||||||
|
"descriptionPt": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "560add56cb82ac38a17513c0",
|
||||||
|
"title": "Configure your Public Profile",
|
||||||
|
"difficulty": 0.02,
|
||||||
|
"challengeSeed": [],
|
||||||
|
"description": [
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/FkEzbto.gif",
|
||||||
|
"A gif showing how you can click your profile image in your upper right hand corner to access the account page and connect GitHub.",
|
||||||
|
"Check out your portfolio page. Click your picture your upper right hand corner. To activate your portfolio page, you'll need to link your GitHub account with Free Code Camp.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/WKzEr1q.gif",
|
||||||
|
"A gif showing how you can access your profile page and hover over different days to see how many brownie points you got on those days.",
|
||||||
|
"Your portfolio page shows your progress and how many Brownie Points you have. You can get Brownie Points by completing challenges and by helping other campers in our chat rooms. If you get Brownie Points on several days in a row, you'll get a streak.",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"type": "Waypoint",
|
||||||
|
"challengeType": 7,
|
||||||
|
"tests": [],
|
||||||
|
"nameCn": "",
|
||||||
|
"descriptionCn": [],
|
||||||
|
"nameFr": "",
|
||||||
|
"descriptionFr": [],
|
||||||
|
"nameRu": "",
|
||||||
|
"descriptionRu": [],
|
||||||
|
"nameEs": "",
|
||||||
|
"descriptionEs": [],
|
||||||
|
"namePt": "",
|
||||||
|
"descriptionPt": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "560add65cb82ac38a17513c1",
|
||||||
|
"title": "Try our Wiki and Camper News",
|
||||||
|
"difficulty": 0.03,
|
||||||
|
"challengeSeed": [],
|
||||||
|
"description": [
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/DoOqkNW.gif",
|
||||||
|
"A gif showing how you can click the \"Wiki\" button in your upper-right corner to access the wiki.",
|
||||||
|
"Try this: Click the \"Wiki\" button in your upper right hand corner. Our community has contributed lots of useful information to this searchable wiki.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/nmSiMy1.gif",
|
||||||
|
"A gif showing how you can access our Camper News page and click the \"upvote\" button to upvote a story.",
|
||||||
|
"Click the \"News\" button in your upper right hand corner. You can browse links on Camper News and upvote ones that you enjoy.",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"type": "Waypoint",
|
||||||
|
"challengeType": 7,
|
||||||
|
"tests": [],
|
||||||
|
"nameCn": "",
|
||||||
|
"descriptionCn": [],
|
||||||
|
"nameFr": "",
|
||||||
|
"descriptionFr": [],
|
||||||
|
"nameRu": "",
|
||||||
|
"descriptionRu": [],
|
||||||
|
"nameEs": "",
|
||||||
|
"descriptionEs": [],
|
||||||
|
"namePt": "",
|
||||||
|
"descriptionPt": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "560add71cb82ac38a17513c2",
|
||||||
|
"title": "Join a Campsite in Your City",
|
||||||
|
"difficulty": 0.04,
|
||||||
|
"challengeSeed": [],
|
||||||
|
"description": [
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/Elb3dfj.jpg",
|
||||||
|
"A picture of some of our campers meeting in a local cafe. 3 men and 3 women are sitting around a table with laptops out, and are smiling and coding.",
|
||||||
|
"Our Campsites help you code with campers in your city. You can coordinate study groups or attend local coding events together.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/EZHzKCV.gif",
|
||||||
|
"A gif showing how you can click the link below, find your city on the list of Campsites, then click on the Facebook link for your city and join your city's Facebook group.",
|
||||||
|
"Find your city on this list, click the \"Facebook\" link, then click the \"Join group\" button to apply to join your city's Facebook group (someone from the campsite should approve you shortly). If your city isn't on this list, scroll to the bottom of the wiki article for instructions for how you can create your city's Campsite.",
|
||||||
|
"https://github.com/FreeCodeCamp/freecodecamp/wiki/List-of-Free-Code-Camp-city-based-Campsites"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"type": "Waypoint",
|
||||||
|
"challengeType": 7,
|
||||||
|
"tests": [],
|
||||||
|
"nameCn": "",
|
||||||
|
"descriptionCn": [],
|
||||||
|
"nameFr": "",
|
||||||
|
"descriptionFr": [],
|
||||||
|
"nameRu": "",
|
||||||
|
"descriptionRu": [],
|
||||||
|
"nameEs": "",
|
||||||
|
"descriptionEs": [],
|
||||||
|
"namePt": "",
|
||||||
|
"descriptionPt": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "560add8ccb82ac38a17513c3",
|
||||||
|
"title": "Join our Alumni Network and Commit to Your Goal",
|
||||||
|
"difficulty": 0.05,
|
||||||
|
"challengeSeed": [],
|
||||||
|
"description": [
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/P7qfJXt.gif",
|
||||||
|
"A gif showing how you can click the link below and fill in the necessary fields to add your Free Code Camp studies to your LinkedIn profile.",
|
||||||
|
"You can add Free Code Camp to your LinkedIn education background. Set your graduation date as next year. For \"Degree\", type \"Full Stack Web Development\". For \"Field of study\", type \"Computer Software Engineering\". Then click \"Save Changes\".",
|
||||||
|
"https://www.linkedin.com/profile/edit-education?school=Free+Code+Camp"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"Free Code Camp will always be free. If you want to feel more motivated to earn our certificates faster, we encourage you to instead donate each month to a nonprofit.",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"type": "Waypoint",
|
||||||
|
"challengeType": 7,
|
||||||
|
"tests": [],
|
||||||
|
"nameCn": "",
|
||||||
|
"descriptionCn": [],
|
||||||
|
"nameFr": "",
|
||||||
|
"descriptionFr": [],
|
||||||
|
"nameRu": "",
|
||||||
|
"descriptionRu": [],
|
||||||
|
"nameEs": "",
|
||||||
|
"descriptionEs": [],
|
||||||
|
"namePt": "",
|
||||||
|
"descriptionPt": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "560add8ccb82ac38a17513c4",
|
||||||
|
"title": "Learn What to Do If You Get Stuck",
|
||||||
|
"difficulty": 0.06,
|
||||||
|
"challengeSeed": [],
|
||||||
|
"description": [
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/EWWZBag.jpg",
|
||||||
|
"An image with the text \"1. Read the error 2. Search Google 3. Ask for help.",
|
||||||
|
"Let's cover one last thing before you start working through our challenges: how to get help. Any time you get stuck or don't know what to do next: Read-Search-Ask.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/99BfAcK.jpg",
|
||||||
|
"An image showing jQuery documentation",
|
||||||
|
"First, read the documentation or error message. A key skill that good coders have is the ability to interpret and then follow instructions.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/GxvrsFb.gif",
|
||||||
|
"A gif showing you how to do an advanced Google search. First, we enter the query \"jquery doesn't run when my page loads\". Then we click search tools button and change the \"Any time\" select box to \"within the last year\". Then we click on a result and read through the article and find our answer.",
|
||||||
|
"If that didn't help, search Google. Good Google queries take a lot of practice. When you search Google, you usually want to include the language or framework you're using. You also want to limit the results to a recent period.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/LZYU7p2.gif",
|
||||||
|
"A gif showing us following the link below to go to the help chat room and ask \"jquery doesn't run when my page loads\".",
|
||||||
|
"If that didn't help, ask your friends. If you have trouble, you can ask your fellow campers in our help chat room.",
|
||||||
|
"https://gitter.im/FreeCodeCamp/Help"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/WsfzvVo.gif",
|
||||||
|
"A gif showing us clicking the \"map\" button in our upper right hand corner and browsing our challenge map.",
|
||||||
|
"Now you're ready to start coding! The \"Map\" button in your upper right hand corner will show you our challenge map. This map shows all our coding challenges. We recommend that you complete these from top to bottom, at a sustainable pace. You can also return to your next challenge by clicking the \"Learn\" button.",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"type": "Waypoint",
|
||||||
|
"challengeType": 7,
|
||||||
|
"tests": [],
|
||||||
|
"nameCn": "",
|
||||||
|
"descriptionCn": [],
|
||||||
|
"nameFr": "",
|
||||||
|
"descriptionFr": [],
|
||||||
|
"nameRu": "",
|
||||||
|
"descriptionRu": [],
|
||||||
|
"nameEs": "",
|
||||||
|
"descriptionEs": [],
|
||||||
|
"namePt": "",
|
||||||
|
"descriptionPt": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -11,11 +11,11 @@
|
|||||||
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
|
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
|
||||||
"If you don't already have Cloud 9 account, create one now at <a href='http://c9.io' target='_blank'>http://c9.io</a>.",
|
"If you don't already have Cloud 9 account, create one now at <a href='http://c9.io' target='_blank'>http://c9.io</a>.",
|
||||||
"Open up <a href='http://c9.io' target='_blank'>http://c9.io</a> and sign in to your account.",
|
"Open up <a href='http://c9.io' target='_blank'>http://c9.io</a> and sign in to your account.",
|
||||||
"Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
|
"Click on the \"+\" icon at the top right of the c9.io page to create a new workspace.",
|
||||||
"Give your workspace a name.",
|
"Give your workspace a name and an optional description.",
|
||||||
"Choose Node.js in the selection area below the name field.",
|
"Choose Node.js in the selection area below the name field.",
|
||||||
"Click the Create button. Then click into your new workspace.",
|
"Click the \"Create workspace\" button.",
|
||||||
"In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
|
"Once C9 builds and loads your workspace, you should see a terminal window in the lower right hand corner. In this window use the following commands. You don't need to know what these mean at this point.",
|
||||||
"Install <code>git-it</code> with this command: <code>npm install -g git-it</code>",
|
"Install <code>git-it</code> with this command: <code>npm install -g git-it</code>",
|
||||||
"Now start the tutorial by running <code>git-it</code>.",
|
"Now start the tutorial by running <code>git-it</code>.",
|
||||||
"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.",
|
||||||
|
@ -383,7 +383,7 @@
|
|||||||
"assert(!$(\"h2\").attr(\"style\"), 'Remove the style attribute from your <code>h2</code> element.')",
|
"assert(!$(\"h2\").attr(\"style\"), 'Remove the style attribute from your <code>h2</code> element.')",
|
||||||
"assert($(\"style\") && $(\"style\").length > 1, 'Create a <code>style</code> element.')",
|
"assert($(\"style\") && $(\"style\").length > 1, 'Create a <code>style</code> element.')",
|
||||||
"assert($(\"h2\").css(\"color\") === \"rgb(0, 0, 255)\", 'Your <code>h2</code> element should be blue.')",
|
"assert($(\"h2\").css(\"color\") === \"rgb(0, 0, 255)\", 'Your <code>h2</code> element should be blue.')",
|
||||||
"assert(editor.match(/<\\/style>/g) && editor.match(/<\\/style>/g).length === editor.match(/<style>/g).length, 'Make sure each of your <code>style</code> elements has a closing tag.')"
|
"assert(editor.match(/<\\/style>/g) && editor.match(/<\\/style>/g).length === (editor.match(/<style((\\s)*((type|media|scoped|title|disabled)=\"[^\"]*\")?(\\s)*)*>/g) || []).length, 'Make sure all your <code>style</code> elements are valid and have a closing tag.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<h2 style=\"color: red\">CatPhotoApp</h2>",
|
"<h2 style=\"color: red\">CatPhotoApp</h2>",
|
||||||
@ -551,7 +551,8 @@
|
|||||||
"assert($(\"p\").length > 1, 'You need 2 <code>p</code> elements with Kitty Ipsum text.')",
|
"assert($(\"p\").length > 1, 'You need 2 <code>p</code> elements with Kitty Ipsum text.')",
|
||||||
"assert(editor.match(/<\\/p>/g) && editor.match(/<\\/p>/g).length === editor.match(/<p/g).length, 'Make sure each of your <code>p</code> elements has a closing tag.')",
|
"assert(editor.match(/<\\/p>/g) && editor.match(/<\\/p>/g).length === editor.match(/<p/g).length, 'Make sure each of your <code>p</code> elements has a closing tag.')",
|
||||||
"assert.isTrue((/Purr\\s+jump\\s+eat/gi).test($(\"p\").text()), 'Your <code>p</code> element should contain the first few words of the provided additional <code>kitty ipsum text</code>.')",
|
"assert.isTrue((/Purr\\s+jump\\s+eat/gi).test($(\"p\").text()), 'Your <code>p</code> element should contain the first few words of the provided additional <code>kitty ipsum text</code>.')",
|
||||||
"assert($(\"p\").css(\"font-size\") === \"16px\", 'Give your <code>p</code> elements the <code>font-size</code> of 16px.')"
|
"assert($(\"p.red-text\").length === 2, 'Give each of your <code>p</code> elements the <code>red-text</code> class.')",
|
||||||
|
"assert($(\"p\").css(\"font-size\") === \"16px\", 'Give elements with the <code>red-text</code> class a <code>font-size</code> of 16px.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<style>",
|
"<style>",
|
||||||
@ -866,7 +867,8 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"CSS borders have properties like <code>style</code>, <code>color</code> and <code>width</code>.",
|
"CSS borders have properties like <code>style</code>, <code>color</code> and <code>width</code>.",
|
||||||
"For example, if we wanted to create a red, 5 pixel border around an HTML element, we could use this class: <code><style> .thin-red-border { border-color: red; border-width: 5px; border-style: solid; } </style></code>.",
|
"For example, if we wanted to create a red, 5 pixel border around an HTML element, we could use this class: <code><style> .thin-red-border { border-color: red; border-width: 5px; border-style: solid; } </style></code>.",
|
||||||
"Create a class called <code>thick-green-border</code> that puts a 10-pixel-wide green border with a style of <code>solid</code> around an HTML element, and apply that class to your cat photo."
|
"Create a class called <code>thick-green-border</code> that puts a 10-pixel-wide green border with a style of <code>solid</code> around an HTML element, and apply that class to your cat photo.",
|
||||||
|
"Remember that you can apply multiple classes to an element by separating each class with a space within its <code>class</code> attribute. For example: <code><img class=\"class1 class2\"></code>"
|
||||||
],
|
],
|
||||||
"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>.')",
|
||||||
@ -1060,7 +1062,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"<code>a</code> elements, also known as <code>anchor</code> elements, are used to link to content outside of the current page.",
|
"<code>a</code> elements, also known as <code>anchor</code> elements, are used to link to content outside of the current page.",
|
||||||
"Here's a diagram of an <code>a</code> element. In this case, the <code>a</code> element is used in the middle of a paragraph element, which means the link will appear in the middle of a sentence.",
|
"Here's a diagram of an <code>a</code> element. In this case, the <code>a</code> element is used in the middle of a paragraph element, which means the link will appear in the middle of a sentence.",
|
||||||
"<img class=\"img-responsive\" alt=\"a diagram of how anchor tags are composed with the same text as on the following line\" src=\"http://i.imgur.com/hviuZwe.png\">",
|
"<a href=\"http://i.imgur.com/hviuZwe.png\" data-lightbox=\"img-enlarge\"><img class=\"img-responsive\" title=\"Click to enlarge\" alt=\"a diagram of how anchor tags are composed with the same text as on the following line\" src=\"http://i.imgur.com/hviuZwe.png\"></a>",
|
||||||
"Here's an example: <code><p>Here's a <a href=\"http://freecodecamp.com\"> link to Free Code Camp</a> for you to follow.</p></code>.",
|
"Here's an example: <code><p>Here's a <a href=\"http://freecodecamp.com\"> link to Free Code Camp</a> for you to follow.</p></code>.",
|
||||||
"Create an <code>a</code> element that links to <code>http://freecatphotoapp.com</code> and has \"cat photos\" as its <code>anchor text</code>."
|
"Create an <code>a</code> element that links to <code>http://freecatphotoapp.com</code> and has \"cat photos\" as its <code>anchor text</code>."
|
||||||
],
|
],
|
||||||
@ -1130,17 +1132,18 @@
|
|||||||
"difficulty": 1.23,
|
"difficulty": 1.23,
|
||||||
"description": [
|
"description": [
|
||||||
"Again, here's a diagram of an <code>a</code> element for your reference:",
|
"Again, here's a diagram of an <code>a</code> element for your reference:",
|
||||||
"<img class=\"img-responsive\" alt=\"a diagram of how anchor tags are composed with the same text as on the following line\" src=\"http://i.imgur.com/hviuZwe.png\">",
|
"<a href=\"http://i.imgur.com/hviuZwe.png\" data-lightbox=\"img-enlarge\"><img class=\"img-responsive\" title=\"Click to enlarge\" alt=\"a diagram of how anchor tags are composed with the same text as on the following line\" src=\"http://i.imgur.com/hviuZwe.png\"></a>",
|
||||||
"Here's an example: <code><p>Here's a <a href=\"http://freecodecamp.com\"> link to Free Code Camp</a> for you to follow.</p></code>.",
|
"Here's an example: <code><p>Here's a <a href=\"http://freecodecamp.com\"> link to Free Code Camp</a> for you to follow.</p></code>.",
|
||||||
"<code>Nesting</code> just means putting one element inside of another element.",
|
"<code>Nesting</code> just means putting one element inside of another element.",
|
||||||
"Now nest your existing <code>a</code> element within a new <code>p</code> element so that the surrounding paragraph says \"click here for cat photos\", but where only \"cat photos\" is a link, and the rest of the text is rest is plain text."
|
"Now nest your existing <code>a</code> element within a new <code>p</code> element so that the surrounding paragraph says \"View more cat photos\", but where only \"cat photos\" is a link, and the rest of the text is plain text."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"a\").attr(\"href\").match(/freecatphotoapp.com/gi).length > 0, 'You need an <code>a</code> element that links to \"freecatphotoapp.com\".')",
|
"assert($(\"a\").attr(\"href\").match(/freecatphotoapp.com/gi).length > 0, 'You need an <code>a</code> element that links to \"freecatphotoapp.com\".')",
|
||||||
"assert($(\"a\").text().match(/cat\\sphotos/gi).length > 0, 'Your <code>a</code> element should have the anchor text of \"cat photos\"')",
|
"assert($(\"a\").text().match(/cat\\sphotos/gi), 'Your <code>a</code> element should have the anchor text of \"cat photos\"')",
|
||||||
"assert($(\"p\") && $(\"p\").length > 2, 'Create a new <code>p</code> element around your <code>a</code> element.')",
|
"assert($(\"p\") && $(\"p\").length > 2, 'Create a new <code>p</code> element around your <code>a</code> element.')",
|
||||||
"assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().is(\"p\"), 'Your <code>a</code> element should be nested within your new <code>p</code> element.')",
|
"assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().is(\"p\"), 'Your <code>a</code> element should be nested within your new <code>p</code> element.')",
|
||||||
"assert($(\"p\").text().match(/click\\shere\\sfor/gi), 'Your <code>p</code> element should have the text \"click here for\".')",
|
"assert($(\"p\").text().match(/^View\\smore\\s/gi), 'Your <code>p</code> element should have the text \"View more \" (with a space after it).')",
|
||||||
|
"assert(!$(\"a\").text().match(/View\\smore/gi), 'Your <code>a</code> element should <em>not</em> have the text \"View more\".')",
|
||||||
"assert(editor.match(/<\\/p>/g) && editor.match(/<p/g) && editor.match(/<\\/p>/g).length === editor.match(/<p/g).length, 'Make sure each of your <code>p</code> elements has a closing tag.')",
|
"assert(editor.match(/<\\/p>/g) && editor.match(/<p/g) && editor.match(/<\\/p>/g).length === editor.match(/<p/g).length, 'Make sure each of your <code>p</code> elements has a closing tag.')",
|
||||||
"assert(editor.match(/<\\/a>/g) && editor.match(/<a/g) && editor.match(/<\\/a>/g).length === editor.match(/<a/g).length, 'Make sure each of your <code>a</code> elements has a closing tag.')"
|
"assert(editor.match(/<\\/a>/g) && editor.match(/<a/g) && editor.match(/<\\/a>/g).length === editor.match(/<a/g).length, 'Make sure each of your <code>a</code> elements has a closing tag.')"
|
||||||
],
|
],
|
||||||
@ -3339,7 +3342,7 @@
|
|||||||
"assert($(\"h1\").hasClass(\"pink-text\"), 'Your <code>h1</code> element should have the class <code>pink-text</code>.')",
|
"assert($(\"h1\").hasClass(\"pink-text\"), 'Your <code>h1</code> element should have the class <code>pink-text</code>.')",
|
||||||
"assert($(\"h1\").hasClass(\"blue-text\"), 'Your <code>h1</code> element should have the class <code>blue-text</code>.')",
|
"assert($(\"h1\").hasClass(\"blue-text\"), 'Your <code>h1</code> element should have the class <code>blue-text</code>.')",
|
||||||
"assert($(\"h1\").attr(\"id\") === \"orange-text\", 'Your <code>h1</code> element should have the id of <code>orange-text</code>.')",
|
"assert($(\"h1\").attr(\"id\") === \"orange-text\", 'Your <code>h1</code> element should have the id of <code>orange-text</code>.')",
|
||||||
"assert(editor.match(/<h1.*style/gi) && editor.match(/<h1.*style.*color:/gi).length > 0, 'Give your <code>h1</code> element the inline style of <code>color: white</code>.')",
|
"assert(editor.match(/<h1.*style/gi) && editor.match(/<h1.*style.*color\\s*?:/gi), 'Give your <code>h1</code> element the inline style of <code>color: white</code>.')",
|
||||||
"assert($(\"h1\").css(\"color\") === \"rgb(255, 255, 255)\", 'Your <code>h1</code> element should be white.')"
|
"assert($(\"h1\").css(\"color\") === \"rgb(255, 255, 255)\", 'Your <code>h1</code> element should be white.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -3392,7 +3395,7 @@
|
|||||||
"assert($(\"h1\").hasClass(\"pink-text\"), 'Your <code>h1</code> element should have the class <code>pink-text</code>.')",
|
"assert($(\"h1\").hasClass(\"pink-text\"), 'Your <code>h1</code> element should have the class <code>pink-text</code>.')",
|
||||||
"assert($(\"h1\").hasClass(\"blue-text\"), 'Your <code>h1</code> element should have the class <code>blue-text</code>.')",
|
"assert($(\"h1\").hasClass(\"blue-text\"), 'Your <code>h1</code> element should have the class <code>blue-text</code>.')",
|
||||||
"assert($(\"h1\").attr(\"id\") === \"orange-text\", 'Your <code>h1</code> element should have the id of <code>orange-text</code>.')",
|
"assert($(\"h1\").attr(\"id\") === \"orange-text\", 'Your <code>h1</code> element should have the id of <code>orange-text</code>.')",
|
||||||
"assert(editor.match(/<h1.*style/gi) && editor.match(/<h1.*style.*color:/gi).length > 0, 'Your <code>h1</code> element should have the inline style of <code>color: white</code>.')",
|
"assert(editor.match(/<h1.*style/gi) && editor.match(/<h1.*style.*color\\s*?:/gi), 'Your <code>h1</code> element should have the inline style of <code>color: white</code>.')",
|
||||||
"assert(editor.match(/pink.*\\!important;/gi), 'Your <code>pink-text</code> class should have the <code>!important</code> keyword to override all other declarations.')",
|
"assert(editor.match(/pink.*\\!important;/gi), 'Your <code>pink-text</code> class should have the <code>!important</code> keyword to override all other declarations.')",
|
||||||
"assert($(\"h1\").css(\"color\") === \"rgb(255, 192, 203)\", 'Your <code>h1</code> element should be pink.')"
|
"assert($(\"h1\").css(\"color\") === \"rgb(255, 192, 203)\", 'Your <code>h1</code> element should be pink.')"
|
||||||
],
|
],
|
||||||
@ -3507,7 +3510,7 @@
|
|||||||
"difficulty": 1.56,
|
"difficulty": 1.56,
|
||||||
"description": [
|
"description": [
|
||||||
"You may be wondering why we use 6 digits to represent a color instead of just one or two. The answer is that using 6 digits gives us a huge variety.",
|
"You may be wondering why we use 6 digits to represent a color instead of just one or two. The answer is that using 6 digits gives us a huge variety.",
|
||||||
"How many colors are possible? 16 colors and 6 positions means we have 16 to the 6th power, or more than 16 million possible colors.",
|
"How many colors are possible? 16 values and 6 positions means we have 16 to the 6th power, or more than 16 million possible colors.",
|
||||||
"Hex code follows the red-green-blue, or <code>rgb</code> format. The first two digits of hex code represent the amount of red in the color. The third and fourth digit represent the amount of green. The fifth and sixth represent the amount of blue.",
|
"Hex code follows the red-green-blue, or <code>rgb</code> format. The first two digits of hex code represent the amount of red in the color. The third and fourth digit represent the amount of green. The fifth and sixth represent the amount of blue.",
|
||||||
"So to get the absolute brightest red, you would just use <code>F</code> for the first and second digits (the highest possible value) and <code>0</code> for the third, fourth, fifth and sixth digits (the lowest possible value).",
|
"So to get the absolute brightest red, you would just use <code>F</code> for the first and second digits (the highest possible value) and <code>0</code> for the third, fourth, fifth and sixth digits (the lowest possible value).",
|
||||||
"Make the <code>body</code> element's background color red by giving it the hex code value of <code>#FF0000</code>."
|
"Make the <code>body</code> element's background color red by giving it the hex code value of <code>#FF0000</code>."
|
||||||
|
@ -19,11 +19,11 @@
|
|||||||
"sumAll([1, 4]);"
|
"sumAll([1, 4]);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(sumAll([1, 4])).to.be.a('Number');",
|
"assert(typeof(sumAll([1, 4])) === \"number\", 'The result should be a number');",
|
||||||
"expect(sumAll([1, 4])).to.equal(10);",
|
"assert.deepEqual(sumAll([1, 4]), 10, '<code>sumAll([1, 4])</code> should return 10');",
|
||||||
"expect(sumAll([4, 1])).to.equal(10);",
|
"assert.deepEqual(sumAll([4, 1]), 10, '<code>sumAll([4, 1])</code> should return 10');",
|
||||||
"expect(sumAll([5, 10])).to.equal(45);",
|
"assert.deepEqual(sumAll([5, 10]), 45, '<code>sumAll([5, 10])</code> should return 45');",
|
||||||
"expect(sumAll([10, 5])).to.equal(45);"
|
"assert.deepEqual(sumAll([10, 5]), 45, '<code>sumAll([10, 5])</code> should return 45');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Math.max()",
|
"Math.max()",
|
||||||
@ -61,7 +61,7 @@
|
|||||||
"diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);"
|
"diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(diff([1, 2, 3, 5], [1, 2, 3, 4, 5])).to.be.a('array');",
|
"assert(typeof(diff([1, 2, 3, 5], [1, 2, 3, 4, 5])) === \"object\", 'The result should be an array.');",
|
||||||
"assert.deepEqual(diff(['diorite', 'andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['pink wool'], 'arrays with only one difference');",
|
"assert.deepEqual(diff(['diorite', 'andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['pink wool'], 'arrays with only one difference');",
|
||||||
"assert.includeMembers(diff(['andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['diorite', 'pink wool'], 'arrays with more than one difference');",
|
"assert.includeMembers(diff(['andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['diorite', 'pink wool'], 'arrays with more than one difference');",
|
||||||
"assert.deepEqual(diff(['andesite', 'grass', 'dirt', 'dead shrub'], ['andesite', 'grass', 'dirt', 'dead shrub']), [], 'arrays with no difference');",
|
"assert.deepEqual(diff(['andesite', 'grass', 'dirt', 'dead shrub'], ['andesite', 'grass', 'dirt', 'dead shrub']), [], 'arrays with no difference');",
|
||||||
@ -93,11 +93,11 @@
|
|||||||
"id": "a7f4d8f2483413a6ce226cac",
|
"id": "a7f4d8f2483413a6ce226cac",
|
||||||
"title": "Roman Numeral Converter",
|
"title": "Roman Numeral Converter",
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(convert(12)).to.equal(\"XII\");",
|
"assert.deepEqual(convert(12), \"XII\", '<code>convert(12)</code> should return \"XII\"');",
|
||||||
"expect(convert(5)).to.equal(\"V\");",
|
"assert.deepEqual(convert(5), \"V\", '<code>convert(5)</code> should return \"V\"');",
|
||||||
"expect(convert(9)).to.equal(\"IX\");",
|
"assert.deepEqual(convert(9), \"IX\", '<code>convert(9)</code> should return \"IX\"');",
|
||||||
"expect(convert(29)).to.equal(\"XXIX\");",
|
"assert.deepEqual(convert(29), \"XXIX\", '<code>convert(29)</code> should return \"XXIX\"');",
|
||||||
"expect(convert(16)).to.equal(\"XVI\");"
|
"assert.deepEqual(convert(16), \"XVI\", '<code>convert(16)</code> should return \"XVI\"');"
|
||||||
],
|
],
|
||||||
"difficulty": "2.02",
|
"difficulty": "2.02",
|
||||||
"description": [
|
"description": [
|
||||||
@ -113,6 +113,7 @@
|
|||||||
"convert(36);"
|
"convert(36);"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
|
"Roman Numerals",
|
||||||
"Array.splice()",
|
"Array.splice()",
|
||||||
"Array.indexOf()",
|
"Array.indexOf()",
|
||||||
"Array.join()"
|
"Array.join()"
|
||||||
@ -130,17 +131,59 @@
|
|||||||
"namePt": "",
|
"namePt": "",
|
||||||
"descriptionPt": []
|
"descriptionPt": []
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "a8e512fbe388ac2f9198f0fa",
|
||||||
|
"title": "Where art thou",
|
||||||
|
"difficulty": "2.03",
|
||||||
|
"description": [
|
||||||
|
"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 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."
|
||||||
|
],
|
||||||
|
"challengeSeed": [
|
||||||
|
"function where(collection, source) {",
|
||||||
|
" var arr = [];",
|
||||||
|
" // What's in a name?",
|
||||||
|
" return arr;",
|
||||||
|
"}",
|
||||||
|
"",
|
||||||
|
"where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });"
|
||||||
|
],
|
||||||
|
"tests": [
|
||||||
|
"assert.deepEqual(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'should return an array of objects');",
|
||||||
|
"assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'should return with multiples');",
|
||||||
|
"assert.deepEqual(where([{ 'a': 1, 'b': 2 }, { 'a': 1 }, { 'a': 1, 'b': 2, 'c': 2 }], { 'a': 1, 'b': 2 }), [{ 'a': 1, 'b': 2 }, { 'a': 1, 'b': 2, 'c': 2 }], 'should return two objects in array');",
|
||||||
|
"assert.deepEqual(where([{ 'a': 5 }, { 'b': 10 }, { 'a': 5, 'b': 10 }], { 'a': 5, 'b': 10 }), [{ 'a': 5, 'b': 10 }], 'should return a single object in array');"
|
||||||
|
],
|
||||||
|
"MDNlinks": [
|
||||||
|
"Global Object",
|
||||||
|
"Object.hasOwnProperty()",
|
||||||
|
"Object.keys()"
|
||||||
|
],
|
||||||
|
"type": "bonfire",
|
||||||
|
"challengeType": 5,
|
||||||
|
"nameCn": "",
|
||||||
|
"descriptionCn": [],
|
||||||
|
"nameFr": "",
|
||||||
|
"descriptionFr": [],
|
||||||
|
"nameRu": "",
|
||||||
|
"descriptionRu": [],
|
||||||
|
"nameEs": "",
|
||||||
|
"descriptionEs": [],
|
||||||
|
"namePt": "",
|
||||||
|
"descriptionPt": []
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "a0b5010f579e69b815e7c5d6",
|
"id": "a0b5010f579e69b815e7c5d6",
|
||||||
"title": "Search and Replace",
|
"title": "Search and Replace",
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(replace(\"Let us go to the store\", \"store\", \"mall\")).to.equal(\"Let us go to the mall\");",
|
"assert.deepEqual(replace(\"Let us go to the store\", \"store\", \"mall\"), \"Let us go to the mall\", '<code>replace(\"Let us go to the store\", \"store\", \"mall\")</code> should return \"Let us go to the mall\"');",
|
||||||
"expect(replace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\")).to.equal(\"He is Sitting on the couch\");",
|
"assert.deepEqual(replace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\"), \"He is Sitting on the couch\", '<code>replace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\")</code> should return \"He is Sitting on the couch\"');",
|
||||||
"expect(replace(\"This has a spellngi error\", \"spellngi\", \"spelling\")).to.equal(\"This has a spelling error\");",
|
"assert.deepEqual(replace(\"This has a spellngi error\", \"spellngi\", \"spelling\"), \"This has a spelling error\", '<code>replace(\"This has a spellngi error\", \"spellingi\", \"spelling\")</code> should return \"This has a spelling error\"');",
|
||||||
"expect(replace(\"His name is Tom\", \"Tom\", \"john\")).to.equal(\"His name is John\");",
|
"assert.deepEqual(replace(\"His name is Tom\", \"Tom\", \"john\"), \"His name is John\", '<code>replace(\"His name is Tom\", \"Tom\", \"john\")</code> should return \"His name is John\"');",
|
||||||
"expect(replace(\"Let us get back to more Coding\", \"Coding\", \"bonfires\")).to.equal(\"Let us get back to more Bonfires\");"
|
"assert.deepEqual(replace(\"Let us get back to more Coding\", \"Coding\", \"bonfires\"), \"Let us get back to more Bonfires\", '<code>replace(\"Let us get back to more Coding\", \"Coding\", \"bonfires\")</code> should return \"Let us get back to more Bonfires\"');"
|
||||||
],
|
],
|
||||||
"difficulty": "2.03",
|
"difficulty": "2.035",
|
||||||
"description": [
|
"description": [
|
||||||
"Perform a search and replace on the sentence using the arguments provided and return the new sentence.",
|
"Perform a search and replace on the sentence using the arguments provided and return the new sentence.",
|
||||||
"First argument is the sentence to perform the search and replace on.",
|
"First argument is the sentence to perform the search and replace on.",
|
||||||
@ -150,11 +193,11 @@
|
|||||||
"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. Try to pair program. 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. Try to pair program. Write your own code."
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"function replace(str, before, after) {",
|
"function myReplace(str, before, after) {",
|
||||||
" return str;",
|
" return str;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"replace(\"A quick brown fox jumped over the lazy dog\", \"jumped\", \"leaped\");"
|
"myReplace(\"A quick brown fox jumped over the lazy dog\", \"jumped\", \"leaped\");"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.splice()",
|
"Array.splice()",
|
||||||
@ -178,11 +221,11 @@
|
|||||||
"id": "aa7697ea2477d1316795783b",
|
"id": "aa7697ea2477d1316795783b",
|
||||||
"title": "Pig Latin",
|
"title": "Pig Latin",
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(translate(\"california\")).to.equal(\"aliforniacay\");",
|
"assert.deepEqual(translate(\"california\"), \"aliforniacay\", '<code>translate(\"california\")</code> should return \"aliforniacay\"');",
|
||||||
"expect(translate(\"paragraphs\")).to.equal(\"aragraphspay\");",
|
"assert.deepEqual(translate(\"paragraphs\"), \"aragraphspay\", '<code>translate(\"paragraphs\")</code> should return \"aragraphspay\"');",
|
||||||
"expect(translate(\"glove\")).to.equal(\"oveglay\");",
|
"assert.deepEqual(translate(\"glove\"), \"oveglay\", '<code>translate(\"glove\")</code> should return \"oveglay\"');",
|
||||||
"expect(translate(\"algorithm\")).to.equal(\"algorithmway\");",
|
"assert.deepEqual(translate(\"algorithm\"), \"algorithmway\", '<code>translate(\"algorithm\")</code> should return \"algorithmway\"');",
|
||||||
"expect(translate(\"eight\")).to.equal(\"eightway\");"
|
"assert.deepEqual(translate(\"eight\"), \"eightway\", '<code>translate(\"eight\")</code> should return \"eightway\"');"
|
||||||
],
|
],
|
||||||
"difficulty": "2.04",
|
"difficulty": "2.04",
|
||||||
"description": [
|
"description": [
|
||||||
@ -232,7 +275,7 @@
|
|||||||
"<a href=\"http://en.wikipedia.org/wiki/Base_pair\" target=\"_blank\">Base pairs</a> are a pair of AT and CG. Match the missing element to the provided character.",
|
"<a href=\"http://en.wikipedia.org/wiki/Base_pair\" target=\"_blank\">Base pairs</a> are a pair of AT and CG. Match the missing element to the provided character.",
|
||||||
"Return the provided character as the first element in each array.",
|
"Return the provided character as the first element in each array.",
|
||||||
"For example, for the input GCG, return [['G', 'C'], ['C','G'],['G', 'C']]",
|
"For example, for the input GCG, return [['G', 'C'], ['C','G'],['G', 'C']]",
|
||||||
"The charater and its pair are paired up in an array, and all the arrays are grouped into one encapsulating array.",
|
"The character and its pair are paired up in an array, and all the arrays are grouped into one encapsulating array.",
|
||||||
"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. Try to pair program. 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. Try to pair program. Write your own code."
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -276,10 +319,10 @@
|
|||||||
"fearNotLetter('abce');"
|
"fearNotLetter('abce');"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(fearNotLetter('abce')).to.equal('d');",
|
"assert.deepEqual(fearNotLetter(\"abce\"), \"d\", '<code>fearNotLetter(\"abce\")</code> should return d');",
|
||||||
"expect(fearNotLetter('bcd')).to.be.undefined;",
|
"assert.deepEqual(fearNotLetter(\"abcdefghjklmno\"), \"i\", '<code>fearNotLetter(\"abcdefghjklmno\")</code> should return i');",
|
||||||
"expect(fearNotLetter('abcdefghjklmno')).to.equal('i');",
|
"assert.isUndefined(fearNotLetter(\"bcd\"), '<code>fearNotLetter(\"bcd\")</code> should return undefined');",
|
||||||
"expect(fearNotLetter('yz')).to.be.undefined;"
|
"assert.isUndefined(fearNotLetter(\"yz\"), '<code>fearNotLetter(\"yz\")</code> should return undefined');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"String.charCodeAt()",
|
"String.charCodeAt()",
|
||||||
@ -482,12 +525,12 @@
|
|||||||
"sumFibs(4);"
|
"sumFibs(4);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(sumFibs(1)).to.be.a('number');",
|
"assert.deepEqual(typeof(sumFibs(1)), \"number\", \"The result should be a number\");",
|
||||||
"expect(sumFibs(1000)).to.equal(1785);",
|
"assert.deepEqual(sumFibs(1000), 1785, '<code>sumFibs(1000)</code> should return 1785');",
|
||||||
"expect(sumFibs(4000000)).to.equal(4613732);",
|
"assert.deepEqual(sumFibs(4000000), 4613732, '<code>sumFibs(4000000)</code> should return 4613732');",
|
||||||
"expect(sumFibs(4)).to.equal(5);",
|
"assert.deepEqual(sumFibs(4), 5, '<code>sumFibs(4)</code> should return 5');",
|
||||||
"expect(sumFibs(75024)).to.equal(60696);",
|
"assert.deepEqual(sumFibs(75024), 60696, '<code>sumFibs(75024)</code> should return 60696');",
|
||||||
"expect(sumFibs(75025)).to.equal(135721);"
|
"assert.deepEqual(sumFibs(75025), 135721, '<code>sumFibs(75025)</code> should return 135721');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Remainder"
|
"Remainder"
|
||||||
@ -523,9 +566,9 @@
|
|||||||
"sumPrimes(10);"
|
"sumPrimes(10);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(sumPrimes(10)).to.be.a('number');",
|
"assert.deepEqual(typeof(sumPrimes(10)), \"number\", \"The result should be a number\");",
|
||||||
"expect(sumPrimes(10)).to.equal(17);",
|
"assert.deepEqual(sumPrimes(10), 17, '<code>sumPrimes(10)</code> should return 17');",
|
||||||
"expect(sumPrimes(977)).to.equal(73156);"
|
"assert.deepEqual(sumPrimes(977), 73156, '<code>sumPrimes(977)</code> should return 73156');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"For Loops",
|
"For Loops",
|
||||||
@ -549,9 +592,9 @@
|
|||||||
"title": "Smallest Common Multiple",
|
"title": "Smallest Common Multiple",
|
||||||
"difficulty": "2.11",
|
"difficulty": "2.11",
|
||||||
"description": [
|
"description": [
|
||||||
"Find the smallest number that is evenly divisible by all numbers in the provided range.",
|
"Find the smallest common multiple of the provided parameters that can be evenly divided by both, as well as by all sequential numbers in the range between these parameters.",
|
||||||
"In other words, given the range [3,7], you will need to find the least common multiple of 3, 4, 5, 6, and 7.",
|
|
||||||
"The range will be an array of two numbers that will not necessarily be in numerical order.",
|
"The range will be an array of two numbers that will not necessarily be in numerical order.",
|
||||||
|
"e.g. for 1 and 3 - find the smallest common multiple of both 1 and 3 that is evenly divisible by all numbers <em>between</em> 1 and 3.",
|
||||||
"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. Try to pair program. 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. Try to pair program. Write your own code."
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -563,10 +606,10 @@
|
|||||||
"smallestCommons([1,5]);"
|
"smallestCommons([1,5]);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(smallestCommons([1,5])).to.be.a('number');",
|
"assert.deepEqual(typeof(smallestCommons([1, 5])), \"number\", \"The result should be a number\");",
|
||||||
"expect(smallestCommons([1,5])).to.equal(60);",
|
"assert.deepEqual(smallestCommons([1, 5]), 60, '<code>smallestCommons([1, 5])</code> should return 60');",
|
||||||
"expect(smallestCommons([5,1])).to.equal(60);",
|
"assert.deepEqual(smallestCommons([5, 1]), 60, '<code>smallestCommons([5, 1])</code> should return 60');",
|
||||||
"expect(smallestCommons([1,13])).to.equal(360360);"
|
"assert.deepEqual(smallestCommons([1, 13]), 360360, '<code>smallestCommons([1, 13])</code> should return 360360');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Smallest Common Multiple"
|
"Smallest Common Multiple"
|
||||||
@ -637,9 +680,10 @@
|
|||||||
"drop([1, 2, 3], function(n) {return n < 3; });"
|
"drop([1, 2, 3], function(n) {return n < 3; });"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(drop([1, 2, 3, 4], function(n) {return n >= 3; })).to.eqls([3, 4]);",
|
"assert.deepEqual(drop([1, 2, 3, 4], function(n) {return n>= 3;}), [3, 4], '<code>drop([1, 2, 3, 4], function(n) {return n>= 3;})</code> should return [3, 4]');",
|
||||||
"expect(drop([1, 2, 3], function(n) {return n > 0; })).to.eqls([1, 2, 3]);",
|
"assert.deepEqual(drop([1, 2, 3], function(n) {return n > 0; }), [1, 2, 3], '<code>drop([1, 2, 3], function(n) {return n > 0; })</code> should return [1, 2, 3]');",
|
||||||
"expect(drop([1, 2, 3, 4], function(n) {return n > 5; })).to.eqls([]);"
|
"assert.deepEqual(drop([1, 2, 3, 4], function(n) {return n > 5;}), [], '<code>drop([1, 2, 3, 4], function(n) {return n > 5;})</code> should return []');",
|
||||||
|
"assert.deepEqual(drop([1, 2, 3, 7, 4], function(n) {return n > 3}), [7, 4], '<code>drop([1, 2, 3, 7, 4], function(n) {return n>= 3})</code> should return [7, 4]');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Arguments object",
|
"Arguments object",
|
||||||
@ -713,8 +757,8 @@
|
|||||||
"binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111');"
|
"binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111');"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111')).to.equal(\"Aren't bonfires fun!?\");",
|
"assert.deepEqual(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111'), \"Aren't bonfires fun!?\", \"<code>binaryAgent()</code> should return Aren't bonfires fun!?\");",
|
||||||
"expect(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001')).to.equal(\"I love FreeCodeCamp!\");"
|
"assert.deepEqual(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001'), \"I love FreeCodeCamp!\", '<code>binaryAgent()</code> should return \"I love FreeCodeCamp!\"');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"String.charCodeAt()",
|
"String.charCodeAt()",
|
||||||
@ -778,8 +822,11 @@
|
|||||||
"title": "Arguments Optional",
|
"title": "Arguments Optional",
|
||||||
"difficulty": "2.22",
|
"difficulty": "2.22",
|
||||||
"description": [
|
"description": [
|
||||||
"Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.",
|
"Create a function that sums two arguments together. If only one argument is provided, then return a function that expects one argument and returns the sum.",
|
||||||
"For example, add(2, 3) should return 5, and add(2) should return a function that is waiting for an argument so that <code>var sum2And = add(2); return sum2And(3); // 5</code>",
|
"For example, <code>add(2, 3)</code> should return <code>5</code>, and <code>add(2)</code> should return a function.",
|
||||||
|
"Calling this returned function with a single argument will then return the sum:",
|
||||||
|
"<code>var sumTwoAnd = add(2);</code>",
|
||||||
|
"<code>sumTwoAnd(3)</code> returns <code>5</code>.",
|
||||||
"If either argument isn't a valid number, return undefined.",
|
"If either argument isn't a valid number, return undefined.",
|
||||||
"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. Try to pair program. 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. Try to pair program. Write your own code."
|
||||||
],
|
],
|
||||||
@ -791,11 +838,11 @@
|
|||||||
"add(2,3);"
|
"add(2,3);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"expect(add(2, 3)).to.equal(5);",
|
"assert.deepEqual(add(2, 3), 5, '<code>add(2, 3)</code> should return 5');",
|
||||||
"expect(add(2)(3)).to.equal(5);",
|
"assert.deepEqual(add(2)(3), 5, '<code>add(2)(3)</code> should return 5');",
|
||||||
"expect(add('http://bit.ly/IqT6zt')).to.be.undefined;",
|
"assert.isUndefined(add(\"http://bit.ly/IqT6zt\"), '<code>add(\"http://bit.ly/IqT6zt\")</code> should return undefined');",
|
||||||
"expect(add(2, '3')).to.be.undefined;",
|
"assert.isUndefined(add(2, \"3\"), '<code>add(2, \"3\")</code> should return undefined');",
|
||||||
"expect(add(2)([3])).to.be.undefined;"
|
"assert.isUndefined(add(2)([3]), '<code>add(2)([3])</code> should return undefined');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Global Function Object",
|
"Global Function Object",
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
"<span class='text-info'>Hint:</span> Here's the Camper News Hot Stories API endpoint: <code>http://www.freecodecamp.com/news/hot</code>.",
|
"<span class='text-info'>Hint:</span> Here's the Camper News Hot Stories API endpoint: <code>http://www.freecodecamp.com/news/hot</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.",
|
"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.",
|
||||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "zipline",
|
"type": "zipline",
|
||||||
"challengeType": 3,
|
"challengeType": 3,
|
||||||
@ -37,7 +37,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd7158d8c442eddfaeb5bd19",
|
"id": "bd7158d8c442eddfaeb5bd19",
|
||||||
"title": "Wikipedia Viewer",
|
"title": "Build a Wikipedia Viewer",
|
||||||
"difficulty": 1.03,
|
"difficulty": 1.03,
|
||||||
"challengeSeed": ["126415131"],
|
"challengeSeed": ["126415131"],
|
||||||
"description": [
|
"description": [
|
||||||
@ -52,7 +52,7 @@
|
|||||||
"<span class='text-info'>Hint:</span> Here's an entry on using Wikipedia's API: <code>http://www.mediawiki.org/wiki/API:Main_page</code>.",
|
"<span class='text-info'>Hint:</span> Here's an entry on using Wikipedia's API: <code>http://www.mediawiki.org/wiki/API:Main_page</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.",
|
"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.",
|
||||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "zipline",
|
"type": "zipline",
|
||||||
"challengeType": 3,
|
"challengeType": 3,
|
||||||
@ -84,7 +84,7 @@
|
|||||||
"<span class='text-info'>Bonus User Story:</span> I can keep chaining mathematical operations together until I hit the clear button, and the calculator will tell me the correct output.",
|
"<span class='text-info'>Bonus User Story:</span> I can keep chaining mathematical operations together until I hit the clear button, and the calculator will tell me the correct output.",
|
||||||
"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.",
|
"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.",
|
||||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "zipline",
|
"type": "zipline",
|
||||||
"challengeType": 3,
|
"challengeType": 3,
|
||||||
@ -117,7 +117,7 @@
|
|||||||
"<span class='text-info'>Bonus User Story:</span> As a user, I can choose whether I want to play as X or O.",
|
"<span class='text-info'>Bonus User Story:</span> As a user, I can choose whether I want to play as X or O.",
|
||||||
"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.",
|
"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.",
|
||||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "zipline",
|
"type": "zipline",
|
||||||
"challengeType": 3,
|
"challengeType": 3,
|
||||||
@ -156,7 +156,7 @@
|
|||||||
"<span class='text-info'>Hint:</span> Here are mp3s you can use for each button: <code>https://s3.amazonaws.com/freecodecamp/simonSound1.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound2.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound3.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound4.mp3</code>.",
|
"<span class='text-info'>Hint:</span> Here are mp3s you can use for each button: <code>https://s3.amazonaws.com/freecodecamp/simonSound1.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound2.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound3.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound4.mp3</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.",
|
"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.",
|
||||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
|
||||||
"If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
],
|
],
|
||||||
"type": "zipline",
|
"type": "zipline",
|
||||||
"challengeType": 3,
|
"challengeType": 3,
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
"tests": [
|
"tests": [
|
||||||
"assert(editor.match(/<script>/g), 'Create a <code>script</code> element.')",
|
"assert(editor.match(/<script>/g), 'Create a <code>script</code> element.')",
|
||||||
"assert(editor.match(/<\\/script>/g) && editor.match(/<script/g) && editor.match(/<\\/script>/g).length === editor.match(/<script/g).length, 'Make sure your <code>script</code> element has a closing tag.')",
|
"assert(editor.match(/<\\/script>/g) && editor.match(/<script/g) && editor.match(/<\\/script>/g).length === editor.match(/<script/g).length, 'Make sure your <code>script</code> element has a closing tag.')",
|
||||||
"assert(editor.match(/\\$\\s*?\\(\\s*?document\\)\\.ready\\s*?\\(\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/g), 'Add <code>$(document).ready(function() {</code> to the beginning of your <code>script</code> element.')",
|
"assert(editor.match(/\\$\\s*?\\(\\s*?document\\)\\.ready\\s*?\\(\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/g), 'You should add <code>$(document).ready(function() {</code> to the beginning of your <code>script</code> element.')",
|
||||||
"assert(editor.match(/\\n*?\\s*?\\}\\s*?\\);/g), 'Close your <code>$(document).ready(function() {</code> function with <code>});</code>.')"
|
"assert(editor.match(/\\n*?\\s*?\\}\\s*?\\);/g), 'Close your <code>$(document).ready(function() {</code> function with <code>});</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"",
|
"",
|
||||||
@ -58,7 +58,7 @@
|
|||||||
"This is important because without your <code>document ready function</code>, your code may run before your HTML is rendered, which would cause bugs.",
|
"This is important because without your <code>document ready function</code>, your code may run before your HTML is rendered, which would cause bugs.",
|
||||||
"Now let's write our first jQuery statement. All jQuery functions start with a <code>$</code>, usually referred to as a <code>dollar sign operator</code>, or simply as <code>bling</code>.",
|
"Now let's write our first jQuery statement. All jQuery functions start with a <code>$</code>, usually referred to as a <code>dollar sign operator</code>, or simply as <code>bling</code>.",
|
||||||
"jQuery often selects an HTML element with a <code>selector</code>, then does something to that element.",
|
"jQuery often selects an HTML element with a <code>selector</code>, then does something to that element.",
|
||||||
"For example, let's make all of your <code>button</code> elements bounce. Just add this code inside your <code>document ready function</code>: <code>$(\"button\").addClass(\"animated bounce\")</code>.",
|
"For example, let's make all of your <code>button</code> elements bounce. Just add this code inside your document ready function: <code>$(\"button\").addClass(\"animated bounce\")</code>.",
|
||||||
"Note that we've already included both the jQuery library and the Animate.css library in your code editor. So you are using jQuery to apply the Animate.css <code>bounce</code> class to your <code>button</code> elements."
|
"Note that we've already included both the jQuery library and the Animate.css library in your code editor. So you are using jQuery to apply the Animate.css <code>bounce</code> class to your <code>button</code> elements."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
@ -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) || editor.match(/\\$\\(\"button\"/g)), 'Use the <code>$(\"button\")</code> selector.')",
|
"assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?button\\s*?(?:'|\")/gi), 'Use the <code>$(\"button\")</code> selector.')",
|
||||||
"assert((editor.match(/\\$\\(\\'\\.btn\\'/g) || editor.match(/\\$\\(\"\\.btn\"/g)), 'Use the <code>$(\".btn\")</code> selector.')",
|
"assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.btn\\s*?(?:'|\")/gi), 'Use the <code>$(\".btn\")</code> selector.')",
|
||||||
"assert((editor.match(/\\$\\(\\'#target1\\'/g) || editor.match(/\\$\\(\"#target1\"/g)), 'Use the <code>$(\"#target1\")</code> selector.')",
|
"assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?#target1\\s*?(?:'|\")/gi), '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.')"
|
||||||
@ -629,7 +629,7 @@
|
|||||||
"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(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?#target1\\s*?(?:'|\")\\s*?\\)\\.parent/gi), '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": [
|
||||||
@ -676,10 +676,10 @@
|
|||||||
"title": "Target the Children of an Element Using jQuery",
|
"title": "Target the Children of an Element Using jQuery",
|
||||||
"difficulty": 3.14,
|
"difficulty": 3.14,
|
||||||
"description": [
|
"description": [
|
||||||
"Many HTML elements have <code>children</code> elements from which they <code>inherit</code> their properties.",
|
"Many HTML elements have <code>children</code> which <code>inherit</code> their properties from their parent HTML elements.",
|
||||||
"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.",
|
||||||
"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 to give the children of your <code>left-well</code> element the color of blue: <code>$(\"#left-well\").children().css(\"color\", \"blue\")</code>",
|
||||||
"Give all the children of your <code>#right-well</code> element a color of green."
|
"Give all the children of your <code>#right-well</code> element a color of green."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
@ -735,11 +735,11 @@
|
|||||||
"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.",
|
||||||
"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. You must target the children of element with the <code>target</code> class.",
|
||||||
"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>"
|
||||||
],
|
],
|
||||||
"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 your <code>target</code> elements should bounce.')",
|
||||||
"assert(editor.match(/\\:nth-child\\(/g), 'You should use the <code>:nth-child()</code> function to modify these elements.')",
|
"assert(editor.match(/\\:nth-child\\(/g), 'You should use the <code>:nth-child()</code> function to modify these elements.')",
|
||||||
"assert(editor.match(/<button class=\"btn btn-default target\" id=\"target2\">/g), 'Only use jQuery to add these classes to the element.')"
|
"assert(editor.match(/<button class=\"btn btn-default target\" id=\"target2\">/g), 'Only use jQuery to add these classes to the element.')"
|
||||||
],
|
],
|
||||||
@ -791,6 +791,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"You can also target all the even-numbered elements.",
|
"You can also target all the even-numbered elements.",
|
||||||
"Here's how you would target all the odd-numbered elements with class <code>target</code> and give them classes: <code>$(\".target:odd\").addClass(\"animated shake\");</code>",
|
"Here's how you would target all the odd-numbered elements with class <code>target</code> and give them classes: <code>$(\".target:odd\").addClass(\"animated shake\");</code>",
|
||||||
|
"Note that jQuery is zero-indexed, meaning that, counter-intuitively, <code>:odd</code> selects the second element, fourth element, and so on.",
|
||||||
"Try selecting all the even-numbered elements - that is, what your browser will consider even-numbered elements - and giving them the classes of <code>animated</code> and <code>shake</code>."
|
"Try selecting all the even-numbered elements - that is, what your browser will consider even-numbered elements - and giving them the classes of <code>animated</code> and <code>shake</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
|
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
|
||||||
"If you don't already have Cloud 9 account, create one now at <a href='http://c9.io' target='_blank'>http://c9.io</a>.",
|
"If you don't already have Cloud 9 account, create one now at <a href='http://c9.io' target='_blank'>http://c9.io</a>.",
|
||||||
"Open up <a href='http://c9.io' target='_blank'>http://c9.io</a> and sign in to your account.",
|
"Open up <a href='http://c9.io' target='_blank'>http://c9.io</a> and sign in to your account.",
|
||||||
"Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
|
"Click on the \"+\" icon at the top right of the c9.io page to create a new workspace.",
|
||||||
"Give your workspace a name.",
|
"Give your workspace a name and an optional description.",
|
||||||
"Choose Node.js in the selection area below the name field.",
|
"Choose Node.js in the selection area below the name field.",
|
||||||
"Click the Create button. Then click into your new workspace.",
|
"Click the \"Create workspace\" button.",
|
||||||
"In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
|
"Once C9 builds and loads your workspace, you should see a terminal window in the lower right hand corner. In this window use the following commands. You don't need to know what these mean at this point.",
|
||||||
"Install <code>learnyoumongo</code> with this command: <code>npm install learnyoumongo -g</code>",
|
"Install <code>learnyoumongo</code> with this command: <code>npm install learnyoumongo -g</code>",
|
||||||
"Now start the tutorial by running <code>learnyoumongo</code>.",
|
"Now start the tutorial by running <code>learnyoumongo</code>.",
|
||||||
"Whenever you run a command that includes <code>mongod</code> on c9.io, be sure to also use the <code>--nojournal</code> flag, like this: <code>mongod --nojournal</code>.",
|
"Whenever you run a command that includes <code>mongod</code> on c9.io, be sure to also use the <code>--nojournal</code> flag, like this: <code>mongod --nojournal</code>.",
|
||||||
|
@ -65,11 +65,11 @@
|
|||||||
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud. We'll do the first 7 steps of Node School's LearnYouNode challenges.",
|
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud. We'll do the first 7 steps of Node School's LearnYouNode challenges.",
|
||||||
"If you don't already have Cloud 9 account, create one now at <a href='http://c9.io' target='_blank'>http://c9.io</a>.",
|
"If you don't already have Cloud 9 account, create one now at <a href='http://c9.io' target='_blank'>http://c9.io</a>.",
|
||||||
"Open up <a href='http://c9.io' target='_blank'>http://c9.io</a> and sign in to your account.",
|
"Open up <a href='http://c9.io' target='_blank'>http://c9.io</a> and sign in to your account.",
|
||||||
"Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
|
"Click on the \"+\" icon at the top right of the c9.io page to create a new workspace.",
|
||||||
"Give your workspace a name.",
|
"Give your workspace a name and an optional description.",
|
||||||
"Choose Node.js in the selection area below the name field.",
|
"Choose Node.js in the selection area below the name field.",
|
||||||
"Click the Create button. Then click into your new workspace.",
|
"Click the \"Create workspace\" button.",
|
||||||
"In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
|
"Once C9 builds and loads your workspace, you should see a terminal window in the lower right hand corner. In this window use the following commands. You don't need to know what these mean at this point.",
|
||||||
"Run this command: <code>sudo npm install -g learnyounode</code>",
|
"Run this command: <code>sudo npm install -g learnyounode</code>",
|
||||||
"Now start this tutorial by running <code>learnyounode</code>",
|
"Now start this tutorial by running <code>learnyounode</code>",
|
||||||
"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.",
|
||||||
@ -167,11 +167,11 @@
|
|||||||
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
|
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
|
||||||
"If you don't already have Cloud 9 account, create one now at <a href='http://c9.io' target='_blank'>http://c9.io</a>.",
|
"If you don't already have Cloud 9 account, create one now at <a href='http://c9.io' target='_blank'>http://c9.io</a>.",
|
||||||
"Open up <a href='http://c9.io' target='_blank'>http://c9.io</a> and sign in to your account.",
|
"Open up <a href='http://c9.io' target='_blank'>http://c9.io</a> and sign in to your account.",
|
||||||
"Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
|
"Click on the \"+\" icon at the top right of the c9.io page to create a new workspace.",
|
||||||
"Give your workspace a name.",
|
"Give your workspace a name and an optional description.",
|
||||||
"Choose Node.js in the selection area below the name field.",
|
"Choose Node.js in the selection area below the name field.",
|
||||||
"Click the Create button. Then click into your new workspace.",
|
"Click the \"Create workspace\" button.",
|
||||||
"In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
|
"Once C9 builds and loads your workspace, you should see a terminal window in the lower right hand corner. In this window use the following commands. You don't need to know what these mean at this point.",
|
||||||
"Run this command: <code>git clone http://github.com/reddock/fcc_express && chmod 744 fcc_express/setup.sh && fcc_express/setup.sh && source ~/.profile</code>",
|
"Run this command: <code>git clone http://github.com/reddock/fcc_express && chmod 744 fcc_express/setup.sh && fcc_express/setup.sh && source ~/.profile</code>",
|
||||||
"Now start this tutorial by running <code>expressworks</code>",
|
"Now start this tutorial by running <code>expressworks</code>",
|
||||||
"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.",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Object Oriented and Functional Programming",
|
"name": "Object Oriented and Functional Programming",
|
||||||
"order": 0.010,
|
"order": 0.006,
|
||||||
"note": [
|
"note": [
|
||||||
"Methods",
|
"Methods",
|
||||||
"Closures",
|
"Closures",
|
||||||
@ -20,9 +20,9 @@
|
|||||||
"Give your <code>motorBike</code> object a <code>wheels</code>, <code>engines</code> and <code>seats</code> attribute and set them to numbers."
|
"Give your <code>motorBike</code> object a <code>wheels</code>, <code>engines</code> and <code>seats</code> attribute and set them to numbers."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(typeof(motorBike.engines) === 'number', '<code>engines</code> should be have a <code>engines</code> attribute set to a number.');",
|
"assert(typeof(motorBike.engines) === 'number', '<code>motorBike</code> should have a <code>engines</code> attribute set to a number.');",
|
||||||
"assert(typeof(motorBike.wheels) === 'number', '<code>wheels</code> should be have a <code>engines</code> attribute set to a number.');",
|
"assert(typeof(motorBike.wheels) === 'number', '<code>motorBike</code> should have a <code>wheels</code> attribute set to a number.');",
|
||||||
"assert(typeof(motorBike.seats) === 'number', '<code>seats</code> should be have a <code>engines</code> attribute set to a number.');"
|
"assert(typeof(motorBike.seats) === 'number', '<code>motorBike</code> should have a <code>seats</code> attribute set to a number.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"//Here is a sample Object",
|
"//Here is a sample Object",
|
||||||
@ -54,12 +54,12 @@
|
|||||||
"difficulty":0,
|
"difficulty":0,
|
||||||
"description":[
|
"description":[
|
||||||
"We are also able to create objects using <code>constructor</code> functions.",
|
"We are also able to create objects using <code>constructor</code> functions.",
|
||||||
"Give your <code>motorBike</code> object a <code>wheels</code>, <code>engines</code> and <code>seats</code> attribute and set them to numbers."
|
"Give your <code>myMotorBike</code> object a <code>wheels</code>, <code>engines</code> and <code>seats</code> attribute and set them to numbers."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(typeof((new MotorBike()).engines) === 'number', '<code>engines</code> should be have a <code>engines</code> attribute set to a number.');",
|
"assert(typeof((new MotorBike()).engines) === 'number', '<code>myMotorBike</code> should have a <code>engines</code> attribute set to a number.');",
|
||||||
"assert(typeof((new MotorBike()).wheels) === 'number', '<code>wheels</code> should be have a <code>engines</code> attribute set to a number.');",
|
"assert(typeof((new MotorBike()).wheels) === 'number', '<code>myMotorBike</code> should have a <code>wheels</code> attribute set to a number.');",
|
||||||
"assert(typeof((new MotorBike()).seats) === 'number', '<code>seats</code> should be have a <code>engines</code> attribute set to a number.');"
|
"assert(typeof((new MotorBike()).seats) === 'number', '<code>myMotorBike</code> should have a <code>seats</code> attribute set to a number.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"// Let's add the properties engines and seats to the car in the same way that the property wheels has been added below. They should both be numbers.",
|
"// Let's add the properties engines and seats to the car in the same way that the property wheels has been added below. They should both be numbers.",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Router from 'react-router';
|
import { RoutingContext } from 'react-router';
|
||||||
import Fetchr from 'fetchr';
|
import Fetchr from 'fetchr';
|
||||||
import Location from 'react-router/lib/Location';
|
import { createLocation } from 'history';
|
||||||
import debugFactory from 'debug';
|
import debugFactory from 'debug';
|
||||||
import { app$ } from '../../common/app';
|
import { app$ } from '../../common/app';
|
||||||
import { RenderToString } from 'thundercats-react';
|
import { RenderToString } from 'thundercats-react';
|
||||||
@ -13,7 +13,8 @@ const debug = debugFactory('freecc:react-server');
|
|||||||
const routes = [
|
const routes = [
|
||||||
'/hikes',
|
'/hikes',
|
||||||
'/hikes/*',
|
'/hikes/*',
|
||||||
'/jobs'
|
'/jobs',
|
||||||
|
'/jobs/*'
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function reactSubRouter(app) {
|
export default function reactSubRouter(app) {
|
||||||
@ -29,25 +30,25 @@ export default function reactSubRouter(app) {
|
|||||||
|
|
||||||
function serveReactApp(req, res, next) {
|
function serveReactApp(req, res, next) {
|
||||||
const services = new Fetchr({ req });
|
const services = new Fetchr({ req });
|
||||||
const location = new Location(req.path, req.query);
|
const location = createLocation(req.path);
|
||||||
|
|
||||||
// returns a router wrapped app
|
// returns a router wrapped app
|
||||||
app$(location)
|
app$({ location })
|
||||||
// if react-router does not find a route send down the chain
|
// if react-router does not find a route send down the chain
|
||||||
.filter(function({ initialState }) {
|
.filter(function({ props}) {
|
||||||
if (!initialState) {
|
if (!props) {
|
||||||
debug('react tried to find %s but got 404', location.pathname);
|
debug('react tried to find %s but got 404', location.pathname);
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
return !!initialState;
|
return !!props;
|
||||||
})
|
})
|
||||||
.flatMap(function({ initialState, AppCat }) {
|
.flatMap(function({ props, AppCat }) {
|
||||||
// call thundercats renderToString
|
// call thundercats renderToString
|
||||||
// prefetches data and sets up it up for current state
|
// prefetches data and sets up it up for current state
|
||||||
debug('rendering to string');
|
debug('rendering to string');
|
||||||
return RenderToString(
|
return RenderToString(
|
||||||
AppCat(null, services),
|
AppCat(null, services),
|
||||||
React.createElement(Router, initialState)
|
React.createElement(RoutingContext, props)
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
// makes sure we only get one onNext and closes subscription
|
// makes sure we only get one onNext and closes subscription
|
||||||
|
@ -14,7 +14,6 @@ import {
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
userMigration,
|
userMigration,
|
||||||
ifNoUserRedirectTo,
|
|
||||||
ifNoUserSend
|
ifNoUserSend
|
||||||
} from '../utils/middleware';
|
} from '../utils/middleware';
|
||||||
|
|
||||||
@ -27,7 +26,8 @@ const challengeView = {
|
|||||||
2: 'coursewares/showVideo',
|
2: 'coursewares/showVideo',
|
||||||
3: 'coursewares/showZiplineOrBasejump',
|
3: 'coursewares/showZiplineOrBasejump',
|
||||||
4: 'coursewares/showZiplineOrBasejump',
|
4: 'coursewares/showZiplineOrBasejump',
|
||||||
5: 'coursewares/showBonfire'
|
5: 'coursewares/showBonfire',
|
||||||
|
7: 'coursewares/showStep'
|
||||||
};
|
};
|
||||||
|
|
||||||
const dasherize = utils.dasherize;
|
const dasherize = utils.dasherize;
|
||||||
@ -100,9 +100,6 @@ module.exports = function(app) {
|
|||||||
const userCount$ = observeMethod(User, 'count');
|
const userCount$ = observeMethod(User, 'count');
|
||||||
|
|
||||||
const send200toNonUser = ifNoUserSend(true);
|
const send200toNonUser = ifNoUserSend(true);
|
||||||
const redirectNonUser = ifNoUserRedirectTo(
|
|
||||||
'/challenges/learn-how-free-code-camp-works'
|
|
||||||
);
|
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
'/completed-challenge/',
|
'/completed-challenge/',
|
||||||
@ -125,26 +122,17 @@ module.exports = function(app) {
|
|||||||
router.get('/map', challengeMap);
|
router.get('/map', challengeMap);
|
||||||
router.get(
|
router.get(
|
||||||
'/challenges/next-challenge',
|
'/challenges/next-challenge',
|
||||||
redirectNonUser,
|
|
||||||
returnNextChallenge
|
returnNextChallenge
|
||||||
);
|
);
|
||||||
|
|
||||||
router.get('/challenges/:challengeName', returnIndividualChallenge);
|
router.get('/challenges/:challengeName', returnIndividualChallenge);
|
||||||
|
|
||||||
router.get(
|
|
||||||
'/challenges/',
|
|
||||||
redirectNonUser,
|
|
||||||
returnCurrentChallenge
|
|
||||||
);
|
|
||||||
|
|
||||||
app.use(router);
|
app.use(router);
|
||||||
|
|
||||||
function returnNextChallenge(req, res, next) {
|
function returnNextChallenge(req, res, next) {
|
||||||
let nextChallengeName = firstChallenge;
|
let nextChallengeName = firstChallenge;
|
||||||
|
|
||||||
const challengeId = req.user.currentChallenge ?
|
const challengeId = req.query.id;
|
||||||
req.user.currentChallenge.challengeId :
|
|
||||||
'bd7123c8c441eddfaeb5bdef';
|
|
||||||
|
|
||||||
// find challenge
|
// find challenge
|
||||||
return challenge$
|
return challenge$
|
||||||
@ -199,16 +187,13 @@ module.exports = function(app) {
|
|||||||
nextChallengeName = nextChallenge.dashedName;
|
nextChallengeName = nextChallenge.dashedName;
|
||||||
return nextChallengeName;
|
return nextChallengeName;
|
||||||
})
|
})
|
||||||
.flatMap(() => {
|
|
||||||
return saveUser(req.user);
|
|
||||||
})
|
|
||||||
.subscribe(
|
.subscribe(
|
||||||
function() {},
|
function() {},
|
||||||
next,
|
next,
|
||||||
function() {
|
function() {
|
||||||
debug('next challengeName', nextChallengeName);
|
debug('next challengeName', nextChallengeName);
|
||||||
if (!nextChallengeName || nextChallengeName === firstChallenge) {
|
if (!nextChallengeName || nextChallengeName === firstChallenge) {
|
||||||
req.flash('errors', {
|
req.flash('info', {
|
||||||
msg: dedent`
|
msg: dedent`
|
||||||
Once you have completed all of our challenges, you should
|
Once you have completed all of our challenges, you should
|
||||||
join our <a href=\"//gitter.im/freecodecamp/HalfWayClub\"
|
join our <a href=\"//gitter.im/freecodecamp/HalfWayClub\"
|
||||||
@ -223,36 +208,9 @@ module.exports = function(app) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function returnCurrentChallenge(req, res, next) {
|
|
||||||
Observable.just(req.user)
|
|
||||||
.flatMap(user => {
|
|
||||||
if (!req.user.currentChallenge) {
|
|
||||||
return challenge$
|
|
||||||
.first()
|
|
||||||
.flatMap(challenge => {
|
|
||||||
user.currentChallenge = {
|
|
||||||
challengeId: challenge.id,
|
|
||||||
challengeName: challenge.name,
|
|
||||||
dashedName: challenge.dashedName
|
|
||||||
};
|
|
||||||
return saveUser(user);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return Observable.just(user);
|
|
||||||
})
|
|
||||||
.map(user => user.currentChallenge.dashedName)
|
|
||||||
.subscribe(
|
|
||||||
function(challengeName) {
|
|
||||||
res.redirect('/challenges/' + challengeName);
|
|
||||||
},
|
|
||||||
next,
|
|
||||||
function() {
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function returnIndividualChallenge(req, res, next) {
|
function returnIndividualChallenge(req, res, next) {
|
||||||
const origChallengeName = req.params.challengeName;
|
const origChallengeName = req.params.challengeName;
|
||||||
|
const solutionCode = req.query.solution;
|
||||||
const unDashedName = unDasherize(origChallengeName);
|
const unDashedName = unDasherize(origChallengeName);
|
||||||
|
|
||||||
const challengeName = challengesRegex.test(unDashedName) ?
|
const challengeName = challengesRegex.test(unDashedName) ?
|
||||||
@ -282,43 +240,33 @@ module.exports = function(app) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dasherize(challenge.name) !== origChallengeName) {
|
if (dasherize(challenge.name) !== origChallengeName) {
|
||||||
return Observable.just('/challenges/' + dasherize(challenge.name));
|
return Observable.just('/challenges/' + dasherize(challenge.name) + '?solution=' + solutionCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (challenge) {
|
// save user does nothing if user does not exist
|
||||||
if (req.user) {
|
return Observable.just({
|
||||||
req.user.currentChallenge = {
|
title: challenge.name,
|
||||||
challengeId: challenge.id,
|
dashedName: origChallengeName,
|
||||||
challengeName: challenge.name,
|
name: challenge.name,
|
||||||
dashedName: challenge.dashedName
|
details: challenge.description,
|
||||||
};
|
description: challenge.description,
|
||||||
}
|
tests: challenge.tests,
|
||||||
|
challengeSeed: challenge.challengeSeed,
|
||||||
// save user does nothing if user does not exist
|
verb: utils.randomVerb(),
|
||||||
return saveUser(req.user)
|
phrase: utils.randomPhrase(),
|
||||||
.map(() => ({
|
compliment: utils.randomCompliment(),
|
||||||
title: challenge.name,
|
challengeId: challenge.id,
|
||||||
dashedName: origChallengeName,
|
challengeType: challenge.challengeType,
|
||||||
name: challenge.name,
|
// video challenges
|
||||||
details: challenge.description,
|
video: challenge.challengeSeed[0],
|
||||||
tests: challenge.tests,
|
// bonfires specific
|
||||||
challengeSeed: challenge.challengeSeed,
|
difficulty: Math.floor(+challenge.difficulty),
|
||||||
verb: utils.randomVerb(),
|
bonfires: challenge,
|
||||||
phrase: utils.randomPhrase(),
|
MDNkeys: challenge.MDNlinks,
|
||||||
compliment: utils.randomCompliment(),
|
MDNlinks: getMDNLinks(challenge.MDNlinks),
|
||||||
challengeId: challenge.id,
|
// htmls specific
|
||||||
challengeType: challenge.challengeType,
|
environment: utils.whichEnvironment()
|
||||||
// video challenges
|
});
|
||||||
video: challenge.challengeSeed[0],
|
|
||||||
// bonfires specific
|
|
||||||
difficulty: Math.floor(+challenge.difficulty),
|
|
||||||
bonfires: challenge,
|
|
||||||
MDNkeys: challenge.MDNlinks,
|
|
||||||
MDNlinks: getMDNLinks(challenge.MDNlinks),
|
|
||||||
// htmls specific
|
|
||||||
environment: utils.whichEnvironment()
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.subscribe(
|
.subscribe(
|
||||||
function(data) {
|
function(data) {
|
||||||
@ -526,6 +474,7 @@ module.exports = function(app) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function challengeMap({ user = {} }, res, next) {
|
function challengeMap({ user = {} }, res, next) {
|
||||||
|
let lastCompleted;
|
||||||
const daysRunning = moment().diff(new Date('10/15/2014'), 'days');
|
const daysRunning = moment().diff(new Date('10/15/2014'), 'days');
|
||||||
|
|
||||||
// if user
|
// if user
|
||||||
@ -568,7 +517,13 @@ module.exports = function(app) {
|
|||||||
})
|
})
|
||||||
.filter(({ name }) => name !== 'Hikes')
|
.filter(({ name }) => name !== 'Hikes')
|
||||||
// turn stream of blocks into a stream of an array
|
// turn stream of blocks into a stream of an array
|
||||||
.toArray();
|
.toArray()
|
||||||
|
.doOnNext((blocks) => {
|
||||||
|
const lastCompletedBlock = _.findLast(blocks, (block) => {
|
||||||
|
return block.completed === 100;
|
||||||
|
});
|
||||||
|
lastCompleted = lastCompleted && lastCompletedBlock.name || null;
|
||||||
|
});
|
||||||
|
|
||||||
Observable.combineLatest(
|
Observable.combineLatest(
|
||||||
camperCount$,
|
camperCount$,
|
||||||
@ -581,6 +536,7 @@ module.exports = function(app) {
|
|||||||
blocks,
|
blocks,
|
||||||
daysRunning,
|
daysRunning,
|
||||||
camperCount,
|
camperCount,
|
||||||
|
lastCompleted,
|
||||||
title: "A map of all Free Code Camp's Challenges"
|
title: "A map of all Free Code Camp's Challenges"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { defaultProfileImage } from '../../common/utils/constantStrings.json';
|
import { defaultProfileImage } from '../../common/utils/constantStrings.json';
|
||||||
|
|
||||||
const message =
|
const message =
|
||||||
'Learn to Code JavaScript and get a Coding Job by Helping Nonprofits';
|
'Learn to Code and Build Projects for Nonprofits';
|
||||||
|
|
||||||
module.exports = function(app) {
|
module.exports = function(app) {
|
||||||
var router = app.loopback.Router();
|
var router = app.loopback.Router();
|
||||||
@ -22,7 +22,7 @@ module.exports = function(app) {
|
|||||||
|
|
||||||
function index(req, res) {
|
function index(req, res) {
|
||||||
if (req.user) {
|
if (req.user) {
|
||||||
return res.render('resources/get-started', { title: message });
|
return res.redirect('/map');
|
||||||
}
|
}
|
||||||
res.render('home', { title: message });
|
res.render('home', { title: message });
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,6 @@ module.exports = function(app) {
|
|||||||
title: story.headline,
|
title: story.headline,
|
||||||
link: story.link,
|
link: story.link,
|
||||||
originalStoryLink: dashedName,
|
originalStoryLink: dashedName,
|
||||||
originalStoryAuthorEmail: story.author.email || '',
|
|
||||||
author: story.author,
|
author: story.author,
|
||||||
rank: story.upVotes.length,
|
rank: story.upVotes.length,
|
||||||
upVotes: story.upVotes,
|
upVotes: story.upVotes,
|
||||||
@ -373,13 +372,11 @@ module.exports = function(app) {
|
|||||||
author: {
|
author: {
|
||||||
picture: req.user.picture,
|
picture: req.user.picture,
|
||||||
userId: req.user.id,
|
userId: req.user.id,
|
||||||
username: req.user.username,
|
username: req.user.username
|
||||||
email: req.user.email
|
|
||||||
},
|
},
|
||||||
image: data.image,
|
image: data.image,
|
||||||
storyLink: storyLink,
|
storyLink: storyLink,
|
||||||
metaDescription: data.storyMetaDescription,
|
metaDescription: data.storyMetaDescription
|
||||||
originalStoryAuthorEmail: req.user.email
|
|
||||||
});
|
});
|
||||||
return saveInstance(newStory);
|
return saveInstance(newStory);
|
||||||
});
|
});
|
||||||
|
@ -76,6 +76,8 @@ module.exports = function(app) {
|
|||||||
);
|
);
|
||||||
router.get('/account/unlink/:provider', getOauthUnlink);
|
router.get('/account/unlink/:provider', getOauthUnlink);
|
||||||
router.get('/account', getAccount);
|
router.get('/account', getAccount);
|
||||||
|
router.get('/vote1', vote1);
|
||||||
|
router.get('/vote2', vote2);
|
||||||
// Ensure this is the last route!
|
// Ensure this is the last route!
|
||||||
router.get('/:username', returnUser);
|
router.get('/:username', returnUser);
|
||||||
|
|
||||||
@ -187,7 +189,8 @@ module.exports = function(app) {
|
|||||||
bonfires: bonfires,
|
bonfires: bonfires,
|
||||||
moment: moment,
|
moment: moment,
|
||||||
longestStreak: user.longestStreak,
|
longestStreak: user.longestStreak,
|
||||||
currentStreak: user.currentStreak
|
currentStreak: user.currentStreak,
|
||||||
|
encodeURI: encodeURI
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -342,4 +345,36 @@ module.exports = function(app) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function vote1(req, res) {
|
||||||
|
if (req.user) {
|
||||||
|
req.user.tshirtVote = 1;
|
||||||
|
req.user.save(function (err) {
|
||||||
|
if (err) {
|
||||||
|
return next(err);
|
||||||
|
}
|
||||||
|
req.flash('success', {msg: 'Thanks for voting!'});
|
||||||
|
res.redirect('/map');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
req.flash('error', {msg: 'You must be signed in to vote.'});
|
||||||
|
res.redirect('/map');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function vote2(req, res) {
|
||||||
|
if (req.user) {
|
||||||
|
req.user.tshirtVote = 2;
|
||||||
|
req.user.save(function (err) {
|
||||||
|
if (err) {
|
||||||
|
return next(err);
|
||||||
|
}
|
||||||
|
req.flash('success', {msg: 'Thanks for voting!'});
|
||||||
|
res.redirect('/map');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
req.flash('error', {msg: 'You must be signed in to vote.'});
|
||||||
|
res.redirect('/map');
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@ -12,20 +12,27 @@ const pathsOfNoReturn = [
|
|||||||
'css'
|
'css'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const pathsWhiteList = [
|
||||||
|
'news',
|
||||||
|
'challenges',
|
||||||
|
'map',
|
||||||
|
'news'
|
||||||
|
];
|
||||||
|
|
||||||
const pathsOfNoReturnRegex = new RegExp(pathsOfNoReturn.join('|'), 'i');
|
const pathsOfNoReturnRegex = new RegExp(pathsOfNoReturn.join('|'), 'i');
|
||||||
|
const whiteListRegex = new RegExp(pathsWhiteList.join('|'), 'i');
|
||||||
|
|
||||||
export default function addReturnToUrl() {
|
export default function addReturnToUrl() {
|
||||||
return function(req, res, next) {
|
return function(req, res, next) {
|
||||||
// Remember original destination before login.
|
// Remember original destination before login.
|
||||||
var path = req.path.split('/')[1];
|
var path = req.path.split('/')[1];
|
||||||
|
|
||||||
if (req.method !== 'GET') {
|
if (
|
||||||
return next();
|
req.method !== 'GET' ||
|
||||||
}
|
pathsOfNoReturnRegex.test(path) ||
|
||||||
if (pathsOfNoReturnRegex.test(path)) {
|
!whiteListRegex.test(path) ||
|
||||||
return next();
|
(/news/i).test(path) && (/hot/i).test(req.path)
|
||||||
}
|
) {
|
||||||
if (/\/stories\/\w+/i.test(req.path)) {
|
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
req.session.returnTo = req.path;
|
req.session.returnTo = req.path;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import manifest from '../rev-manifest.json';
|
import manifest from '../rev-manifest.json';
|
||||||
|
|
||||||
const __DEV__ = process.env.NODE_ENV === 'development';
|
const __DEV__ = process.env.NODE_ENV === 'development';
|
||||||
|
const manifestPath = '../rev-manifest.json';
|
||||||
|
|
||||||
export default function({ globalPrepend = '' } = {}) {
|
export default function({ globalPrepend = '' } = {}) {
|
||||||
|
|
||||||
function rev(manifest, scopedPrepend, asset) {
|
function rev(manifest, scopedPrepend, asset) {
|
||||||
@ -13,7 +15,10 @@ export default function({ globalPrepend = '' } = {}) {
|
|||||||
// this means we do not need to restart server on every change to
|
// this means we do not need to restart server on every change to
|
||||||
// client code
|
// client code
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
const manifest = require('../rev-manifest.json');
|
// we first need to remove the manifest from require cache
|
||||||
|
delete require.cache[require.resolve(manifestPath)];
|
||||||
|
// and re-require
|
||||||
|
const manifest = require(manifestPath);
|
||||||
res.locals.rev = rev.bind(null, manifest);
|
res.locals.rev = rev.bind(null, manifest);
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,12 @@ export default function getJobServices(app) {
|
|||||||
const { Job } = app.models;
|
const { Job } = app.models;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: 'job',
|
name: 'jobs',
|
||||||
read: (req, resource, params, config, cb) => {
|
read: (req, resource, params, config, cb) => {
|
||||||
|
const id = params ? params.id : null;
|
||||||
|
if (id) {
|
||||||
|
return Job.findById(id, cb);
|
||||||
|
}
|
||||||
Job.find({}, (err, jobs) => {
|
Job.find({}, (err, jobs) => {
|
||||||
cb(err, jobs);
|
cb(err, jobs);
|
||||||
});
|
});
|
||||||
|
@ -97,7 +97,7 @@ block content
|
|||||||
h4.col-sm-6.text-left Current Streak: #{currentStreak} #{currentStreak + currentStreak === 1 ? ' day' : ' days'}
|
h4.col-sm-6.text-left Current Streak: #{currentStreak} #{currentStreak + currentStreak === 1 ? ' day' : ' days'}
|
||||||
|
|
||||||
|
|
||||||
if (!user.lockdownMode)
|
if (user.username == username || !user.lockdownMode)
|
||||||
if (challenges.length > 0)
|
if (challenges.length > 0)
|
||||||
.col-sm-12
|
.col-sm-12
|
||||||
table.table.table-striped
|
table.table.table-striped
|
||||||
@ -123,11 +123,10 @@ block content
|
|||||||
th.col-xs-6 Solution
|
th.col-xs-6 Solution
|
||||||
for bonfire in bonfires
|
for bonfire in bonfires
|
||||||
tr
|
tr
|
||||||
td.col-xs-4
|
td.col-xs-4= bonfire.name
|
||||||
a(href='/challenges/' + bonfire.name, target='_blank')= bonfire.name
|
|
||||||
td.col-xs-2= moment(bonfire.completedDate, 'x').format("MMM DD, YYYY")
|
td.col-xs-2= moment(bonfire.completedDate, 'x').format("MMM DD, YYYY")
|
||||||
td.col-xs-6
|
td.col-xs-6
|
||||||
pre.wrappable= bonfire.solution
|
a(href='/challenges/' + bonfire.name + '?solution=' + encodeURIComponent(bonfire.solution), target='_blank') View my solution
|
||||||
|
|
||||||
if (user && user.username === username)
|
if (user && user.username === username)
|
||||||
.panel.panel-info
|
.panel.panel-info
|
||||||
|
@ -5,9 +5,6 @@ block content
|
|||||||
a.btn.btn-lg.btn-block.btn-github.btn-social(href='/auth/github')
|
a.btn.btn-lg.btn-block.btn-github.btn-social(href='/auth/github')
|
||||||
i.fa.fa-github
|
i.fa.fa-github
|
||||||
| Sign in with Github
|
| Sign in with Github
|
||||||
a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/twitter')
|
|
||||||
i.fa.fa-twitter
|
|
||||||
| Sign in with Twitter
|
|
||||||
a.btn.btn-lg.btn-block.btn-facebook.btn-social(href='/auth/facebook')
|
a.btn.btn-lg.btn-block.btn-facebook.btn-social(href='/auth/facebook')
|
||||||
i.fa.fa-facebook
|
i.fa.fa-facebook
|
||||||
| Sign in with Facebook
|
| Sign in with Facebook
|
||||||
@ -17,8 +14,11 @@ block content
|
|||||||
a.btn.btn-lg.btn-block.btn-linkedin.btn-social(href='/auth/linkedin')
|
a.btn.btn-lg.btn-block.btn-linkedin.btn-social(href='/auth/linkedin')
|
||||||
i.fa.fa-linkedin
|
i.fa.fa-linkedin
|
||||||
| Sign in with LinkedIn
|
| Sign in with LinkedIn
|
||||||
|
a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/twitter')
|
||||||
|
i.fa.fa-twitter
|
||||||
|
| Sign in with Twitter
|
||||||
br
|
br
|
||||||
p
|
p
|
||||||
a(href="/email-signup") Or sign up using your email address here.
|
a(href="/email-signup") Or sign up using your email address here.
|
||||||
p
|
p
|
||||||
a(href="/email-signin") Sign in to your existing account with your email address here.
|
a(href="/email-signin") If you originally signed up using your email address, you can sign in here.
|
||||||
|
@ -9,7 +9,7 @@ block content
|
|||||||
audio(autoplay src='https://s3.amazonaws.com/freecodecamp/t-rex-roar.mp3')
|
audio(autoplay src='https://s3.amazonaws.com/freecodecamp/t-rex-roar.mp3')
|
||||||
else
|
else
|
||||||
img.img-responsive.img-center.border-radius-5(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner.png')
|
img.img-responsive.img-center.border-radius-5(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner.png')
|
||||||
.col-xs-12.col-md-10.col-md-offset-1
|
.col-xs-12.col-md-8.col-md-offset-2
|
||||||
h2.text-center
|
h2.text-center
|
||||||
span.text-primary #{camperCount}  
|
span.text-primary #{camperCount}  
|
||||||
| campers have joined our community
|
| campers have joined our community
|
||||||
@ -18,6 +18,35 @@ block content
|
|||||||
span.text-primary #{daysRunning}  
|
span.text-primary #{daysRunning}  
|
||||||
| days ago.
|
| days ago.
|
||||||
.spacer
|
.spacer
|
||||||
|
if (user && !user.tshirtVote && user.progressTimestamps.length > 5)
|
||||||
|
h3.text-center Vote for the T-shirt design you like the most.
|
||||||
|
h4.text-center We'll announce the winning design during our Summit on Saturday at Noon EST on 
|
||||||
|
a(href='https://twitch.tv/freecodecamp' target='_blank') Twitch.tv
|
||||||
|
|  and it will become our community's first official t-shirt (in women's and men's sizes).
|
||||||
|
.row
|
||||||
|
.col-xs-6
|
||||||
|
a(href="http://i.imgur.com/LlXGa5y.png" data-lightbox="img-enlarge")
|
||||||
|
img.img-responsive(src='http://i.imgur.com/LlXGa5y.png' alt="t-shirt option 1 women's")
|
||||||
|
.col-xs-6
|
||||||
|
a(href="http://i.imgur.com/aefwnnv.png" data-lightbox="img-enlarge")
|
||||||
|
img.img-responsive(src='http://i.imgur.com/aefwnnv.png' alt="t-shirt option 2 women's")
|
||||||
|
.button-spacer
|
||||||
|
.row
|
||||||
|
.col-xs-6
|
||||||
|
a(href="http://i.imgur.com/aYH0aqf.png" data-lightbox="img-enlarge")
|
||||||
|
img.img-responsive(src='http://i.imgur.com/aYH0aqf.png' alt="t-shirt option 1 men's")
|
||||||
|
.col-xs-6
|
||||||
|
a(href="http://i.imgur.com/v9KlV4g.png" data-lightbox="img-enlarge")
|
||||||
|
img.img-responsive(src='http://i.imgur.com/v9KlV4g.png' alt="t-shirt option 2 men's")
|
||||||
|
.button-spacer
|
||||||
|
.row
|
||||||
|
.col-xs-6
|
||||||
|
h3.text-center "Minified JavaScript Logo"
|
||||||
|
a.button.btn.btn-block.btn-primary(href='/vote1') Vote for this Design
|
||||||
|
.col-xs-6
|
||||||
|
h3.text-center "Function Call Logo"
|
||||||
|
a.button.btn.btn-block.btn-primary(href='/vote2') Vote for this design
|
||||||
|
.spacer
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-8.col-sm-offset-2
|
.col-xs-12.col-sm-8.col-sm-offset-2
|
||||||
h3 800 Hours of Practice:
|
h3 800 Hours of Practice:
|
||||||
@ -26,22 +55,22 @@ block content
|
|||||||
.row
|
.row
|
||||||
if (user)
|
if (user)
|
||||||
if (challengeBlock.completed === 100)
|
if (challengeBlock.completed === 100)
|
||||||
.hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center.large-p.negative-10
|
.hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center.map-p.negative-10
|
||||||
.col-xs-12.col-sm-9.col-md-10
|
.col-xs-12.col-sm-9.col-md-10
|
||||||
li.large-p.faded.negative-10
|
li.map-p.faded.negative-10
|
||||||
a(href='#' + challengeBlock.dashedName)= challengeBlock.name
|
a(href='#' + challengeBlock.dashedName)= challengeBlock.name
|
||||||
else
|
else
|
||||||
.hidden-xs.col-sm-3.col-md-2
|
.hidden-xs.col-sm-3.col-md-2
|
||||||
.progress.progress-bar-padding.text-center.thin-progress-bar
|
.progress.progress-bar-padding.text-center.thin-progress-bar
|
||||||
.progress-bar(role='progressbar', aria-valuenow=(challengeBlock.completed), aria-valuemin='0', aria-valuemax='100', style='width: ' + challengeBlock.completed + '%;')
|
.progress-bar(role='progressbar', aria-valuenow=(challengeBlock.completed), aria-valuemin='0', aria-valuemax='100', style='width: ' + challengeBlock.completed + '%;')
|
||||||
.col-xs-12.col-sm-9.col-md-10
|
.col-xs-12.col-sm-9.col-md-10
|
||||||
li.large-p.negative-10
|
li.map-p.negative-10
|
||||||
a(href='#' + challengeBlock.dashedName)= challengeBlock.name
|
a(href='#' + challengeBlock.dashedName)= challengeBlock.name
|
||||||
else
|
else
|
||||||
.hidden-xs.col-sm-3.col-md-2
|
.hidden-xs.col-sm-3.col-md-2
|
||||||
span.negative-10
|
span.negative-10
|
||||||
.col-xs-12.col-sm-9.col-md-10
|
.col-xs-12.col-sm-9.col-md-10
|
||||||
li.large-p.negative-10
|
li.map-p.negative-10
|
||||||
a(href='#' + challengeBlock.dashedName)= challengeBlock.name
|
a(href='#' + challengeBlock.dashedName)= challengeBlock.name
|
||||||
|
|
||||||
.row
|
.row
|
||||||
@ -51,21 +80,21 @@ block content
|
|||||||
| :
|
| :
|
||||||
ol
|
ol
|
||||||
.row
|
.row
|
||||||
.hidden-xs.col-sm-3.col-md-2.ion-locked.padded-ionic-icon.text-center.large-p.negative-10
|
.hidden-xs.col-sm-3.col-md-2.ion-locked.padded-ionic-icon.text-center.map-p.negative-10
|
||||||
.col-xs-12.col-sm-9.col-md-10
|
.col-xs-12.col-sm-9.col-md-10
|
||||||
li.large-p.negative-10 100-hour Nonprofit Project
|
li.map-p.negative-10 100-hour Nonprofit Project
|
||||||
.row
|
.row
|
||||||
.hidden-xs.col-sm-3.col-md-2.ion-locked.padded-ionic-icon.text-center.large-p.negative-10
|
.hidden-xs.col-sm-3.col-md-2.ion-locked.padded-ionic-icon.text-center.map-p.negative-10
|
||||||
.col-xs-12.col-sm-9.col-md-10
|
.col-xs-12.col-sm-9.col-md-10
|
||||||
li.large-p.negative-10 200-hour Nonprofit Project #1
|
li.map-p.negative-10 200-hour Nonprofit Project #1
|
||||||
.row
|
.row
|
||||||
.hidden-xs.col-sm-3.col-md-2.ion-locked.padded-ionic-icon.text-center.large-p.negative-10
|
.hidden-xs.col-sm-3.col-md-2.ion-locked.padded-ionic-icon.text-center.map-p.negative-10
|
||||||
.col-xs-12.col-sm-9.col-md-10
|
.col-xs-12.col-sm-9.col-md-10
|
||||||
li.large-p.negative-10 200-hour Nonprofit Project #2
|
li.map-p.negative-10 200-hour Nonprofit Project #2
|
||||||
.row
|
.row
|
||||||
.hidden-xs.col-sm-3.col-md-2.ion-locked.padded-ionic-icon.text-center.large-p.negative-10
|
.hidden-xs.col-sm-3.col-md-2.ion-locked.padded-ionic-icon.text-center.map-p.negative-10
|
||||||
.col-xs-12.col-sm-9.col-md-10
|
.col-xs-12.col-sm-9.col-md-10
|
||||||
li.large-p.negative-10 300-hour Nonprofit Project
|
li.map-p.negative-10 300-hour Nonprofit Project
|
||||||
hr
|
hr
|
||||||
|
|
||||||
for challengeBlock in blocks
|
for challengeBlock in blocks
|
||||||
@ -82,9 +111,9 @@ block content
|
|||||||
for challenge in challengeBlock.challenges
|
for challenge in challengeBlock.challenges
|
||||||
if challenge.completed
|
if challenge.completed
|
||||||
.row
|
.row
|
||||||
.hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center.large-p.negative-10
|
.hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center.map-p.negative-10
|
||||||
.col-xs-12.col-sm-9.col-md-10
|
.col-xs-12.col-sm-9.col-md-10
|
||||||
li.faded.large-p.negative-10
|
li.faded.map-p.negative-10
|
||||||
a(href="/challenges/#{challenge.dashedName}")
|
a(href="/challenges/#{challenge.dashedName}")
|
||||||
span.capitalize= challenge.type + ': '
|
span.capitalize= challenge.type + ': '
|
||||||
span= challenge.title
|
span= challenge.title
|
||||||
@ -96,13 +125,22 @@ block content
|
|||||||
.hidden-xs.col-sm-3.col-md-2
|
.hidden-xs.col-sm-3.col-md-2
|
||||||
span.negative-10
|
span.negative-10
|
||||||
.col-xs-12.col-sm-9.col-md-10
|
.col-xs-12.col-sm-9.col-md-10
|
||||||
li.large-p.negative-10
|
li.map-p.negative-10
|
||||||
a(href="/challenges/#{challenge.dashedName}")
|
a(href="/challenges/#{challenge.dashedName}")
|
||||||
span.capitalize= challenge.type + ': '
|
span.capitalize= challenge.type + ': '
|
||||||
span= challenge.title
|
span= challenge.title
|
||||||
span.sr-only= " Incomplete"
|
span.sr-only= " Incomplete"
|
||||||
|
|
||||||
//#announcementModal.modal(tabindex='-1')
|
if (challengeBlock.completed === 100)
|
||||||
|
.button-spacer
|
||||||
|
.row
|
||||||
|
.col-xs-12.col-sm-8.col-md-6.col-sm-offset-3.col-md-offset-2.hidden
|
||||||
|
a.btn.btn-lg.btn-block.signup-btn.map-challenge-block-share Section complete. Share your Portfolio with your friends.
|
||||||
|
.hidden(id="#{challengeBlock.name}")
|
||||||
|
script.
|
||||||
|
var username = !{JSON.stringify(user && user.username || '')};
|
||||||
|
var lastCompleted = !{JSON.stringify(lastCompleted || false)}
|
||||||
|
// #announcementModal.modal(tabindex='-1')
|
||||||
// .modal-dialog.animated.fadeInUp.fast-animation
|
// .modal-dialog.animated.fadeInUp.fast-animation
|
||||||
// .modal-content
|
// .modal-content
|
||||||
// .modal-header.challenge-list-header Add us to your LinkedIn profile
|
// .modal-header.challenge-list-header Add us to your LinkedIn profile
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
//
|
|
||||||
Created by nathanleniz on 5/19/15.
|
|
||||||
|
|
||||||
extends ../layout-wide
|
|
||||||
block content
|
|
||||||
script.
|
|
||||||
var stuff = !{JSON.stringify(stuff)};
|
|
||||||
var challengeMapWithIds = !{JSON.stringify(stuffWithIds)};
|
|
||||||
|
|
@ -11,60 +11,22 @@ block content
|
|||||||
link(rel='stylesheet', href='/js/lib/codemirror/lib/codemirror.css')
|
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/addon/lint/lint.css')
|
||||||
link(rel='stylesheet', href='/js/lib/codemirror/theme/monokai.css')
|
link(rel='stylesheet', href='/js/lib/codemirror/theme/monokai.css')
|
||||||
link(rel="stylesheet", href="//fonts.googleapis.com/css?family=Ubuntu+Mono")
|
link(rel='stylesheet', href='/css/ubuntu.css')
|
||||||
script(type='text/javascript', src='/js/lib/codemirror/mode/javascript/javascript.js')
|
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/jailed/jailed.js')
|
||||||
|
|
||||||
.row(ng-controller="pairedWithController")
|
.row(ng-controller="pairedWithController")
|
||||||
.col-xs-12.col-sm-12.col-md-4.col-lg-3
|
.col-md-4.col-lg-3
|
||||||
.scroll-locker(id = "scroll-locker")
|
.scroll-locker(id = "scroll-locker")
|
||||||
.innerMarginFix(style=' width: 99%')
|
.innerMarginFix(style=' width: 99%')
|
||||||
#testCreatePanel.well
|
#testCreatePanel.well
|
||||||
h3.text-center.negative-10= name
|
h3.text-center.negative-10= name
|
||||||
.positive-15.positive-15-bottom
|
|
||||||
h4.text-center.bonfire-flames Difficulty: 
|
|
||||||
if (difficulty == "0")
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
if (difficulty == "1")
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
if (difficulty == "2")
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
if (difficulty == "3")
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
if (difficulty == "4")
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame-outline
|
|
||||||
if (difficulty == "5")
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame
|
|
||||||
i.ion-ios-flame
|
|
||||||
.row
|
.row
|
||||||
.col-xs-12
|
.col-xs-12
|
||||||
.bonfire-instructions
|
.bonfire-instructions
|
||||||
for sentence in details
|
for sentence in details
|
||||||
p.wrappable.negative-10!= sentence
|
p.wrappable.negative-10!= sentence
|
||||||
.negative-bottom-margin-30
|
.negative-30-bottom
|
||||||
#MDN-links
|
#MDN-links
|
||||||
p.negative-10 Here are some helpful links:
|
p.negative-10 Here are some helpful links:
|
||||||
for link, index in MDNlinks
|
for link, index in MDNlinks
|
||||||
@ -82,7 +44,7 @@ block content
|
|||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
| Username not found
|
| Username not found
|
||||||
label.negative-10.btn.btn-primary.btn-block#submitButton
|
label.negative-10.btn.btn-primary.btn-block.btn-lg#submitButton
|
||||||
i.fa.fa-play
|
i.fa.fa-play
|
||||||
| Run tests (ctrl + enter)
|
| Run tests (ctrl + enter)
|
||||||
.button-spacer
|
.button-spacer
|
||||||
@ -93,14 +55,15 @@ block content
|
|||||||
label.btn.btn-success#trigger-help-modal
|
label.btn.btn-success#trigger-help-modal
|
||||||
i.fa.fa-medkit
|
i.fa.fa-medkit
|
||||||
| Help
|
| Help
|
||||||
label.btn.btn-success#trigger-pair-modal
|
|
||||||
i.fa.fa-user-plus
|
|
||||||
| Pair
|
|
||||||
label.btn.btn-success#trigger-issue-modal
|
label.btn.btn-success#trigger-issue-modal
|
||||||
i.fa.fa-bug
|
i.fa.fa-bug
|
||||||
| Bug
|
| Bug
|
||||||
|
if (!user)
|
||||||
|
.button-spacer
|
||||||
|
a.btn.signup-btn.btn-block.btn-block(href='/login') Sign in so you can save your progress
|
||||||
|
script.
|
||||||
|
var userLoggedIn = false;
|
||||||
.button-spacer
|
.button-spacer
|
||||||
|
|
||||||
form.code
|
form.code
|
||||||
.form-group.codeMirrorView
|
.form-group.codeMirrorView
|
||||||
textarea#codeOutput(style='display: none;')
|
textarea#codeOutput(style='display: none;')
|
||||||
@ -114,10 +77,11 @@ block content
|
|||||||
var challenge_Name = !{JSON.stringify(name)};
|
var challenge_Name = !{JSON.stringify(name)};
|
||||||
var started = Math.floor(Date.now());
|
var started = Math.floor(Date.now());
|
||||||
var challengeType = !{JSON.stringify(challengeType)};
|
var challengeType = !{JSON.stringify(challengeType)};
|
||||||
|
var dashedName = !{JSON.stringify(dashedName)};
|
||||||
var _ = R;
|
var _ = R;
|
||||||
var dashed = !{JSON.stringify(dashedName)};
|
var dashed = !{JSON.stringify(dashedName)};
|
||||||
|
|
||||||
.col-xs-12.col-sm-12.col-md-8
|
.col-md-8.col-lg-9
|
||||||
.editorScrollDiv(style = "overflow-y: auto; overflow-x: hidden;")
|
.editorScrollDiv(style = "overflow-y: auto; overflow-x: hidden;")
|
||||||
#mainEditorPanel
|
#mainEditorPanel
|
||||||
form.code
|
form.code
|
||||||
@ -128,7 +92,7 @@ block content
|
|||||||
editor.setOption("mode", "javascript");
|
editor.setOption("mode", "javascript");
|
||||||
|
|
||||||
#complete-courseware-dialog.modal(tabindex='-1')
|
#complete-courseware-dialog.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.zoomIn.fast-animation
|
.modal-dialog.animated.fadeIn.fast-animation
|
||||||
.modal-content
|
.modal-content
|
||||||
.modal-header.challenge-list-header= compliment
|
.modal-header.challenge-list-header= compliment
|
||||||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||||
@ -140,14 +104,13 @@ block content
|
|||||||
.spacer
|
.spacer
|
||||||
.row
|
.row
|
||||||
if (user)
|
if (user)
|
||||||
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to next challenge
|
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter)
|
||||||
|
|
||||||
if (user.progressTimestamps.length > 2)
|
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")
|
a.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  
|
i.fa.fa-twitter  
|
||||||
= phrase
|
= phrase
|
||||||
else
|
else
|
||||||
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge
|
||||||
#reset-modal.modal(tabindex='-1')
|
#reset-modal.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.fadeInUp.fast-animation
|
.modal-dialog.animated.fadeInUp.fast-animation
|
||||||
.modal-content
|
.modal-content
|
||||||
@ -163,4 +126,3 @@ block content
|
|||||||
if (!MDNlinks.length) {
|
if (!MDNlinks.length) {
|
||||||
$('#MDN-links').addClass('collapse');
|
$('#MDN-links').addClass('collapse');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ block content
|
|||||||
link(rel='stylesheet', href='/js/lib/codemirror/lib/codemirror.css')
|
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/addon/lint/lint.css')
|
||||||
link(rel='stylesheet', href='/js/lib/codemirror/theme/monokai.css')
|
link(rel='stylesheet', href='/js/lib/codemirror/theme/monokai.css')
|
||||||
link(rel="stylesheet", href="http://fonts.googleapis.com/css?family=Ubuntu+Mono")
|
link(rel='stylesheet', href='/css/ubuntu.css')
|
||||||
script(src='/js/lib/codemirror/mode/javascript/javascript.js')
|
script(src='/js/lib/codemirror/mode/javascript/javascript.js')
|
||||||
script(src='/js/lib/jailed/jailed.js')
|
script(src='/js/lib/jailed/jailed.js')
|
||||||
script(src='/js/lib/codemirror/mode/xml/xml.js')
|
script(src='/js/lib/codemirror/mode/xml/xml.js')
|
||||||
@ -19,7 +19,7 @@ block content
|
|||||||
script(src='/js/lib/codemirror/mode/htmlmixed/htmlmixed.js')
|
script(src='/js/lib/codemirror/mode/htmlmixed/htmlmixed.js')
|
||||||
script(src='/js/lib/codemirror/addon/emmet/emmet.js')
|
script(src='/js/lib/codemirror/addon/emmet/emmet.js')
|
||||||
.row.courseware-height
|
.row.courseware-height
|
||||||
.col-xs-12.col-sm-12.col-md-3.col-lg-3
|
.col-md-3.col-lg-3
|
||||||
.scroll-locker(id = "scroll-locker")
|
.scroll-locker(id = "scroll-locker")
|
||||||
.innerMarginFix(style = "width: 99%;")
|
.innerMarginFix(style = "width: 99%;")
|
||||||
.well
|
.well
|
||||||
@ -30,24 +30,23 @@ block content
|
|||||||
for sentence in details
|
for sentence in details
|
||||||
p.wrappable.negative-10!= sentence
|
p.wrappable.negative-10!= sentence
|
||||||
.negative-bottom-margin-30
|
.negative-bottom-margin-30
|
||||||
label.negative-10.btn.btn-primary.btn-block#submitButton
|
label.negative-10.btn.btn-primary.btn-lg.btn-block#submitButton
|
||||||
i.fa.fa-play
|
i.fa.fa-play
|
||||||
| Run tests (ctrl + enter)
|
| Run tests (ctrl + enter)
|
||||||
if (user)
|
.button-spacer
|
||||||
.button-spacer
|
.btn-group.input-group.btn-group-justified
|
||||||
.btn-group.input-group.btn-group-justified
|
label.btn.btn-success#trigger-reset-modal
|
||||||
label.btn.btn-success#trigger-reset-modal
|
i.fa.fa-refresh
|
||||||
i.fa.fa-refresh
|
| Reset
|
||||||
| Reset
|
label.btn.btn-success#trigger-help-modal
|
||||||
label.btn.btn-success#trigger-help-modal
|
i.fa.fa-medkit
|
||||||
i.fa.fa-medkit
|
| Help
|
||||||
| Help
|
label.btn.btn-success#trigger-issue-modal
|
||||||
label.btn.btn-success#trigger-issue-modal
|
i.fa.fa-bug
|
||||||
i.fa.fa-bug
|
| Bug
|
||||||
| Bug
|
script.
|
||||||
script.
|
var userLoggedIn = true;
|
||||||
var userLoggedIn = true;
|
if (!user)
|
||||||
else
|
|
||||||
.button-spacer
|
.button-spacer
|
||||||
a.btn.signup-btn.btn-block.btn-block(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.
|
||||||
@ -62,9 +61,10 @@ block content
|
|||||||
var challenge_Id = !{JSON.stringify(challengeId)};
|
var challenge_Id = !{JSON.stringify(challengeId)};
|
||||||
var challenge_Name = !{JSON.stringify(name)};
|
var challenge_Name = !{JSON.stringify(name)};
|
||||||
var prodOrDev = !{JSON.stringify(environment)};
|
var prodOrDev = !{JSON.stringify(environment)};
|
||||||
|
var dashedName = !{JSON.stringify(dashedName)};
|
||||||
var challengeType = !{JSON.stringify(challengeType)};
|
var challengeType = !{JSON.stringify(challengeType)};
|
||||||
var started = Math.floor(Date.now());
|
var started = Math.floor(Date.now());
|
||||||
.col-xs-12.col-sm-12.col-md-5.col-lg-6
|
.col-md-5.col-lg-6
|
||||||
.editorScrollDiv(style = "overflow-y: auto; overflow-x: hidden;")
|
.editorScrollDiv(style = "overflow-y: auto; overflow-x: hidden;")
|
||||||
#mainEditorPanel
|
#mainEditorPanel
|
||||||
form.code
|
form.code
|
||||||
@ -79,7 +79,7 @@ block content
|
|||||||
iframe.iphone.iframe-scroll#preview
|
iframe.iphone.iframe-scroll#preview
|
||||||
.spacer
|
.spacer
|
||||||
#complete-courseware-dialog.modal(tabindex='-1')
|
#complete-courseware-dialog.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.zoomIn.fast-animation
|
.modal-dialog.animated.fadeIn.fast-animation
|
||||||
.modal-content
|
.modal-content
|
||||||
.modal-header.challenge-list-header
|
.modal-header.challenge-list-header
|
||||||
= compliment
|
= compliment
|
||||||
@ -91,7 +91,7 @@ block content
|
|||||||
span.completion-icon.ion-checkmark-circled.text-primary
|
span.completion-icon.ion-checkmark-circled.text-primary
|
||||||
.spacer
|
.spacer
|
||||||
if(user)
|
if(user)
|
||||||
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to next challenge
|
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter)
|
||||||
else
|
else
|
||||||
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge
|
||||||
include ../partials/challenge-modals
|
include ../partials/challenge-modals
|
||||||
|
@ -10,11 +10,11 @@ block content
|
|||||||
link(rel='stylesheet', href='/js/lib/codemirror/lib/codemirror.css')
|
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/addon/lint/lint.css')
|
||||||
link(rel='stylesheet', href='/js/lib/codemirror/theme/monokai.css')
|
link(rel='stylesheet', href='/js/lib/codemirror/theme/monokai.css')
|
||||||
link(rel="stylesheet", href="//fonts.googleapis.com/css?family=Ubuntu+Mono")
|
link(rel='stylesheet', href='/css/ubuntu.css')
|
||||||
script(type='text/javascript', src='/js/lib/codemirror/mode/javascript/javascript.js')
|
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/jailed/jailed.js')
|
||||||
.row(ng-controller="pairedWithController")
|
.row(ng-controller="pairedWithController")
|
||||||
.col-xs-12.col-sm-12.col-md-4.col-lg-3
|
.col-md-4.col-lg-3
|
||||||
.scroll-locker(id = "scroll-locker")
|
.scroll-locker(id = "scroll-locker")
|
||||||
.innerMarginFix(style = "width: 99%;")
|
.innerMarginFix(style = "width: 99%;")
|
||||||
#testCreatePanel.well
|
#testCreatePanel.well
|
||||||
@ -35,7 +35,7 @@ block content
|
|||||||
.form-group.text-center.negative-10
|
.form-group.text-center.negative-10
|
||||||
.col-xs-12
|
.col-xs-12
|
||||||
// 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
|
||||||
label.negative-10.btn.btn-primary.btn-block#submitButton
|
label.negative-10.btn.btn-primary.btn-lg.btn-block#submitButton
|
||||||
i.fa.fa-play
|
i.fa.fa-play
|
||||||
| Run tests (ctrl + enter)
|
| Run tests (ctrl + enter)
|
||||||
.button-spacer
|
.button-spacer
|
||||||
@ -49,6 +49,11 @@ block content
|
|||||||
label.btn.btn-success#trigger-issue-modal
|
label.btn.btn-success#trigger-issue-modal
|
||||||
i.fa.fa-bug
|
i.fa.fa-bug
|
||||||
| Bug
|
| Bug
|
||||||
|
if (!user)
|
||||||
|
.button-spacer
|
||||||
|
a.btn.signup-btn.btn-block.btn-block(href='/login') Sign in so you can save your progress
|
||||||
|
script.
|
||||||
|
var userLoggedIn = false;
|
||||||
.button-spacer
|
.button-spacer
|
||||||
form.code
|
form.code
|
||||||
.form-group.codeMirrorView
|
.form-group.codeMirrorView
|
||||||
@ -61,11 +66,12 @@ block content
|
|||||||
var challengeSeed = !{JSON.stringify(challengeSeed)};
|
var challengeSeed = !{JSON.stringify(challengeSeed)};
|
||||||
var challenge_Id = !{JSON.stringify(challengeId)};
|
var challenge_Id = !{JSON.stringify(challengeId)};
|
||||||
var challenge_Name = !{JSON.stringify(name)};
|
var challenge_Name = !{JSON.stringify(name)};
|
||||||
|
var dashedName = !{JSON.stringify(dashedName)};
|
||||||
var started = Math.floor(Date.now());
|
var started = Math.floor(Date.now());
|
||||||
var challengeType = !{JSON.stringify(challengeType)};
|
var challengeType = !{JSON.stringify(challengeType)};
|
||||||
var _ = R;
|
var _ = R;
|
||||||
var dashed = !{JSON.stringify(dashedName)};
|
var dashed = !{JSON.stringify(dashedName)};
|
||||||
.col-xs-12.col-sm-12.col-md-8
|
.col-md-8.col-lg-9
|
||||||
.editorScrollDiv(style = "overflow-y: auto; overflow-x: hidden;")
|
.editorScrollDiv(style = "overflow-y: auto; overflow-x: hidden;")
|
||||||
#mainEditorPanel
|
#mainEditorPanel
|
||||||
form.code
|
form.code
|
||||||
@ -75,7 +81,7 @@ block content
|
|||||||
script.
|
script.
|
||||||
editor.setOption("mode", "javascript");
|
editor.setOption("mode", "javascript");
|
||||||
#complete-courseware-dialog.modal(tabindex='-1')
|
#complete-courseware-dialog.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.zoomIn.fast-animation
|
.modal-dialog.animated.fadeIn.fast-animation
|
||||||
.modal-content
|
.modal-content
|
||||||
.modal-header.challenge-list-header= compliment
|
.modal-header.challenge-list-header= compliment
|
||||||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||||
@ -87,13 +93,9 @@ block content
|
|||||||
.spacer
|
.spacer
|
||||||
.row
|
.row
|
||||||
if (user)
|
if (user)
|
||||||
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to next challenge
|
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and 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
|
else
|
||||||
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge
|
||||||
include ../partials/challenge-modals
|
include ../partials/challenge-modals
|
||||||
script.
|
script.
|
||||||
var MDNlinks = !{JSON.stringify(MDNlinks)};
|
var MDNlinks = !{JSON.stringify(MDNlinks)};
|
||||||
|
39
server/views/coursewares/showStep.jade
Normal file
39
server/views/coursewares/showStep.jade
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
extends ../layout-wide
|
||||||
|
block content
|
||||||
|
.row
|
||||||
|
.col-md-8.col-md-offset-2
|
||||||
|
.jumbotron
|
||||||
|
for step, index in description
|
||||||
|
.thumbnail.challenge-step(class=index !== 0 ? 'hidden': '')
|
||||||
|
img.gif-block.img-center.img-responsive.thumbnail(src='#{step[0]}' alt='#{step[1]}')
|
||||||
|
.caption
|
||||||
|
p.large-p= step[2]
|
||||||
|
if step[3]
|
||||||
|
a.btn.btn-block.btn-primary.challenge-step-btn-action(href='#{step[3]}' target='_blank') Go To Link
|
||||||
|
if index + 1 === description.length
|
||||||
|
.btn.btn-block.btn-primary.challenge-step-btn-finish(id='last' class=step[3] ? 'disabled' : '') Finish challenge
|
||||||
|
else
|
||||||
|
.btn.btn-block.btn-primary.challenge-step-btn-next(id='#{index}' class=step[3] ? 'disabled' : '') Go to my next step
|
||||||
|
#challenge-step-modal.modal(tabindex='-1')
|
||||||
|
.modal-dialog.animated.fadeIn.fast-animation
|
||||||
|
.modal-content
|
||||||
|
.modal-header.challenge-list-header= compliment
|
||||||
|
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||||
|
.modal-body
|
||||||
|
.text-center
|
||||||
|
#checkmark-container.row
|
||||||
|
#challenge-checkmark.animated.zoomInDown.delay-half
|
||||||
|
span.completion-icon.ion-checkmark-circled.text-primary
|
||||||
|
.spacer
|
||||||
|
.row
|
||||||
|
if (user)
|
||||||
|
#challenge-step-btn-submit.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter)
|
||||||
|
else
|
||||||
|
a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge
|
||||||
|
script(src=rev('/js', 'commonFramework.js'))
|
||||||
|
script.
|
||||||
|
var common = common || { init: [] };
|
||||||
|
common.challengeId = !{JSON.stringify(challengeId)};
|
||||||
|
common.challengeName = !{JSON.stringify(name)};
|
||||||
|
common.challengeType = 7;
|
||||||
|
common.dashedName = !{JSON.stringify(dashedName || '')};
|
@ -15,21 +15,23 @@ block content
|
|||||||
.col-xs-12.col-sm-12.col-md-8
|
.col-xs-12.col-sm-12.col-md-8
|
||||||
.embed-responsive.embed-responsive-16by9
|
.embed-responsive.embed-responsive-16by9
|
||||||
iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')
|
iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')
|
||||||
br
|
.spacer
|
||||||
if (user)
|
if (user)
|
||||||
a.btn.btn-primary.btn-big.btn-block#completed-courseware-editorless I've completed this challenge (ctrl + enter)
|
a.btn.btn-primary.btn-big.btn-block#completed-courseware-editorless I've completed this challenge (ctrl + enter)
|
||||||
|
else
|
||||||
|
a.btn.btn-big.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) I've completed this challenge (ctrl + enter)
|
||||||
script.
|
script.
|
||||||
var userLoggedIn = true;
|
var userLoggedIn = true;
|
||||||
|
.button-spacer
|
||||||
|
.btn-group.input-group.btn-group-justified
|
||||||
|
.btn.btn-success.btn-big#trigger-help-modal
|
||||||
|
i.fa.fa-medkit
|
||||||
|
| Get help
|
||||||
|
.btn.btn-success.btn-big#trigger-issue-modal
|
||||||
|
i.fa.fa-bug
|
||||||
|
| Report a bug
|
||||||
|
if (!user)
|
||||||
.button-spacer
|
.button-spacer
|
||||||
.btn-group.input-group.btn-group-justified
|
|
||||||
.btn.btn-success.btn-big#trigger-help-modal-modal
|
|
||||||
i.fa.fa-medkit
|
|
||||||
| Get help
|
|
||||||
.btn.btn-success.btn-big#trigger-issue-modal
|
|
||||||
i.fa.fa-bug
|
|
||||||
| Report a bug
|
|
||||||
.button-spacer
|
|
||||||
else
|
|
||||||
a.btn.btn-big.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
a.btn.btn-big.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
||||||
script.
|
script.
|
||||||
var userLoggedIn = false;
|
var userLoggedIn = false;
|
||||||
@ -55,31 +57,25 @@ block content
|
|||||||
};
|
};
|
||||||
|
|
||||||
#complete-courseware-editorless-dialog.modal(tabindex='-1')
|
#complete-courseware-editorless-dialog.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.zoomIn.fast-animation
|
.modal-dialog.animated.fadeIn.fast-animation
|
||||||
.modal-content
|
.modal-content
|
||||||
.modal-header.challenge-list-header= compliment
|
.modal-header.challenge-list-header= compliment
|
||||||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||||
.modal-body(ng-controller="pairedWithController")
|
.modal-body(ng-controller="pairedWithController")
|
||||||
.text-center
|
.text-center
|
||||||
.animated.zoomInDown.delay-half
|
.animated.zoomInDown
|
||||||
span.completion-icon.ion-checkmark-circled.text-primary
|
span.completion-icon.ion-checkmark-circled.text-primary
|
||||||
if (user)
|
if (user)
|
||||||
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf) On to my next challenge (ctrl + enter)
|
a.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf) I've completed this challenge (ctrl + enter)
|
||||||
script.
|
script.
|
||||||
$('#complete-courseware-editorless-dialog').bind('keypress', modalControlEnterHandler);
|
$('#complete-courseware-editorless-dialog').bind('keypress', modalControlEnterHandler);
|
||||||
|
|
||||||
if (user.progressTimestamps.length > 2)
|
|
||||||
.button-spacer
|
|
||||||
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")
|
|
||||||
i.fa.fa-twitter  
|
|
||||||
= phrase
|
|
||||||
else
|
else
|
||||||
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) I've completed this challenge (ctrl + enter)
|
||||||
h1 #{name}
|
|
||||||
script.
|
script.
|
||||||
$('body').bind('keypress', controlEnterHandler);
|
$('body').bind('keypress', controlEnterHandler);
|
||||||
script.
|
script.
|
||||||
var challenge_Id = !{JSON.stringify(challengeId)};
|
var challenge_Id = !{JSON.stringify(challengeId)};
|
||||||
var challenge_Name = !{JSON.stringify(name)};
|
var challenge_Name = !{JSON.stringify(name)};
|
||||||
var challengeType = !{JSON.stringify(challengeType)};
|
var challengeType = !{JSON.stringify(challengeType)};
|
||||||
|
var dashedName = !{JSON.stringify(dashedName)};
|
||||||
include ../partials/challenge-modals
|
include ../partials/challenge-modals
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
extends ../layout-wide
|
extends ../layout-wide
|
||||||
block content
|
block content
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-12.col-md-4.bonfire-top
|
.col-md-4.bonfire-top
|
||||||
h1.text-center= name
|
h1.text-center= name
|
||||||
.well
|
.well
|
||||||
h4
|
h4
|
||||||
@ -12,28 +12,27 @@ block content
|
|||||||
input(type='checkbox' class='challenge-list-checkbox')
|
input(type='checkbox' class='challenge-list-checkbox')
|
||||||
.col-xs-9.col-sm-11.col-md-10
|
.col-xs-9.col-sm-11.col-md-10
|
||||||
li.step-text.wrappable!= step
|
li.step-text.wrappable!= step
|
||||||
.col-xs-12.col-sm-12.col-md-8
|
.col-md-8
|
||||||
.embed-responsive.embed-responsive-16by9
|
.embed-responsive.embed-responsive-16by9
|
||||||
iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')
|
iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')
|
||||||
br
|
br
|
||||||
if (user)
|
if (user)
|
||||||
a.btn.btn-primary.btn-big.btn-block#completed-zipline-or-basejump I've completed this challenge (ctrl + enter)
|
a.btn.btn-primary.btn-big.btn-block#completed-zipline-or-basejump I've completed this challenge (ctrl + enter)
|
||||||
.button-spacer
|
|
||||||
.btn-group.input-group.btn-group-justified
|
|
||||||
.btn.btn-success.btn-big#trigger-help-modal
|
|
||||||
i.fa.fa-medkit
|
|
||||||
| Help
|
|
||||||
.btn.btn-success.btn-big#trigger-pair-modal
|
|
||||||
i.fa.fa-user-plus
|
|
||||||
| Pair
|
|
||||||
.btn.btn-success.btn-big#trigger-issue-modal
|
|
||||||
i.fa.fa-bug
|
|
||||||
| Bug
|
|
||||||
.button-spacer
|
|
||||||
script.
|
script.
|
||||||
var userLoggedIn = true;
|
var userLoggedIn = true;
|
||||||
else
|
else
|
||||||
a.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
a.btn.btn-big.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge (ctrl + enter)
|
||||||
|
.button-spacer
|
||||||
|
.btn-group.input-group.btn-group-justified
|
||||||
|
.btn.btn-success.btn-big#trigger-help-modal
|
||||||
|
i.fa.fa-medkit
|
||||||
|
| Help
|
||||||
|
.btn.btn-success.btn-big#trigger-issue-modal
|
||||||
|
i.fa.fa-bug
|
||||||
|
| Bug
|
||||||
|
if (!user)
|
||||||
|
.button-spacer
|
||||||
|
a.btn.btn-big.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
||||||
script.
|
script.
|
||||||
var userLoggedIn = false;
|
var userLoggedIn = false;
|
||||||
br
|
br
|
||||||
@ -41,6 +40,7 @@ block content
|
|||||||
var challenge_Id = !{JSON.stringify(challengeId)};
|
var challenge_Id = !{JSON.stringify(challengeId)};
|
||||||
var challenge_Name = !{JSON.stringify(name)};
|
var challenge_Name = !{JSON.stringify(name)};
|
||||||
var started = Math.floor(Date.now());
|
var started = Math.floor(Date.now());
|
||||||
|
var dashedName = !{JSON.stringify(dashedName)};
|
||||||
var challengeType = !{JSON.stringify(challengeType)};
|
var challengeType = !{JSON.stringify(challengeType)};
|
||||||
var controlEnterHandler = function (e) {
|
var controlEnterHandler = function (e) {
|
||||||
$('body').unbind('keypress');
|
$('body').unbind('keypress');
|
||||||
@ -60,18 +60,18 @@ block content
|
|||||||
};
|
};
|
||||||
|
|
||||||
#complete-zipline-or-basejump-dialog.modal(tabindex='-1')
|
#complete-zipline-or-basejump-dialog.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.zoomIn.fast-animation
|
.modal-dialog.animated.fadeIn.fast-animation
|
||||||
.modal-content
|
.modal-content
|
||||||
.modal-header.challenge-list-header= compliment
|
.modal-header.challenge-list-header= compliment
|
||||||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||||
.modal-body(ng-controller="pairedWithController")
|
.modal-body(ng-controller="pairedWithController")
|
||||||
.text-center
|
.text-center
|
||||||
.animated.zoomInDown.delay-half
|
.animated.zoomInDown
|
||||||
span.completion-icon.ion-checkmark-circled.text-primary
|
span.completion-icon.ion-checkmark-circled.text-primary
|
||||||
if (user)
|
if (user)
|
||||||
form.form-horizontal(novalidate='novalidate', name='completedWithForm')
|
form.form-horizontal(novalidate='novalidate', name='completedWithForm')
|
||||||
.form-group.text-center
|
.form-group.text-center
|
||||||
.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
|
||||||
// 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")
|
||||||
@ -87,11 +87,12 @@ block content
|
|||||||
| Username not found
|
| Username not found
|
||||||
|
|
||||||
if (user)
|
if (user)
|
||||||
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf, ng-disabled='completedWithForm.$invalid') Go to my next challenge (ctrl + enter)
|
a.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf, ng-disabled='completedWithForm.$invalid') Go to my next challenge
|
||||||
|
.button-spacer
|
||||||
script.
|
script.
|
||||||
$('#complete-zipline-or-basejump-dialog').on('keypress', modalControlEnterHandler);
|
$('#complete-zipline-or-basejump-dialog').on('keypress', modalControlEnterHandler);
|
||||||
else
|
else
|
||||||
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge
|
||||||
script.
|
script.
|
||||||
$('body').on('keypress', controlEnterHandler);
|
$('body').on('keypress', controlEnterHandler);
|
||||||
include ../partials/challenge-modals
|
include ../partials/challenge-modals
|
||||||
|
@ -3,12 +3,12 @@ block content
|
|||||||
.jumbotron
|
.jumbotron
|
||||||
.text-center
|
.text-center
|
||||||
h1.hug-top Code with Us
|
h1.hug-top Code with Us
|
||||||
h2 Let's learn to code by building projects for nonprofits
|
h2 Let's learn to code and build projects for nonprofits
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-12.col-md-3
|
.col-xs-12.col-sm-12.col-md-3
|
||||||
h3.nowrap Get Connected
|
h3.nowrap Get Connected
|
||||||
img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_connect.svg.gz', alt='Get great references and connections to start your software engineer career')
|
img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_connect.svg.gz', alt='Get great references and connections to start your software engineer career')
|
||||||
p.landing-p Join a community of busy, motivated professionals.
|
p.landing-p Join a community of busy, motivated people.
|
||||||
.col-xs-12.col-sm-12.col-md-3
|
.col-xs-12.col-sm-12.col-md-3
|
||||||
h3.nowrap Learn JavaScript
|
h3.nowrap Learn JavaScript
|
||||||
img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_learn.svg.gz', alt='Learn to code and learn full stack JavaScript')
|
img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_learn.svg.gz', alt='Learn to code and learn full stack JavaScript')
|
||||||
@ -77,18 +77,16 @@ block content
|
|||||||
br
|
br
|
||||||
br
|
br
|
||||||
.big-break
|
.big-break
|
||||||
h2 Why you should join our community right now:
|
h2 Why you should join our open source community right now:
|
||||||
h3.col-xs-offset-0.col-sm-offset-1
|
h3.col-xs-offset-0.col-sm-offset-1
|
||||||
ul.text-left
|
ul.text-left
|
||||||
li.ion-code   We're thousands of professionals. We all learn to code together.
|
li.ion-code   You'll get help in real time from our community chat rooms.
|
||||||
li.ion-code   We're building projects for dozens of nonprofits.
|
li.ion-code   You'll meet up with other coders in your city.
|
||||||
li.ion-code   Our community is 100% free and open source.
|
|
||||||
li.ion-code   You'll learn Full Stack JavaScript and become a Software Engineer.
|
|
||||||
li.ion-code   You'll work through our focused, interactive courses and tutorials.
|
|
||||||
li.ion-code   You'll learn to code at your own pace, in your browser or on your phone.
|
li.ion-code   You'll learn to code at your own pace, in your browser or on your phone.
|
||||||
li.ion-code   You'll become qualified for thousands of jobs currently going unfilled.
|
li.ion-code   You'll work through our focused, interactive courses and tutorials.
|
||||||
li.ion-code   You can get help in real time from our community chat rooms.
|
li.ion-code   You'll learn state-of-the-art full stack JavaScript technologies.
|
||||||
li.ion-code   We all share one common goal: to boost our careers with code.
|
li.ion-code   You'll build projects that help nonprofits carry out their missions more effectively.
|
||||||
|
li.ion-code   You'll assemble a portfolio of real apps used by real people.
|
||||||
.big-break
|
.big-break
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-8.col-sm-offset-2
|
.col-xs-12.col-sm-8.col-sm-offset-2
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
doctype html
|
doctype html
|
||||||
html(ng-app='profileValidation', lang='en')
|
html(ng-app='profileValidation', lang='en')
|
||||||
head
|
head
|
||||||
include partials/universal-head
|
include partials/meta
|
||||||
|
include partials/stylesheets
|
||||||
body.no-top-and-bottom-margins.full-screen-body-background
|
body.no-top-and-bottom-margins.full-screen-body-background
|
||||||
|
include partials/scripts
|
||||||
include partials/navbar
|
include partials/navbar
|
||||||
include partials/flash
|
include partials/flash
|
||||||
block content
|
block content
|
||||||
include partials/footer
|
include partials/footer
|
||||||
include partials/universal-tail
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
doctype html
|
doctype html
|
||||||
html(ng-app='profileValidation', lang='en')
|
html(ng-app='profileValidation', lang='en')
|
||||||
head
|
head
|
||||||
|
include partials/meta
|
||||||
|
include partials/stylesheets
|
||||||
body.top-and-bottom-margins
|
body.top-and-bottom-margins
|
||||||
include partials/universal-head
|
include partials/scripts
|
||||||
include partials/navbar
|
include partials/navbar
|
||||||
.container
|
.container
|
||||||
include partials/flash
|
include partials/flash
|
||||||
block content
|
block content
|
||||||
include partials/footer
|
include partials/footer
|
||||||
include partials/universal-tail
|
|
||||||
|
@ -1,19 +1,5 @@
|
|||||||
#pair-modal.modal(tabindex='-1')
|
|
||||||
.modal-dialog.animated.zoomIn.fast-animation
|
|
||||||
.modal-content
|
|
||||||
.modal-header.challenge-list-header Ready to pair program?
|
|
||||||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
|
||||||
.modal-body.text-center
|
|
||||||
h3 This will take you to our pair programming room where you can request a pair.
|
|
||||||
h3 You'll need  
|
|
||||||
a(href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-install-Screenhero' target='_blank') Screenhero
|
|
||||||
| .
|
|
||||||
h3 Other campers may then message you about pair programming.
|
|
||||||
a.btn.btn-lg.btn-primary.btn-block.close-modal(href='https://gitter.im/FreeCodeCamp/LetsPair', target='_blank') Take me to the pair programming room
|
|
||||||
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
|
||||||
|
|
||||||
#issue-modal.modal(tabindex='-1')
|
#issue-modal.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.zoomIn.fast-animation
|
.modal-dialog.animated.fadeIn.fast-animation
|
||||||
.modal-content
|
.modal-content
|
||||||
.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') ×
|
||||||
@ -25,7 +11,7 @@
|
|||||||
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
|
||||||
|
|
||||||
#help-modal.modal(tabindex='-1')
|
#help-modal.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.zoomIn.fast-animation
|
.modal-dialog.animated.fadeIn.fast-animation
|
||||||
.modal-content
|
.modal-content
|
||||||
.modal-header.challenge-list-header Need some help?
|
.modal-header.challenge-list-header Need some help?
|
||||||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||||
@ -47,3 +33,7 @@
|
|||||||
h3 This will restore your code editor to its original state.
|
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-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
|
a.btn.btn-lg.btn-primary.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
||||||
|
script.
|
||||||
|
if (typeof localStorage !== 'undefined') {
|
||||||
|
localStorage.setItem('currentDashedName', common.dashedName || dashedName || '');
|
||||||
|
}
|
||||||
|
@ -1,29 +1,34 @@
|
|||||||
|
meta(charset='utf-8')
|
||||||
|
meta(http-equiv='X-UA-Compatible', content='IE=edge')
|
||||||
|
meta(name='viewport', content='width=device-width, initial-scale=1.0')
|
||||||
|
meta(name='csrf-token', content=_csrf)
|
||||||
|
title #{title} | Free Code Camp
|
||||||
link(rel='canonical', href='http://freecodecamp.com')
|
link(rel='canonical', href='http://freecodecamp.com')
|
||||||
meta(charset='utf-8')
|
meta(charset='utf-8')
|
||||||
meta(http-equiv='X-UA-Compatible', content='IE=edge')
|
meta(http-equiv='X-UA-Compatible', content='IE=edge')
|
||||||
meta(name='viewport', content='width=device-width, initial-scale=1.0')
|
meta(name='viewport', content='width=device-width, initial-scale=1.0')
|
||||||
meta(name='csrf-token', content=_csrf)
|
meta(name='csrf-token', content=_csrf)
|
||||||
meta(name='keywords', content='learn to code, learn how to code, code, coding, software engineer, software developer, mean stack, pair programming, node.js, angular.js, express.js, mongoDB, coding bootcamp')
|
meta(name='keywords', content='learn to code, learn to program, learn programming, learn javascript, learn coding, code, coding, programming, software engineer, software developer, mean stack, web development, development, engineering, learn node.js, learn angular.js, learn express.js, learn mongoDB, coding bootcamp, javascript, open source')
|
||||||
meta(property="og:title", content="Learn to code")
|
meta(property="og:title", content="Learn to code and build projects for nonprofits")
|
||||||
meta(property="og:site_name", content="Free Code Camp")
|
meta(property="og:site_name", content="Free Code Camp")
|
||||||
meta(name='twitter:widgets:csp', content='on')
|
meta(name='twitter:widgets:csp', content='on')
|
||||||
meta(name='p:domain_verify', content='d0bc047a482c03c24f1168004c2a216a')
|
meta(name='p:domain_verify', content='d0bc047a482c03c24f1168004c2a216a')
|
||||||
meta(property="og:url", content="http://www.freecodecamp.com")
|
meta(property="og:url", content="http://www.freecodecamp.com")
|
||||||
meta(property="og:description", content="Learn to code by helping nonprofits. Build your full stack web development portfolio today.")
|
meta(property="og:description", content="Learn to code and build projects for nonprofits. Build your full stack web development portfolio today.")
|
||||||
meta(property="og:image", content="https://s3.amazonaws.com/freecodecamp/curriculum-diagram-full.jpg")
|
meta(property="og:image", content="https://s3.amazonaws.com/freecodecamp/curriculum-diagram-full.jpg")
|
||||||
meta(property="og:type", content="article")
|
meta(property="og:type", content="article")
|
||||||
meta(property="article:publisher", content="https://www.facebook.com/freecodecamp")
|
meta(property="article:publisher", content="https://www.facebook.com/freecodecamp")
|
||||||
meta(property="article:section", content="Responsive")
|
meta(property="article:section", content="Responsive")
|
||||||
link(rel="publisher", href="https://plus.google.com/+Freecodecamp")
|
link(rel="publisher", href="https://plus.google.com/+Freecodecamp")
|
||||||
link(rel="author", href="https://plus.google.com/+Freecodecamp")
|
link(rel="author", href="https://plus.google.com/+Freecodecamp")
|
||||||
meta(name="description", content="Learn to code by helping nonprofits. Build your full stack web development portfolio today.")
|
meta(name="description", content="Learn to code and build projects for nonprofits. Build your full stack web development portfolio today.")
|
||||||
meta(name="twitter:creator", content="@freecodecamp")
|
meta(name="twitter:creator", content="@freecodecamp")
|
||||||
meta(name="twitter:url", content="http://www.freecodecamp.com")
|
meta(name="twitter:url", content="http://www.freecodecamp.com")
|
||||||
meta(name="twitter:site", content="@freecodecamp")
|
meta(name="twitter:site", content="@freecodecamp")
|
||||||
meta(name="twitter:card", content="summary_large_image")
|
meta(name="twitter:card", content="summary_large_image")
|
||||||
meta(name="twitter:image:src", content="https://s3.amazonaws.com/freecodecamp/curriculum-diagram-full.jpg")
|
meta(name="twitter:image:src", content="https://s3.amazonaws.com/freecodecamp/curriculum-diagram-full.jpg")
|
||||||
meta(name="twitter:title", content="Learn to code by helping nonprofits")
|
meta(name="twitter:title", content="Learn to code and build projects for nonprofits")
|
||||||
meta(name="twitter:description", content="We're a community where you learn to code by helping nonprofits. Build your full stack JavaScript Portfolio today.")
|
meta(name="twitter:description", content="We're an open source community of busy people who learn to code and build projects for nonprofits. Build your full stack web development portfolio today.")
|
||||||
meta(content="a40ee5d5dba3bb091ad783ebd2b1383f", name="p:domain_verify")
|
meta(content="a40ee5d5dba3bb091ad783ebd2b1383f", name="p:domain_verify")
|
||||||
meta(name="msapplication-TileColor", content="#FFFFFF")
|
meta(name="msapplication-TileColor", content="#FFFFFF")
|
||||||
meta(name="msapplication-TileImage", content="/")
|
meta(name="msapplication-TileImage", content="/")
|
||||||
|
@ -7,6 +7,8 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height
|
|||||||
img.img-responsive.nav-logo(src='https://s3.amazonaws.com/freecodecamp/freecodecamp_logo.svg', alt='learn to code javascript at Free Code Camp logo')
|
img.img-responsive.nav-logo(src='https://s3.amazonaws.com/freecodecamp/freecodecamp_logo.svg', alt='learn to code javascript at Free Code Camp logo')
|
||||||
.collapse.navbar-collapse
|
.collapse.navbar-collapse
|
||||||
ul.nav.navbar-nav.navbar-right.hamburger-dropdown
|
ul.nav.navbar-nav.navbar-right.hamburger-dropdown
|
||||||
|
li
|
||||||
|
a.learn-btn(href='#') Learn
|
||||||
li
|
li
|
||||||
a(href='/map') Map
|
a(href='/map') Map
|
||||||
li
|
li
|
||||||
|
@ -1,22 +1,7 @@
|
|||||||
link(rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Lato:400|Inconsolata")
|
script(src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
||||||
|
|
||||||
link(rel="stylesheet" type="text/css" href="/bower_components/cal-heatmap/cal-heatmap.css")
|
|
||||||
|
|
||||||
link(rel='stylesheet', href='/bower_components/font-awesome/css/font-awesome.min.css')
|
|
||||||
|
|
||||||
link(rel='stylesheet', href=rev('/css', 'main.css'))
|
|
||||||
// End **REQUIRED** includes
|
|
||||||
|
|
||||||
include meta
|
|
||||||
title #{title} | Free Code Camp
|
|
||||||
meta(charset='utf-8')
|
|
||||||
meta(http-equiv='X-UA-Compatible', content='IE=edge')
|
|
||||||
meta(name='viewport', content='width=device-width, initial-scale=1.0')
|
|
||||||
meta(name='csrf-token', content=_csrf)
|
|
||||||
script(src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
|
||||||
script.
|
script.
|
||||||
window.jQuery || document.write('<script src="/bower_components/jquery/dist/jquery.min.js"><\/script>');
|
window.jQuery || document.write('<script src="/bower_components/jquery/dist/jquery.min.js"><\/script>');
|
||||||
script(src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.js")
|
script(src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular.js")
|
||||||
script.
|
script.
|
||||||
if (typeof window.angular === 'undefined') {
|
if (typeof window.angular === 'undefined') {
|
||||||
document.write('<script src="/bower_components/angular/angular.min.js"><\/script>');
|
document.write('<script src="/bower_components/angular/angular.min.js"><\/script>');
|
||||||
@ -43,27 +28,12 @@ script.
|
|||||||
script(src=rev('/js', 'main.js'))
|
script(src=rev('/js', 'main.js'))
|
||||||
script(src="/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js")
|
script(src="/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js")
|
||||||
script(src="/bower_components/ramda/dist/ramda.min.js")
|
script(src="/bower_components/ramda/dist/ramda.min.js")
|
||||||
|
script(src='/bower_components/lightbox2/dist/js/lightbox.min.js')
|
||||||
script.
|
script.
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
ga('create', 'UA-55446531-1', 'auto');
|
ga('create', 'UA-55446531-1', 'auto');
|
||||||
ga('require', 'displayfeatures');
|
ga('require', 'displayfeatures');
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
script#inspectletjs(type='text/javascript').
|
|
||||||
window.__insp = window.__insp || [];
|
|
||||||
__insp.push(['wid', 561999918]);
|
|
||||||
(function() {
|
|
||||||
function __ldinsp() {
|
|
||||||
var insp = document.createElement('script');
|
|
||||||
insp.type = 'text/javascript';
|
|
||||||
insp.async = true;
|
|
||||||
insp.id = "inspsync";
|
|
||||||
insp.src = '//cdn.inspectlet.com/inspectlet.js';
|
|
||||||
var x = document.getElementsByTagName('script')[0];
|
|
||||||
x.parentNode.insertBefore(insp, x);
|
|
||||||
}
|
|
||||||
if (window.attachEvent) window.attachEvent('onload', __ldinsp);
|
|
||||||
else window.addEventListener('load', __ldinsp, false);
|
|
||||||
})();
|
|
@ -1,6 +1,5 @@
|
|||||||
script(src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
script(src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
||||||
script(src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js")
|
script(src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js")
|
||||||
link(rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Lato:400|Inconsolata")
|
|
||||||
link(rel='stylesheet', href='/bower_components/font-awesome/css/font-awesome.min.css')
|
link(rel='stylesheet', href='/bower_components/font-awesome/css/font-awesome.min.css')
|
||||||
link(rel='stylesheet', href=rev('/css', 'main.css'))
|
link(rel='stylesheet', href=rev('/css', 'main.css'))
|
||||||
link(rel='stylesheet', href='/css/Vimeo.css')
|
link(rel='stylesheet', href='/css/Vimeo.css')
|
||||||
@ -12,7 +11,7 @@ meta(http-equiv='X-UA-Compatible', content='IE=edge')
|
|||||||
meta(name='viewport', content='width=device-width, initial-scale=1.0')
|
meta(name='viewport', content='width=device-width, initial-scale=1.0')
|
||||||
meta(name='csrf-token', content=_csrf)
|
meta(name='csrf-token', content=_csrf)
|
||||||
script.
|
script.
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
5
server/views/partials/stylesheets.jade
Normal file
5
server/views/partials/stylesheets.jade
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
link(rel='stylesheet', type='text/css' href='/css/lato.css')
|
||||||
|
link(rel="stylesheet" type="text/css" href="/bower_components/cal-heatmap/cal-heatmap.css")
|
||||||
|
link(rel='stylesheet', href='/bower_components/font-awesome/css/font-awesome.min.css')
|
||||||
|
link(rel='stylesheet', href='/bower_components/lightbox2/dist/css/lightbox.css')
|
||||||
|
link(rel='stylesheet', href=rev('/css', 'main.css'))
|
@ -1,189 +0,0 @@
|
|||||||
extends ../layout
|
|
||||||
block content
|
|
||||||
.jumbotron
|
|
||||||
h2.text-center Scroll down and follow along with this 8-minute guide.
|
|
||||||
br
|
|
||||||
| It will help you get the most out of Free Code Camp.
|
|
||||||
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive.thumbnail(src='http://i.imgur.com/RlEk2IF.jpg' alt="a picture of Free Code Camp's 4 benefits: Get connected, Learn JavaScript, Build your Portfolio, Help nonprofits")
|
|
||||||
.caption
|
|
||||||
p.large-p Welcome to Free Code Camp. We're an open source community of busy people who learn to code, then practice by building projects for nonprofits.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/pYsTbjI.jpg' alt='a screenshot of our curriculum alongside a screenshot of our chat room.')
|
|
||||||
.caption
|
|
||||||
p.large-p Learning to code is hard. To succeed, you'll need lots of practice and support. That's why we've created a rigorous curriculum and supportive community.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/D7Y5luw.jpg' alt='A graph of the rate of job growth against growth in computer science degree graduates. There are 1.4 million jobs and only 400 million people to fill them.')
|
|
||||||
.caption
|
|
||||||
p.large-p If you can finish Free Code Camp, you will be able to get a coding job. There are thousands of coding jobs currently going unfilled, and the demand for coders grows every year.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/dLx8nrg.jpg' alt='An illustration showing that you will learn HTML5, CSS3, JavaScript, Databases, Git, Node.js, Angular.js and Agile.')
|
|
||||||
.caption
|
|
||||||
p.large-p During the first 800 hours of Free Code Camp, you'll learn technologies like HTML5, Node.js and databases.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/yXyxbDd.jpg' alt='a screen shot of our nonprofit project directory.')
|
|
||||||
.caption
|
|
||||||
p.large-p During the last 800 hours, you'll build several real-life projects for nonprofits. By the time you finish, you'll have a job-winning portfolio of real apps that people use every day.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/EAR7Lvh.jpg' alt='a screenshot of our one of our Gitter chat rooms.')
|
|
||||||
.caption
|
|
||||||
p.large-p Now let's join Free Code Camp's chat rooms. You can come here any time of day to hang out, ask questions, or find another camper to pair program with. First you'll need a GitHub account.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/FEImaEN.gif' alt='A gif showing you to click the link below to go to GitHub. Fill in the necessary fields and click submit.')
|
|
||||||
.caption
|
|
||||||
p.large-p Try this: 
|
|
||||||
a(href='https://github.com/join' target='_blank') Create an account with GitHub
|
|
||||||
| . Be sure to use your real email address - GitHub will keep this private.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/ALN6zPK.gif' alt='A gif showing you how to click the profile image in the upper right hand corner of GitHub. Upload a photo of yourself or you will continue to use the automatically generated pixel art. Then fill in the remaining form fields and click submit.')
|
|
||||||
.caption
|
|
||||||
p.large-p Try this: 
|
|
||||||
| Click the pixel art in the upper right hand corner of GitHub, then choose settings. Upload a picture of yourself. A picture of your face works best. This is how your fellow campers will see you in our chat rooms, so put your best foot forward. You can add your city and your name if you want.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/OXL3G3n.gif' alt="Click the link below to navigate to Free Code Camp's open-source repository. In the upper right hand corner, you can click the \"star\" button to star this repository.")
|
|
||||||
.caption
|
|
||||||
p.large-p Try this: 
|
|
||||||
a(href='//github.com/freecodecamp/freecodecamp' target='_blank') Go to Free Code Camp's open-source repository
|
|
||||||
|  and "star" it. "Starring" is the GitHub equivalent of "liking" something.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/EZHzKCV.gif' alt='A gif showing you how to click the link below to go to our chat room and click the \"sign in with GitHub\" button. Then you can click into the text input field and type a message to your fellow campers.')
|
|
||||||
.caption
|
|
||||||
p.large-p Try this: 
|
|
||||||
| Now that you have a GitHub account, you can 
|
|
||||||
a(href='https://gitter.im/FreeCodeCamp/FreeCodeCamp' target='_blank') join our main chat room by logging in with GitHub
|
|
||||||
| . Introduce yourself by saying "Hello world!". Tell your fellow campers how you found Free Code Camp. Also tell us why you want to learn to code.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/Ecs5XAd.gif' alt='A gif showing you how you can click the settings button in the upper right hand corner and modify your notification settings.')
|
|
||||||
.caption
|
|
||||||
p.large-p Try this: 
|
|
||||||
| Our chat rooms are extremely active. You should change your settings so you're only notified if someone mentions you.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/T0bGJPe.gif' alt='A gif showing how you can click on a user profile image to initiate a private message with that user.')
|
|
||||||
.caption
|
|
||||||
p.large-p Please note that all of our chat rooms are visible to the public. If you need to share sensitive information, such as an email address or phone number, do it in a private message.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/vDTMJSh.gif' alt='A gif showing that you can tab back and forth between challenges and our chat rooms.')
|
|
||||||
.caption
|
|
||||||
p.large-p Keep our chat room open while you work through our challenges. That way, you can ask for help if you get stuck. You can also socialize with other campers when you feel like taking a break.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/SLQ27Gr.gif' alt='A gif showing how you can click the link below to download a native chat room app for your computer.')
|
|
||||||
.caption
|
|
||||||
p.large-p You can also 
|
|
||||||
a(href='https://gitter.im/apps' target='_blank') download the chat room app
|
|
||||||
|  to your computer or phone.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/DoOqkNW.gif' alt='A gif showing how you can click the "Wiki" button in your upper-right corner to access the wiki.')
|
|
||||||
.caption
|
|
||||||
p.large-p Try this: Click the "Wiki" button in your upper right hand corner. Our community has contributed lots of useful information to this searchable wiki.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/FkEzbto.gif' alt='A gif showing how you can click your profile image in your upper right hand corner to access the account page and connect GitHub.')
|
|
||||||
.caption
|
|
||||||
p.large-p Try this: Check out your portfolio page. Click your picture your upper right hand corner. To activate your portfolio page, you'll need to link your GitHub account with Free Code Camp.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/WKzEr1q.gif' alt='A gif showing how you can access your profile page and hover over different days to see how many brownie points you got on those days.')
|
|
||||||
.caption
|
|
||||||
p.large-p Your portfolio page shows your progress and how many Brownie Points you have. You can get Brownie Points by completing challenges and by helping other campers in our chat rooms. If you get Brownie Points on several days in a row, you'll get a streak.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/nmSiMy1.gif' alt='A gif showing how you can access our Camper News page and click the "upvote" button to upvote a story.')
|
|
||||||
.caption
|
|
||||||
p.large-p Try this: 
|
|
||||||
| Click the "News" button in your upper right hand corner. You can browse links on Camper News and upvote ones that you enjoy.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/Elb3dfj.jpg' alt='A picture of some of our campers meeting in a local cafe. 3 men and 3 women are sitting around a table with laptops out, and are smiling and coding.')
|
|
||||||
.caption
|
|
||||||
p.large-p Our Campsites help you code with campers in your city. You can coordinate study groups or attend local coding events together.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/EZHzKCV.gif' alt="A gif showing how you can click the link below, find your city on the list of Campsites, then click on the Facebook link for your city and join your city's Facebook group.")
|
|
||||||
.caption
|
|
||||||
p.large-p Try this: 
|
|
||||||
a(href='https://github.com/FreeCodeCamp/freecodecamp/wiki/List-of-Free-Code-Camp-city-based-Campsites' target='_blank') Find your city on this list
|
|
||||||
| . Click the "Join group" button to join your city's Facebook group. If your city isn't on this list, 
|
|
||||||
a(href='https://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-create-a-Campsite-for-your-city' target='_blank') follow these directions to create a Facebook group for your city
|
|
||||||
| .
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/3AgvJQg.gif' alt="A gif showing how click the link below, find your city, and click the \"Gitter\" button to join your city's Gitter chat room")
|
|
||||||
.caption
|
|
||||||
p.large-p Try this: 
|
|
||||||
a(href='https://github.com/FreeCodeCamp/freecodecamp/wiki/List-of-Free-Code-Camp-city-based-Campsites' target='_blank') Go back to our list of Campsites 
|
|
||||||
| and click "Gitter" to join your city's chat room.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/P7qfJXt.gif' alt='A gif showing how you can click the link below and fill in the necessary fields to add your Free Code Camp studies to your LinkedIn profile.')
|
|
||||||
.caption
|
|
||||||
p.large-p You can 
|
|
||||||
a(href='https://www.linkedin.com/profile/edit-education?school=Free+Code+Camp' target='_blank') add Free Code Camp to your LinkedIn education background
|
|
||||||
| . Set your graduation date as next year. For "Degree", type "Full Stack Web Development". For "Field of study", type "Computer Software Engineering". Then click "Save Changes".
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/EWWZBag.jpg' alt='An image with the text \"1. Read the error 2. Search Google 3. Ask for help.')
|
|
||||||
.caption
|
|
||||||
p.large-p Let's cover one last thing before you start working through our challenges: how to get help. Any time you get stuck or don't know what to do next: Read-Search-Ask.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/99BfAcK.jpg' alt='An image showing jQuery documentation')
|
|
||||||
.caption
|
|
||||||
p.large-p First, read the documentation or error message. A key skill that good coders have is the ability to interpret and then follow instructions.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/GxvrsFb.gif' alt="A gif showing you how to do an advanced Google search. First, we enter the query \"jquery doesn't run when my page loads\". Then we click search tools button and change the \"Any time\" select box to \"within the last year\". Then we click on a result and read through the article and find our answer.")
|
|
||||||
.caption
|
|
||||||
p.large-p If that didn't help, search Google. Good Google queries take a lot of practice. When you search Google, you usually want to include the language or framework you're using. You also want to limit the results to a recent period.
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/LZYU7p2.gif' alt="A gif showing us following the link below to go to the help chat room and ask \"jquery doesn't run when my page loads\".")
|
|
||||||
.caption
|
|
||||||
p.large-p If that didn't help, ask your friends. If you have trouble, you can ask your fellow campers in our 
|
|
||||||
a(href='https://gitter.im/FreeCodeCamp/Help' target='_blank') help chat room
|
|
||||||
| .
|
|
||||||
|
|
||||||
.big-spacer
|
|
||||||
.thumbnail
|
|
||||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/WsfzvVo.gif' alt='A gif showing us clicking the \"map\" button in our upper right hand corner and browsing our challenge map.')
|
|
||||||
.caption
|
|
||||||
p.large-p Now you're ready to start coding! Click the "Map" button in your upper right hand corner. Our map shows all our coding challenges. We recommend that you complete these from top to bottom, at a sustainable pace.
|
|
@ -1,3 +0,0 @@
|
|||||||
extends ../layout
|
|
||||||
block content
|
|
||||||
iframe(src="https://docs.google.com/forms/d/1b8JYvQ5ibdwwC0owQ9e9EMRlg22O2wbJgqMvPjiILqs/viewform?embedded=true", frameborder="0", marginheight="0", marginwidth="0", width='102%', height=2100, scrolling="no") Loading...
|
|
@ -48,7 +48,7 @@
|
|||||||
(typeof username !== 'undefined' ?
|
(typeof username !== 'undefined' ?
|
||||||
"<button id='" + data[i].id + "' class='btn btn-no-shadow btn-primary btn-block btn-primary-ghost btn-upvote'>upvote</button>" :
|
"<button id='" + data[i].id + "' class='btn btn-no-shadow btn-primary btn-block btn-primary-ghost btn-upvote'>upvote</button>" :
|
||||||
"<a href='/signup' class='btn btn-no-shadow btn-primary btn-block btn-primary-ghost btn-upvote'>upvote</a>") +
|
"<a href='/signup' class='btn btn-no-shadow btn-primary btn-block btn-primary-ghost btn-upvote'>upvote</a>") +
|
||||||
"<a class='btn btn-no-shadow btn-primary btn-block btn-primary-ghost' href='/news/" + linkedName + "'>more info...</a>" +
|
"<a class='btn btn-no-shadow btn-primary btn-block btn-primary-ghost' href='/news/" + linkedName + "'>more info</a>" +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
"<div class='hidden-xs row media-stories'>" +
|
"<div class='hidden-xs row media-stories'>" +
|
||||||
@ -69,7 +69,7 @@
|
|||||||
(typeof username !== 'undefined' ?
|
(typeof username !== 'undefined' ?
|
||||||
"<button id='" + data[i].id + "' class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost btn-upvote'>upvote</button>" :
|
"<button id='" + data[i].id + "' class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost btn-upvote'>upvote</button>" :
|
||||||
"<a href='/signin' class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost'>upvote</a>") +
|
"<a href='/signin' class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost'>upvote</a>") +
|
||||||
" · <a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' href='/news/" + linkedName + "'>more info...</a> · " +
|
" · <a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' href='/news/" + linkedName + "'>more info</a> · " +
|
||||||
rank + (rank > 1 ? " points" : " point") + " · posted " +
|
rank + (rank > 1 ? " points" : " point") + " · posted " +
|
||||||
moment(data[i].timePosted).fromNow() +
|
moment(data[i].timePosted).fromNow() +
|
||||||
" by <a href='/" + data[i].author.username + "'>@" + data[i].author.username + "</a> " +
|
" by <a href='/" + data[i].author.username + "'>@" + data[i].author.username + "</a> " +
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
.row
|
.row
|
||||||
|
.col-xs-12.col-sm-9
|
||||||
|
.input-group
|
||||||
|
input#searchArea.big-text-field.field-responsive.form-control(type='text', placeholder='Search our links')
|
||||||
|
span.input-group-btn
|
||||||
|
button#searchbutton.btn.btn-big.btn-primary.btn-responsive(type='button') Search
|
||||||
|
.spacer
|
||||||
.col-xs-12.col-sm-3
|
.col-xs-12.col-sm-3
|
||||||
span
|
span
|
||||||
a.btn.btn-primary.btn-big.btn-block.btn-responsive(href='/stories/submit' class="#{ page === 'hot' ? '' : 'hidden' }") Submit
|
a.btn.btn-primary.btn-big.btn-block.btn-responsive(href='/stories/submit' class="#{ page === 'hot' ? '' : 'hidden' }") Submit
|
||||||
@ -6,21 +12,6 @@
|
|||||||
a.btn.btn-success.btn-big.btn-block.btn-responsive(href='/news/' class="#{ (page !== 'hot') ? '' : 'hidden' }") All
|
a.btn.btn-success.btn-big.btn-block.btn-responsive(href='/news/' class="#{ (page !== 'hot') ? '' : 'hidden' }") All
|
||||||
.visible-xs
|
.visible-xs
|
||||||
.button-spacer
|
.button-spacer
|
||||||
.col-xs-12.col-sm-9
|
|
||||||
.input-group
|
|
||||||
input#searchArea.big-text-field.field-responsive.form-control(type='text', placeholder='Search our links')
|
|
||||||
span.input-group-btn
|
|
||||||
button#searchbutton.btn.btn-big.btn-primary.btn-responsive(type='button') Search
|
|
||||||
.spacer
|
|
||||||
|
|
||||||
//.spacer
|
|
||||||
//.row
|
|
||||||
// .col-xs-12.col-sm-8.col-sm-offset-2.well
|
|
||||||
// h4.text-center Which other free resources do you use?
|
|
||||||
// img.img-responsive(src='https://www.evernote.com/l/AHRNhlwViM1Kh5qCm6iy7MSWrbdyxYbRkWkB/image.png')
|
|
||||||
// p Link us to your favorite free coding resources.
|
|
||||||
// p Use the headline: "Awesome Free Resource: (the name of the book, podcast, or video series)". We'll publish a list of the 25 most-upvoted resources (and the campers who submitted them) in Wednesday's blog post, and in an upcoming Field Guide article. Also - as always - you'll get 1 point every time someone upvotes your post.
|
|
||||||
//.spacer
|
|
||||||
|
|
||||||
#search-results
|
#search-results
|
||||||
|
|
||||||
@ -53,11 +44,14 @@ script.
|
|||||||
.fail(function (xhr, textStatus, errorThrown) {
|
.fail(function (xhr, textStatus, errorThrown) {
|
||||||
$('#search-results').empty();
|
$('#search-results').empty();
|
||||||
var div = document.createElement("div");
|
var div = document.createElement("div");
|
||||||
$(div).html("<h3 class='negative-35 text-center text-warning dotted-underline'><em>No Results Found</em></h3>");
|
$(div).html("<h3 class='text-center text-warning dotted-underline'><em>No Results Found</em></h3>");
|
||||||
$(div).appendTo($('#search-results'));
|
$(div).appendTo($('#search-results'));
|
||||||
})
|
})
|
||||||
.done(function (data, textStatus, xhr) {
|
.done(function (data, textStatus, xhr) {
|
||||||
$('#search-results').empty();
|
$('#search-results').empty();
|
||||||
|
var spacer = document.createElement('div');
|
||||||
|
$(spacer).html("<div class='spacer'></div>");
|
||||||
|
$(spacer).appendTo($('#search-results'));
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
var linkedName = getLinkedName(data[i].storyLink);
|
var linkedName = getLinkedName(data[i].storyLink);
|
||||||
@ -84,7 +78,7 @@ script.
|
|||||||
"</div>" +
|
"</div>" +
|
||||||
"<div class='col-xs-12'>" +
|
"<div class='col-xs-12'>" +
|
||||||
"<br>" +
|
"<br>" +
|
||||||
"<a class='btn btn-no-shadow btn-primary btn-block btn-primary-ghost' href='/news/" + linkedName + "'>more info...</a>" +
|
"<a class='btn btn-no-shadow btn-primary btn-block btn-primary-ghost' href='/news/" + linkedName + "'>more info</a>" +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
@ -103,7 +97,7 @@ script.
|
|||||||
"</a>" +
|
"</a>" +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
"<div class='story-byline col-xs-12 wrappable'>" +
|
"<div class='story-byline col-xs-12 wrappable'>" +
|
||||||
"<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' href='/news/" + linkedName + "'>more info...</a> · " +
|
"<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' href='/news/" + linkedName + "'>more info</a> · " +
|
||||||
rank + (rank > 1 ? " points" : " point") + " · posted " +
|
rank + (rank > 1 ? " points" : " point") + " · posted " +
|
||||||
moment(data[i].timePosted).fromNow() +
|
moment(data[i].timePosted).fromNow() +
|
||||||
" by <a href='/" + data[i].author.username + "'>@" + data[i].author.username +
|
" by <a href='/" + data[i].author.username + "'>@" + data[i].author.username +
|
||||||
@ -117,7 +111,7 @@ script.
|
|||||||
$(div).appendTo($('#search-results'));
|
$(div).appendTo($('#search-results'));
|
||||||
}
|
}
|
||||||
var hr = document.createElement("div");
|
var hr = document.createElement("div");
|
||||||
$(hr).html("<h3 class='negative-35 text-center text-success dotted-underline'><em>End search results</em></h3>")
|
$(hr).html("<h3 class='text-center text-success dotted-underline'><em>End search results</em></h3>")
|
||||||
$(hr).appendTo($('#search-results'));
|
$(hr).appendTo($('#search-results'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
script.
|
script.
|
||||||
var storyId = !{JSON.stringify(id)};
|
var storyId = !{JSON.stringify(id)};
|
||||||
var originalStoryLink = !{JSON.stringify(originalStoryLink)};
|
var originalStoryLink = !{JSON.stringify(originalStoryLink)};
|
||||||
var originalStoryAuthorEmail = !{JSON.stringify(originalStoryAuthorEmail)};
|
|
||||||
var upVotes = !{JSON.stringify(upVotes)};
|
var upVotes = !{JSON.stringify(upVotes)};
|
||||||
var image = !{JSON.stringify(image)};
|
var image = !{JSON.stringify(image)};
|
||||||
var hasUserVoted = !{JSON.stringify(hasUserVoted)};
|
var hasUserVoted = !{JSON.stringify(hasUserVoted)};
|
||||||
|
Reference in New Issue
Block a user