From 86d6dde42f3ba5d922955f9e49ccbb8caef2e404 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Sat, 10 Mar 2012 14:52:19 -0800 Subject: [PATCH] Rename javascript path from 'minified' to 'javascripts/src'. Also anticipate requirement of libary modules for plugins. --- node/server.js | 6 +++--- static/js/ace.js | 10 +++++++--- static/pad.html | 5 +++-- static/timeslider.html | 5 +++-- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/node/server.js b/node/server.js index c5377d81..56bdadd4 100644 --- a/node/server.js +++ b/node/server.js @@ -142,9 +142,9 @@ async.waterfall([ gracefulShutdown(); }); - // Cache both minified and static. + // Cache both packaged and static. var assetCache = new CachingMiddleware; - app.all('/(minified|static)/*', assetCache.handle); + app.all('/(javascripts|static)/*', assetCache.handle); // Minify will serve static files compressed (minify enabled). It also has // file-specific hacks for ace/require-kernel/etc. @@ -153,7 +153,7 @@ async.waterfall([ // Setup middleware that will package JavaScript files served by minify for // CommonJS loader on the client-side. var jsServer = new (Yajsml.Server)({ - rootPath: 'minified/' + rootPath: 'javascripts/src' , rootURI: 'http://localhost:' + settings.port + '/static/js/' }); var StaticAssociator = Yajsml.associators.StaticAssociator; diff --git a/static/js/ace.js b/static/js/ace.js index 789aba52..6af42068 100644 --- a/static/js/ace.js +++ b/static/js/ace.js @@ -156,7 +156,11 @@ function Ace2Editor() } function pushRequireScriptTo(buffer) { var KERNEL_SOURCE = '../static/js/require-kernel.js'; - var KERNEL_BOOT = 'require.setRootURI("../minified/");\nrequire.setGlobalKeyPath("require");' + var KERNEL_BOOT = '\ +require.setRootURI("../javascripts/src");\n\ +require.setLibraryURI("../javascripts/lib");\n\ +require.setGlobalKeyPath("require");\n\ +'; if (Ace2Editor.EMBEDED && Ace2Editor.EMBEDED[KERNEL_SOURCE]) { buffer.push(' - + - +