mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
avoid manually including require-kernel in ace.js
This commit is contained in:
parent
12c23d468c
commit
fa29858a4e
2 changed files with 2 additions and 11 deletions
|
@ -226,8 +226,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';
|
||||||
|
|
|
@ -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,15 +194,10 @@ 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\
|
`\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\
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue