diff --git a/src/node/utils/Minify.js b/src/node/utils/Minify.js index 2a7ee2bfa..181f67687 100644 --- a/src/node/utils/Minify.js +++ b/src/node/utils/Minify.js @@ -187,8 +187,6 @@ const getAceFile = async () => { filenames.push(matches[2]); } } - // Always include the require kernel. - filenames.push('../static/js/require-kernel.js'); data += ';\n'; data += 'Ace2Editor.EMBEDED = Ace2Editor.EMBEDED || {};\n'; diff --git a/src/node/utils/tar.json b/src/node/utils/tar.json index 055961a9e..666450218 100644 --- a/src/node/utils/tar.json +++ b/src/node/utils/tar.json @@ -42,6 +42,13 @@ , "pad_impexp.js" , "colorutils.js" , "socketio.js" + , "AttributePool.js" + , "Changeset.js" + , "cssmanager.js" + , "domline.js" + , "linestylefilter.js" + , "AttributeManager.js" + , "ChangesetUtils.js" ] , "timeslider.js": [ "timeslider.js" diff --git a/src/static/js/ace.js b/src/static/js/ace.js index e648df07e..d9c6b4231 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -24,8 +24,6 @@ // requires: top // requires: undefined -const KERNEL_SOURCE = '../static/js/require-kernel.js'; - const hooks = require('./pluginfw/hooks'); const pluginUtils = require('./pluginfw/shared'); @@ -196,18 +194,19 @@ const Ace2Editor = function () { `../static/skins/${clientVars.skinName}/pad.css?v=${clientVars.randomVersionString}`); pushStyleTagsFor(iframeHTML, includedCSS); - - 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(``); iframeHTML.push(scriptTag( - `${Ace2Editor.EMBEDED[KERNEL_SOURCE]}\n\ + ` require.setRootURI("../javascripts/src");\n\ require.setLibraryURI("../javascripts/lib");\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\ var plugins = require("ep_etherpad-lite/static/js/pluginfw/client_plugins");\n\ plugins.adoptPluginsFromAncestorsOf(window);\n\