OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
core
/
test
/
ts
/
browser
/
keyboard
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:14:55 AM
rwxr-xr-x
📄
ArrowKeysAnchorTest.ts
9.31 KB
02/20/2020 06:14:22 AM
rw-r--r--
📄
ArrowKeysContentEndpointBrModeTest.ts
2.83 KB
02/20/2020 06:14:21 AM
rw-r--r--
📄
ArrowKeysContentEndpointTest.ts
4.06 KB
02/20/2020 06:14:23 AM
rw-r--r--
📄
ArrowKeysInlineBoundariesTest.ts
14.39 KB
02/20/2020 06:14:23 AM
rw-r--r--
📄
ArrowKeysTableTest.ts
11.51 KB
02/20/2020 06:14:24 AM
rw-r--r--
📄
BoundaryCaretTest.ts
2.94 KB
02/20/2020 06:14:24 AM
rw-r--r--
📄
BoundaryLocationTest.ts
12.35 KB
02/20/2020 06:14:25 AM
rw-r--r--
📄
EnterKeyAnchorTest.ts
6.66 KB
02/20/2020 06:14:25 AM
rw-r--r--
📄
EnterKeyCeFalseTest.ts
2.61 KB
02/20/2020 06:14:26 AM
rw-r--r--
📄
EnterKeyHrTest.ts
2.9 KB
02/20/2020 06:14:26 AM
rw-r--r--
📄
EnterKeyInlineTest.ts
1021 bytes
02/20/2020 06:14:27 AM
rw-r--r--
📄
EnterKeyListsTest.ts
16.34 KB
02/20/2020 06:14:27 AM
rw-r--r--
📄
EnterKeyTest.ts
30.93 KB
02/20/2020 06:14:28 AM
rw-r--r--
📄
HomeEndKeysTest.ts
4.5 KB
02/20/2020 06:14:28 AM
rw-r--r--
📄
InlineUtilsTest.ts
7.64 KB
02/20/2020 06:14:30 AM
rw-r--r--
📄
InsertKeysBrModeTest.ts
5.65 KB
02/20/2020 06:14:30 AM
rw-r--r--
📄
InsertKeysTest.ts
10.22 KB
02/20/2020 06:14:31 AM
rw-r--r--
📄
SpaceKeyTest.ts
3.52 KB
02/20/2020 06:14:31 AM
rw-r--r--
📄
TableNavigationTest.ts
4.84 KB
02/20/2020 06:14:31 AM
rw-r--r--
📄
TypeTextAtCefTest.ts
2.37 KB
02/20/2020 06:14:32 AM
rw-r--r--
Editing: BoundaryCaretTest.ts
Close
import { Assertions, GeneralSteps, Logger, Pipeline, Step } from '@ephox/agar'; import { Cell } from '@ephox/katamari'; import { Hierarchy, Element, Selectors } from '@ephox/sugar'; import CaretPosition from 'tinymce/core/caret/CaretPosition'; import BoundaryCaret from 'tinymce/core/keyboard/BoundaryCaret'; import BoundaryLocation from 'tinymce/core/keyboard/BoundaryLocation'; import Zwsp from 'tinymce/core/text/Zwsp'; import { UnitTest } from '@ephox/bedrock'; UnitTest.asynctest('browser.tinymce.core.keyboard.BoundaryCaretTest', function () { const success = arguments[arguments.length - 2]; const failure = arguments[arguments.length - 1]; const ZWSP = Zwsp.ZWSP; const isInlineTarget = function (elm) { return Selectors.is(Element.fromDom(elm), 'a[href],code'); }; const createLocation = function (elm, elementPath, offset) { const container = Hierarchy.follow(elm, elementPath); const pos = CaretPosition(container.getOrDie().dom(), offset); const location = BoundaryLocation.readLocation(isInlineTarget, elm.dom(), pos); return location; }; const sTestRenderCaret = function (html, elementPath, offset, expectedHtml, expectedPath, expectedOffset) { return Step.sync(function () { const elm = Element.fromHtml('<div>' + html + '</div>'); const location = createLocation(elm, elementPath, offset); const caret = Cell(null); Assertions.assertEq('Should be a valid location: ' + html, true, location.isSome()); const pos = BoundaryCaret.renderCaret(caret, location.getOrDie()).getOrDie(); Assertions.assertHtml('Should be equal html', expectedHtml, elm.dom().innerHTML); const container = Hierarchy.follow(elm, expectedPath); Assertions.assertDomEq('Should be equal nodes', container.getOrDie(), Element.fromDom(pos.container())); }); }; Pipeline.async({}, [ Logger.t('sTestRenderCaret', GeneralSteps.sequence([ sTestRenderCaret('<p><a href="#">a</a></p>', [0], 0, '<p>' + ZWSP + '<a href="#">a</a></p>', [0, 0], 1), sTestRenderCaret('<p><a href="#">a</a></p>', [0, 0, 0], 0, '<p><a href="#">' + ZWSP + 'a</a></p>', [0, 0, 0], 1), sTestRenderCaret('<p><a href="#">a</a></p>', [0, 0, 0], 1, '<p><a href="#">a' + ZWSP + '</a></p>', [0, 0, 0], 1), sTestRenderCaret('<p><a href="#">a</a></p>', [0], 1, '<p><a href="#">a</a>' + ZWSP + '</p>', [0, 1], 1), sTestRenderCaret('<p><img src="#"><a href="#">a</a></p>', [0], 1, '<p><img src="#">' + ZWSP + '<a href="#">a</a></p>', [0, 1], 0), sTestRenderCaret('<p><a href="#"><img src="#">a</a></p>', [0, 0], 0, '<p><a href="#">' + ZWSP + '<img src="#">a</a></p>', [0, 0, 0], 1), sTestRenderCaret('<p><a href="#">a<img src="#"></a></p>', [0, 0], 2, '<p><a href="#">a<img src="#">' + ZWSP + '</a></p>', [0, 0, 2], 1), sTestRenderCaret('<p><a href="#">a</a><img src="#"></p>', [0], 1, '<p><a href="#">a</a>' + ZWSP + '<img src="#"></p>', [0, 1], 1) ])) ], function () { success(); }, failure); });