OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
themes
/
silver
/
main
/
ts
/
ui
/
core
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:40:48 AM
rwxr-xr-x
📄
AlignmentButtons.ts
1.45 KB
02/20/2020 06:38:07 AM
rw-r--r--
📄
ComplexControls.ts
716 bytes
02/20/2020 06:38:08 AM
rw-r--r--
📄
FormatControls.ts
1015 bytes
02/20/2020 06:38:08 AM
rw-r--r--
📄
IndentOutdent.ts
1.16 KB
02/20/2020 06:38:09 AM
rw-r--r--
📄
LinkTargets.ts
4.05 KB
02/20/2020 06:38:10 AM
rw-r--r--
📄
SimpleControls.ts
4.59 KB
02/20/2020 06:38:10 AM
rw-r--r--
📄
UndoRedo.ts
1.9 KB
02/20/2020 06:38:11 AM
rw-r--r--
📄
VisualAid.ts
1.22 KB
02/20/2020 06:38:11 AM
rw-r--r--
📁
color
-
02/20/2020 06:40:29 AM
rwxr-xr-x
📁
complex
-
02/20/2020 06:42:37 AM
rwxr-xr-x
Editing: VisualAid.ts
Close
/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ import Editor from 'tinymce/core/api/Editor'; import { Menu } from '@ephox/bridge'; const toggleVisualAidState = (api: Menu.ToggleMenuItemInstanceApi, editor: Editor) => { api.setActive(editor.hasVisual); const onVisualAid = (e) => { api.setActive(e.hasVisual); }; editor.on('VisualAid', onVisualAid); return () => editor.off('VisualAid', onVisualAid); }; const registerMenuItems = (editor: Editor) => { editor.ui.registry.addToggleMenuItem('visualaid', { text: 'Visual aids', onSetup: (api) => toggleVisualAidState(api, editor), onAction: () => { editor.execCommand('mceToggleVisualAid'); } }); }; const registerToolbarButton = (editor: Editor) => { editor.ui.registry.addButton('visualaid', { tooltip: 'Visual aids', text: 'Visual aids', onAction: () => editor.execCommand('mceToggleVisualAid') }); }; const register = (editor: Editor) => { registerToolbarButton(editor); registerMenuItems(editor); }; export default { register };