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.
Files changed (110) hide show
  1. package/.idea/codeStyles/Project.xml +68 -0
  2. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  3. package/.idea/dictionaries/v_chupurnov.xml +10 -0
  4. package/.idea/encodings.xml +4 -0
  5. package/.idea/inspectionProfiles/Project_Default.xml +118 -0
  6. package/.idea/jodit.iml +12 -0
  7. package/.idea/jsLibraryMappings.xml +6 -0
  8. package/.idea/markdown-navigator-enh.xml +29 -0
  9. package/.idea/markdown-navigator.xml +55 -0
  10. package/.idea/misc.xml +6 -0
  11. package/.idea/modules.xml +8 -0
  12. package/.idea/prettier.xml +6 -0
  13. package/.idea/vcs.xml +6 -0
  14. package/.idea/watcherTasks.xml +4 -0
  15. package/.idea/workspace.xml +1264 -0
  16. package/build/jodit.css +2 -2
  17. package/build/jodit.es2018.css +1 -1
  18. package/build/jodit.es2018.en.css +1 -1
  19. package/build/jodit.es2018.en.js +4 -4
  20. package/build/jodit.es2018.en.min.js +2 -2
  21. package/build/jodit.es2018.js +4 -4
  22. package/build/jodit.es2018.min.js +2 -2
  23. package/build/jodit.js +4 -4
  24. package/build/jodit.min.css +1 -1
  25. package/build/jodit.min.js +2 -2
  26. package/package.json +2 -2
  27. package/.travis.yml +0 -7
  28. package/bower.json +0 -33
  29. package/build.js +0 -39
  30. package/docker/Dockerfile +0 -11
  31. package/docker/README.md +0 -45
  32. package/docker/build +0 -3
  33. package/docker/install +0 -7
  34. package/docker/start +0 -3
  35. package/docker/test +0 -3
  36. package/docker/uninstall +0 -3
  37. package/examples/arabic.lang.html +0 -76
  38. package/examples/assets/app.css +0 -175
  39. package/examples/assets/app.js +0 -57
  40. package/examples/assets/download.jpg +0 -0
  41. package/examples/assets/icon.png +0 -0
  42. package/examples/assets/logo.png +0 -0
  43. package/examples/assets/prism.css +0 -200
  44. package/examples/assets/prism.js +0 -1254
  45. package/examples/color-picker.html +0 -139
  46. package/examples/custom-icons.html +0 -173
  47. package/examples/custom-toolbar.html +0 -80
  48. package/examples/example.default.html +0 -75
  49. package/examples/fullsize.html +0 -75
  50. package/examples/index.html +0 -176
  51. package/examples/inline-mode.html +0 -116
  52. package/examples/oneinstance.html +0 -125
  53. package/icons.html +0 -50
  54. package/karma.conf.js +0 -157
  55. package/make.js +0 -10
  56. package/server.js +0 -101
  57. package/test/bootstrap.js +0 -1167
  58. package/test/test.html +0 -102
  59. package/test/test.index.html +0 -11
  60. package/test/tests/acceptance/clipboardTest.js +0 -1234
  61. package/test/tests/acceptance/commandsTest.js +0 -647
  62. package/test/tests/acceptance/creatorTest.js +0 -103
  63. package/test/tests/acceptance/deleteBackSpaceTest.js +0 -1289
  64. package/test/tests/acceptance/dialogTest.js +0 -188
  65. package/test/tests/acceptance/editorTest.js +0 -855
  66. package/test/tests/acceptance/enterTest.js +0 -1088
  67. package/test/tests/acceptance/eventsTest.js +0 -1246
  68. package/test/tests/acceptance/filebrowserTest.js +0 -1309
  69. package/test/tests/acceptance/i18nTest.js +0 -81
  70. package/test/tests/acceptance/iframeTest.js +0 -306
  71. package/test/tests/acceptance/imageTest.js +0 -1649
  72. package/test/tests/acceptance/inlineModeTest.js +0 -826
  73. package/test/tests/acceptance/interfaceTest.js +0 -119
  74. package/test/tests/acceptance/mobileTest.js +0 -229
  75. package/test/tests/acceptance/plugins/classSpan.js +0 -220
  76. package/test/tests/acceptance/plugins/cleanHtml.js +0 -351
  77. package/test/tests/acceptance/plugins/color.js +0 -188
  78. package/test/tests/acceptance/plugins/dragAndDropElement.js +0 -172
  79. package/test/tests/acceptance/plugins/focus.js +0 -115
  80. package/test/tests/acceptance/plugins/font.js +0 -316
  81. package/test/tests/acceptance/plugins/image.js +0 -79
  82. package/test/tests/acceptance/plugins/indent.js +0 -179
  83. package/test/tests/acceptance/plugins/inline-popup.js +0 -578
  84. package/test/tests/acceptance/plugins/insert.js +0 -17
  85. package/test/tests/acceptance/plugins/limit.js +0 -164
  86. package/test/tests/acceptance/plugins/link.js +0 -1640
  87. package/test/tests/acceptance/plugins/orderedList.js +0 -290
  88. package/test/tests/acceptance/plugins/placeholder.js +0 -138
  89. package/test/tests/acceptance/plugins/resizer.js +0 -329
  90. package/test/tests/acceptance/plugins/search.js +0 -623
  91. package/test/tests/acceptance/plugins/size.js +0 -344
  92. package/test/tests/acceptance/plugins/source.js +0 -218
  93. package/test/tests/acceptance/plugins/stat.js +0 -120
  94. package/test/tests/acceptance/plugins/tooltip.js +0 -97
  95. package/test/tests/acceptance/plugins/wrapTextNodes.js +0 -105
  96. package/test/tests/acceptance/pluginsTest.js +0 -2219
  97. package/test/tests/acceptance/selectionTest.js +0 -862
  98. package/test/tests/acceptance/statesTest.js +0 -310
  99. package/test/tests/acceptance/tableTest.js +0 -1988
  100. package/test/tests/acceptance/toolbarTest.js +0 -1747
  101. package/test/tests/acceptance/undoredoTest.js +0 -217
  102. package/test/tests/acceptance/uploaderTest.js +0 -187
  103. package/test/tests/artio.jpg +0 -0
  104. package/test/tests/units/helpersTest.js +0 -771
  105. package/test/tests/units/modules/dom.js +0 -282
  106. package/test/tests/units/objectObserverTest.js +0 -533
  107. package/test/tests/units/popupTest.js +0 -211
  108. package/test/tests/units/positionTest.js +0 -238
  109. package/test/tests/units/styleTest.js +0 -1361
  110. package/webpack.config.js +0 -308
