OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
themes
/
mobile
/
main
/
ts
/
ui
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:45:48 AM
rwxr-xr-x
📄
AndroidRealm.ts
2.43 KB
02/20/2020 06:32:39 AM
rw-r--r--
📄
Buttons.ts
2.4 KB
02/20/2020 06:32:40 AM
rw-r--r--
📄
ColorSlider.ts
3.21 KB
02/20/2020 06:32:40 AM
rw-r--r--
📄
CommonRealm.ts
1.49 KB
02/20/2020 06:32:41 AM
rw-r--r--
📄
Dropup.ts
2.38 KB
02/20/2020 06:32:41 AM
rw-r--r--
📄
FontSizeSlider.ts
1.34 KB
02/20/2020 06:32:42 AM
rw-r--r--
📄
HeadingSlider.ts
1.63 KB
02/20/2020 06:32:42 AM
rw-r--r--
📄
ImagePicker.ts
2.13 KB
02/20/2020 06:32:43 AM
rw-r--r--
📄
Inputs.ts
2.86 KB
02/20/2020 06:32:43 AM
rw-r--r--
📄
IosRealm.ts
2.65 KB
02/20/2020 06:32:44 AM
rw-r--r--
📄
LinkButton.ts
2.33 KB
02/20/2020 06:32:45 AM
rw-r--r--
📄
OuterContainer.ts
953 bytes
02/20/2020 06:32:45 AM
rw-r--r--
📄
SerialisedDialog.ts
8.2 KB
02/20/2020 06:32:46 AM
rw-r--r--
📄
SizeSlider.ts
2.32 KB
02/20/2020 06:32:46 AM
rw-r--r--
📄
StylesMenu.ts
6.51 KB
02/20/2020 06:32:47 AM
rw-r--r--
📄
ToolbarWidgets.ts
645 bytes
02/20/2020 06:32:47 AM
rw-r--r--
Editing: Buttons.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 { Behaviour, Button, Toggling, Unselecting, SketchSpec } from '@ephox/alloy'; import { Merger, Option } from '@ephox/katamari'; import Receivers from '../channels/Receivers'; import Styles from '../style/Styles'; import * as UiDomFactory from '../util/UiDomFactory'; const forToolbarCommand = function (editor, command) { return forToolbar(command, function () { editor.execCommand(command); }, { }, editor); }; const getToggleBehaviours = function (command) { return Behaviour.derive([ Toggling.config({ toggleClass: Styles.resolve('toolbar-button-selected'), toggleOnExecute: false, aria: { mode: 'pressed' } }), Receivers.format(command, function (button, status) { const toggle = status ? Toggling.on : Toggling.off; toggle(button); }) ]); }; const forToolbarStateCommand = function (editor, command) { const extraBehaviours = getToggleBehaviours(command); return forToolbar(command, function () { editor.execCommand(command); }, extraBehaviours, editor); }; // The action is not just executing the same command const forToolbarStateAction = function (editor, clazz, command, action) { const extraBehaviours = getToggleBehaviours(command); return forToolbar(clazz, action, extraBehaviours, editor); }; const getToolbarIconButton = (clazz, editor) => { const icons = editor.ui.registry.getAll().icons; const optOxideIcon = Option.from(icons[clazz]); return optOxideIcon.fold( () => UiDomFactory.dom('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-' + clazz + ' ${prefix}-icon"></span>'), (icon) => UiDomFactory.dom('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item">' + icon + '</span>') ); }; const forToolbar = function (clazz, action, extraBehaviours, editor): SketchSpec { return Button.sketch({ dom: getToolbarIconButton(clazz, editor), action, buttonBehaviours: Merger.deepMerge( Behaviour.derive([ Unselecting.config({ }) ]), extraBehaviours ) }); }; export default { forToolbar, forToolbarCommand, forToolbarStateAction, forToolbarStateCommand, getToolbarIconButton };