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,164 +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('Limit plugin', function () {
|
|
7
|
-
describe('Keydown', function () {
|
|
8
|
-
describe('On keydown when editor already full', function () {
|
|
9
|
-
it('should deny insert any chars', function (done) {
|
|
10
|
-
const editor = getJodit({
|
|
11
|
-
limitChars: 5,
|
|
12
|
-
observer: {
|
|
13
|
-
timeout: 5
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
editor.value = '11111';
|
|
18
|
-
editor.s.insertHTML('a');
|
|
19
|
-
|
|
20
|
-
setTimeout(() => {
|
|
21
|
-
expect(editor.value).equals('<p>11111</p>');
|
|
22
|
-
done();
|
|
23
|
-
}, 200);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('Stat plugin', function () {
|
|
27
|
-
it('should show chars count', function (done) {
|
|
28
|
-
const editor = getJodit({
|
|
29
|
-
limitChars: 5,
|
|
30
|
-
observer: {
|
|
31
|
-
timeout: 5
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
editor.value = '1111';
|
|
36
|
-
|
|
37
|
-
editor.s.insertHTML('a');
|
|
38
|
-
editor.s.insertHTML('a');
|
|
39
|
-
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
expect(editor.value).equals('<p>a1111</p>');
|
|
42
|
-
const chars = editor.statusbar.container.querySelector(
|
|
43
|
-
'.jodit-status-bar__item'
|
|
44
|
-
);
|
|
45
|
-
expect(chars.textContent.trim()).equals('Chars: 5');
|
|
46
|
-
done();
|
|
47
|
-
}, 200);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
describe('Prevent keypress', function () {
|
|
51
|
-
it('should show chars count', function (done) {
|
|
52
|
-
const editor = getJodit({
|
|
53
|
-
limitChars: 5,
|
|
54
|
-
observer: {
|
|
55
|
-
timeout: 5
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
editor.value = '<p>1111</p>';
|
|
60
|
-
|
|
61
|
-
const range = editor.s.createRange(true);
|
|
62
|
-
|
|
63
|
-
range.setEndAfter(editor.editor.firstChild.firstChild);
|
|
64
|
-
range.collapse(false);
|
|
65
|
-
|
|
66
|
-
expect(simulateEvent('keydown', 'v', editor.editor)).is
|
|
67
|
-
.true;
|
|
68
|
-
|
|
69
|
-
editor.value = '<p>11111</p>';
|
|
70
|
-
expect(simulateEvent('keydown', 'v', editor.editor)).is
|
|
71
|
-
.false;
|
|
72
|
-
|
|
73
|
-
setTimeout(() => {
|
|
74
|
-
expect(editor.value).equals('<p>11111</p>');
|
|
75
|
-
const chars =
|
|
76
|
-
editor.statusbar.container.querySelector(
|
|
77
|
-
'.jodit-status-bar__item'
|
|
78
|
-
);
|
|
79
|
-
expect(chars.textContent.trim()).equals('Chars: 5');
|
|
80
|
-
done();
|
|
81
|
-
}, 200);
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
describe('Paste', function () {
|
|
89
|
-
describe('When editor already full', function () {
|
|
90
|
-
it('should deny insert any chars', function (done) {
|
|
91
|
-
const editor = getJodit({
|
|
92
|
-
limitChars: 5,
|
|
93
|
-
observer: {
|
|
94
|
-
timeout: 5
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
editor.value = '11111';
|
|
99
|
-
|
|
100
|
-
simulateEvent('paste', editor.editor, function (data) {
|
|
101
|
-
data.clipboardData = {
|
|
102
|
-
types: ['text/html'],
|
|
103
|
-
getData: function () {
|
|
104
|
-
return 'a';
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
setTimeout(() => {
|
|
110
|
-
expect(editor.value).equals('<p>11111</p>');
|
|
111
|
-
done();
|
|
112
|
-
}, 200);
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
describe('Limit words', function () {
|
|
118
|
-
describe('Paste', function () {
|
|
119
|
-
describe('When editor already full', function () {
|
|
120
|
-
it('should deny insert any chars', function (done) {
|
|
121
|
-
const editor = getJodit({
|
|
122
|
-
limitWords: 3,
|
|
123
|
-
observer: {
|
|
124
|
-
timeout: 5
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
editor.value = '11111';
|
|
129
|
-
|
|
130
|
-
editor.s.setCursorAfter(
|
|
131
|
-
editor.editor.firstChild.firstChild
|
|
132
|
-
);
|
|
133
|
-
|
|
134
|
-
const paste = function () {
|
|
135
|
-
simulateEvent('paste', editor.editor, function (data) {
|
|
136
|
-
data.clipboardData = {
|
|
137
|
-
types: ['text/html'],
|
|
138
|
-
getData: function () {
|
|
139
|
-
return ' aaa';
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
const timeout = () => {
|
|
146
|
-
setTimeout(() => {
|
|
147
|
-
expect(editor.value).equals('<p>11111 aaa</p>');
|
|
148
|
-
done();
|
|
149
|
-
}, 200);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
paste();
|
|
153
|
-
expect(editor.value).equals('<p>11111 aaa</p>');
|
|
154
|
-
|
|
155
|
-
paste();
|
|
156
|
-
expect(editor.value).equals('<p>11111 aaa</p>');
|
|
157
|
-
|
|
158
|
-
paste();
|
|
159
|
-
timeout();
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
});
|