OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
core
/
main
/
ts
/
fmt
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 05:44:43 AM
rwxr-xr-x
📄
ApplyFormat.ts
11.18 KB
02/20/2020 05:43:19 AM
rw-r--r--
📄
CaretFormat.ts
10.27 KB
02/20/2020 05:43:19 AM
rw-r--r--
📄
DefaultFormats.ts
5.17 KB
02/20/2020 05:43:20 AM
rw-r--r--
📄
ExpandRange.ts
12.32 KB
02/20/2020 05:43:21 AM
rw-r--r--
📄
FontInfo.ts
2.1 KB
02/20/2020 05:43:21 AM
rw-r--r--
📄
FormatChanged.ts
4.52 KB
02/20/2020 05:43:22 AM
rw-r--r--
📄
FormatContainer.ts
706 bytes
02/20/2020 05:43:22 AM
rw-r--r--
📄
FormatRegistry.ts
2.7 KB
02/20/2020 05:43:23 AM
rw-r--r--
📄
FormatUtils.ts
4.83 KB
02/20/2020 05:43:23 AM
rw-r--r--
📄
Hooks.ts
1.56 KB
02/20/2020 05:43:24 AM
rw-r--r--
📄
MatchFormat.ts
5.54 KB
02/20/2020 05:43:24 AM
rw-r--r--
📄
MergeFormats.ts
6.75 KB
02/20/2020 05:43:25 AM
rw-r--r--
📄
Preview.ts
8.79 KB
02/20/2020 05:43:26 AM
rw-r--r--
📄
RemoveFormat.ts
18.89 KB
02/20/2020 05:43:26 AM
rw-r--r--
📄
ToggleFormat.ts
842 bytes
02/20/2020 05:43:27 AM
rw-r--r--
Editing: Hooks.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 ArrUtils from '../util/ArrUtils'; import NodeType from '../dom/NodeType'; import DomQuery from '../api/dom/DomQuery'; import Editor from '../api/Editor'; /** * Internal class for overriding formatting. * * @private * @class tinymce.fmt.Hooks */ const postProcessHooks = {}, filter = ArrUtils.filter, each = ArrUtils.each; const addPostProcessHook = function (name, hook) { let hooks = postProcessHooks[name]; if (!hooks) { postProcessHooks[name] = hooks = []; } postProcessHooks[name].push(hook); }; const postProcess = function (name: string, editor: Editor) { each(postProcessHooks[name], function (hook) { hook(editor); }); }; addPostProcessHook('pre', function (editor: Editor) { const rng = editor.selection.getRng(); let isPre, blocks; const hasPreSibling = function (pre) { return isPre(pre.previousSibling) && ArrUtils.indexOf(blocks, pre.previousSibling) !== -1; }; const joinPre = function (pre1, pre2) { DomQuery(pre2).remove(); DomQuery(pre1).append('<br><br>').append(pre2.childNodes); }; isPre = NodeType.matchNodeNames('pre'); if (!rng.collapsed) { blocks = editor.selection.getSelectedBlocks(); each(filter(filter(blocks, isPre), hasPreSibling), function (pre) { joinPre(pre.previousSibling, pre); }); } }); export default { postProcess };