diff --git a/test/2040/iframe.html b/test/2040/iframe.html new file mode 100644 index 00000000..fa439d9e --- /dev/null +++ b/test/2040/iframe.html @@ -0,0 +1,35 @@ + + +
+ + + + + + + + + + diff --git a/test/2040/iframe.js b/test/2040/iframe.js new file mode 100644 index 00000000..d9001744 --- /dev/null +++ b/test/2040/iframe.js @@ -0,0 +1,22 @@ +const init = () => { + loadEditor(function() { + // create the editor + const target = document.getElementById('container'); + const editor = monaco.editor.create(target, { language: 'html' }); + + // load some sample data + (async () => { + const response = await fetch('https://microsoft.github.io/monaco-editor/'); + const html = await response.text(); + editor.getModel().setValue(html); + })(); + }); +}; + +window.addEventListener('DOMContentLoaded', () => { + if (!window.innerWidth || !window.innerHeight) { + window.addEventListener('resize', init, { once: true }); + } else { + init(); + } +}); diff --git a/test/2040/index.html b/test/2040/index.html new file mode 100644 index 00000000..cf9786da --- /dev/null +++ b/test/2040/index.html @@ -0,0 +1,42 @@ + + + + + + + +