no inlining of require-kernel in the inner iframe
parent
500215ea0e
commit
46833a9054
|
@ -187,8 +187,6 @@ const getAceFile = async () => {
|
||||||
filenames.push(matches[2]);
|
filenames.push(matches[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Always include the require kernel.
|
|
||||||
filenames.push('../static/js/require-kernel.js');
|
|
||||||
|
|
||||||
data += ';\n';
|
data += ';\n';
|
||||||
data += 'Ace2Editor.EMBEDED = Ace2Editor.EMBEDED || {};\n';
|
data += 'Ace2Editor.EMBEDED = Ace2Editor.EMBEDED || {};\n';
|
||||||
|
|
|
@ -42,6 +42,13 @@
|
||||||
, "pad_impexp.js"
|
, "pad_impexp.js"
|
||||||
, "colorutils.js"
|
, "colorutils.js"
|
||||||
, "socketio.js"
|
, "socketio.js"
|
||||||
|
, "AttributePool.js"
|
||||||
|
, "Changeset.js"
|
||||||
|
, "cssmanager.js"
|
||||||
|
, "domline.js"
|
||||||
|
, "linestylefilter.js"
|
||||||
|
, "AttributeManager.js"
|
||||||
|
, "ChangesetUtils.js"
|
||||||
]
|
]
|
||||||
, "timeslider.js": [
|
, "timeslider.js": [
|
||||||
"timeslider.js"
|
"timeslider.js"
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
// requires: top
|
// requires: top
|
||||||
// requires: undefined
|
// requires: undefined
|
||||||
|
|
||||||
const KERNEL_SOURCE = '../static/js/require-kernel.js';
|
|
||||||
|
|
||||||
const hooks = require('./pluginfw/hooks');
|
const hooks = require('./pluginfw/hooks');
|
||||||
const pluginUtils = require('./pluginfw/shared');
|
const pluginUtils = require('./pluginfw/shared');
|
||||||
|
|
||||||
|
@ -196,18 +194,19 @@ const Ace2Editor = function () {
|
||||||
`../static/skins/${clientVars.skinName}/pad.css?v=${clientVars.randomVersionString}`);
|
`../static/skins/${clientVars.skinName}/pad.css?v=${clientVars.randomVersionString}`);
|
||||||
|
|
||||||
pushStyleTagsFor(iframeHTML, includedCSS);
|
pushStyleTagsFor(iframeHTML, includedCSS);
|
||||||
|
iframeHTML.push(`<script type="text/javascript" src="../static/js/require-kernel.js?v=${clientVars.randomVersionString}"></script>`);
|
||||||
if (!Ace2Editor.EMBEDED || !Ace2Editor.EMBEDED[KERNEL_SOURCE]) {
|
|
||||||
// Remotely src'd script tag will not work in IE; it must be embedded, so
|
|
||||||
// throw an error if it is not.
|
|
||||||
throw new Error('Require kernel could not be found.');
|
|
||||||
}
|
|
||||||
|
|
||||||
iframeHTML.push(scriptTag(
|
iframeHTML.push(scriptTag(
|
||||||
`${Ace2Editor.EMBEDED[KERNEL_SOURCE]}\n\
|
`
|
||||||
require.setRootURI("../javascripts/src");\n\
|
require.setRootURI("../javascripts/src");\n\
|
||||||
require.setLibraryURI("../javascripts/lib");\n\
|
require.setLibraryURI("../javascripts/lib");\n\
|
||||||
require.setGlobalKeyPath("require");\n\
|
require.setGlobalKeyPath("require");\n\
|
||||||
|
// we can't reuse require-kernel from main window (the one that embeds sidediv+ace_outer)
|
||||||
|
// as it would be scoped to the main window, but we need it scoped to ace_inner
|
||||||
|
|
||||||
|
window.__pad = require('ep_etherpad-lite/static/js/pad');\n\
|
||||||
|
delete window.__pad;\n\
|
||||||
|
|
||||||
\n\
|
\n\
|
||||||
var plugins = require("ep_etherpad-lite/static/js/pluginfw/client_plugins");\n\
|
var plugins = require("ep_etherpad-lite/static/js/pluginfw/client_plugins");\n\
|
||||||
plugins.adoptPluginsFromAncestorsOf(window);\n\
|
plugins.adoptPluginsFromAncestorsOf(window);\n\
|
||||||
|
|
Loading…
Reference in New Issue