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,217 +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
-
7
- describe('Undo/Redo behaviors', function () {
8
- describe('Do some changes', function () {
9
- it('Should change redo/undo stack', function () {
10
- const editor = getJodit({
11
- observer: {
12
- timeout: 0
13
- }
14
- });
15
-
16
- editor.value = 'test';
17
-
18
- const range = editor.s.createRange();
19
- range.setEnd(editor.editor.firstChild.firstChild, 4);
20
- range.collapse(false);
21
- editor.s.selectRange(range);
22
-
23
- clickTrigger('paragraph', editor);
24
-
25
- const list = getOpenedPopup(editor);
26
-
27
- clickButton('h1', list);
28
-
29
- expect(editor.value).equals('<h1>test</h1>');
30
-
31
- editor.execCommand('undo');
32
-
33
- expect(editor.value).equals('<p>test</p>');
34
-
35
- editor.execCommand('redo');
36
-
37
- expect(editor.value).equals('<h1>test</h1>');
38
- });
39
-
40
- describe('Several operations', function () {
41
- it('Should work perfect', function () {
42
- const editor = getJodit();
43
- editor.value =
44
- '<p>test</p>' +
45
- '<ul>' +
46
- '<li>test2</li>' +
47
- '<li>test3</li>' +
48
- '<li><a>test4</a></li>' +
49
- '</ul>';
50
-
51
- const range = editor.s.createRange();
52
- range.setStart(editor.editor.firstChild.firstChild, 1);
53
- range.setEnd(editor.editor.lastChild.firstChild, 1);
54
- editor.s.selectRange(range);
55
-
56
- simulateEvent('keydown', Jodit.KEY_BACKSPACE, editor.editor);
57
-
58
- expect(editor.value).equals(
59
- '<p>t</p><ul><li>test3</li><li><a>test4</a></li></ul>'
60
- );
61
-
62
- editor.execCommand('undo');
63
-
64
- expect(editor.value).equals(
65
- '<p>test</p><ul><li>test2</li><li>test3</li><li><a>test4</a></li></ul>'
66
- );
67
-
68
- range.setStart(editor.editor.firstChild.firstChild, 0);
69
- range.setEnd(editor.editor.firstChild.firstChild, 3);
70
- editor.s.selectRange(range);
71
-
72
- simulateEvent('keydown', Jodit.KEY_BACKSPACE, editor.editor);
73
-
74
- expect(editor.value).equals(
75
- '<p>t</p><ul><li>test2</li><li>test3</li><li><a>test4</a></li></ul>'
76
- );
77
-
78
- editor.execCommand('undo');
79
-
80
- expect(editor.value).equals(
81
- '<p>test</p><ul><li>test2</li><li>test3</li><li><a>test4</a></li></ul>'
82
- );
83
- });
84
- });
85
- });
86
-
87
- describe('Commands', function () {
88
- it('Undo. Enter text wait and again enter text. After execute "undo" command. First text should be returned', function () {
89
- const editor = getJodit({
90
- observer: {
91
- timeout: 0 // disable delay
92
- }
93
- });
94
-
95
- editor.value = 'test';
96
- editor.value = 'test2';
97
- editor.execCommand('undo');
98
- expect(editor.value).equals('<p>test</p>');
99
- });
100
-
101
- it('Redo. Enter text wait and again enter text. After execute "undo" + "redo" command in editor should be second text', function () {
102
- const editor = getJodit({
103
- observer: {
104
- timeout: 0
105
- }
106
- });
107
-
108
- editor.value = 'test';
109
- editor.value = 'test2';
110
- editor.execCommand('undo');
111
- expect(editor.value).equals('<p>test</p>');
112
- editor.execCommand('redo');
113
- expect(editor.value).equals('<p>test2</p>');
114
- });
115
-
116
- it('Check react UndoRedo to another changes', function () {
117
- const editor = getJodit({
118
- observer: {
119
- timeout: 0
120
- }
121
- });
122
-
123
- editor.value = 'test';
124
-
125
- const range = editor.s.createRange();
126
- range.setEnd(editor.editor.firstChild.firstChild, 4);
127
- range.collapse(false);
128
- editor.s.sel.removeAllRanges();
129
- editor.s.sel.addRange(range);
130
-
131
- editor.s.insertNode(editor.createInside.text('test2'));
132
- editor.execCommand('undo');
133
- expect(editor.value).equals('<p>test</p>');
134
-
135
- editor.execCommand('redo');
136
- expect(editor.value).equals('<p>testtest2</p>');
137
- });
138
- });
139
-
140
- describe('Clear stack', function () {
141
- it('Should disable both buttons in toolbar and all calls redo and undo must do nothing', function () {
142
- const editor = getJodit({
143
- toolbarAdaptive: false,
144
- observer: {
145
- timeout: 0
146
- }
147
- });
148
-
149
- const undo = getButton('undo', editor);
150
- expect(undo).is.not.null;
151
- const redo = getButton('redo', editor);
152
- expect(redo).is.not.null;
153
-
154
- expect(undo.hasAttribute('disabled')).is.true;
155
- expect(redo.hasAttribute('disabled')).is.true;
156
-
157
- editor.value = 'test';
158
- editor.value = 'stop';
159
-
160
- expect(undo.hasAttribute('disabled')).is.false;
161
- expect(redo.hasAttribute('disabled')).is.true;
162
-
163
- simulateEvent('click', 0, undo);
164
- expect(editor.value).equals('<p>test</p>');
165
- expect(undo.hasAttribute('disabled')).is.false;
166
- expect(redo.hasAttribute('disabled')).is.false;
167
-
168
- simulateEvent('click', 0, redo);
169
- expect(editor.value).equals('<p>stop</p>');
170
- expect(undo.hasAttribute('disabled')).is.false;
171
- expect(redo.hasAttribute('disabled')).is.true;
172
-
173
- editor.observer.clear();
174
-
175
- expect(undo.hasAttribute('disabled')).is.true;
176
- expect(redo.hasAttribute('disabled')).is.true;
177
- expect(editor.value).equals('<p>stop</p>');
178
-
179
- editor.execCommand('undo');
180
- expect(undo.hasAttribute('disabled')).is.true;
181
- expect(redo.hasAttribute('disabled')).is.true;
182
- expect(editor.value).equals('<p>stop</p>');
183
- });
184
- });
185
-
186
- describe('Limited history', function () {
187
- it('Should store only limited history', function () {
188
- const editor = getJodit({
189
- observer: {
190
- maxHistoryLength: 3
191
- }
192
- });
193
-
194
- editor.value = '<p>123456789|</p>';
195
-
196
- setCursorToChar(editor);
197
-
198
- simulateEvent('keydown', Jodit.KEY_BACKSPACE, editor.editor);
199
- simulateEvent('keydown', Jodit.KEY_BACKSPACE, editor.editor);
200
- simulateEvent('keydown', Jodit.KEY_BACKSPACE, editor.editor);
201
- simulateEvent('keydown', Jodit.KEY_BACKSPACE, editor.editor);
202
- simulateEvent('keydown', Jodit.KEY_BACKSPACE, editor.editor);
203
- simulateEvent('keydown', Jodit.KEY_BACKSPACE, editor.editor);
204
-
205
- expect(editor.value).equals('<p>123</p>');
206
-
207
- editor.execCommand('undo');
208
- editor.execCommand('undo');
209
- editor.execCommand('undo');
210
- editor.execCommand('undo');
211
- editor.execCommand('undo');
212
- editor.execCommand('undo');
213
-
214
- expect(editor.value).equals('<p>123456</p>');
215
- });
216
- });
217
- });
@@ -1,187 +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 uploader module', function () {
7
- describe('Drop file', function () {
8
- describe('Drop Image like base64', function () {
9
- it('Should insert image with SRC in base64', function (done) {
10
- const file = new FileImage(),
11
- editor = getJodit({
12
- uploader: {
13
- insertImageAsBase64URI: true
14
- },
15
- events: {
16
- afterInsertImage: function (img) {
17
- expect(img.src).equals(file.dataURI);
18
- expect(sortAttributes(editor.value)).equals(
19
- '<p><img src="' +
20
- file.dataURI +
21
- '" style="width:300px"></p>'
22
- );
23
- done();
24
- }
25
- }
26
- });
27
-
28
- simulateEvent('drop', 0, editor.editor, function (data) {
29
- Object.defineProperty(data, 'dataTransfer', {
30
- value: {
31
- files: [file]
32
- }
33
- });
34
- });
35
- });
36
- });
37
-
38
- describe('Drop Image and upload on server', function () {
39
- it('Should upload file and insert image with SRC from server', function (done) {
40
- const file = new FileImage(),
41
- editor = getJodit({
42
- observer: {
43
- timeout: 0
44
- },
45
- uploader: {
46
- url: 'https://xdsoft.net/jodit/connector/index.php?action=fileUpload'
47
- },
48
- events: {
49
- afterInsertImage: function (img) {
50
- expect(img.src).equals(
51
- 'https://xdsoft.net/jodit/files/logo.gif'
52
- );
53
-
54
- expect(sortAttributes(editor.value)).equals(
55
- '<p><img src="https://xdsoft.net/jodit/files/logo.gif" style="width:300px"></p>'
56
- );
57
-
58
- done();
59
- }
60
- }
61
- });
62
-
63
- simulateEvent('drop', 0, editor.editor, function (data) {
64
- Object.defineProperty(data, 'dataTransfer', {
65
- value: {
66
- files: [file]
67
- }
68
- });
69
- });
70
- });
71
-
72
- describe('For iframe mode', function () {
73
- it('Should upload file and insert image with SRC from server', function (done) {
74
- const timer = setTimeout(function () {
75
- expect(true).is.false;
76
- }, 4000);
77
-
78
- const file = new FileImage(),
79
- editor = getJodit({
80
- iframe: true,
81
- observer: {
82
- timeout: 0
83
- },
84
- uploader: {
85
- url: 'https://xdsoft.net/jodit/connector/index.php?action=fileUpload'
86
- },
87
- events: {
88
- afterInsertImage: function (img) {
89
- clearTimeout(timer);
90
-
91
- expect(img.src).equals(
92
- 'https://xdsoft.net/jodit/files/logo.gif'
93
- );
94
- expect(sortAttributes(editor.value)).equals(
95
- '<p><img src="https://xdsoft.net/jodit/files/logo.gif" style="width:300px"></p>'
96
- );
97
- done();
98
- }
99
- }
100
- });
101
-
102
- setTimeout(function () {
103
- simulateEvent(
104
- 'drop',
105
- 0,
106
- editor.editor,
107
- function (data) {
108
- Object.defineProperty(data, 'dataTransfer', {
109
- value: {
110
- files: [file]
111
- }
112
- });
113
- }
114
- );
115
- }, 300);
116
- });
117
- });
118
- });
119
-
120
- describe('Drop File and upload on server', function () {
121
- it('Should upload file and insert A element with HREF to file on server', function (done) {
122
- const file = new FileXLS(),
123
- editor = getJodit({
124
- observer: {
125
- timeout: 0
126
- },
127
- uploader: {
128
- url: 'https://xdsoft.net/jodit/connector/index.php?action=fileUpload'
129
- },
130
- events: {
131
- afterInsertNode: function (node) {
132
- expect(node.href).equals(
133
- 'https://xdsoft.net/jodit/files/file.xls'
134
- );
135
- expect(editor.value).equals(
136
- '<p><a href="https://xdsoft.net/jodit/files/file.xls">https://xdsoft.net/jodit/files/file.xls</a></p>'
137
- );
138
- done();
139
- }
140
- }
141
- });
142
-
143
- simulateEvent('drop', 0, editor.editor, function (data) {
144
- Object.defineProperty(data, 'dataTransfer', {
145
- value: {
146
- files: [file]
147
- }
148
- });
149
- });
150
- });
151
-
152
- describe('Drop with insertImageAsBase64URI=true', function () {
153
- it('Should upload file and insert A element with HREF to file on server', function (done) {
154
- const file = new FileXLS(),
155
- editor = getJodit({
156
- observer: {
157
- timeout: 0
158
- },
159
- uploader: {
160
- url: 'https://xdsoft.net/jodit/connector/index.php?action=fileUpload',
161
- insertImageAsBase64URI: true
162
- },
163
- events: {
164
- afterInsertNode: function (node) {
165
- expect(node.href).equals(
166
- 'https://xdsoft.net/jodit/files/file.xls'
167
- );
168
- expect(editor.value).equals(
169
- '<p><a href="https://xdsoft.net/jodit/files/file.xls">https://xdsoft.net/jodit/files/file.xls</a></p>'
170
- );
171
- done();
172
- }
173
- }
174
- });
175
-
176
- simulateEvent('drop', 0, editor.editor, function (data) {
177
- Object.defineProperty(data, 'dataTransfer', {
178
- value: {
179
- files: [file]
180
- }
181
- });
182
- });
183
- });
184
- });
185
- });
186
- });
187
- });
Binary file