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,188 +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('Dialog system tests', function () {
|
|
7
|
-
describe('About dialog', function () {
|
|
8
|
-
it('Should be opened when use clicks on the About button', function () {
|
|
9
|
-
getBox().style.width = '100%';
|
|
10
|
-
|
|
11
|
-
const editor = getJodit({
|
|
12
|
-
disablePlugins: 'mobile'
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const about = getButton('about', editor);
|
|
16
|
-
expect(about).is.not.null;
|
|
17
|
-
|
|
18
|
-
simulateEvent('click', 0, about);
|
|
19
|
-
|
|
20
|
-
const dialog = getOpenedDialog(editor);
|
|
21
|
-
expect(dialog).is.not.null;
|
|
22
|
-
|
|
23
|
-
expect(dialog.innerHTML.indexOf('xdsoft.net') !== -1).is.true;
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('Close About dialog', function () {
|
|
27
|
-
it('Should show Close button in right top corner and close dialog after click', function () {
|
|
28
|
-
getBox().style.width = '100%';
|
|
29
|
-
const editor = getJodit({
|
|
30
|
-
disablePlugins: 'mobile'
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const about = getButton('about', editor);
|
|
34
|
-
expect(about).is.not.null;
|
|
35
|
-
|
|
36
|
-
simulateEvent('click', 0, about);
|
|
37
|
-
|
|
38
|
-
const dialog = getOpenedDialog(editor);
|
|
39
|
-
expect(dialog).is.not.null;
|
|
40
|
-
|
|
41
|
-
expect(dialog.innerHTML.indexOf('xdsoft.net') !== -1).is.true;
|
|
42
|
-
|
|
43
|
-
const close = getButton('close', dialog);
|
|
44
|
-
expect(close).is.not.null;
|
|
45
|
-
|
|
46
|
-
simulateEvent('click', 0, close);
|
|
47
|
-
|
|
48
|
-
expect(getOpenedDialog(editor)).is.null;
|
|
49
|
-
|
|
50
|
-
expect(dialog.parentElement).is.null;
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
describe('Popup inside dialog', function () {
|
|
56
|
-
it('Should be opened under dialog', function () {
|
|
57
|
-
getBox().style.width = '100%';
|
|
58
|
-
|
|
59
|
-
const editor = getJodit({
|
|
60
|
-
filebrowser: {
|
|
61
|
-
ajax: {
|
|
62
|
-
url: 'https://xdsoft.net/jodit/connector/index.php'
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
editor.value = '<img alt="" src="../artio.jpg"/>';
|
|
67
|
-
editor.s.focus();
|
|
68
|
-
|
|
69
|
-
simulateEvent('click', editor.editor.querySelector('img'));
|
|
70
|
-
|
|
71
|
-
const popup = getOpenedPopup(editor);
|
|
72
|
-
clickButton('pencil', popup);
|
|
73
|
-
|
|
74
|
-
const dialog = getOpenedDialog(editor);
|
|
75
|
-
const changeImage = dialog.querySelector(
|
|
76
|
-
'a[data-ref="changeImage"]'
|
|
77
|
-
);
|
|
78
|
-
expect(changeImage).is.not.null;
|
|
79
|
-
|
|
80
|
-
simulateEvent('click', changeImage);
|
|
81
|
-
|
|
82
|
-
const popup2 = getOpenedPopup(editor);
|
|
83
|
-
expect(popup2).is.not.null;
|
|
84
|
-
|
|
85
|
-
const pos = Jodit.modules.Helpers.position(popup2),
|
|
86
|
-
elm = document.elementFromPoint(pos.left + 20, pos.top + 20);
|
|
87
|
-
|
|
88
|
-
expect(Jodit.modules.Dom.isOrContains(popup2, elm)).is.true;
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
describe('Short Jodit.Alert etc static methods', function () {
|
|
93
|
-
it('Should work without Jodit instance', function () {
|
|
94
|
-
const dialog = Jodit.Alert('Hello');
|
|
95
|
-
dialog.close();
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it('Should return Dialog instance', function () {
|
|
99
|
-
const dialog = Jodit.Alert('Hello');
|
|
100
|
-
expect(dialog instanceof Jodit.modules.Dialog).is.true;
|
|
101
|
-
dialog.close();
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
describe('Show not string', function () {
|
|
105
|
-
it('Should show dialog with toString value', function () {
|
|
106
|
-
const dialog = Jodit.Alert(111);
|
|
107
|
-
expect(
|
|
108
|
-
dialog.dialog.querySelector('.jodit-dialog__content')
|
|
109
|
-
.textContent
|
|
110
|
-
).equals('111');
|
|
111
|
-
dialog.close();
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
it('Should get string or HTMLElement or array of string or array of HTMLElement in arguments', function () {
|
|
115
|
-
const dialog = Jodit.Alert(['<div id="hello1">Hello</div>']);
|
|
116
|
-
expect(document.getElementById('hello1')).is.not.null;
|
|
117
|
-
dialog.close();
|
|
118
|
-
|
|
119
|
-
const dialog2 = Jodit.Alert(document.createTextNode('Test'));
|
|
120
|
-
expect(dialog2 instanceof Jodit.modules.Dialog).is.true;
|
|
121
|
-
dialog2.close();
|
|
122
|
-
|
|
123
|
-
const div = document.createElement('div');
|
|
124
|
-
div.id = 'hello3';
|
|
125
|
-
const dialog3 = Jodit.Alert(div);
|
|
126
|
-
expect(div).equals(document.getElementById('hello3'));
|
|
127
|
-
dialog3.close();
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
describe('Dialog image', function () {
|
|
132
|
-
describe('Opened dialog image', function () {
|
|
133
|
-
it('Should disable margin inputs for left, bottom, right if element has equals margins(margin:10px;)', function () {
|
|
134
|
-
const editor = getJodit({
|
|
135
|
-
observer: {
|
|
136
|
-
timeout: 0
|
|
137
|
-
},
|
|
138
|
-
image: {
|
|
139
|
-
openOnDblClick: true
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
editor.value =
|
|
143
|
-
'<img src="https://xdsoft.net/jodit/build/images/artio.jpg" style="margin:10px;border:1px solid red;width:100px;height:100px;"/>';
|
|
144
|
-
simulateEvent(
|
|
145
|
-
'dblclick',
|
|
146
|
-
0,
|
|
147
|
-
editor.editor.querySelector('img')
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
const dialog = getOpenedDialog(editor);
|
|
151
|
-
|
|
152
|
-
expect(dialog.style.display).does.not.equal('none');
|
|
153
|
-
expect(
|
|
154
|
-
dialog.querySelectorAll(
|
|
155
|
-
'[data-ref="marginBottom"][disabled]'
|
|
156
|
-
).length
|
|
157
|
-
).equals(1);
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it('Should enable margin inputs for left, bottom, right if element has not equals margins(margin:10px 5px;)', function () {
|
|
161
|
-
const editor = getJodit({
|
|
162
|
-
observer: {
|
|
163
|
-
timeout: 0
|
|
164
|
-
},
|
|
165
|
-
image: {
|
|
166
|
-
openOnDblClick: true
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
editor.value =
|
|
170
|
-
'<img src="https://xdsoft.net/jodit/build/images/artio.jpg" style="margin:10px 5px;border:1px solid red;width:100px;height:100px;"/>';
|
|
171
|
-
simulateEvent(
|
|
172
|
-
'dblclick',
|
|
173
|
-
0,
|
|
174
|
-
editor.editor.querySelector('img')
|
|
175
|
-
);
|
|
176
|
-
|
|
177
|
-
const dialog = getOpenedDialog(editor);
|
|
178
|
-
|
|
179
|
-
expect(dialog.style.display).does.not.equal('none');
|
|
180
|
-
expect(
|
|
181
|
-
dialog.querySelectorAll(
|
|
182
|
-
'[data-ref="marginBottom"][disabled]'
|
|
183
|
-
).length
|
|
184
|
-
).equals(0);
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
});
|