Rename javascript path from 'minified' to 'javascripts/src'.

Also anticipate requirement of libary modules for plugins.
This commit is contained in:
Chad Weider 2012-03-10 14:52:19 -08:00
parent 652fffe8ea
commit 86d6dde42f
4 changed files with 16 additions and 10 deletions

View File

@ -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;

View File

@ -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('<script type="text/javascript">');
buffer.push(Ace2Editor.EMBEDED[KERNEL_SOURCE]);
@ -166,8 +170,8 @@ function Ace2Editor()
}
function pushScriptsTo(buffer) {
/* Folling is for packaging regular expression. */
/* $$INCLUDE_JS("../minified/ace2_inner.js?callback=require.define"); */
var ACE_SOURCE = '../minified/ace2_inner.js?callback=require.define';
/* $$INCLUDE_JS("../javascripts/src/ace2_inner.js?callback=require.define"); */
var ACE_SOURCE = '../javascripts/src/ace2_inner.js?callback=require.define';
if (Ace2Editor.EMBEDED && Ace2Editor.EMBEDED[ACE_SOURCE]) {
buffer.push('<script type="text/javascript">');
buffer.push(Ace2Editor.EMBEDED[ACE_SOURCE]);

View File

@ -259,12 +259,13 @@
<script type="text/javascript" src="../static/js/require-kernel.js"></script>
<script type="text/javascript" src="../socket.io/socket.io.js"></script>
<script type="text/javascript" src="../minified/pad.js?callback=require.define"></script>
<script type="text/javascript" src="../javascripts/src/pad.js?callback=require.define"></script>
<script type="text/javascript" src="../static/custom/pad.js"></script>
<script type="text/javascript">
var clientVars = {};
(function () {
require.setRootURI("../minified/");
require.setRootURI("../javascripts/src/");
require.setLibraryURI("../javascripts/lib/");
require.setGlobalKeyPath("require");
require('/pad').init();

View File

@ -199,12 +199,13 @@
<script type="text/javascript" src="../../static/js/require-kernel.js"></script>
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
<script type="text/javascript" src="../../minified/timeslider.js?callback=require.define"></script>
<script type="text/javascript" src="../../javascripts/src/timeslider.js?callback=require.define"></script>
<script type="text/javascript" src="../../static/custom/timeslider.js"></script>
<script type="text/javascript" >
var clientVars = {};
(function () {
require.setRootURI("../minified/");
require.setRootURI("../javascripts/src/");
require.setLibraryURI("../javascripts/lib/");
require.setGlobalKeyPath("require");
require('/timeslider').init();