OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
themes
/
silver
/
test
/
ts
/
module
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:40:09 AM
rwxr-xr-x
📄
DomSteps.ts
934 bytes
02/20/2020 06:34:11 AM
rw-r--r--
📄
ReperesentingSteps.ts
1.36 KB
02/20/2020 06:34:11 AM
rw-r--r--
📄
TestBackstage.ts
1.1 KB
02/20/2020 06:34:12 AM
rw-r--r--
📄
TestExtras.ts
1.38 KB
02/20/2020 06:34:12 AM
rw-r--r--
📄
TestProviders.ts
185 bytes
02/20/2020 06:34:13 AM
rw-r--r--
📄
UiChainUtils.ts
504 bytes
02/20/2020 06:34:13 AM
rw-r--r--
Editing: TestExtras.ts
Close
import { Attachment, GuiFactory, DomFactory, Behaviour, Positioning, Gui } from '@ephox/alloy'; import { Body, Class } from '@ephox/sugar'; import { document } from '@ephox/dom-globals'; import TestBackstage from './TestBackstage'; import Editor from 'tinymce/core/api/Editor'; export default () => { const oldSink = document.querySelectorAll('.mce-silver-sink'); if (oldSink.length > 0) { throw Error('old sinks found, a previous test did not call helpers.destroy() leaving artifacts, found: ' + oldSink.length); } const sink = GuiFactory.build({ dom: DomFactory.fromHtml('<div class="mce-silver-sink"></div>'), behaviours: Behaviour.derive([ Positioning.config({ useFixed: true }) ]) }); const uiMothership = Gui.create(); Class.add(uiMothership.element(), 'tox'); const backstage = TestBackstage(sink); const mockEditor = { setContent: (content) => {}, insertContent: (content: string, args?: any) => {}, execCommand: (cmd: string, ui?: boolean, value?: any) => {} } as Editor; const extras = { editor: mockEditor, backstage }; uiMothership.add(sink); Attachment.attachSystem(Body.body(), uiMothership); const destroy = () => { uiMothership.remove(sink); uiMothership.destroy(); }; return { backstage, shared: backstage.shared, extras, destroy, uiMothership, mockEditor }; };