Allow modules to be fetched remotely.

pull/405/head
Chad Weider 2012-01-30 21:49:04 -08:00
parent b5ddba8741
commit 64ae1c433f
3 changed files with 7 additions and 1 deletions

View File

@ -218,9 +218,11 @@ function Ace2Editor()
}
function pushRequireScriptTo(buffer) {
var KERNEL_SOURCE = '../static/js/require-kernel.js';
var KERNEL_BOOT = 'require.setRootURI("../minified/");\nrequire.setGlobalKeyPath("require");'
if (Ace2Editor.EMBEDED && Ace2Editor.EMBEDED[KERNEL_SOURCE]) {
buffer.push('<script type="text/javascript">');
buffer.push(Ace2Editor.EMBEDED[KERNEL_SOURCE]);
buffer.push(KERNEL_BOOT);
buffer.push('<\/script>');
}
}

View File

@ -295,6 +295,8 @@
<script type="text/javascript">
var clientVars = {};
(function () {
require.setRootURI("../minified/");
require.setGlobalKeyPath("require");
require('/pad').init();
/* TODO: These globals shouldn't exist. */

View File

@ -204,7 +204,9 @@
<script type="text/javascript" >
var clientVars = {};
(function () {
var TimeSlider = require('/timeslider').init();
require.setRootURI("../minified/");
require.setGlobalKeyPath("require");
require('/timeslider').init();
/* TODO: These globals shouldn't exist. */
padeditbar = require('/pad_editbar').padeditbar;