OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
core
/
test
/
ts
/
browser
/
dom
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:14:55 AM
rwxr-xr-x
📄
ContentCssCorsTest.ts
1.26 KB
02/20/2020 06:13:25 AM
rw-r--r--
📄
ControlSelectionTest.ts
1.8 KB
02/20/2020 06:13:25 AM
rw-r--r--
📄
DimensionsTest.ts
1.59 KB
02/20/2020 06:13:26 AM
rw-r--r--
📄
DomUtilsTest.ts
28.64 KB
02/20/2020 06:13:26 AM
rw-r--r--
📄
ElementTypeTest.ts
4.84 KB
02/20/2020 06:13:27 AM
rw-r--r--
📄
EmptyTest.ts
2 KB
02/20/2020 06:13:27 AM
rw-r--r--
📄
EventUtilsTest.ts
13.79 KB
02/20/2020 06:13:28 AM
rw-r--r--
📄
NodePathTest.ts
1.65 KB
02/20/2020 06:13:28 AM
rw-r--r--
📄
NodeTypeTest.ts
6.15 KB
02/20/2020 06:13:29 AM
rw-r--r--
📄
PaddingBrTest.ts
3.99 KB
02/20/2020 06:13:29 AM
rw-r--r--
📄
ParentsTest.ts
4.24 KB
02/20/2020 06:13:30 AM
rw-r--r--
📄
ScrollIntoViewTest.ts
8.76 KB
02/20/2020 06:13:30 AM
rw-r--r--
📄
SelectionEventsTest.ts
4.32 KB
02/20/2020 06:13:31 AM
rw-r--r--
📄
SelectionQuirksTest.ts
3.6 KB
02/20/2020 06:13:31 AM
rw-r--r--
📄
SelectionTest.ts
52.46 KB
02/20/2020 06:13:33 AM
rw-r--r--
📄
SerializerEventsTest.ts
2.24 KB
02/20/2020 06:13:33 AM
rw-r--r--
📄
SerializerTest.ts
36.74 KB
02/20/2020 06:13:34 AM
rw-r--r--
📄
TreeWalkerTest.ts
2.76 KB
02/20/2020 06:13:34 AM
rw-r--r--
📄
TrimHtmlTest.ts
1.32 KB
02/20/2020 06:13:35 AM
rw-r--r--
📄
TrimNodeTest.ts
1.68 KB
02/20/2020 06:13:35 AM
rw-r--r--
Editing: SerializerEventsTest.ts
Close
import { Assertions, Logger, Pipeline, Step } from '@ephox/agar'; import { TinyLoader } from '@ephox/mcagar'; import Theme from 'tinymce/themes/silver/Theme'; import { UnitTest } from '@ephox/bedrock'; UnitTest.asynctest('browser.tinymce.core.dom.SerializerEventsTest', function () { const success = arguments[arguments.length - 2]; const failure = arguments[arguments.length - 1]; Theme(); TinyLoader.setup(function (editor, onSuccess, onFailure) { Pipeline.async({}, [ Logger.t('Pre/post process events', Step.sync(function () { let preProcessArgs, postProcessArgs; editor.on('PreProcess', function (o) { preProcessArgs = o; editor.dom.setAttrib(preProcessArgs.node.getElementsByTagName('span')[0], 'class', 'abc'); }); editor.on('PostProcess', function (o) { o.content = o.content.replace(/<em>/g, '<em class="123">'); postProcessArgs = o; }); editor.setContent('<p><span id="test2"><em>abc</em></span>123<a href="file.html" data-mce-href="file.html">link</a>'); Assertions.assertHtml( 'Should be expected altered html', '<p><span id="test2" class="abc"><em class="123">abc</em></span>123<a href="file.html">link</a></p>', editor.serializer.serialize(editor.getBody(), { test : 'abc', getInner: true }) ); Assertions.assertEq('Should be expected preprocess custom arg', 'abc', preProcessArgs.test); Assertions.assertEq('Should be expected preprocess format', 'html', preProcessArgs.format); Assertions.assertEq('Should be expected element child', 'P', preProcessArgs.node.firstChild.tagName); Assertions.assertEq('Should be expected postprocess custom arg', 'abc', postProcessArgs.test); Assertions.assertEq('Should be expected postprocess format', 'html', postProcessArgs.format); Assertions.assertEq( 'Should be expected postprocess format', '<p><span id="test2" class="abc"><em class="123">abc</em></span>123<a href="file.html">link</a></p>', postProcessArgs.content ); })) ], onSuccess, onFailure); }, { inline: true, add_unload_trigger: false, base_url: '/project/tinymce/js/tinymce' }, success, failure); });