OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
themes
/
silver
/
demo
/
ts
/
dialogs
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:33:39 AM
rwxr-xr-x
📄
DemoDialogBuilder.ts
467 bytes
02/20/2020 06:33:42 AM
rw-r--r--
📄
DialogDemos.ts
1.59 KB
02/20/2020 06:33:42 AM
rw-r--r--
📄
UrlDialogDemo.ts
984 bytes
02/20/2020 06:33:43 AM
rw-r--r--
📁
spec
-
02/20/2020 06:37:38 AM
rwxr-xr-x
Editing: UrlDialogDemo.ts
Close
import { console, setTimeout } from '@ephox/dom-globals'; declare let tinymce: any; export default () => { const openDialog = (editor) => { // The end user will use this as config const api = editor.windowManager.openUrl({ title: 'Example', url: './examples/iframe.html', onMessage: (api, message) => { console.log('Custom message received from iframe', message); }, onClose: () => { console.log('Closing dialog'); } }); // Send a dummy message to the iframe after 2 seconds setTimeout(() => { api.sendMessage({ message: 'Some example message' }); }, 2000); }; tinymce.init({ selector: 'textarea.tiny-text', init_instance_callback: (editor) => { // Add in a button to open the dialog editor.$('<button>openDialog()</button>').appendTo('body').on('click', () => openDialog(editor)); // Open the dialog initially openDialog(editor); } }); };