Merge pull request #7864 from clickthisnick/fix/remove-trailing-spaces
FIX - Remove trailing spaces
@ -2,15 +2,15 @@ language: node_js
|
||||
|
||||
node_js:
|
||||
- '4.2.1'
|
||||
|
||||
|
||||
env:
|
||||
- CXX=g++-4.8
|
||||
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.8
|
||||
|
||||
- g++-4.8
|
||||
|
||||
sudo: false
|
||||
|
@ -107,15 +107,15 @@ Free Code Camp Issue Mods and staff are on hand to assist with Pull Request rela
|
||||
There are two methods of creating a Pull for Free Code Camp:
|
||||
|
||||
- Editing files via the GitHub Interface
|
||||
- Editing files on a local clone
|
||||
- Editing files on a local clone
|
||||
|
||||
**Important: ALWAYS EDIT ON A BRANCH**
|
||||
**Important: ALWAYS EDIT ON A BRANCH**
|
||||
Take away only one thing from this document, it should be this: Never, **EVER** make edits to the `staging` branch. ALWAYS make a new branch BEFORE you edit files. This is critical, because if your PR is not accepted, your copy of staging will be forever sullied and the only way to fix it is to delete your fork and re-fork.
|
||||
|
||||
_**Method 1: Editing via your Local Fork (Recommended)**_
|
||||
_**Method 1: Editing via your Local Fork (Recommended)**_
|
||||
This is the recommended method. Read about How to Setup and Maintain a Local Instance of Free Code Camp.
|
||||
|
||||
1. Perform the maintenance step of rebasing `staging`.
|
||||
1. Perform the maintenance step of rebasing `staging`.
|
||||
2. Ensure you are on the `staging` branch using `git status`:
|
||||
|
||||
```bash
|
||||
@ -127,7 +127,7 @@ nothing to commit, working directory clean
|
||||
```
|
||||
|
||||
3. If you are not on staging or your working directory is not clean, resolve any outstanding files/commits and checkout staging `git checkout staging`
|
||||
4. Create a branch off of `staging` with git: `git checkout -B branch/name-here`
|
||||
4. Create a branch off of `staging` with git: `git checkout -B branch/name-here`
|
||||
**Note:** Branch naming is important. Use a name like `fix/short-fix-description` or `feature/short-feature-description`. Review the [Contribution Guidelines](#contribution-guidelines) for more detail.
|
||||
5. Edit your file(s) locally with the editor of your choice
|
||||
6. Check your `git status` to see unstaged files.
|
||||
@ -137,9 +137,9 @@ nothing to commit, working directory clean
|
||||
10. Push your commits to your GitHub Fork: `git push -u origin branch/name-here`
|
||||
11. Go to [Common Steps](#common-steps)
|
||||
|
||||
_**Method 2: Editing via the GitHub Interface**_
|
||||
_**Method 2: Editing via the GitHub Interface**_
|
||||
|
||||
Note: Editing via the GitHub Interface is not recommended, since it is not possible to update your fork via GitHub's interface without deleting and recreating your fork.
|
||||
Note: Editing via the GitHub Interface is not recommended, since it is not possible to update your fork via GitHub's interface without deleting and recreating your fork.
|
||||
|
||||
Read the [Wiki article](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/How-To-Create-A-Pull-Request-for-Free-Code-Camp#editing-via-the-github-interface) for further information
|
||||
|
||||
@ -147,11 +147,11 @@ Read the [Wiki article](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/How-To
|
||||
1. Once the edits have been committed, you will be prompted to create a pull request on your fork's Github Page.
|
||||
2. By default, all pull requests should be against the FCC main repo, `staging` branch.
|
||||
3. Submit a [pull request](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Pull-Request-Contribute) from your branch to Free Code Camp's `staging` branch.
|
||||
3. The title (also called the subject) of your PR should be descriptive of your changes and succinctly indicates what is being fixed.
|
||||
3. The title (also called the subject) of your PR should be descriptive of your changes and succinctly indicates what is being fixed.
|
||||
- **Do not add the issue number in the PR title**.
|
||||
- Examples: `Add Test Cases to Bonfire Drop It` `Correct typo in Waypoint Size Your Images`
|
||||
4. In the body of your PR include a more detailed summary of the changes you made and why.
|
||||
- If the PR is meant to fix an existing bug/issue, then, at the end of your PR's commit message, append the keyword `closes` and #xxxx (where xxxx is the issue number). Example: `closes #1337`.
|
||||
- If the PR is meant to fix an existing bug/issue, then, at the end of your PR's commit message, append the keyword `closes` and #xxxx (where xxxx is the issue number). Example: `closes #1337`.
|
||||
This tells GitHub to close the existing issue, if the PR is merged.
|
||||
5. Indicate if you have tested on a local copy of the site or not.
|
||||
|
||||
@ -159,7 +159,7 @@ Read the [Wiki article](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/How-To
|
||||
|
||||
**If your PR is accepted**
|
||||
|
||||
Once your PR is accepted, you may delete the branch you created to submit it. This keeps your working fork clean.
|
||||
Once your PR is accepted, you may delete the branch you created to submit it. This keeps your working fork clean.
|
||||
|
||||
You can do this with a press of a button on the GitHub PR interface. You can delete the local copy of the branch with: `git branch -D branch/to-delete-name`
|
||||
|
||||
|
@ -97,7 +97,7 @@ iframe.iphone {
|
||||
height: 500px;
|
||||
}
|
||||
@media (min-width: 1200px) and (max-width: 1250px){
|
||||
right: 22px;
|
||||
right: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,6 +108,6 @@ iframe.iphone {
|
||||
z-index: -1;
|
||||
right: -195px;
|
||||
@media (min-width: 1200px) and (max-width: 1250px){
|
||||
right: -207px;
|
||||
right: -207px;
|
||||
}
|
||||
}
|
||||
|
@ -562,4 +562,4 @@
|
||||
<glyph unicode="" horiz-adv-x="1792" />
|
||||
<glyph unicode="" horiz-adv-x="1792" />
|
||||
</font>
|
||||
</defs></svg>
|
||||
</defs></svg>
|
Before Width: | Height: | Size: 306 KiB After Width: | Height: | Size: 306 KiB |
@ -56,30 +56,30 @@
|
||||
animation-timing-function: steps(8, start);
|
||||
}
|
||||
|
||||
.@{ionicons-prefix}loading-a:before {
|
||||
.@{ionicons-prefix}loading-a:before {
|
||||
&:extend(.@{ionicons-prefix}load-a:before);
|
||||
}
|
||||
|
||||
.@{ionicons-prefix}loading-b:before {
|
||||
.@{ionicons-prefix}loading-b:before {
|
||||
&:extend(.@{ionicons-prefix}load-b:before);
|
||||
}
|
||||
|
||||
.@{ionicons-prefix}loading-c:before {
|
||||
.@{ionicons-prefix}loading-c:before {
|
||||
&:extend(.@{ionicons-prefix}load-c:before);
|
||||
}
|
||||
|
||||
.@{ionicons-prefix}loading-d:before {
|
||||
.@{ionicons-prefix}loading-d:before {
|
||||
&:extend(.@{ionicons-prefix}load-d:before);
|
||||
}
|
||||
|
||||
.@{ionicons-prefix}looping:before {
|
||||
.@{ionicons-prefix}looping:before {
|
||||
&:extend(.@{ionicons-prefix}loop:before);
|
||||
}
|
||||
|
||||
.@{ionicons-prefix}refreshing:before {
|
||||
.@{ionicons-prefix}refreshing:before {
|
||||
&:extend(.@{ionicons-prefix}refresh:before);
|
||||
}
|
||||
|
||||
.@{ionicons-prefix}ios7-reloading:before {
|
||||
.@{ionicons-prefix}ios7-reloading:before {
|
||||
&:extend(.@{ionicons-prefix}ios7-reload:before);
|
||||
}
|
||||
|
@ -134,12 +134,12 @@
|
||||
position:absolute;
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.map-accordion {
|
||||
width:700px;
|
||||
margin:155px auto 0;
|
||||
width:700px;
|
||||
margin:155px auto 0;
|
||||
position:relative;
|
||||
#nested {
|
||||
margin:0 10px;
|
||||
@ -256,7 +256,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.map-aside-action-item {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
|
@ -562,4 +562,4 @@
|
||||
<glyph unicode="" horiz-adv-x="1792" />
|
||||
<glyph unicode="" horiz-adv-x="1792" />
|
||||
</font>
|
||||
</defs></svg>
|
||||
</defs></svg>
|
Before Width: | Height: | Size: 306 KiB After Width: | Height: | Size: 306 KiB |
Before Width: | Height: | Size: 326 KiB After Width: | Height: | Size: 326 KiB |
@ -24,20 +24,20 @@
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs45">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</defs><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@ -5,11 +5,11 @@
|
||||
*/
|
||||
|
||||
(function(){
|
||||
|
||||
|
||||
/**
|
||||
* JailedSite object represents a single site in the
|
||||
* communication protocol between the application and the plugin
|
||||
*
|
||||
*
|
||||
* @param {Object} connection a special object allowing to send
|
||||
* and receive messages from the opposite site (basically it
|
||||
* should only provide send() and onMessage() methods)
|
||||
@ -40,7 +40,7 @@
|
||||
/**
|
||||
* Set a handler to be called when the remote site updates its
|
||||
* interface
|
||||
*
|
||||
*
|
||||
* @param {Function} handler
|
||||
*/
|
||||
JailedSite.prototype.onRemoteUpdate = function(handler) {
|
||||
@ -52,7 +52,7 @@
|
||||
* Set a handler to be called when received a responce from the
|
||||
* remote site reporting that the previously provided interface
|
||||
* has been succesfully set as remote for that site
|
||||
*
|
||||
*
|
||||
* @param {Function} handler
|
||||
*/
|
||||
JailedSite.prototype.onInterfaceSetAsRemote = function(handler) {
|
||||
@ -66,7 +66,7 @@
|
||||
* completion without sending additional request, since in fact
|
||||
* 'getInterface' request is only sent by application at the last
|
||||
* step of the plugin initialization
|
||||
*
|
||||
*
|
||||
* @param {Function} handler
|
||||
*/
|
||||
JailedSite.prototype.onGetInterface = function(handler) {
|
||||
@ -85,7 +85,7 @@
|
||||
/**
|
||||
* Sets the interface of this site making it available to the
|
||||
* remote site by sending a message with a set of methods names
|
||||
*
|
||||
*
|
||||
* @param {Object} _interface to set
|
||||
*/
|
||||
JailedSite.prototype.setInterface = function(_interface) {
|
||||
@ -154,7 +154,7 @@
|
||||
|
||||
/**
|
||||
* Sets the new remote interface provided by the other site
|
||||
*
|
||||
*
|
||||
* @param {Array} names list of function names
|
||||
*/
|
||||
JailedSite.prototype._setRemote = function(names) {
|
||||
@ -168,16 +168,16 @@
|
||||
this._remoteUpdateHandler();
|
||||
this._reportRemoteSet();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generates the wrapped function corresponding to a single remote
|
||||
* method. When the generated function is called, it will send the
|
||||
* corresponding message to the remote site asking it to execute
|
||||
* the particular method of its interface
|
||||
*
|
||||
*
|
||||
* @param {String} name of the remote method
|
||||
*
|
||||
*
|
||||
* @returns {Function} wrapped remote method
|
||||
*/
|
||||
JailedSite.prototype._genRemoteMethod = function(name) {
|
||||
@ -207,9 +207,9 @@
|
||||
* Prepares the provided set of remote method arguments for
|
||||
* sending to the remote site, replaces all the callbacks with
|
||||
* identifiers
|
||||
*
|
||||
* @param {Array} args to wrap
|
||||
*
|
||||
*
|
||||
* @param {Array} args to wrap
|
||||
*
|
||||
* @returns {Array} wrapped arguments
|
||||
*/
|
||||
JailedSite.prototype._wrap = function(args) {
|
||||
@ -240,14 +240,14 @@
|
||||
* Unwraps the set of arguments delivered from the remote site,
|
||||
* replaces all callback identifiers with a function which will
|
||||
* initiate sending that callback identifier back to other site
|
||||
*
|
||||
*
|
||||
* @param {Object} args to unwrap
|
||||
*
|
||||
*
|
||||
* @returns {Array} unwrapped args
|
||||
*/
|
||||
JailedSite.prototype._unwrap = function(args) {
|
||||
var called = false;
|
||||
|
||||
|
||||
// wraps each callback so that the only one could be called
|
||||
var once = function(cb) {
|
||||
return function() {
|
||||
@ -261,7 +261,7 @@
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
var result = [];
|
||||
var i, arg, cb, me = this;
|
||||
for (i = 0; i < args.args.length; i++) {
|
||||
@ -278,18 +278,18 @@
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generates the wrapped function corresponding to a single remote
|
||||
* callback. When the generated function is called, it will send
|
||||
* the corresponding message to the remote site asking it to
|
||||
* execute the particular callback previously saved during a call
|
||||
* by the remote site a method from the interface of this site
|
||||
*
|
||||
*
|
||||
* @param {Number} id of the remote callback to execute
|
||||
* @param {Number} argNum argument index of the callback
|
||||
*
|
||||
*
|
||||
* @returns {Function} wrapped remote callback
|
||||
*/
|
||||
JailedSite.prototype._genRemoteCallback = function(id, argNum) {
|
||||
@ -306,7 +306,7 @@
|
||||
return remoteCallback;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sends the notification message and breaks the connection
|
||||
*/
|
||||
@ -314,20 +314,20 @@
|
||||
this._connection.send({type: 'disconnect'});
|
||||
this._connection.disconnect();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set a handler to be called when received a disconnect message
|
||||
* from the remote site
|
||||
*
|
||||
*
|
||||
* @param {Function} handler
|
||||
*/
|
||||
JailedSite.prototype.onDisconnect = function(handler) {
|
||||
this._disconnectHandler = handler;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ReferenceStore is a special object which stores other objects
|
||||
@ -336,17 +336,17 @@
|
||||
* to another Node.js process or a message to the Worker). Other
|
||||
* site may then provide the reference in the responce message
|
||||
* implying the given object should be activated.
|
||||
*
|
||||
*
|
||||
* Primary usage for the ReferenceStore is a storage for the
|
||||
* callbacks, which therefore makes it possible to initiate a
|
||||
* callback execution by the opposite site (which normally cannot
|
||||
* directly execute functions over the communication channel).
|
||||
*
|
||||
*
|
||||
* Each stored object can only be fetched once and is not
|
||||
* available for the second time. Each stored object must be
|
||||
* fetched, since otherwise it will remain stored forever and
|
||||
* consume memory.
|
||||
*
|
||||
*
|
||||
* Stored object indeces are simply the numbers, which are however
|
||||
* released along with the objects, and are later reused again (in
|
||||
* order to postpone the overflow, which should not likely happen,
|
||||
@ -360,7 +360,7 @@
|
||||
|
||||
/**
|
||||
* @function _genId() generates the new reference id
|
||||
*
|
||||
*
|
||||
* @returns {Number} smallest available id and reserves it
|
||||
*/
|
||||
ReferenceStore.prototype._genId = function() {
|
||||
@ -378,7 +378,7 @@
|
||||
/**
|
||||
* Releases the given reference id so that it will be available by
|
||||
* another object stored
|
||||
*
|
||||
*
|
||||
* @param {Number} id to release
|
||||
*/
|
||||
ReferenceStore.prototype._releaseId = function(id) {
|
||||
@ -402,9 +402,9 @@
|
||||
|
||||
/**
|
||||
* Stores the given object and returns the refernce id instead
|
||||
*
|
||||
*
|
||||
* @param {Object} obj to store
|
||||
*
|
||||
*
|
||||
* @returns {Number} reference id of the stored object
|
||||
*/
|
||||
ReferenceStore.prototype.put = function(obj) {
|
||||
@ -416,7 +416,7 @@
|
||||
|
||||
/**
|
||||
* Retrieves previously stored object and releases its reference
|
||||
*
|
||||
*
|
||||
* @param {Number} id of an object to retrieve
|
||||
*/
|
||||
ReferenceStore.prototype.fetch = function(id) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/**
|
||||
* Contains the code executed in the sandboxed frame under web-browser
|
||||
*
|
||||
*
|
||||
* Creates a Web-Worker inside the frame, sets up the communication
|
||||
* between the worker and the parent window
|
||||
*/
|
||||
|
@ -1,26 +1,26 @@
|
||||
|
||||
/**
|
||||
* Core plugin script loaded into the plugin process/thread.
|
||||
*
|
||||
*
|
||||
* Initializes the plugin-site API global methods.
|
||||
*/
|
||||
|
||||
(function(){
|
||||
|
||||
|
||||
// localize
|
||||
var site = new JailedSite(connection);
|
||||
delete JailedSite;
|
||||
delete connection;
|
||||
|
||||
|
||||
site.onGetInterface(function(){
|
||||
launchConnected();
|
||||
});
|
||||
|
||||
|
||||
site.onRemoteUpdate(function(){
|
||||
application.remote = site.getRemote();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Simplified clone of Whenable instance (the object can not be
|
||||
@ -29,7 +29,7 @@
|
||||
*/
|
||||
var connected = false;
|
||||
var connectedHandlers = [];
|
||||
|
||||
|
||||
var launchConnected = function() {
|
||||
if (!connected) {
|
||||
connected = true;
|
||||
@ -40,7 +40,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var checkHandler = function(handler){
|
||||
var type = typeof handler;
|
||||
if (type != 'function') {
|
||||
@ -53,13 +53,13 @@
|
||||
|
||||
return handler;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets a function executed after the connection to the
|
||||
* application is estaplished, and the initial interface-exchange
|
||||
* messaging is completed
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to be called upon initialization
|
||||
*/
|
||||
application.whenConnected = function(handler) {
|
||||
@ -74,15 +74,15 @@
|
||||
|
||||
/**
|
||||
* Sets the plugin interface available to the application
|
||||
*
|
||||
*
|
||||
* @param {Object} _interface to set
|
||||
*/
|
||||
application.setInterface = function(_interface) {
|
||||
site.setInterface(_interface);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Disconnects the plugin from the application (sending
|
||||
* notification message) and destroys itself
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/**
|
||||
* Contains the routines loaded by the plugin process under Node.js
|
||||
*
|
||||
*
|
||||
* Initializes the Node.js environment version of the
|
||||
* platform-dependent connection object for the plugin site
|
||||
*/
|
||||
@ -12,7 +12,7 @@ connection = {};
|
||||
|
||||
/**
|
||||
* Prints error message and its stack
|
||||
*
|
||||
*
|
||||
* @param {Object} msg stack provided by error.stack or a message
|
||||
*/
|
||||
var printError = function(msg) {
|
||||
@ -49,7 +49,7 @@ process.on('message', function(m) {
|
||||
|
||||
/**
|
||||
* Checks if the given path is remote
|
||||
*
|
||||
*
|
||||
* @param {String} path to check
|
||||
* @returns {Boolean} true if path is remote
|
||||
*/
|
||||
@ -76,7 +76,7 @@ var importScript = function(url) {
|
||||
var run = function(code) {
|
||||
executeNormal(code, url, sCb, fCb);
|
||||
}
|
||||
|
||||
|
||||
if (isRemote(url)) {
|
||||
loadRemote(url, run, fCb);
|
||||
} else {
|
||||
@ -109,7 +109,7 @@ var importScriptJailed = function(url) {
|
||||
var run = function(code) {
|
||||
executeJailed(code, url, sCb, fCb);
|
||||
}
|
||||
|
||||
|
||||
if (isRemote(url)) {
|
||||
loadRemote(url, run, fCb);
|
||||
} else {
|
||||
@ -128,7 +128,7 @@ var importScriptJailed = function(url) {
|
||||
/**
|
||||
* Executes the given code in the jailed environment, sends the
|
||||
* corresponding message to the application site when succeeded/failed
|
||||
*
|
||||
*
|
||||
* @param {String} code to execute
|
||||
*/
|
||||
var execute = function(code) {
|
||||
@ -147,7 +147,7 @@ var execute = function(code) {
|
||||
/**
|
||||
* Executes the given code in the current environment / scope, runs
|
||||
* the corresponding callback when done
|
||||
*
|
||||
*
|
||||
* @param {String} code to execute
|
||||
* @param {String} url of the script (for displaying the stack)
|
||||
* @param {Function} sCb
|
||||
@ -168,7 +168,7 @@ var executeNormal = function(code, url, sCb, fCb) {
|
||||
/**
|
||||
* Executes the given code in a jailed environment, runs the
|
||||
* corresponding callback when done
|
||||
*
|
||||
*
|
||||
* @param {String} code to execute
|
||||
* @param {String} url of the script (for displaying the stack)
|
||||
* @param {Function} sCb
|
||||
@ -201,10 +201,10 @@ var executeJailed = function(code, url, sCb, fCb) {
|
||||
|
||||
|
||||
/**
|
||||
* Loads local file and
|
||||
*
|
||||
* Loads local file and
|
||||
*
|
||||
* @param {String} path of the file to read
|
||||
*
|
||||
*
|
||||
* @returns {String} file contents
|
||||
*/
|
||||
var loadLocal = function(path) {
|
||||
@ -215,7 +215,7 @@ var loadLocal = function(path) {
|
||||
/**
|
||||
* Downloads the script by remote url and provides its content as a
|
||||
* string to the callback
|
||||
*
|
||||
*
|
||||
* @param {String} url of the remote module to load
|
||||
* @param {Function} sCb success callback
|
||||
* @param {Function} fCb failure callback
|
||||
@ -262,6 +262,6 @@ var conn = {
|
||||
_messageHandler: function(){},
|
||||
onDisconnect: function() {}
|
||||
};
|
||||
|
||||
|
||||
connection = conn;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/**
|
||||
* Contains the routines loaded by the plugin Worker under web-browser.
|
||||
*
|
||||
*
|
||||
* Initializes the web environment version of the platform-dependent
|
||||
* connection object for the plugin site
|
||||
*/
|
||||
@ -11,7 +11,7 @@ self.connection = {};
|
||||
|
||||
|
||||
(function(){
|
||||
|
||||
|
||||
/**
|
||||
* Event lisener for the plugin message
|
||||
*/
|
||||
@ -59,7 +59,7 @@ self.connection = {};
|
||||
* Executes the given code in a jailed environment. For web
|
||||
* implementation, we're already jailed in the worker, so simply
|
||||
* eval()
|
||||
*
|
||||
*
|
||||
* @param {String} code code to execute
|
||||
*/
|
||||
var execute = function(code) {
|
||||
@ -73,7 +73,7 @@ self.connection = {};
|
||||
self.postMessage({type: 'executeSuccess'});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Connection object provided to the JailedSite constructor,
|
||||
* plugin site implementation for the web-based environment.
|
||||
@ -89,8 +89,8 @@ self.connection = {};
|
||||
_messageHandler: function(){},
|
||||
onDisconnect: function() {}
|
||||
};
|
||||
|
||||
|
||||
connection = conn;
|
||||
|
||||
|
||||
})();
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @fileoverview Jailed - safe yet flexible sandbox
|
||||
* @version 0.2.0
|
||||
*
|
||||
*
|
||||
* @license MIT, see http://github.com/asvd/jailed
|
||||
* Copyright (c) 2014 asvd <heliosframework@gmail.com>
|
||||
*
|
||||
* Copyright (c) 2014 asvd <heliosframework@gmail.com>
|
||||
*
|
||||
* Main library script, the only one to be loaded by a developer into
|
||||
* the application. Other scrips shipped along will be loaded by the
|
||||
* library either here (application site), or into the plugin site
|
||||
@ -44,7 +44,7 @@ if (typeof window == 'undefined') {
|
||||
}
|
||||
}(this, function (exports) {
|
||||
var isNode = typeof window == 'undefined';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A special kind of event:
|
||||
@ -52,7 +52,7 @@ if (typeof window == 'undefined') {
|
||||
* - executes a set of subscribed handlers upon emission;
|
||||
* - if a handler is subscribed after the event was emitted, it
|
||||
* will be invoked immideately.
|
||||
*
|
||||
*
|
||||
* Used for the events which only happen once (or do not happen at
|
||||
* all) during a single plugin lifecycle - connect, disconnect and
|
||||
* connection failure
|
||||
@ -79,14 +79,14 @@ if (typeof window == 'undefined') {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Saves the provided function as a handler for the Whenable
|
||||
* event. This handler will then be called upon the event emission
|
||||
* (if it has not been emitted yet), or will be scheduled for
|
||||
* immediate issue (if the event has already been emmitted before)
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to subscribe for the event
|
||||
*/
|
||||
Whenable.prototype.whenEmitted = function(handler){
|
||||
@ -98,15 +98,15 @@ if (typeof window == 'undefined') {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the provided object is suitable for being subscribed
|
||||
* to the event (= is a function), throws an exception if not
|
||||
*
|
||||
*
|
||||
* @param {Object} obj to check for being subscribable
|
||||
*
|
||||
*
|
||||
* @throws {Exception} if object is not suitable for subscription
|
||||
*
|
||||
*
|
||||
* @returns {Object} the provided object if yes
|
||||
*/
|
||||
Whenable.prototype._checkHandler = function(handler){
|
||||
@ -121,9 +121,9 @@ if (typeof window == 'undefined') {
|
||||
|
||||
return handler;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the library site for Node.js environment (loads
|
||||
* _JailedSite.js)
|
||||
@ -131,8 +131,8 @@ if (typeof window == 'undefined') {
|
||||
var initNode = function() {
|
||||
require('./_JailedSite.js');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the library site for web environment (loads
|
||||
* _JailedSite.js)
|
||||
@ -182,7 +182,7 @@ if (typeof window == 'undefined') {
|
||||
|
||||
|
||||
var BasicConnection;
|
||||
|
||||
|
||||
/**
|
||||
* Creates the platform-dependent BasicConnection object in the
|
||||
* Node.js environment
|
||||
@ -194,7 +194,7 @@ if (typeof window == 'undefined') {
|
||||
* Platform-dependent implementation of the BasicConnection
|
||||
* object, initializes the plugin site and provides the basic
|
||||
* messaging-based connection with it
|
||||
*
|
||||
*
|
||||
* For Node.js the plugin is created as a forked process
|
||||
*/
|
||||
BasicConnection = function() {
|
||||
@ -220,10 +220,10 @@ if (typeof window == 'undefined') {
|
||||
/**
|
||||
* Sets-up the handler to be called upon the BasicConnection
|
||||
* initialization is completed.
|
||||
*
|
||||
*
|
||||
* For Node.js the connection is fully initialized within the
|
||||
* constructor, so simply calls the provided handler.
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to be called upon connection init
|
||||
*/
|
||||
BasicConnection.prototype.whenInit = function(handler) {
|
||||
@ -233,7 +233,7 @@ if (typeof window == 'undefined') {
|
||||
|
||||
/**
|
||||
* Sends a message to the plugin site
|
||||
*
|
||||
*
|
||||
* @param {Object} data to send
|
||||
*/
|
||||
BasicConnection.prototype.send = function(data) {
|
||||
@ -245,7 +245,7 @@ if (typeof window == 'undefined') {
|
||||
|
||||
/**
|
||||
* Adds a handler for a message received from the plugin site
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to call upon a message
|
||||
*/
|
||||
BasicConnection.prototype.onMessage = function(handler) {
|
||||
@ -264,7 +264,7 @@ if (typeof window == 'undefined') {
|
||||
/**
|
||||
* Adds a handler for the event of plugin disconnection
|
||||
* (= plugin process exit)
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to call upon a disconnect
|
||||
*/
|
||||
BasicConnection.prototype.onDisconnect = function(handler) {
|
||||
@ -306,7 +306,7 @@ if (typeof window == 'undefined') {
|
||||
* Platform-dependent implementation of the BasicConnection
|
||||
* object, initializes the plugin site and provides the basic
|
||||
* messaging-based connection with it
|
||||
*
|
||||
*
|
||||
* For the web-browser environment, the plugin is created as a
|
||||
* Worker in a sandbaxed frame
|
||||
*/
|
||||
@ -333,17 +333,17 @@ if (typeof window == 'undefined') {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets-up the handler to be called upon the BasicConnection
|
||||
* initialization is completed.
|
||||
*
|
||||
*
|
||||
* For the web-browser environment, the handler is issued when
|
||||
* the plugin worker successfully imported and executed the
|
||||
* _pluginWeb.js, and replied to the application site with the
|
||||
* initImprotSuccess message.
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to be called upon connection init
|
||||
*/
|
||||
BasicConnection.prototype.whenInit = function(handler) {
|
||||
@ -353,7 +353,7 @@ if (typeof window == 'undefined') {
|
||||
|
||||
/**
|
||||
* Sends a message to the plugin site
|
||||
*
|
||||
*
|
||||
* @param {Object} data to send
|
||||
*/
|
||||
BasicConnection.prototype.send = function(data) {
|
||||
@ -365,7 +365,7 @@ if (typeof window == 'undefined') {
|
||||
|
||||
/**
|
||||
* Adds a handler for a message received from the plugin site
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to call upon a message
|
||||
*/
|
||||
BasicConnection.prototype.onMessage = function(handler) {
|
||||
@ -376,7 +376,7 @@ if (typeof window == 'undefined') {
|
||||
/**
|
||||
* Adds a handler for the event of plugin disconnection
|
||||
* (not used in case of Worker)
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to call upon a disconnect
|
||||
*/
|
||||
BasicConnection.prototype.onDisconnect = function(){};
|
||||
@ -406,7 +406,7 @@ if (typeof window == 'undefined') {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Application-site Connection object constructon, reuses the
|
||||
* platform-dependent BasicConnection declared above in order to
|
||||
@ -454,7 +454,7 @@ if (typeof window == 'undefined') {
|
||||
* Tells the plugin to load a script with the given path, and to
|
||||
* execute it. Callbacks executed upon the corresponding responce
|
||||
* message from the plugin site
|
||||
*
|
||||
*
|
||||
* @param {String} path of a script to load
|
||||
* @param {Function} sCb to call upon success
|
||||
* @param {Function} fCb to call upon failure
|
||||
@ -464,13 +464,13 @@ if (typeof window == 'undefined') {
|
||||
this._importCallbacks[path] = {sCb: sCb||f, fCb: fCb||f};
|
||||
this._platformConnection.send({type: 'import', url: path});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Tells the plugin to load a script with the given path, and to
|
||||
* execute it in the JAILED environment. Callbacks executed upon
|
||||
* the corresponding responce message from the plugin site
|
||||
*
|
||||
*
|
||||
* @param {String} path of a script to load
|
||||
* @param {Function} sCb to call upon success
|
||||
* @param {Function} fCb to call upon failure
|
||||
@ -487,7 +487,7 @@ if (typeof window == 'undefined') {
|
||||
* in the JAILED enviroment. Assuming the execution may only be
|
||||
* requested once by the Plugin object, which means a single set
|
||||
* of callbacks is enough (unlike importing additional scripts)
|
||||
*
|
||||
*
|
||||
* @param {String} code code to execute
|
||||
* @param {Function} sCb to call upon success
|
||||
* @param {Function} fCb to call upon failure
|
||||
@ -501,18 +501,18 @@ if (typeof window == 'undefined') {
|
||||
|
||||
/**
|
||||
* Adds a handler for a message received from the plugin site
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to call upon a message
|
||||
*/
|
||||
Connection.prototype.onMessage = function(handler) {
|
||||
this._messageHandler = handler;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Adds a handler for a disconnect message received from the
|
||||
* plugin site
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to call upon disconnect
|
||||
*/
|
||||
Connection.prototype.onDisconnect = function(handler) {
|
||||
@ -522,7 +522,7 @@ if (typeof window == 'undefined') {
|
||||
|
||||
/**
|
||||
* Sends a message to the plugin
|
||||
*
|
||||
*
|
||||
* @param {Object} data of the message to send
|
||||
*/
|
||||
Connection.prototype.send = function(data) {
|
||||
@ -535,7 +535,7 @@ if (typeof window == 'undefined') {
|
||||
|
||||
/**
|
||||
* Handles import succeeded message from the plugin
|
||||
*
|
||||
*
|
||||
* @param {String} url of a script loaded by the plugin
|
||||
*/
|
||||
Connection.prototype._handleImportSuccess = function(url) {
|
||||
@ -548,7 +548,7 @@ if (typeof window == 'undefined') {
|
||||
|
||||
/**
|
||||
* Handles import failure message from the plugin
|
||||
*
|
||||
*
|
||||
* @param {String} url of a script loaded by the plugin
|
||||
*/
|
||||
Connection.prototype._handleImportFailure = function(url) {
|
||||
@ -572,7 +572,7 @@ if (typeof window == 'undefined') {
|
||||
/**
|
||||
* Plugin constructor, represents a plugin initialized by a script
|
||||
* with the given path
|
||||
*
|
||||
*
|
||||
* @param {String} url of a plugin source
|
||||
* @param {Object} _interface to provide for the plugin
|
||||
*/
|
||||
@ -581,12 +581,12 @@ if (typeof window == 'undefined') {
|
||||
this._initialInterface = _interface||{};
|
||||
this._connect();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* DynamicPlugin constructor, represents a plugin initialized by a
|
||||
* string containing the code to be executed
|
||||
*
|
||||
*
|
||||
* @param {String} code of the plugin
|
||||
* @param {Object} _interface to provide to the plugin
|
||||
*/
|
||||
@ -595,8 +595,8 @@ if (typeof window == 'undefined') {
|
||||
this._initialInterface = _interface||{};
|
||||
this._connect();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Creates the connection to the plugin site
|
||||
*/
|
||||
@ -607,15 +607,15 @@ if (typeof window == 'undefined') {
|
||||
this._connect = new Whenable;
|
||||
this._fail = new Whenable;
|
||||
this._disconnect = new Whenable;
|
||||
|
||||
|
||||
var me = this;
|
||||
|
||||
|
||||
// binded failure callback
|
||||
this._fCb = function(){
|
||||
me._fail.emit();
|
||||
me.disconnect();
|
||||
}
|
||||
|
||||
|
||||
this._connection = new Connection;
|
||||
this._connection.whenInit(function(){
|
||||
me._init();
|
||||
@ -630,7 +630,7 @@ if (typeof window == 'undefined') {
|
||||
DynamicPlugin.prototype._init =
|
||||
Plugin.prototype._init = function() {
|
||||
this._site = new JailedSite(this._connection);
|
||||
|
||||
|
||||
var me = this;
|
||||
this._site.onDisconnect(function() {
|
||||
me._disconnect.emit();
|
||||
@ -660,8 +660,8 @@ if (typeof window == 'undefined') {
|
||||
__jailed__path__+'_pluginCore.js', sCb, this._fCb
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sends to the remote site a signature of the interface provided
|
||||
* upon the Plugin creation
|
||||
@ -677,8 +677,8 @@ if (typeof window == 'undefined') {
|
||||
|
||||
this._site.setInterface(this._initialInterface);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Loads the plugin body (loads the plugin url in case of the
|
||||
* Plugin)
|
||||
@ -691,8 +691,8 @@ if (typeof window == 'undefined') {
|
||||
|
||||
this._connection.importJailedScript(this._path, sCb, this._fCb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Loads the plugin body (executes the code in case of the
|
||||
* DynamicPlugin)
|
||||
@ -705,8 +705,8 @@ if (typeof window == 'undefined') {
|
||||
|
||||
this._connection.execute(this._code, sCb, this._fCb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Requests the remote interface from the plugin (which was
|
||||
* probably set by the plugin during its initialization), emits
|
||||
@ -714,7 +714,7 @@ if (typeof window == 'undefined') {
|
||||
* (meaning both the plugin and the application can use the
|
||||
* interfaces provided to each other)
|
||||
*/
|
||||
DynamicPlugin.prototype._requestRemote =
|
||||
DynamicPlugin.prototype._requestRemote =
|
||||
Plugin.prototype._requestRemote = function() {
|
||||
var me = this;
|
||||
this._site.onRemoteUpdate(function(){
|
||||
@ -725,24 +725,24 @@ if (typeof window == 'undefined') {
|
||||
this._site.requestRemote();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Disconnects the plugin immideately
|
||||
*/
|
||||
DynamicPlugin.prototype.disconnect =
|
||||
DynamicPlugin.prototype.disconnect =
|
||||
Plugin.prototype.disconnect = function() {
|
||||
this._connection.disconnect();
|
||||
this._disconnect.emit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Saves the provided function as a handler for the connection
|
||||
* failure Whenable event
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to be issued upon disconnect
|
||||
*/
|
||||
DynamicPlugin.prototype.whenFailed =
|
||||
DynamicPlugin.prototype.whenFailed =
|
||||
Plugin.prototype.whenFailed = function(handler) {
|
||||
this._fail.whenEmitted(handler);
|
||||
}
|
||||
@ -751,30 +751,30 @@ if (typeof window == 'undefined') {
|
||||
/**
|
||||
* Saves the provided function as a handler for the connection
|
||||
* success Whenable event
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to be issued upon connection
|
||||
*/
|
||||
DynamicPlugin.prototype.whenConnected =
|
||||
DynamicPlugin.prototype.whenConnected =
|
||||
Plugin.prototype.whenConnected = function(handler) {
|
||||
this._connect.whenEmitted(handler);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Saves the provided function as a handler for the connection
|
||||
* failure Whenable event
|
||||
*
|
||||
*
|
||||
* @param {Function} handler to be issued upon connection failure
|
||||
*/
|
||||
DynamicPlugin.prototype.whenDisconnected =
|
||||
DynamicPlugin.prototype.whenDisconnected =
|
||||
Plugin.prototype.whenDisconnected = function(handler) {
|
||||
this._disconnect.whenEmitted(handler);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
exports.Plugin = Plugin;
|
||||
exports.DynamicPlugin = DynamicPlugin;
|
||||
|
||||
|
||||
}));
|
||||
|
||||
|
@ -36,12 +36,12 @@ block content
|
||||
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='/commit')
|
||||
| Edit my pledge
|
||||
.spacer
|
||||
h2.text-center Privacy Settings
|
||||
h2.text-center Privacy Settings
|
||||
.row
|
||||
.col-xs-12.col-sm-8.col-sm-offset-2.col-md-6.col-md-offset-3
|
||||
.row
|
||||
.col-xs-9
|
||||
p.large-p Make all of my solutions private
|
||||
p.large-p Make all of my solutions private
|
||||
br
|
||||
| (this disables your certificates)
|
||||
if (user.isLocked)
|
||||
|
@ -5,7 +5,7 @@ block content
|
||||
h4.text-center.challenge-instructions-title= name
|
||||
if (isCompleted)
|
||||
|
|
||||
i.ion-checkmark-circled.text-primary(title="Completed")
|
||||
i.ion-checkmark-circled.text-primary(title="Completed")
|
||||
hr
|
||||
ol
|
||||
for step, index in description
|
||||
|
@ -1,6 +1,6 @@
|
||||
doctype xml
|
||||
rss(version="2.0", xmlns:atom="http://www.w3.org/2005/Atom")
|
||||
channel
|
||||
channel
|
||||
title= title
|
||||
link= url
|
||||
description= description
|
||||
|
@ -1,15 +1,15 @@
|
||||
extends ../layout
|
||||
block content
|
||||
.row
|
||||
.col-xs-12.col-sm-10.col-sm-offset-1.col-md-6.col-md-offset-3
|
||||
.col-xs-12.col-sm-10.col-sm-offset-1.col-md-6.col-md-offset-3
|
||||
h2.text-center Statistics
|
||||
hr
|
||||
ul.population-table
|
||||
li
|
||||
li
|
||||
span.tag Established:	
|
||||
span.text-primary #{daysRunning}
|
||||
| days ago
|
||||
li
|
||||
li
|
||||
span.tag Population:	
|
||||
span.text-primary #{camperCount}
|
||||
| campers
|
||||
@ -74,7 +74,7 @@ block content
|
||||
a(href="/code-of-conduct") Our code of conduct
|
||||
tr
|
||||
td.text-center
|
||||
i.fa.fa-university
|
||||
i.fa.fa-university
|
||||
td
|
||||
a(href="/academic-honesty") Our academic honesty policy
|
||||
tr
|
||||
|
@ -1,9 +1,9 @@
|
||||
.row
|
||||
.col-xs-12
|
||||
h2 We are retiring Camper News in favor of our
|
||||
h2 We are retiring Camper News in favor of our
|
||||
a(href='http://reddit.com/r/freecodecamp') Subreddit
|
||||
| .
|
||||
h3 Thank you to all of the campers who have contributed links over the past year. We will keep Camper News accessible until May. Our
|
||||
h3 Thank you to all of the campers who have contributed links over the past year. We will keep Camper News accessible until May. Our
|
||||
a(href='http://reddit.com/r/freecodecamp') Subreddit
|
||||
|   is now the best place to share coding-related links.
|
||||
.spacer
|
||||
|
@ -1,7 +1,7 @@
|
||||
import moment from 'moment-timezone';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import {
|
||||
import {
|
||||
prepUniqueDays,
|
||||
calcCurrentStreak,
|
||||
calcLongestStreak
|
||||
|