mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
ace: Use globalThis
instead of non-strict default context
This is necessary before `'use strict';` can be added to the top of the file.
This commit is contained in:
parent
7652b7010e
commit
e49341926f
1 changed files with 4 additions and 4 deletions
|
@ -255,13 +255,13 @@ plugins.ensure(function () {\n\
|
||||||
|
|
||||||
iframeHTML.push('</head><body id="innerdocbody" class="innerdocbody" role="application" class="syntax" spellcheck="false"> </body></html>');
|
iframeHTML.push('</head><body id="innerdocbody" class="innerdocbody" role="application" class="syntax" spellcheck="false"> </body></html>');
|
||||||
|
|
||||||
// Expose myself to global for my child frame.
|
// eslint-disable-next-line node/no-unsupported-features/es-builtins
|
||||||
const thisFunctionsName = 'ChildAccessibleAce2Editor';
|
const gt = typeof globalThis === 'object' ? globalThis : window;
|
||||||
(function () { return this; }())[thisFunctionsName] = Ace2Editor;
|
gt.ChildAccessibleAce2Editor = Ace2Editor;
|
||||||
|
|
||||||
const outerScript = `\
|
const outerScript = `\
|
||||||
editorId = ${JSON.stringify(info.id)};\n\
|
editorId = ${JSON.stringify(info.id)};\n\
|
||||||
editorInfo = parent[${JSON.stringify(thisFunctionsName)}].registry[editorId];\n\
|
editorInfo = parent.ChildAccessibleAce2Editor.registry[editorId];\n\
|
||||||
window.onload = function () {\n\
|
window.onload = function () {\n\
|
||||||
window.onload = null;\n\
|
window.onload = null;\n\
|
||||||
setTimeout(function () {\n\
|
setTimeout(function () {\n\
|
||||||
|
|
Loading…
Reference in a new issue