suneditor 2.43.5 → 2.43.8
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/dist/suneditor.min.js +2 -2
- package/package.json +1 -1
- package/src/assets/defaultIcons.js +2 -2
- package/src/lib/constructor.js +34 -29
- package/src/lib/context.js +17 -17
- package/src/lib/core.d.ts +0 -7
- package/src/lib/core.js +404 -200
- package/src/lib/util.d.ts +13 -0
- package/src/lib/util.js +45 -1
- package/src/plugins/dialog/audio.js +12 -8
- package/src/plugins/dialog/image.js +14 -10
- package/src/plugins/dialog/link.js +2 -2
- package/src/plugins/dialog/math.js +2 -2
- package/src/plugins/dialog/mention.js +1 -1
- package/src/plugins/dialog/video.js +14 -10
- package/src/plugins/modules/_anchor.js +2 -2
- package/src/plugins/modules/_colorPicker.js +3 -3
- package/src/plugins/modules/fileBrowser.js +2 -2
- package/src/plugins/submenu/align.js +1 -1
- package/src/plugins/submenu/font.js +3 -14
- package/src/plugins/submenu/fontSize.js +2 -2
- package/src/plugins/submenu/formatBlock.js +1 -1
- package/src/plugins/submenu/horizontalRule.js +1 -1
- package/src/plugins/submenu/lineHeight.js +2 -2
- package/src/plugins/submenu/list.js +2 -2
- package/src/plugins/submenu/paragraphStyle.js +1 -1
- package/src/plugins/submenu/table.js +2 -2
- package/src/plugins/submenu/template.js +1 -1
- package/src/plugins/submenu/textStyle.js +1 -1
package/src/lib/util.d.ts
CHANGED
|
@@ -42,6 +42,12 @@ declare interface util {
|
|
|
42
42
|
*/
|
|
43
43
|
camelToKebabCase(param: string | string[]): string | string[],
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* @description Convert the KebabCase To the CamelCase.
|
|
47
|
+
* @param {String|Array} param [KebabCase string]
|
|
48
|
+
*/
|
|
49
|
+
kebabToCamelCase(param: string | string[]): string | string[],
|
|
50
|
+
|
|
45
51
|
/**
|
|
46
52
|
* @description Create Element node
|
|
47
53
|
* @param elementName Element name
|
|
@@ -351,6 +357,13 @@ declare interface util {
|
|
|
351
357
|
*/
|
|
352
358
|
isEmptyLine(element: Element): boolean;
|
|
353
359
|
|
|
360
|
+
/**
|
|
361
|
+
* @description Check the span's attributes are empty.
|
|
362
|
+
* @param {Element} element Element node
|
|
363
|
+
* @returns {Boolean}
|
|
364
|
+
*/
|
|
365
|
+
isSpanWithoutAttr(element: Element|null): boolean;
|
|
366
|
+
|
|
354
367
|
/**
|
|
355
368
|
* @description Check the node is a list (ol, ul)
|
|
356
369
|
* @param node The element or element name to check
|
package/src/lib/util.js
CHANGED
|
@@ -119,6 +119,19 @@ const util = {
|
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
|
|
122
|
+
/**
|
|
123
|
+
* @description Convert the KebabCase To the CamelCase.
|
|
124
|
+
* @param {String|Array} param [KebabCase string]
|
|
125
|
+
* @returns {String|Array}
|
|
126
|
+
*/
|
|
127
|
+
kebabToCamelCase: function (param) {
|
|
128
|
+
if (typeof param === 'string') {
|
|
129
|
+
return param.replace(/-[a-zA-Z]/g, function (letter) { return letter.replace('-', '').toUpperCase(); });
|
|
130
|
+
} else {
|
|
131
|
+
return param.map(function(str) { return util.camelToKebabCase(str); });
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
|
|
122
135
|
/**
|
|
123
136
|
* @description Create Element node
|
|
124
137
|
* @param {String} elementName Element name
|
|
@@ -763,6 +776,15 @@ const util = {
|
|
|
763
776
|
return !element || !element.parentNode || (!element.querySelector('IMG, IFRAME, AUDIO, VIDEO, CANVAS, TABLE') && this.onlyZeroWidthSpace(element.textContent));
|
|
764
777
|
},
|
|
765
778
|
|
|
779
|
+
/**
|
|
780
|
+
* @description Check the span's attributes are empty.
|
|
781
|
+
* @param {Element|null} element Element node
|
|
782
|
+
* @returns {Boolean}
|
|
783
|
+
*/
|
|
784
|
+
isSpanWithoutAttr: function (element) {
|
|
785
|
+
return !!element && element.nodeType === 1 && /^SPAN$/i.test(element.nodeName) && !element.className && !element.style.cssText;
|
|
786
|
+
},
|
|
787
|
+
|
|
766
788
|
/**
|
|
767
789
|
* @description Check the node is a list (ol, ul)
|
|
768
790
|
* @param {Node|String} node The element or element name to check
|
|
@@ -1375,11 +1397,33 @@ const util = {
|
|
|
1375
1397
|
* @description Split all tags based on "baseNode"
|
|
1376
1398
|
* Returns the last element of the splited tag.
|
|
1377
1399
|
* @param {Node} baseNode Element or text node on which to base
|
|
1378
|
-
* @param {Number|null} offset Text offset of "baseNode" (Only valid when "baseNode" is a text node)
|
|
1400
|
+
* @param {Number|Node|null} offset Text offset of "baseNode" (Only valid when "baseNode" is a text node)
|
|
1379
1401
|
* @param {Number} depth The nesting depth of the element being split. (default: 0)
|
|
1380
1402
|
* @returns {Element}
|
|
1381
1403
|
*/
|
|
1382
1404
|
splitElement: function (baseNode, offset, depth) {
|
|
1405
|
+
if (this.isWysiwygDiv(baseNode)) return baseNode;
|
|
1406
|
+
|
|
1407
|
+
if (!!offset && !this.isNumber(offset)) {
|
|
1408
|
+
const children = baseNode.childNodes;
|
|
1409
|
+
let index = this.getPositionIndex(offset);
|
|
1410
|
+
const prev = baseNode.cloneNode(false);
|
|
1411
|
+
const next = baseNode.cloneNode(false);
|
|
1412
|
+
for (let i = 0, len = children.length; i < len; i++) {
|
|
1413
|
+
if (i < index) prev.appendChild(children[i]);
|
|
1414
|
+
else if (i > index) next.appendChild(children[i]);
|
|
1415
|
+
else continue;
|
|
1416
|
+
i--;
|
|
1417
|
+
len--;
|
|
1418
|
+
index--;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
if (prev.childNodes.length > 0) baseNode.parentNode.insertBefore(prev, baseNode);
|
|
1422
|
+
if (next.childNodes.length > 0) baseNode.parentNode.insertBefore(next, baseNode.nextElementSibling);
|
|
1423
|
+
|
|
1424
|
+
return baseNode;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1383
1427
|
const bp = baseNode.parentNode;
|
|
1384
1428
|
let index = 0, newEl, children, temp;
|
|
1385
1429
|
let next = true;
|
|
@@ -73,7 +73,7 @@ export default {
|
|
|
73
73
|
let html = '' +
|
|
74
74
|
'<form method="post" enctype="multipart/form-data">' +
|
|
75
75
|
'<div class="se-dialog-header">' +
|
|
76
|
-
'<button type="button" data-command="close" class="se-btn se-dialog-close"
|
|
76
|
+
'<button type="button" data-command="close" class="se-btn se-dialog-close" title="' + lang.dialogBox.close + '" aria-label="' + lang.dialogBox.close + '">' +
|
|
77
77
|
core.icons.cancel +
|
|
78
78
|
'</button>' +
|
|
79
79
|
'<span class="se-modal-title">' + lang.dialogBox.audioBox.title + '</span>' +
|
|
@@ -86,7 +86,7 @@ export default {
|
|
|
86
86
|
'<label>' + lang.dialogBox.audioBox.file + '</label>' +
|
|
87
87
|
'<div class="se-dialog-form-files">' +
|
|
88
88
|
'<input class="se-input-form _se_audio_files" type="file" accept="' + option.audioAccept + '"' + (option.audioMultipleFile ? ' multiple="multiple"' : '') + '/>' +
|
|
89
|
-
'<button type="button" data-command="filesRemove" class="se-btn se-dialog-files-edge-button se-file-remove" title="' + lang.controller.remove + '">' + core.icons.cancel + '</button>' +
|
|
89
|
+
'<button type="button" data-command="filesRemove" class="se-btn se-dialog-files-edge-button se-file-remove" title="' + lang.controller.remove + '" aria-label="' + lang.controller.remove + '">' + core.icons.cancel + '</button>' +
|
|
90
90
|
'</div>' +
|
|
91
91
|
'</div>';
|
|
92
92
|
}
|
|
@@ -103,7 +103,7 @@ export default {
|
|
|
103
103
|
html += '' +
|
|
104
104
|
'</div>' +
|
|
105
105
|
'<div class="se-dialog-footer">' +
|
|
106
|
-
'<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
|
|
106
|
+
'<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '" aria-label="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
|
|
107
107
|
'</div>' +
|
|
108
108
|
'</form>';
|
|
109
109
|
|
|
@@ -454,7 +454,7 @@ export default {
|
|
|
454
454
|
this.plugins.audio._setTagAttrs.call(this, element);
|
|
455
455
|
|
|
456
456
|
// find component element
|
|
457
|
-
|
|
457
|
+
let existElement = (this.util.isRangeFormatElement(element.parentNode) || this.util.isWysiwygDiv(element.parentNode)) ?
|
|
458
458
|
element : this.util.getFormatElement(element) || element;
|
|
459
459
|
|
|
460
460
|
// clone element
|
|
@@ -464,12 +464,16 @@ export default {
|
|
|
464
464
|
const container = this.plugins.component.set_container.call(this, cover, 'se-audio-container');
|
|
465
465
|
|
|
466
466
|
try {
|
|
467
|
-
if (this.util.isListCell(existElement)
|
|
468
|
-
|
|
469
|
-
|
|
467
|
+
if (this.util.isListCell(existElement)) {
|
|
468
|
+
const refer = this.util.getParentElement(prevElement, function (current) { return current.parentNode === existElement; });
|
|
469
|
+
existElement.insertBefore(container, refer);
|
|
470
|
+
this.util.removeItem(prevElement);
|
|
471
|
+
this.util.removeEmptyNode(refer, null);
|
|
472
|
+
} else if (this.util.isFormatElement(existElement)) {
|
|
473
|
+
const refer = this.util.getParentElement(prevElement, function (current) { return current.parentNode === existElement; });
|
|
474
|
+
existElement = this.util.splitElement(existElement, refer);
|
|
470
475
|
existElement.parentNode.insertBefore(container, existElement);
|
|
471
476
|
this.util.removeItem(prevElement);
|
|
472
|
-
// clean format tag
|
|
473
477
|
this.util.removeEmptyNode(existElement, null);
|
|
474
478
|
if (existElement.children.length === 0) existElement.innerHTML = this.util.htmlRemoveWhiteSpace(existElement.innerHTML);
|
|
475
479
|
} else {
|
|
@@ -126,7 +126,7 @@ export default {
|
|
|
126
126
|
|
|
127
127
|
let html = '' +
|
|
128
128
|
'<div class="se-dialog-header">' +
|
|
129
|
-
'<button type="button" data-command="close" class="se-btn se-dialog-close" class="close"
|
|
129
|
+
'<button type="button" data-command="close" class="se-btn se-dialog-close" class="close" title="' + lang.dialogBox.close + '" aria-label="' + lang.dialogBox.close + '">' +
|
|
130
130
|
core.icons.cancel +
|
|
131
131
|
'</button>' +
|
|
132
132
|
'<span class="se-modal-title">' + lang.dialogBox.imageBox.title + '</span>' +
|
|
@@ -145,7 +145,7 @@ export default {
|
|
|
145
145
|
'<label>' + lang.dialogBox.imageBox.file + '</label>' +
|
|
146
146
|
'<div class="se-dialog-form-files">' +
|
|
147
147
|
'<input class="se-input-form _se_image_file" type="file" accept="' + option.imageAccept + '"' + (option.imageMultipleFile ? ' multiple="multiple"' : '') + '/>' +
|
|
148
|
-
'<button type="button" class="se-btn se-dialog-files-edge-button se-file-remove" title="' + lang.controller.remove + '">' + core.icons.cancel + '</button>' +
|
|
148
|
+
'<button type="button" class="se-btn se-dialog-files-edge-button se-file-remove" title="' + lang.controller.remove + '" aria-label="' + lang.controller.remove + '">' + core.icons.cancel + '</button>' +
|
|
149
149
|
'</div>' +
|
|
150
150
|
'</div>' ;
|
|
151
151
|
}
|
|
@@ -156,7 +156,7 @@ export default {
|
|
|
156
156
|
'<label>' + lang.dialogBox.imageBox.url + '</label>' +
|
|
157
157
|
'<div class="se-dialog-form-files">' +
|
|
158
158
|
'<input class="se-input-form se-input-url _se_image_url" type="text" />' +
|
|
159
|
-
((option.imageGalleryUrl && core.plugins.imageGallery) ? '<button type="button" class="se-btn se-dialog-files-edge-button __se__gallery" title="' + lang.toolbar.imageGallery + '">' + core.icons.image_gallery + '</button>' : '') +
|
|
159
|
+
((option.imageGalleryUrl && core.plugins.imageGallery) ? '<button type="button" class="se-btn se-dialog-files-edge-button __se__gallery" title="' + lang.toolbar.imageGallery + '" aria-label="' + lang.toolbar.imageGallery + '">' + core.icons.image_gallery + '</button>' : '') +
|
|
160
160
|
'</div>' +
|
|
161
161
|
'<pre class="se-link-preview"></pre>' +
|
|
162
162
|
'</div>';
|
|
@@ -190,7 +190,7 @@ export default {
|
|
|
190
190
|
'<label class="se-dialog-size-x"' + heightDisplay + '>' + (onlyPercentage ? '%' : 'x') + '</label>' +
|
|
191
191
|
'<input type="text" class="se-input-control _se_image_size_y" placeholder="auto"' + onlyPercentDisplay + (onlyPercentage ? ' max="100"' : '') + heightDisplay + '/>' +
|
|
192
192
|
'<label' + onlyPercentDisplay + heightDisplay + '><input type="checkbox" class="se-dialog-btn-check _se_image_check_proportion" checked/> ' + lang.dialogBox.proportion + '</label>' +
|
|
193
|
-
'<button type="button" title="' + lang.dialogBox.revertButton + '" class="se-btn se-dialog-btn-revert" style="float: right;">' + core.icons.revert + '</button>' +
|
|
193
|
+
'<button type="button" title="' + lang.dialogBox.revertButton + '" aria-label="' + lang.dialogBox.revertButton + '" class="se-btn se-dialog-btn-revert" style="float: right;">' + core.icons.revert + '</button>' +
|
|
194
194
|
'</div>' ;
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -210,7 +210,7 @@ export default {
|
|
|
210
210
|
'<label><input type="radio" name="suneditor_image_radio" class="se-dialog-btn-radio" value="center">' + lang.dialogBox.center + '</label>' +
|
|
211
211
|
'<label><input type="radio" name="suneditor_image_radio" class="se-dialog-btn-radio" value="right">' + lang.dialogBox.right + '</label>' +
|
|
212
212
|
'</div>' +
|
|
213
|
-
'<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
|
|
213
|
+
'<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '" aria-label="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
|
|
214
214
|
'</div>' +
|
|
215
215
|
'</form>';
|
|
216
216
|
|
|
@@ -768,16 +768,20 @@ export default {
|
|
|
768
768
|
}
|
|
769
769
|
|
|
770
770
|
if (isNewContainer) {
|
|
771
|
-
|
|
771
|
+
let existElement = (this.util.isRangeFormatElement(contextImage._element.parentNode) || this.util.isWysiwygDiv(contextImage._element.parentNode)) ?
|
|
772
772
|
contextImage._element :
|
|
773
773
|
/^A$/i.test(contextImage._element.parentNode.nodeName) ? contextImage._element.parentNode : this.util.getFormatElement(contextImage._element) || contextImage._element;
|
|
774
774
|
|
|
775
|
-
if (this.util.isListCell(existElement)
|
|
776
|
-
|
|
777
|
-
|
|
775
|
+
if (this.util.isListCell(existElement)) {
|
|
776
|
+
const refer = this.util.getParentElement(contextImage._element, function (current) { return current.parentNode === existElement; });
|
|
777
|
+
existElement.insertBefore(container, refer);
|
|
778
|
+
this.util.removeItem(contextImage._element);
|
|
779
|
+
this.util.removeEmptyNode(refer, null);
|
|
780
|
+
} else if (this.util.isFormatElement(existElement)) {
|
|
781
|
+
const refer = this.util.getParentElement(contextImage._element, function (current) { return current.parentNode === existElement; });
|
|
782
|
+
existElement = this.util.splitElement(existElement, refer);
|
|
778
783
|
existElement.parentNode.insertBefore(container, existElement);
|
|
779
784
|
this.util.removeItem(contextImage._element);
|
|
780
|
-
// clean format tag
|
|
781
785
|
this.util.removeEmptyNode(existElement, null);
|
|
782
786
|
if (existElement.children.length === 0) existElement.innerHTML = this.util.htmlRemoveWhiteSpace(existElement.innerHTML);
|
|
783
787
|
} else {
|
|
@@ -59,14 +59,14 @@ export default {
|
|
|
59
59
|
let html = '' +
|
|
60
60
|
'<form>' +
|
|
61
61
|
'<div class="se-dialog-header">' +
|
|
62
|
-
'<button type="button" data-command="close" class="se-btn se-dialog-close"
|
|
62
|
+
'<button type="button" data-command="close" class="se-btn se-dialog-close" title="' + lang.dialogBox.close + '" aria-label="' + lang.dialogBox.close + '">' +
|
|
63
63
|
icons.cancel +
|
|
64
64
|
'</button>' +
|
|
65
65
|
'<span class="se-modal-title">' + lang.dialogBox.linkBox.title + '</span>' +
|
|
66
66
|
'</div>' +
|
|
67
67
|
core.context.anchor.forms.innerHTML +
|
|
68
68
|
'<div class="se-dialog-footer">' +
|
|
69
|
-
'<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
|
|
69
|
+
'<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '" aria-label="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
|
|
70
70
|
'</div>' +
|
|
71
71
|
'</form>';
|
|
72
72
|
|
|
@@ -56,7 +56,7 @@ export default {
|
|
|
56
56
|
let html = '' +
|
|
57
57
|
'<form>' +
|
|
58
58
|
'<div class="se-dialog-header">' +
|
|
59
|
-
'<button type="button" data-command="close" class="se-btn se-dialog-close"
|
|
59
|
+
'<button type="button" data-command="close" class="se-btn se-dialog-close" title="' + lang.dialogBox.close + '" aria-label="' + lang.dialogBox.close + '">' +
|
|
60
60
|
core.icons.cancel +
|
|
61
61
|
'</button>' +
|
|
62
62
|
'<span class="se-modal-title">' + lang.dialogBox.mathBox.title + '</span>' +
|
|
@@ -82,7 +82,7 @@ export default {
|
|
|
82
82
|
'</div>' +
|
|
83
83
|
'</div>' +
|
|
84
84
|
'<div class="se-dialog-footer">' +
|
|
85
|
-
'<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
|
|
85
|
+
'<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '" aria-label="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
|
|
86
86
|
'</div>' +
|
|
87
87
|
'</form>';
|
|
88
88
|
|
|
@@ -89,7 +89,7 @@ export default {
|
|
|
89
89
|
const html = `
|
|
90
90
|
<form class="se-dialog-form">
|
|
91
91
|
<div class="se-dialog-header">
|
|
92
|
-
<button type="button" data-command="close" class="se-btn se-dialog-close"
|
|
92
|
+
<button type="button" data-command="close" class="se-btn se-dialog-close" title="${lang.dialogBox.close}" aria-label="${lang.dialogBox.close}">
|
|
93
93
|
${core.icons.cancel}
|
|
94
94
|
</button>
|
|
95
95
|
<span class="se-modal-title">${lang.dialogBox.mentionBox.title}</span>
|
|
@@ -114,7 +114,7 @@ export default {
|
|
|
114
114
|
let html = '' +
|
|
115
115
|
'<form method="post" enctype="multipart/form-data">' +
|
|
116
116
|
'<div class="se-dialog-header">' +
|
|
117
|
-
'<button type="button" data-command="close" class="se-btn se-dialog-close"
|
|
117
|
+
'<button type="button" data-command="close" class="se-btn se-dialog-close" title="' + lang.dialogBox.close + '" aria-label="' + lang.dialogBox.close + '">' +
|
|
118
118
|
core.icons.cancel +
|
|
119
119
|
'</button>' +
|
|
120
120
|
'<span class="se-modal-title">' + lang.dialogBox.videoBox.title + '</span>' +
|
|
@@ -127,7 +127,7 @@ export default {
|
|
|
127
127
|
'<label>' + lang.dialogBox.videoBox.file + '</label>' +
|
|
128
128
|
'<div class="se-dialog-form-files">' +
|
|
129
129
|
'<input class="se-input-form _se_video_file" type="file" accept="' + option.videoAccept + '"' + (option.videoMultipleFile ? ' multiple="multiple"' : '') + '/>' +
|
|
130
|
-
'<button type="button" data-command="filesRemove" class="se-btn se-dialog-files-edge-button se-file-remove" title="' + lang.controller.remove + '">' + core.icons.cancel + '</button>' +
|
|
130
|
+
'<button type="button" data-command="filesRemove" class="se-btn se-dialog-files-edge-button se-file-remove" title="' + lang.controller.remove + '" aria-label="' + lang.controller.remove + '">' + core.icons.cancel + '</button>' +
|
|
131
131
|
'</div>' +
|
|
132
132
|
'</div>' ;
|
|
133
133
|
}
|
|
@@ -160,13 +160,13 @@ export default {
|
|
|
160
160
|
'<input class="se-input-control _se_video_size_x" placeholder="100%"' + (onlyPercentage ? ' type="number" min="1"' : 'type="text"') + (onlyPercentage ? ' max="100"' : '') + '/>' +
|
|
161
161
|
'<label class="se-dialog-size-x"' + onlyWidthDisplay + '>' + (onlyPercentage ? '%' : 'x') + '</label>' +
|
|
162
162
|
'<input class="se-input-control _se_video_size_y" placeholder="' + (option.videoRatio * 100) + '%"' + (onlyPercentage ? ' type="number" min="1"' : 'type="text"') + (onlyPercentage ? ' max="100"' : '') + heightDisplay + '/>' +
|
|
163
|
-
'<select class="se-input-select se-video-ratio" title="' + lang.dialogBox.ratio + '"' + ratioDisplay + '>';
|
|
163
|
+
'<select class="se-input-select se-video-ratio" title="' + lang.dialogBox.ratio + '" aria-label="' + lang.dialogBox.ratio + '"' + ratioDisplay + '>';
|
|
164
164
|
if (!heightDisplay) html += '<option value=""> - </option>';
|
|
165
165
|
for (let i = 0, len = ratioList.length; i < len; i++) {
|
|
166
166
|
html += '<option value="' + ratioList[i].value + '"' + (ratio.toString() === ratioList[i].value.toString() ? ' selected' : '') + '>' + ratioList[i].name + '</option>';
|
|
167
167
|
}
|
|
168
168
|
html += '</select>' +
|
|
169
|
-
'<button type="button" title="' + lang.dialogBox.revertButton + '" class="se-btn se-dialog-btn-revert" style="float: right;">' + core.icons.revert + '</button>' +
|
|
169
|
+
'<button type="button" title="' + lang.dialogBox.revertButton + '" aria-label="' + lang.dialogBox.revertButton + '" class="se-btn se-dialog-btn-revert" style="float: right;">' + core.icons.revert + '</button>' +
|
|
170
170
|
'</div>' +
|
|
171
171
|
'<div class="se-dialog-form se-dialog-form-footer"' + onlyPercentDisplay + onlyWidthDisplay + '>' +
|
|
172
172
|
'<label><input type="checkbox" class="se-dialog-btn-check _se_video_check_proportion" checked/> ' + lang.dialogBox.proportion + '</label>' +
|
|
@@ -182,7 +182,7 @@ export default {
|
|
|
182
182
|
'<label><input type="radio" name="suneditor_video_radio" class="se-dialog-btn-radio" value="center">' + lang.dialogBox.center + '</label>' +
|
|
183
183
|
'<label><input type="radio" name="suneditor_video_radio" class="se-dialog-btn-radio" value="right">' + lang.dialogBox.right + '</label>' +
|
|
184
184
|
'</div>' +
|
|
185
|
-
'<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
|
|
185
|
+
'<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '" aria-label="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
|
|
186
186
|
'</div>' +
|
|
187
187
|
'</form>';
|
|
188
188
|
|
|
@@ -645,7 +645,7 @@ export default {
|
|
|
645
645
|
if (/^video$/i.test(oFrame.nodeName)) this.plugins.video._setTagAttrs.call(this, oFrame);
|
|
646
646
|
else this.plugins.video._setIframeAttrs.call(this, oFrame);
|
|
647
647
|
|
|
648
|
-
|
|
648
|
+
let existElement = (this.util.isRangeFormatElement(oFrame.parentNode) || this.util.isWysiwygDiv(oFrame.parentNode)) ?
|
|
649
649
|
oFrame : this.util.getFormatElement(oFrame) || oFrame;
|
|
650
650
|
|
|
651
651
|
const prevFrame = oFrame;
|
|
@@ -671,12 +671,16 @@ export default {
|
|
|
671
671
|
if (format) contextVideo._align = format.style.textAlign || format.style.float;
|
|
672
672
|
this.plugins.video.setAlign.call(this, null, oFrame, cover, container);
|
|
673
673
|
|
|
674
|
-
if (this.util.isListCell(existElement)
|
|
675
|
-
|
|
676
|
-
|
|
674
|
+
if (this.util.isListCell(existElement)) {
|
|
675
|
+
const refer = this.util.getParentElement(prevFrame, function (current) { return current.parentNode === existElement; });
|
|
676
|
+
existElement.insertBefore(container, refer);
|
|
677
|
+
this.util.removeItem(prevFrame);
|
|
678
|
+
this.util.removeEmptyNode(refer, null);
|
|
679
|
+
} else if (this.util.isFormatElement(existElement)) {
|
|
680
|
+
const refer = this.util.getParentElement(prevFrame, function (current) { return current.parentNode === existElement; });
|
|
681
|
+
existElement = this.util.splitElement(existElement, refer);
|
|
677
682
|
existElement.parentNode.insertBefore(container, existElement);
|
|
678
683
|
this.util.removeItem(prevFrame);
|
|
679
|
-
// clean format tag
|
|
680
684
|
this.util.removeEmptyNode(existElement, null);
|
|
681
685
|
if (existElement.children.length === 0) existElement.innerHTML = this.util.htmlRemoveWhiteSpace(existElement.innerHTML);
|
|
682
686
|
} else {
|
|
@@ -35,7 +35,7 @@ export default {
|
|
|
35
35
|
'<label>' + lang.dialogBox.linkBox.url + '</label>' +
|
|
36
36
|
'<div class="se-dialog-form-files">' +
|
|
37
37
|
'<input class="se-input-form se-input-url" type="text" placeholder="' + (core.options.protocol || '') + '" />' +
|
|
38
|
-
'<button type="button" class="se-btn se-dialog-files-edge-button _se_bookmark_button" title="' + lang.dialogBox.linkBox.bookmark + '">' + icons.bookmark + '</button>' +
|
|
38
|
+
'<button type="button" class="se-btn se-dialog-files-edge-button _se_bookmark_button" title="' + lang.dialogBox.linkBox.bookmark + '" aria-label="' + lang.dialogBox.linkBox.bookmark + '">' + icons.bookmark + '</button>' +
|
|
39
39
|
core.plugins.selectMenu.setForm() +
|
|
40
40
|
'</div>' +
|
|
41
41
|
'<div class="se-anchor-preview-form">' +
|
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
'<ul class="se-list-basic se-list-checked">';
|
|
59
59
|
for (let i = 0, len = relList.length, rel; i < len; i++) {
|
|
60
60
|
rel = relList[i];
|
|
61
|
-
html += '<li><button type="button" class="se-btn-list' + (defaultRel.indexOf(rel) > -1 ? ' se-checked' : '') + '" data-command="' + rel + '" title="' + rel + '"><span class="se-svg">' + icons.checked + '</span>' + rel + '</button></li>';
|
|
61
|
+
html += '<li><button type="button" class="se-btn-list' + (defaultRel.indexOf(rel) > -1 ? ' se-checked' : '') + '" data-command="' + rel + '" title="' + rel + '" aria-label="' + rel + '"><span class="se-svg">' + icons.checked + '</span>' + rel + '</button></li>';
|
|
62
62
|
}
|
|
63
63
|
html += '</ul></div></div></div>';
|
|
64
64
|
}
|
|
@@ -68,10 +68,10 @@ export default {
|
|
|
68
68
|
list += '' +
|
|
69
69
|
'<form class="se-form-group">' +
|
|
70
70
|
'<input type="text" maxlength="9" class="_se_color_picker_input se-color-input"/>' +
|
|
71
|
-
'<button type="submit" class="se-btn-primary _se_color_picker_submit" title="' + lang.dialogBox.submitButton + '">' +
|
|
71
|
+
'<button type="submit" class="se-btn-primary _se_color_picker_submit" title="' + lang.dialogBox.submitButton + '" aria-label="' + lang.dialogBox.submitButton + '">' +
|
|
72
72
|
core.icons.checked +
|
|
73
73
|
'</button>' +
|
|
74
|
-
'<button type="button" class="se-btn _se_color_picker_remove" title="' + lang.toolbar.removeFormat + '">' +
|
|
74
|
+
'<button type="button" class="se-btn _se_color_picker_remove" title="' + lang.toolbar.removeFormat + '" aria-label="' + lang.toolbar.removeFormat + '">' +
|
|
75
75
|
core.icons.erase +
|
|
76
76
|
'</button>' +
|
|
77
77
|
'</form>' +
|
|
@@ -93,7 +93,7 @@ export default {
|
|
|
93
93
|
color = colorList[i];
|
|
94
94
|
if (typeof color === 'string') {
|
|
95
95
|
list += '<li>' +
|
|
96
|
-
'<button type="button" data-value="' + color + '" title="' + color + '" style="background-color:' + color + ';"></button>' +
|
|
96
|
+
'<button type="button" data-value="' + color + '" title="' + color + '" aria-label="' + color + '" style="background-color:' + color + ';"></button>' +
|
|
97
97
|
'</li>';
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
|
|
88
88
|
return '<div class="se-file-browser-content">' +
|
|
89
89
|
'<div class="se-file-browser-header">' +
|
|
90
|
-
'<button type="button" data-command="close" class="se-btn se-file-browser-close" class="close"
|
|
90
|
+
'<button type="button" data-command="close" class="se-btn se-file-browser-close" class="close" title="' + lang.dialogBox.close + '" aria-label="' + lang.dialogBox.close + '">' +
|
|
91
91
|
core.icons.cancel +
|
|
92
92
|
'</button>' +
|
|
93
93
|
'<span class="se-file-browser-title"></span>' +
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
tag = tags[t];
|
|
282
282
|
if (tag && _tags.indexOf(tag) === -1) {
|
|
283
283
|
_tags.push(tag);
|
|
284
|
-
tagsHTML += '<a title="' + tag + '">' + tag + '</a>';
|
|
284
|
+
tagsHTML += '<a title="' + tag + '" aria-label="' + tag + '">' + tag + '</a>';
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
}
|
|
@@ -53,7 +53,7 @@ export default {
|
|
|
53
53
|
item = alignItems[i];
|
|
54
54
|
text = lang.toolbar['align' + item.charAt(0).toUpperCase() + item.slice(1)];
|
|
55
55
|
html += '<li>' +
|
|
56
|
-
'<button type="button" class="se-btn-list se-btn-align" data-value="' + item + '" title="' + text + '">' +
|
|
56
|
+
'<button type="button" class="se-btn-list se-btn-align" data-value="' + item + '" title="' + text + '" aria-label="' + text + '">' +
|
|
57
57
|
'<span class="se-list-icon">' + icons['align_' + item] + '</span>' + text +
|
|
58
58
|
'</button>' +
|
|
59
59
|
'</li>';
|
|
@@ -35,32 +35,21 @@ export default {
|
|
|
35
35
|
},
|
|
36
36
|
|
|
37
37
|
setSubmenu: function (core) {
|
|
38
|
-
const option = core.options;
|
|
39
38
|
const lang = core.lang;
|
|
40
39
|
const listDiv = core.util.createElement('DIV');
|
|
41
40
|
|
|
42
41
|
listDiv.className = 'se-submenu se-list-layer se-list-font-family';
|
|
43
42
|
|
|
44
43
|
let font, text, i, len;
|
|
45
|
-
let fontList =
|
|
46
|
-
[
|
|
47
|
-
'Arial',
|
|
48
|
-
'Comic Sans MS',
|
|
49
|
-
'Courier New',
|
|
50
|
-
'Impact',
|
|
51
|
-
'Georgia',
|
|
52
|
-
'tahoma',
|
|
53
|
-
'Trebuchet MS',
|
|
54
|
-
'Verdana'
|
|
55
|
-
] : option.font;
|
|
44
|
+
let fontList = core.options.font;
|
|
56
45
|
|
|
57
46
|
let list = '<div class="se-list-inner">' +
|
|
58
47
|
'<ul class="se-list-basic">' +
|
|
59
|
-
'<li><button type="button" class="default_value se-btn-list" title="' + lang.toolbar.default + '">(' + lang.toolbar.default + ')</button></li>';
|
|
48
|
+
'<li><button type="button" class="default_value se-btn-list" title="' + lang.toolbar.default + '" aria-label="' + lang.toolbar.default + '">(' + lang.toolbar.default + ')</button></li>';
|
|
60
49
|
for (i = 0, len = fontList.length; i < len; i++) {
|
|
61
50
|
font = fontList[i];
|
|
62
51
|
text = font.split(',')[0];
|
|
63
|
-
list += '<li><button type="button" class="se-btn-list" data-value="' + font + '" data-txt="' + text + '" title="' + text + '" style="font-family:' + font + ';">' + text + '</button></li>';
|
|
52
|
+
list += '<li><button type="button" class="se-btn-list" data-value="' + font + '" data-txt="' + text + '" title="' + text + '" aria-label="' + text + '" style="font-family:' + font + ';">' + text + '</button></li>';
|
|
64
53
|
}
|
|
65
54
|
list += '</ul></div>';
|
|
66
55
|
listDiv.innerHTML = list;
|
|
@@ -44,10 +44,10 @@ export default {
|
|
|
44
44
|
|
|
45
45
|
let list = '<div class="se-list-inner">' +
|
|
46
46
|
'<ul class="se-list-basic">' +
|
|
47
|
-
'<li><button type="button" class="default_value se-btn-list" title="' + lang.toolbar.default + '">(' + lang.toolbar.default + ')</button></li>';
|
|
47
|
+
'<li><button type="button" class="default_value se-btn-list" title="' + lang.toolbar.default + '" aria-label="' + lang.toolbar.default + '">(' + lang.toolbar.default + ')</button></li>';
|
|
48
48
|
for (let i = 0, unit = option.fontSizeUnit, len = sizeList.length, size; i < len; i++) {
|
|
49
49
|
size = sizeList[i];
|
|
50
|
-
list += '<li><button type="button" class="se-btn-list" data-value="' + size + unit + '" title="' + size + unit + '" style="font-size:' + size + unit + ';">' + size + '</button></li>';
|
|
50
|
+
list += '<li><button type="button" class="se-btn-list" data-value="' + size + unit + '" title="' + size + unit + '" aria-label="' + size + unit + '" style="font-size:' + size + unit + ';">' + size + '</button></li>';
|
|
51
51
|
}
|
|
52
52
|
list += '</ul></div>';
|
|
53
53
|
|
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
list += '<li>' +
|
|
65
|
-
'<button type="button" class="se-btn-list" data-command="' + command + '" data-value="' + tagName + '" data-class="' + className + '" title="' + name + '">' +
|
|
65
|
+
'<button type="button" class="se-btn-list" data-command="' + command + '" data-value="' + tagName + '" data-class="' + className + '" title="' + name + '" aria-label="' + name + '">' +
|
|
66
66
|
'<' + tagName + attrs + '>' + name + '</' + tagName + '>' +
|
|
67
67
|
'</button></li>';
|
|
68
68
|
}
|
|
@@ -36,7 +36,7 @@ export default {
|
|
|
36
36
|
let list = '';
|
|
37
37
|
for (let i = 0, len = items.length; i < len; i++) {
|
|
38
38
|
list += '<li>' +
|
|
39
|
-
'<button type="button" class="se-btn-list btn_line" data-command="horizontalRule" data-value="' + items[i].class + '" title="' + items[i].name + '">' +
|
|
39
|
+
'<button type="button" class="se-btn-list btn_line" data-command="horizontalRule" data-value="' + items[i].class + '" title="' + items[i].name + '" aria-label="' + items[i].name + '">' +
|
|
40
40
|
'<hr' + (items[i].class ? ' class="' + items[i].class + '"' : '') + (items[i].style ? ' style="' + items[i].style + '"' : '') + '/>' +
|
|
41
41
|
'</button>' +
|
|
42
42
|
'</li>';
|
|
@@ -49,10 +49,10 @@ export default {
|
|
|
49
49
|
|
|
50
50
|
let list = '<div class="se-list-inner">' +
|
|
51
51
|
'<ul class="se-list-basic">' +
|
|
52
|
-
'<li><button type="button" class="default_value se-btn-list" title="' + lang.toolbar.default + '">(' + lang.toolbar.default + ')</button></li>';
|
|
52
|
+
'<li><button type="button" class="default_value se-btn-list" title="' + lang.toolbar.default + '" aria-label="' + lang.toolbar.default + '">(' + lang.toolbar.default + ')</button></li>';
|
|
53
53
|
for (let i = 0, len = sizeList.length, size; i < len; i++) {
|
|
54
54
|
size = sizeList[i];
|
|
55
|
-
list += '<li><button type="button" class="se-btn-list" data-value="' + size.value + '" title="' + size.text + '">' + size.text + '</button></li>';
|
|
55
|
+
list += '<li><button type="button" class="se-btn-list" data-value="' + size.value + '" title="' + size.text + '" aria-label="' + size.text + '">' + size.text + '</button></li>';
|
|
56
56
|
}
|
|
57
57
|
list += '</ul></div>';
|
|
58
58
|
|
|
@@ -45,10 +45,10 @@ export default {
|
|
|
45
45
|
listDiv.innerHTML = '' +
|
|
46
46
|
'<div class="se-list-inner">' +
|
|
47
47
|
'<ul class="se-list-basic">' +
|
|
48
|
-
'<li><button type="button" class="se-btn-list se-tooltip" data-command="OL" title="' + lang.toolbar.orderList + '">' +
|
|
48
|
+
'<li><button type="button" class="se-btn-list se-tooltip" data-command="OL" title="' + lang.toolbar.orderList + '" aria-label="' + lang.toolbar.orderList + '">' +
|
|
49
49
|
core.icons.list_number +
|
|
50
50
|
'</button></li>' +
|
|
51
|
-
'<li><button type="button" class="se-btn-list se-tooltip" data-command="UL" title="' + lang.toolbar.unorderList + '">' +
|
|
51
|
+
'<li><button type="button" class="se-btn-list se-tooltip" data-command="UL" title="' + lang.toolbar.unorderList + '" aria-label="' + lang.toolbar.unorderList + '">' +
|
|
52
52
|
core.icons.list_bullets +
|
|
53
53
|
'</button></li>' +
|
|
54
54
|
'</ul>' +
|
|
@@ -71,7 +71,7 @@ export default {
|
|
|
71
71
|
_class = p._class;
|
|
72
72
|
|
|
73
73
|
list += '<li>' +
|
|
74
|
-
'<button type="button" class="se-btn-list' + (_class ? ' ' + _class: '') + '" data-value="' + p.class + '" title="' + name + '">' +
|
|
74
|
+
'<button type="button" class="se-btn-list' + (_class ? ' ' + _class: '') + '" data-value="' + p.class + '" title="' + name + '" aria-label="' + name + '">' +
|
|
75
75
|
'<div' + attrs + '>' + name + '</div>' +
|
|
76
76
|
'</button></li>';
|
|
77
77
|
}
|
|
@@ -176,9 +176,9 @@ export default {
|
|
|
176
176
|
'<div class="se-btn-group-sub sun-editor-common se-list-layer se-table-split">' +
|
|
177
177
|
'<div class="se-list-inner">' +
|
|
178
178
|
'<ul class="se-list-basic">' +
|
|
179
|
-
'<li class="se-btn-list" data-command="split" data-value="vertical" style="line-height:32px;" title="' + lang.controller.VerticalSplit + '">' +
|
|
179
|
+
'<li class="se-btn-list" data-command="split" data-value="vertical" style="line-height:32px;" title="' + lang.controller.VerticalSplit + '" aria-label="' + lang.controller.VerticalSplit + '">' +
|
|
180
180
|
lang.controller.VerticalSplit + '</li>' +
|
|
181
|
-
'<li class="se-btn-list" data-command="split" data-value="horizontal" style="line-height:32px;" title="' + lang.controller.HorizontalSplit + '">' +
|
|
181
|
+
'<li class="se-btn-list" data-command="split" data-value="horizontal" style="line-height:32px;" title="' + lang.controller.HorizontalSplit + '" aria-label="' + lang.controller.HorizontalSplit + '">' +
|
|
182
182
|
lang.controller.HorizontalSplit + '</li>' +
|
|
183
183
|
'</ul>' +
|
|
184
184
|
'</div>' +
|
|
@@ -42,7 +42,7 @@ export default {
|
|
|
42
42
|
'<ul class="se-list-basic">';
|
|
43
43
|
for (let i = 0, len = templateList.length, t; i < len; i++) {
|
|
44
44
|
t = templateList[i];
|
|
45
|
-
list += '<li><button type="button" class="se-btn-list" data-value="' + i + '" title="' + t.name + '">' + t.name + '</button></li>';
|
|
45
|
+
list += '<li><button type="button" class="se-btn-list" data-value="' + i + '" title="' + t.name + '" aria-label="' + t.name + '">' + t.name + '</button></li>';
|
|
46
46
|
}
|
|
47
47
|
list += '</ul></div>';
|
|
48
48
|
|
|
@@ -85,7 +85,7 @@ export default {
|
|
|
85
85
|
value = value.replace(/,$/, '');
|
|
86
86
|
|
|
87
87
|
list += '<li>' +
|
|
88
|
-
'<button type="button" class="se-btn-list' + (_class ? ' ' + _class: '') + '" data-command="' + tag + '" data-value="' + value + '" title="' + name + '">' +
|
|
88
|
+
'<button type="button" class="se-btn-list' + (_class ? ' ' + _class: '') + '" data-command="' + tag + '" data-value="' + value + '" title="' + name + '" aria-label="' + name + '">' +
|
|
89
89
|
'<' + tag + attrs + '>' + name + '</' + tag + '>' +
|
|
90
90
|
'</button></li>';
|
|
91
91
|
}
|