From 576be344e4d4e3a1c3beb12a560235631d7fa4b6 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Sun, 28 Feb 2021 18:46:05 +0100 Subject: [PATCH] move require of Ace2Inner up --- src/static/js/ace.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/static/js/ace.js b/src/static/js/ace.js index 514bb71fe..472bef5f7 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -171,11 +171,10 @@ const Ace2Editor = function () { const outerFrame = document.createElement('iframe'); outerFrame.name = 'ace_outer'; - outerFrame.frameBorder = 0; // for IE outerFrame.title = 'Ether'; info.frame = outerFrame; - const postOuterFrame = () => { + const postOuterFrame = () => { const outerWindow = outerFrame.contentWindow; const outerDocument = outerWindow.document; const skinVariants = clientVars.skinVariants.split(' ').filter((x) => x !== ''); @@ -195,19 +194,20 @@ const Ace2Editor = function () { outerWindow.editorInfo = Ace2Editor.registry[info.id]; const postRequire = () => { - const w = document.querySelectorAll('iframe[name=ace_outer]')[0].contentDocument - .querySelectorAll('iframe[name=ace_inner]')[0].contentWindow; + const w = document.querySelectorAll('iframe[name=ace_outer]')[0].contentDocument + .querySelectorAll('iframe[name=ace_inner]')[0].contentWindow; const require = w.require; require.setRootURI('../javascripts/src'); require.setLibraryURI('../javascripts/lib'); require.setGlobalKeyPath('require'); + w.Ace2Inner = require('ep_etherpad-lite/static/js/ace2_inner'); + w.plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins'); w.plugins.adoptPluginsFromAncestorsOf(w); w.jQuery = require('ep_etherpad-lite/static/js/rjquery').jQuery; w.$ = w.jQuery; - w.Ace2Inner = require('ep_etherpad-lite/static/js/ace2_inner'); w.plugins.ensure(() => w.Ace2Inner.init()); }; @@ -248,8 +248,6 @@ const Ace2Editor = function () { const iframe = outerDocument.createElement('iframe'); iframe.name = 'ace_inner'; iframe.title = 'pad'; - iframe.scrolling = 'no'; - iframe.frameBorder = 0; iframe.allowTransparency = true; // for IE iframe.ace_outerWin = outerWindow; iframe.onload = postInnerFrame;