@@ -1,290 +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 orderedList plugin', function () {
7
- describe('Commands', function () {
8
- describe('Unordered', function () {
9
- describe('insertUnorderedList', function () {
10
- it('Run command insertUnorderedList should wrap or replace all paragraphs and headings to ul>li', function () {
11
- const editor = getJodit();
12
- editor.value = '<h1>test</h1><h2>test</h2><p>test</p>';
13
-
14
- editor.execCommand('selectAll');
15
- editor.execCommand('insertUnorderedList');
16
-
17
- expect(editor.value).equals(
18
- '<ul><li>test</li><li>test</li><li>test</li></ul>'
19
- );
20
- });
21
-
22
- it('If press Enter inside <li> in the end it should create new <li> and cursor must be in it', function () {
23
- const editor = getJodit();
24
- editor.value = '<ul><li>test</li></ul>';
25
-
26
- const sel = editor.s.sel,
27
- range = editor.s.createRange();
28
-
29
- range.setStart(
30
- editor.editor.firstChild.firstChild.firstChild,
31
- 4
32
- );
33
- range.collapse(true);
34
-
35
- sel.removeAllRanges();
36
- sel.addRange(range);
37
-
38
- simulateEvent('keydown', Jodit.KEY_ENTER, editor.editor);
39
-
40
- editor.s.insertNode(editor.createInside.text(' a '));
41
-
42
- expect(editor.value).equals(
43
- '<ul><li>test</li><li> a <br></li></ul>'
44
- );
45
- });
46
-
47
- it('If press Enter inside <li> inside some text should split that text and created new <li> and cursor must be in it', function () {
48
- const editor = getJodit();
49
- editor.value = '<ul><li>test</li></ul>';
50
-
51
- const sel = editor.s.sel,
52
- range = editor.s.createRange();
53
-
54
- range.setStart(
55
- editor.editor.firstChild.firstChild.firstChild,
56
- 2
57
- );
58
- range.collapse(true);
59
-
60
- sel.removeAllRanges();
61
- sel.addRange(range);
62
-
63
- simulateEvent('keydown', Jodit.KEY_ENTER, editor.editor);
64
-
65
- editor.s.insertNode(editor.createInside.text(' a '));
66
-
67
- expect(editor.value).equals(
68
- '<ul><li>te</li><li> a st</li></ul>'
69
- );
70
- });
71
- });
72
-
73
- describe('Exec command on selected text', function () {
74
- it('Should wrap this text in ul/li', function () {
75
- const editor = getJodit();
76
- editor.value = 'Hello world';
77
- editor.s.select(editor.editor.firstChild);
78
-
79
- editor.execCommand('insertUnorderedList');
80
-
81
- expect(editor.value).equals(
82
- '<ul><li>Hello world</li></ul>'
83
- );
84
- });
85
- });
86
-
87
- describe('Exec command on collapsed cursor', function () {
88
- it('Should wrap whole text in ul/li', function () {
89
- const editor = getJodit();
90
- editor.value = 'Hello world';
91
- editor.s.setCursorAfter(
92
- editor.editor.firstChild.firstChild
93
- );
94
-
95
- editor.execCommand('insertUnorderedList');
96
-
97
- expect(editor.value).equals(
98
- '<ul><li>Hello world</li></ul>'
99
- );
100
- });
101
- });
102
-
103
- describe('With second argument', function () {
104
- it('Should wrap this text in styled ul/li', function () {
105
- const editor = getJodit();
106
- editor.value = 'Hello world';
107
- editor.s.select(editor.editor.firstChild);
108
-
109
- editor.execCommand('insertUnorderedList', false, 'circle');
110
-
111
- expect(sortAttributes(editor.value)).equals(
112
- '<ul style="list-style-type:circle"><li>Hello world</li></ul>'
113
- );
114
- });
115
- });
116
- });
117
-
118
- describe('Ordered', function () {
119
- describe('Exec command on selected text', function () {
120
- it('Should wrap this text inside ol/li', function () {
121
- const editor = getJodit();
122
- editor.value = 'Hello world';
123
- editor.s.select(editor.editor.firstChild);
124
-
125
- editor.execCommand('insertOrderedList');
126
-
127
- expect(editor.value).equals(
128
- '<ol><li>Hello world</li></ol>'
129
- );
130
- });
131
- });
132
- });
133
-
134
- describe('Run second time', function () {
135
- describe('On same place', function () {
136
- it('Should not do anything', function () {
137
- const editor = getJodit();
138
- editor.value = '<p>test</p>';
139
- editor.s.setCursorIn(editor.editor.firstChild);
140
-
141
- clickButton('ul', editor);
142
-
143
- expect(editor.value.replace(/<br>/, '')).equals(
144
- '<ul><li>test</li></ul>'
145
- );
146
-
147
- clickButton('ul', editor);
148
-
149
- expect(editor.value.replace(/<br>/, '')).equals(
150
- '<p>test</p>'
151
- );
152
- });
153
- });
154
-
155
- describe('Unordered after Unordered', function () {
156
- it('Should unwrap selected ul/li', function () {
157
- const editor = getJodit();
158
- editor.value = '<ul><li>Hello world</li></ul>';
159
- editor.s.select(editor.editor.firstChild);
160
-
161
- editor.execCommand('insertUnorderedList');
162
-
163
- expect(editor.value.replace(/<br>/, '')).equals(
164
- '<p>Hello world</p>'
165
- );
166
- });
167
- });
168
-
169
- describe('Ordered after Unordered', function () {
170
- it('Should replace selected ul/li to ol/li', function () {
171
- const editor = getJodit();
172
- editor.value = '<ul><li>Hello world</li></ul>';
173
- editor.s.select(editor.editor.firstChild);
174
-
175
- editor.execCommand('insertOrderedList');
176
-
177
- expect(editor.value).equals(
178
- '<ol><li>Hello world</li></ol>'
179
- );
180
- });
181
- });
182
-
183
- describe('With another second argument', function () {
184
- it('Should change style.listStyleType', function () {
185
- const editor = getJodit();
186
- editor.value =
187
- '<ul style="list-style-type: circle"><li>Hello world</li></ul>';
188
- editor.s.select(editor.editor.firstChild);
189
-
190
- editor.execCommand('insertUnorderedList', false, 'square');
191
-
192
- expect(sortAttributes(editor.value)).equals(
193
- '<ul style="list-style-type:square"><li>Hello world</li></ul>'
194
- );
195
- });
196
- });
197
- });
198
- });
199
-
200
- describe('UI', function () {
201
- describe('Click on unordered list button', function () {
202
- describe('when selection is collapsed', function () {
203
- it('should wrap current box in new <ul><li> element', function () {
204
- const editor = getJodit();
205
-
206
- editor.value = '<p>Text to text</p>';
207
-
208
- const range = editor.s.createRange();
209
-
210
- range.setStart(editor.editor.firstChild.firstChild, 0);
211
- range.collapse(true);
212
- editor.s.selectRange(range);
213
-
214
- clickButton('ul', editor);
215
-
216
- editor.s.insertHTML('test ');
217
-
218
- expect(editor.value).equals(
219
- '<ul><li>test Text to text</li></ul>'
220
- );
221
- });
222
- });
223
- });
224
-
225
- describe('Click on trigger and click on some element', function () {
226
- describe('when selection is collapsed', function () {
227
- it('should wrap current box in new <ul><li> element with list-style-type', function () {
228
- const editor = getJodit();
229
-
230
- editor.value = '<p>Text to text</p>';
231
-
232
- const range = editor.s.createRange();
233
-
234
- range.setStart(editor.editor.firstChild.firstChild, 0);
235
- range.collapse(true);
236
- editor.s.selectRange(range);
237
-
238
- clickTrigger('ul', editor);
239
- clickButton('circle', getOpenedPopup(editor));
240
-
241
- editor.s.insertHTML('test ');
242
-
243
- expect(sortAttributes(editor.value)).equals(
244
- '<ul style="list-style-type:circle"><li>test Text to text</li></ul>'
245
- );
246
- });
247
- });
248
-
249
- describe('Click on same element inside popup two times', function () {
250
- it('should return ul to first state', function () {
251
- const editor = getJodit();
252
-
253
- editor.value = '<p>Text to text</p>';
254
-
255
- const range = editor.s.createRange();
256
-
257
- range.setStart(editor.editor.firstChild.firstChild, 0);
258
- range.collapse(true);
259
- editor.s.selectRange(range);
260
-
261
- clickTrigger('ul', editor);
262
- clickButton(
263
- 'circle',
264
- document.querySelector(
265
- '[role="popup"][data-editor_id="' + editor.id + '"]'
266
- )
267
- );
268
-
269
- expect(sortAttributes(editor.value)).equals(
270
- '<ul style="list-style-type:circle"><li>Text to text</li></ul>'
271
- );
272
-
273
- clickTrigger('ul', editor);
274
- clickButton(
275
- 'circle',
276
- document.querySelector(
277
- '[role="popup"][data-editor_id="' + editor.id + '"]'
278
- )
279
- );
280
-
281
- editor.s.insertHTML('test ');
282
-
283
- expect(
284
- sortAttributes(editor.value).replace(/<br>/, '')
285
- ).equals('<p>test Text to text</p>');
286
- });
287
- });
288
- });
289
- });
290
- });
@@ -1,138 +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('Placeholder plugin', function () {
7
- describe('After init on empty textarea', function () {
8
- it('Should show placeholder', function () {
9
- const area = appendTestArea();
10
-
11
- area.value = '';
12
-
13
- const editor = new Jodit(area);
14
-
15
- expect(
16
- editor.container.querySelectorAll('.jodit-placeholder')
17
- .length &&
18
- editor.container.querySelector('.jodit-placeholder').style
19
- .display === 'block'
20
- ).is.true;
21
- });
22
- });
23
-
24
- describe('After init on not empty textarea', function () {
25
- it('Should hide placeholder', function () {
26
- const area = appendTestArea();
27
- area.value = '111';
28
- const editor = new Jodit(area);
29
- expect(
30
- !editor.container.querySelectorAll('.jodit-placeholder').length
31
- ).is.true;
32
- });
33
-
34
- describe('Empty P', function () {
35
- it('Should show placeholder', function () {
36
- const area = appendTestArea();
37
- area.value = '<p><br></p>';
38
- const editor = new Jodit(area);
39
-
40
- expect(editor.container.querySelector('.jodit-placeholder')).is
41
- .not.null;
42
- });
43
- });
44
-
45
- describe('Empty UL/LI', function () {
46
- it('Should not show placeholder', function () {
47
- const area = appendTestArea();
48
- area.value = '<ul><li><br></li></ul>';
49
- const editor = new Jodit(area);
50
-
51
- expect(editor.container.querySelector('.jodit-placeholder')).is
52
- .null;
53
- });
54
- });
55
- });
56
-
57
- describe('Add text inside editor', function () {
58
- it('should show placeholder', function () {
59
- const area = appendTestArea();
60
- const editor = new Jodit(area);
61
-
62
- editor.value = '';
63
-
64
- expect(
65
- editor.container.querySelectorAll('.jodit-placeholder')
66
- .length &&
67
- editor.container.querySelector('.jodit-placeholder').style
68
- .display === 'block'
69
- ).is.true;
70
-
71
- editor.s.insertNode(editor.createInside.text('test'));
72
-
73
- expect(
74
- !editor.container.querySelectorAll('.jodit-placeholder').length
75
- ).is.true;
76
- });
77
- });
78
-
79
- describe('For element with fontsize 12px', function () {
80
- it("Should set Placeholder's fontsize", function () {
81
- const area = appendTestArea();
82
- const editor = new Jodit(area);
83
-
84
- editor.editor.style.fontSize = '12px';
85
- simulateEvent('keydown', Jodit.KEY_BACKSPACE, editor.editor);
86
- expect(
87
- editor.container.querySelectorAll('.jodit-placeholder')
88
- .length &&
89
- editor.container.querySelector('.jodit-placeholder').style
90
- .fontSize === '12px'
91
- ).is.true;
92
- });
93
- });
94
-
95
- describe('For different align', function () {
96
- it("Should set Placeholder's text-align", function () {
97
- const editor = getJodit();
98
-
99
- editor.value = '<p><br></p>';
100
- editor.s.setCursorIn(editor.editor.firstChild);
101
-
102
- clickTrigger('left', editor);
103
- const list = getOpenedPopup(editor);
104
- clickButton('right', list);
105
-
106
- const placeholder = editor.container.querySelector(
107
- '[data-ref="placeholder"]'
108
- );
109
-
110
- expect(placeholder.style.textAlign === 'right').is.true;
111
-
112
- clickTrigger('left', editor);
113
- const list2 = getOpenedPopup(editor);
114
- clickButton('center', list2);
115
-
116
- expect(placeholder.style.textAlign === 'center').is.true;
117
- });
118
- });
119
-
120
- describe('ReadOnly', function () {
121
- it('Should hide placeholder', function () {
122
- const table_editor_interface = appendTestArea();
123
- table_editor_interface.value = '';
124
-
125
- const editor = new Jodit(table_editor_interface, {
126
- readonly: true
127
- });
128
-
129
- expect(
130
- !editor.container.querySelectorAll('.jodit-placeholder').length
131
- ).is.true;
132
- editor.value = 'test';
133
- expect(
134
- !editor.container.querySelectorAll('.jodit-placeholder').length
135
- ).is.true;
136
- });
137
- });
138
- });