OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
core
/
main
/
ts
/
newline
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 05:44:43 AM
rwxr-xr-x
📄
ContextSelectors.ts
994 bytes
02/20/2020 05:44:04 AM
rw-r--r--
📄
InsertBlock.ts
16.37 KB
02/20/2020 05:44:04 AM
rw-r--r--
📄
InsertBr.ts
5.95 KB
02/20/2020 05:44:05 AM
rw-r--r--
📄
InsertLi.ts
3.73 KB
02/20/2020 05:44:05 AM
rw-r--r--
📄
InsertNewLine.ts
856 bytes
02/20/2020 05:44:06 AM
rw-r--r--
📄
NewLineAction.ts
3.46 KB
02/20/2020 05:44:06 AM
rw-r--r--
📄
NewLineUtils.ts
3.32 KB
02/20/2020 05:44:07 AM
rw-r--r--
Editing: ContextSelectors.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 { Element, Selectors } from '@ephox/sugar'; import Settings from '../api/Settings'; import NewLineUtils from './NewLineUtils'; import Editor from '../api/Editor'; const matchesSelector = function (editor: Editor, selector: string) { return NewLineUtils.getParentBlock(editor).filter(function (parentBlock) { return selector.length > 0 && Selectors.is(Element.fromDom(parentBlock), selector); }).isSome(); }; const shouldInsertBr = function (editor: Editor) { return matchesSelector(editor, Settings.getBrNewLineSelector(editor)); }; const shouldBlockNewLine = function (editor: Editor) { return matchesSelector(editor, Settings.getNoNewLineSelector(editor)); }; export default { shouldInsertBr, shouldBlockNewLine };