diff --git a/README.md b/README.md index 9b0c87d631..91176090b0 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Our campers (students) start by working through our free, self-paced, browser-ba 80% of our campers are over 25, and nearly a fifth of our campers are women. -This code is running live at [FreeCodeCamp.com](http://www.FreeCodeCamp.com). We also have [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp), a [blog](http://blog.freecodecamp.com), and even a [Twitch.tv channel](http://twitch.tv/freecodecamp). +This code is running live at [FreeCodeCamp.com](http://www.FreeCodeCamp.com). We also have [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp), a [blog](http://medium.freecodecamp.com), and even a [Twitch.tv channel](http://twitch.tv/freecodecamp). [Join our community here](http://www.freecodecamp.com/signin). diff --git a/client/commonFramework.js b/client/commonFramework.js index bff815cb1d..cfbb3141e4 100644 --- a/client/commonFramework.js +++ b/client/commonFramework.js @@ -1,31 +1,72 @@ -// common namespace -// all classes should be stored here -var common = common || { - // init is an array of functions that are - // called at the beginning of dom ready - init: [] -}; +var common = (function() { + // common namespace + // all classes should be stored here + var common = window.common || { + // init is an array of functions that are + // called at the beginning of dom ready + init: [] + }; -common.challengeName = common.challengeName || window.challenge_Name ? - window.challenge_Name : - ''; + common.challengeName = common.challengeName || window.challenge_Name ? + window.challenge_Name : + ''; -common.challengeType = common.challengeType || window.challengeType ? - window.challengeType : - 0; + common.challengeType = common.challengeType || window.challengeType ? + window.challengeType : + 0; -common.challengeId = common.challengeId || window.challenge_Id; + common.challengeId = common.challengeId || window.challenge_Id; -common.challengeSeed = common.challengeSeed || window.challengeSeed ? - window.challengeSeed : - []; + common.challengeSeed = common.challengeSeed || window.challengeSeed ? + window.challengeSeed : + []; -common.seed = common.challengeSeed.reduce(function(seed, line) { - return seed + line + '\n'; -}, ''); + common.seed = common.challengeSeed.reduce(function(seed, line) { + return seed + line + '\n'; + }, ''); + + common.replaceScriptTags = function replaceScriptTags(value) { + return value + .replace(/'); + }; + + common.replaceFormActionAttr = function replaceFormAction(value) { + return value.replace(/