jodit 3.8.1 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/codeStyles/Project.xml +68 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/dictionaries/v_chupurnov.xml +10 -0
- package/.idea/encodings.xml +4 -0
- package/.idea/inspectionProfiles/Project_Default.xml +118 -0
- package/.idea/jodit.iml +12 -0
- package/.idea/jsLibraryMappings.xml +6 -0
- package/.idea/markdown-navigator-enh.xml +29 -0
- package/.idea/markdown-navigator.xml +55 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/watcherTasks.xml +4 -0
- package/.idea/workspace.xml +1264 -0
- package/build/jodit.css +2 -2
- package/build/jodit.es2018.css +1 -1
- package/build/jodit.es2018.en.css +1 -1
- package/build/jodit.es2018.en.js +4 -4
- package/build/jodit.es2018.en.min.js +2 -2
- package/build/jodit.es2018.js +4 -4
- package/build/jodit.es2018.min.js +2 -2
- package/build/jodit.js +4 -4
- package/build/jodit.min.css +1 -1
- package/build/jodit.min.js +2 -2
- package/package.json +2 -2
- package/.travis.yml +0 -7
- package/bower.json +0 -33
- package/build.js +0 -39
- package/docker/Dockerfile +0 -11
- package/docker/README.md +0 -45
- package/docker/build +0 -3
- package/docker/install +0 -7
- package/docker/start +0 -3
- package/docker/test +0 -3
- package/docker/uninstall +0 -3
- package/examples/arabic.lang.html +0 -76
- package/examples/assets/app.css +0 -175
- package/examples/assets/app.js +0 -57
- package/examples/assets/download.jpg +0 -0
- package/examples/assets/icon.png +0 -0
- package/examples/assets/logo.png +0 -0
- package/examples/assets/prism.css +0 -200
- package/examples/assets/prism.js +0 -1254
- package/examples/color-picker.html +0 -139
- package/examples/custom-icons.html +0 -173
- package/examples/custom-toolbar.html +0 -80
- package/examples/example.default.html +0 -75
- package/examples/fullsize.html +0 -75
- package/examples/index.html +0 -176
- package/examples/inline-mode.html +0 -116
- package/examples/oneinstance.html +0 -125
- package/icons.html +0 -50
- package/karma.conf.js +0 -157
- package/make.js +0 -10
- package/server.js +0 -101
- package/test/bootstrap.js +0 -1167
- package/test/test.html +0 -102
- package/test/test.index.html +0 -11
- package/test/tests/acceptance/clipboardTest.js +0 -1234
- package/test/tests/acceptance/commandsTest.js +0 -647
- package/test/tests/acceptance/creatorTest.js +0 -103
- package/test/tests/acceptance/deleteBackSpaceTest.js +0 -1289
- package/test/tests/acceptance/dialogTest.js +0 -188
- package/test/tests/acceptance/editorTest.js +0 -855
- package/test/tests/acceptance/enterTest.js +0 -1088
- package/test/tests/acceptance/eventsTest.js +0 -1246
- package/test/tests/acceptance/filebrowserTest.js +0 -1309
- package/test/tests/acceptance/i18nTest.js +0 -81
- package/test/tests/acceptance/iframeTest.js +0 -306
- package/test/tests/acceptance/imageTest.js +0 -1649
- package/test/tests/acceptance/inlineModeTest.js +0 -826
- package/test/tests/acceptance/interfaceTest.js +0 -119
- package/test/tests/acceptance/mobileTest.js +0 -229
- package/test/tests/acceptance/plugins/classSpan.js +0 -220
- package/test/tests/acceptance/plugins/cleanHtml.js +0 -351
- package/test/tests/acceptance/plugins/color.js +0 -188
- package/test/tests/acceptance/plugins/dragAndDropElement.js +0 -172
- package/test/tests/acceptance/plugins/focus.js +0 -115
- package/test/tests/acceptance/plugins/font.js +0 -316
- package/test/tests/acceptance/plugins/image.js +0 -79
- package/test/tests/acceptance/plugins/indent.js +0 -179
- package/test/tests/acceptance/plugins/inline-popup.js +0 -578
- package/test/tests/acceptance/plugins/insert.js +0 -17
- package/test/tests/acceptance/plugins/limit.js +0 -164
- package/test/tests/acceptance/plugins/link.js +0 -1640
- package/test/tests/acceptance/plugins/orderedList.js +0 -290
- package/test/tests/acceptance/plugins/placeholder.js +0 -138
- package/test/tests/acceptance/plugins/resizer.js +0 -329
- package/test/tests/acceptance/plugins/search.js +0 -623
- package/test/tests/acceptance/plugins/size.js +0 -344
- package/test/tests/acceptance/plugins/source.js +0 -218
- package/test/tests/acceptance/plugins/stat.js +0 -120
- package/test/tests/acceptance/plugins/tooltip.js +0 -97
- package/test/tests/acceptance/plugins/wrapTextNodes.js +0 -105
- package/test/tests/acceptance/pluginsTest.js +0 -2219
- package/test/tests/acceptance/selectionTest.js +0 -862
- package/test/tests/acceptance/statesTest.js +0 -310
- package/test/tests/acceptance/tableTest.js +0 -1988
- package/test/tests/acceptance/toolbarTest.js +0 -1747
- package/test/tests/acceptance/undoredoTest.js +0 -217
- package/test/tests/acceptance/uploaderTest.js +0 -187
- package/test/tests/artio.jpg +0 -0
- package/test/tests/units/helpersTest.js +0 -771
- package/test/tests/units/modules/dom.js +0 -282
- package/test/tests/units/objectObserverTest.js +0 -533
- package/test/tests/units/popupTest.js +0 -211
- package/test/tests/units/positionTest.js +0 -238
- package/test/tests/units/styleTest.js +0 -1361
- package/webpack.config.js +0 -308
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
-
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
-
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
-
*/
|
|
6
|
-
describe('Test editor indent plugin', function () {
|
|
7
|
-
describe('Indent', function () {
|
|
8
|
-
describe('Exec Indent command several times', function () {
|
|
9
|
-
it('Should increase margin-left', function () {
|
|
10
|
-
const editor = getJodit();
|
|
11
|
-
editor.value = '<ul><li>test</li></ul>';
|
|
12
|
-
|
|
13
|
-
const range = editor.s.createRange();
|
|
14
|
-
range.setStart(
|
|
15
|
-
editor.editor.firstChild.firstChild.firstChild,
|
|
16
|
-
0
|
|
17
|
-
);
|
|
18
|
-
range.collapse(true);
|
|
19
|
-
editor.s.selectRange(range);
|
|
20
|
-
|
|
21
|
-
editor.execCommand('indent');
|
|
22
|
-
expect(editor.value).equals(
|
|
23
|
-
'<ul><li style="margin-left: 10px;">test</li></ul>'
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
editor.execCommand('indent');
|
|
27
|
-
expect(editor.value).equals(
|
|
28
|
-
'<ul><li style="margin-left: 20px;">test</li></ul>'
|
|
29
|
-
);
|
|
30
|
-
editor.execCommand('indent');
|
|
31
|
-
expect(editor.value).equals(
|
|
32
|
-
'<ul><li style="margin-left: 30px;">test</li></ul>'
|
|
33
|
-
);
|
|
34
|
-
editor.execCommand('outdent');
|
|
35
|
-
expect(editor.value).equals(
|
|
36
|
-
'<ul><li style="margin-left: 20px;">test</li></ul>'
|
|
37
|
-
);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
describe('For RTL direction', function () {
|
|
41
|
-
it('Should increase margin-right', function () {
|
|
42
|
-
const editor = getJodit({
|
|
43
|
-
direction: 'rtl'
|
|
44
|
-
});
|
|
45
|
-
editor.value = '<ul><li>test</li></ul>';
|
|
46
|
-
|
|
47
|
-
const range = editor.s.createRange();
|
|
48
|
-
range.setStart(
|
|
49
|
-
editor.editor.firstChild.firstChild.firstChild,
|
|
50
|
-
0
|
|
51
|
-
);
|
|
52
|
-
range.collapse(true);
|
|
53
|
-
editor.s.selectRange(range);
|
|
54
|
-
|
|
55
|
-
editor.execCommand('indent');
|
|
56
|
-
expect(editor.value).equals(
|
|
57
|
-
'<ul><li style="margin-right: 10px;">test</li></ul>'
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
editor.execCommand('indent');
|
|
61
|
-
expect(editor.value).equals(
|
|
62
|
-
'<ul><li style="margin-right: 20px;">test</li></ul>'
|
|
63
|
-
);
|
|
64
|
-
editor.execCommand('indent');
|
|
65
|
-
expect(editor.value).equals(
|
|
66
|
-
'<ul><li style="margin-right: 30px;">test</li></ul>'
|
|
67
|
-
);
|
|
68
|
-
editor.execCommand('outdent');
|
|
69
|
-
expect(editor.value).equals(
|
|
70
|
-
'<ul><li style="margin-right: 20px;">test</li></ul>'
|
|
71
|
-
);
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('should indent multi-line selection of various child elements only on 1st 2 lines', function () {
|
|
78
|
-
const editor = getJodit();
|
|
79
|
-
editor.value = `
|
|
80
|
-
<p>
|
|
81
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. <i>Quonam, inquit, modo?</i> <span>prima quaeque bene</span>
|
|
82
|
-
</p>
|
|
83
|
-
<blockquote cite="http://loripsum.net">
|
|
84
|
-
Nec enim absolvi beata vita sapientis neque ad exitum perduci poterit, si prima quaeque bene ab eo consulta atque facta ipsius oblivione obruentur.
|
|
85
|
-
</blockquote>
|
|
86
|
-
<pre>
|
|
87
|
-
Tum ille: Tu autem cum ipse tantum librorum habeas, quos hic tandem requiris?
|
|
88
|
-
</pre>
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
const children =
|
|
92
|
-
editor.container.querySelector('.jodit-wysiwyg').children;
|
|
93
|
-
const el1 = children[0];
|
|
94
|
-
const el1Child = el1.querySelector('i');
|
|
95
|
-
const el2 = children[1];
|
|
96
|
-
const el3 = children[2];
|
|
97
|
-
|
|
98
|
-
const sel = editor.s.sel,
|
|
99
|
-
range = editor.s.createRange();
|
|
100
|
-
|
|
101
|
-
range.setStart(el1Child, 0);
|
|
102
|
-
range.setEnd(el2, 1);
|
|
103
|
-
|
|
104
|
-
sel.removeAllRanges();
|
|
105
|
-
sel.addRange(range);
|
|
106
|
-
|
|
107
|
-
editor.execCommand('indent');
|
|
108
|
-
|
|
109
|
-
expect(el1.style.marginLeft).equals('10px');
|
|
110
|
-
expect(el2.style.marginLeft).equals('10px');
|
|
111
|
-
expect(el3.style.marginLeft).equals('');
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it('should indent multi-line selection of "dd" and "dt" child elements only on 1st 2 dt/dd groups', function () {
|
|
115
|
-
const editor = getJodit();
|
|
116
|
-
editor.value = `
|
|
117
|
-
<dl>
|
|
118
|
-
<dt><dfn>Falli igitur possumus.</dfn></dt>
|
|
119
|
-
<dd>Quid enim ab antiquis ex eo genere, quod ad disserendum valet, praetermissum est?</dd>
|
|
120
|
-
|
|
121
|
-
<dt><dfn>Scrupulum, inquam, abeunti;</dfn></dt>
|
|
122
|
-
<dd>Scio enim esse quosdam, qui quavis lingua philosophari possint;</dd>
|
|
123
|
-
|
|
124
|
-
<dt><dfn>Poterat autem inpune;</dfn></dt>
|
|
125
|
-
<dd>Tum ille: Tu autem cum ipse tantum librorum habeas, quos hic tandem requiris?</dd>
|
|
126
|
-
</dl>
|
|
127
|
-
`;
|
|
128
|
-
|
|
129
|
-
const children = editor.container.querySelectorAll(
|
|
130
|
-
'.jodit-wysiwyg dt,.jodit-wysiwyg dd'
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
const el1 = children[0];
|
|
134
|
-
const el2 = children[1];
|
|
135
|
-
const el3 = children[2];
|
|
136
|
-
const el4 = children[3];
|
|
137
|
-
const el5 = children[4];
|
|
138
|
-
const el6 = children[5];
|
|
139
|
-
|
|
140
|
-
const sel = editor.s.sel,
|
|
141
|
-
range = editor.s.createRange();
|
|
142
|
-
|
|
143
|
-
range.setStart(el1, 0);
|
|
144
|
-
range.setEnd(el4, 1);
|
|
145
|
-
|
|
146
|
-
sel.removeAllRanges();
|
|
147
|
-
sel.addRange(range);
|
|
148
|
-
|
|
149
|
-
editor.execCommand('indent');
|
|
150
|
-
|
|
151
|
-
expect(el1.style.marginLeft).equals('10px');
|
|
152
|
-
expect(el2.style.marginLeft).equals('10px');
|
|
153
|
-
expect(el3.style.marginLeft).equals('10px');
|
|
154
|
-
expect(el4.style.marginLeft).equals('10px');
|
|
155
|
-
expect(el5.style.marginLeft).equals('');
|
|
156
|
-
expect(el6.style.marginLeft).equals('');
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
describe('If selection element outside the editor', function () {
|
|
160
|
-
it('should do nothing', function () {
|
|
161
|
-
const editor = getJodit(),
|
|
162
|
-
div = appendTestDiv();
|
|
163
|
-
editor.value = 'test';
|
|
164
|
-
|
|
165
|
-
div.innerHTML = 'text';
|
|
166
|
-
|
|
167
|
-
const range = editor.s.createRange();
|
|
168
|
-
|
|
169
|
-
range.setStart(div.firstChild, 0);
|
|
170
|
-
range.setEnd(div.firstChild, 1);
|
|
171
|
-
|
|
172
|
-
editor.s.selectRange(range);
|
|
173
|
-
|
|
174
|
-
editor.execCommand('indent');
|
|
175
|
-
|
|
176
|
-
expect(div.style.marginLeft).does.not.equals('10px');
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
});
|