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: WordSelection.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 { Type } from '@ephox/katamari'; import * as CaretContainer from '../caret/CaretContainer'; import CaretPosition from '../caret/CaretPosition'; import Selection from '../api/dom/Selection'; import Editor from '../api/Editor'; const hasSelectionModifyApi = function (editor: Editor) { return Type.isFunction((<any> editor.selection.getSel()).modify); }; const moveRel = function (forward: boolean, selection: Selection, pos: CaretPosition) { const delta = forward ? 1 : -1; selection.setRng(CaretPosition(pos.container(), pos.offset() + delta).toRange()); (<any> selection.getSel()).modify('move', forward ? 'forward' : 'backward', 'word'); return true; }; const moveByWord = function (forward: boolean, editor: Editor) { const rng = editor.selection.getRng(); const pos = forward ? CaretPosition.fromRangeEnd(rng) : CaretPosition.fromRangeStart(rng); if (!hasSelectionModifyApi(editor)) { return false; } else if (forward && CaretContainer.isBeforeInline(pos)) { return moveRel(true, editor.selection, pos); } else if (!forward && CaretContainer.isAfterInline(pos)) { return moveRel(false, editor.selection, pos); } else { return false; } }; export default { hasSelectionModifyApi, moveByWord };