add revisioning to js/css files to break caching

This moves the location of javascript files, commonFramework,
iFrameScript, sandbox, plugin, and all the less files.
On gulp or gulp build these files are moved and revisioned.
Places where they are references in jade/html are now removed and
replaced with the use of a helper function `rev`. This function will
take the required file and return a string referencing the revisioned
file. This should alleviate the need for hard refreshing and will break
caches when files change, so fixes for firefox caching issue as well.

NOTE: @benmcmahon @quincylarson, This means files will need to be build
on the server in production before doing a server restart/reload
In production: 'npm run build' To build and revision js/css files

`gulp` and `gulp build` will used in development

npm install also needs to be run in production on initial deploy
This commit is contained in:
Berkeley Martinez
2015-08-26 23:20:56 -07:00
parent 9a7ee3a549
commit 306c441ae7
130 changed files with 112 additions and 30 deletions

23
client/iFrameScripts.js Normal file
View File

@@ -0,0 +1,23 @@
(function() {
var expect = chai.expect;
var tests = parent.tests;
var editor = parent.editorValueForIFrame;
setTimeout(function() {
for (var i = 0; i < tests.length; i++) {
var thisTest = true;
try {
eval(parent.tests[i]);
} catch (err) {
allTestsGood = false;
thisTest = false;
parent.postError(JSON.stringify(err.message.split(':').shift()));
} finally {
if (thisTest) {
parent.postSuccess(JSON.stringify(tests[i].split(',').pop().replace(
/\'/g, '').replace(/\)/, '')));
}
}
}
}, 10);
})();