summaryrefslogtreecommitdiff
path: root/src/static/js/ace.js
diff options
context:
space:
mode:
authorEgil Moeller <egil.moller@freecode.no>2012-02-28 21:14:31 +0100
committerEgil Moeller <egil.moller@freecode.no>2012-02-28 21:14:31 +0100
commitcf191df0b85f15d20e7f35489e7cab382c7813a2 (patch)
treec98fb9591b21e9ab068938e6103ded5dee82ecb2 /src/static/js/ace.js
parentb20b86cdc8d536be6caa17f1d5feac298c51c852 (diff)
downloadetherpad-lite-cf191df0b85f15d20e7f35489e7cab382c7813a2.zip
So simple, yet so hard to find. Finally I found you, oh error caused by the new require usage...
Diffstat (limited to 'src/static/js/ace.js')
-rw-r--r--src/static/js/ace.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/static/js/ace.js b/src/static/js/ace.js
index 610aa33b..7022b1c5 100644
--- a/src/static/js/ace.js
+++ b/src/static/js/ace.js
@@ -238,7 +238,10 @@ function Ace2Editor()
} else {
file = ACE_SOURCE;
file = file.replace(/^\.\.\/static\/js\//, '../minified/');
- buffer.push('<script type="application/javascript">require = parent.parent.require;<\/script>');
+ buffer.push('<script type="text/javascript" src="../static/js/require-kernel.js"><\/script>');
+ buffer.push('<script type="text/javascript">');
+ buffer.push('require.setRootURI("../minified/"); require.setLibraryURI("../minified/plugins/"); require.setGlobalKeyPath("require");');
+ buffer.push('<\/script>');
buffer.push('<script type="application/javascript" src="' + file + '"><\/script>');
buffer.push('<script type="text/javascript">');
buffer.push('require("ep_etherpad-lite/static/js/ace2_inner");');
@@ -320,10 +323,12 @@ function Ace2Editor()
pushRequireScriptTo(iframeHTML);
// Inject my plugins into my child.
iframeHTML.push('\
+<script type="text/javascript" src="../static/js/require-kernel.js"></script>\
<script type="text/javascript">\
+ require.setRootURI("../minified/"); require.setLibraryURI("../minified/plugins/"); require.setGlobalKeyPath("require");\
require.define("/plugins", null);\n\
require.define("/plugins.js", function (require, exports, module) {\
- module.exports = parent.parent.require("ep_etherpad-lite/static/js/plugins");\
+ module.exports = require("ep_etherpad-lite/static/js/plugins");\
});\
</script>\
');