OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
core
/
main
/
ts
/
selection
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 05:44:43 AM
rwxr-xr-x
📄
CaretRangeFromPoint.ts
2.6 KB
02/20/2020 05:44:11 AM
rw-r--r--
📄
DetailsElement.ts
1.19 KB
02/20/2020 05:44:11 AM
rw-r--r--
📄
ElementSelection.ts
4.83 KB
02/20/2020 05:44:12 AM
rw-r--r--
📄
EventProcessRanges.ts
593 bytes
02/20/2020 05:44:12 AM
rw-r--r--
📄
FragmentReader.ts
3.82 KB
02/20/2020 05:44:13 AM
rw-r--r--
📄
GetSelectionContent.ts
2.12 KB
02/20/2020 05:44:15 AM
rw-r--r--
📄
MultiClickSelection.ts
1.64 KB
02/20/2020 05:44:16 AM
rw-r--r--
📄
MultiRange.ts
955 bytes
02/20/2020 05:44:17 AM
rw-r--r--
📄
NormalizeRange.ts
10.02 KB
02/20/2020 05:44:17 AM
rw-r--r--
📄
RangeCompare.ts
580 bytes
02/20/2020 05:44:18 AM
rw-r--r--
📄
RangeInsertNode.ts
1.52 KB
02/20/2020 05:44:18 AM
rw-r--r--
📄
RangeNodes.ts
946 bytes
02/20/2020 05:44:19 AM
rw-r--r--
📄
RangeNormalizer.ts
1.69 KB
02/20/2020 05:44:19 AM
rw-r--r--
📄
RangeWalk.ts
4.38 KB
02/20/2020 05:44:20 AM
rw-r--r--
📄
SelectionBookmark.ts
3.36 KB
02/20/2020 05:44:20 AM
rw-r--r--
📄
SelectionRestore.ts
1.98 KB
02/20/2020 05:44:21 AM
rw-r--r--
📄
SelectionUtils.ts
3.65 KB
02/20/2020 05:44:21 AM
rw-r--r--
📄
SetSelectionContent.ts
2.44 KB
02/20/2020 05:44:22 AM
rw-r--r--
📄
SimpleTableModel.ts
4.08 KB
02/20/2020 05:44:22 AM
rw-r--r--
📄
SplitRange.ts
1.94 KB
02/20/2020 05:44:23 AM
rw-r--r--
📄
TableCellSelection.ts
1.25 KB
02/20/2020 05:44:24 AM
rw-r--r--
📄
WordSelection.ts
1.47 KB
02/20/2020 05:44:24 AM
rw-r--r--
Editing: SelectionRestore.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 { document } from '@ephox/dom-globals'; import { Throttler } from '@ephox/katamari'; import { PlatformDetection } from '@ephox/sand'; import DOMUtils from '../api/dom/DOMUtils'; import SelectionBookmark from './SelectionBookmark'; import Editor from '../api/Editor'; const isManualNodeChange = function (e) { return e.type === 'nodechange' && e.selectionChange; }; const registerPageMouseUp = function (editor: Editor, throttledStore) { const mouseUpPage = function () { throttledStore.throttle(); }; DOMUtils.DOM.bind(document, 'mouseup', mouseUpPage); editor.on('remove', function () { DOMUtils.DOM.unbind(document, 'mouseup', mouseUpPage); }); }; const registerFocusOut = function (editor: Editor) { editor.on('focusout', function () { SelectionBookmark.store(editor); }); }; const registerMouseUp = function (editor: Editor, throttledStore) { editor.on('mouseup touchend', function (e) { throttledStore.throttle(); }); }; const registerEditorEvents = function (editor: Editor, throttledStore) { const browser = PlatformDetection.detect().browser; if (browser.isIE()) { registerFocusOut(editor); } else { registerMouseUp(editor, throttledStore); } editor.on('keyup NodeChange', function (e) { if (!isManualNodeChange(e)) { SelectionBookmark.store(editor); } }); }; const register = function (editor: Editor) { const throttledStore = Throttler.first(function () { SelectionBookmark.store(editor); }, 0); if (editor.inline) { registerPageMouseUp(editor, throttledStore); } editor.on('init', function () { registerEditorEvents(editor, throttledStore); }); editor.on('remove', function () { throttledStore.cancel(); }); }; export default { register };