| 21 | } |
| 22 | |
| 23 | create() { |
| 24 | return new Promise((resolve, reject) => { |
| 25 | this.createPromise = {resolve, reject}; |
| 26 | this.parent = document.querySelector(this.selector); |
| 27 | this.container = document.createElement('iframe'); |
| 28 | let quota = ''; |
| 29 | if (this.options.quota) { |
| 30 | quota = `"a=${this.options.quota}`; |
| 31 | } |
| 32 | const url = chrome.runtime.getURL(`components/editor/editor.html?id=${this.id}${quota}&embedded=true`); |
| 33 | this.container.setAttribute('src', url); |
| 34 | this.container.setAttribute('frameBorder', 0); |
| 35 | this.container.setAttribute('scrolling', 'no'); |
| 36 | this.container.style.width = '100%'; |
| 37 | this.container.style.height = '100%'; |
| 38 | this.parent.appendChild(this.container); |
| 39 | }); |
| 40 | } |
| 41 | |
| 42 | registerEventListener() { |
| 43 | this.port.on('editor-ready', this.onEditorReady); |