@syncfusion/ej2-richtexteditor 24.2.4 → 24.2.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/CHANGELOG.md +34 -0
- package/dist/ej2-richtexteditor.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +669 -272
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +662 -269
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/common/util.js +4 -1
- package/src/editor-manager/plugin/dom-node.js +3 -1
- package/src/editor-manager/plugin/format-painter-actions.d.ts +1 -0
- package/src/editor-manager/plugin/format-painter-actions.js +18 -0
- package/src/editor-manager/plugin/formats.d.ts +1 -0
- package/src/editor-manager/plugin/formats.js +37 -2
- package/src/editor-manager/plugin/inserthtml.js +15 -2
- package/src/editor-manager/plugin/lists.js +85 -63
- package/src/editor-manager/plugin/ms-word-clean-up.js +87 -18
- package/src/editor-manager/plugin/nodecutter.js +1 -1
- package/src/editor-manager/plugin/selection-commands.d.ts +1 -0
- package/src/editor-manager/plugin/selection-commands.js +56 -1
- package/src/editor-manager/plugin/table.js +1 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.js +4 -4
- package/src/rich-text-editor/actions/color-picker.d.ts +1 -0
- package/src/rich-text-editor/actions/color-picker.js +10 -0
- package/src/rich-text-editor/actions/enter-key.js +2 -2
- package/src/rich-text-editor/actions/html-editor.js +25 -12
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +1 -0
- package/src/rich-text-editor/actions/paste-clean-up.js +26 -5
- package/src/rich-text-editor/actions/toolbar-action.js +1 -1
- package/src/rich-text-editor/actions/toolbar.js +4 -1
- package/src/rich-text-editor/base/constant.d.ts +5 -0
- package/src/rich-text-editor/base/constant.js +5 -0
- package/src/rich-text-editor/base/interface.d.ts +0 -8
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +1 -1
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -1
- package/src/rich-text-editor/base/rich-text-editor.js +33 -7
- package/src/rich-text-editor/base/util.js +3 -0
- package/src/rich-text-editor/models/default-locale.js +3 -2
- package/src/rich-text-editor/renderer/dialog-renderer.js +5 -1
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +31 -10
- package/src/rich-text-editor/renderer/table-module.d.ts +4 -1
- package/src/rich-text-editor/renderer/table-module.js +200 -131
- package/src/rich-text-editor/renderer/toolbar-renderer.js +13 -13
- package/styles/bootstrap-dark.css +57 -22
- package/styles/bootstrap.css +61 -29
- package/styles/bootstrap4.css +48 -17
- package/styles/bootstrap5-dark.css +47 -18
- package/styles/bootstrap5.css +47 -18
- package/styles/fabric-dark.css +43 -12
- package/styles/fabric.css +43 -12
- package/styles/fluent-dark.css +51 -14
- package/styles/fluent.css +51 -14
- package/styles/highcontrast-light.css +43 -12
- package/styles/highcontrast.css +46 -12
- package/styles/material-dark.css +47 -12
- package/styles/material.css +47 -12
- package/styles/material3-dark.css +45 -14
- package/styles/material3.css +45 -14
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +12 -10
- package/styles/rich-text-editor/_bootstrap-definition.scss +18 -16
- package/styles/rich-text-editor/_bootstrap4-definition.scss +8 -6
- package/styles/rich-text-editor/_bootstrap5-definition.scss +4 -2
- package/styles/rich-text-editor/_fabric-dark-definition.scss +4 -2
- package/styles/rich-text-editor/_fabric-definition.scss +4 -2
- package/styles/rich-text-editor/_fluent-definition.scss +5 -3
- package/styles/rich-text-editor/_fusionnew-definition.scss +4 -2
- package/styles/rich-text-editor/_highcontrast-definition.scss +4 -2
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +4 -2
- package/styles/rich-text-editor/_layout.scss +46 -6
- package/styles/rich-text-editor/_material-dark-definition.scss +4 -2
- package/styles/rich-text-editor/_material-definition.scss +4 -2
- package/styles/rich-text-editor/_material3-definition.scss +6 -4
- package/styles/rich-text-editor/_tailwind-definition.scss +21 -19
- package/styles/rich-text-editor/_theme.scss +65 -16
- package/styles/rich-text-editor/bootstrap-dark.css +57 -22
- package/styles/rich-text-editor/bootstrap.css +61 -29
- package/styles/rich-text-editor/bootstrap4.css +48 -17
- package/styles/rich-text-editor/bootstrap5-dark.css +47 -18
- package/styles/rich-text-editor/bootstrap5.css +47 -18
- package/styles/rich-text-editor/fabric-dark.css +43 -12
- package/styles/rich-text-editor/fabric.css +43 -12
- package/styles/rich-text-editor/fluent-dark.css +51 -14
- package/styles/rich-text-editor/fluent.css +51 -14
- package/styles/rich-text-editor/highcontrast-light.css +43 -12
- package/styles/rich-text-editor/highcontrast.css +46 -12
- package/styles/rich-text-editor/material-dark.css +47 -12
- package/styles/rich-text-editor/material.css +47 -12
- package/styles/rich-text-editor/material3-dark.css +45 -14
- package/styles/rich-text-editor/material3.css +45 -14
- package/styles/rich-text-editor/tailwind-dark.css +98 -35
- package/styles/rich-text-editor/tailwind.css +98 -35
- package/styles/tailwind-dark.css +98 -35
- package/styles/tailwind.css +98 -35
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -41
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -27
|
@@ -764,6 +764,11 @@ const updateValueOnIdle = 'updateValueOnIdle';
|
|
|
764
764
|
* @deprecated
|
|
765
765
|
*/
|
|
766
766
|
const documentClickClosedBy = 'documentClickClosedBy';
|
|
767
|
+
/**
|
|
768
|
+
* @hidden
|
|
769
|
+
* @deprecated
|
|
770
|
+
*/
|
|
771
|
+
const showColorPicker = 'showColorPicker';
|
|
767
772
|
/**
|
|
768
773
|
* @hidden
|
|
769
774
|
* @deprecated
|
|
@@ -2714,7 +2719,7 @@ let defaultLocale = {
|
|
|
2714
2719
|
'browse': 'Browse',
|
|
2715
2720
|
'imageUrl': 'http://example.com/image.png',
|
|
2716
2721
|
'audioUrl': 'http://example.com/audio.mp3',
|
|
2717
|
-
'videoUrl': 'http://example.com/video.
|
|
2722
|
+
'videoUrl': 'http://example.com/video.mp4',
|
|
2718
2723
|
'webUrl': 'Web URL',
|
|
2719
2724
|
'embedUrl': 'Embed Code',
|
|
2720
2725
|
'imageCaption': 'Caption',
|
|
@@ -2819,6 +2824,7 @@ let defaultLocale = {
|
|
|
2819
2824
|
'emojiPickerNoResultFound': 'No results found',
|
|
2820
2825
|
'emojiPickerTrySomethingElse': 'Try something else',
|
|
2821
2826
|
'linkAriaLabel': 'Open in new window',
|
|
2827
|
+
'unsupportedImage': 'Unsupported file format'
|
|
2822
2828
|
};
|
|
2823
2829
|
let toolsLocale = {
|
|
2824
2830
|
'alignments': 'alignments',
|
|
@@ -2914,7 +2920,7 @@ let toolsLocale = {
|
|
|
2914
2920
|
'emojiPickerTypeToFind': 'Type to find',
|
|
2915
2921
|
'emojiPickerNoResultFound': 'No results found',
|
|
2916
2922
|
'emojiPickerTrySomethingElse': 'Try something else',
|
|
2917
|
-
'
|
|
2923
|
+
'imageLinkAriaLabel': 'Open in new window',
|
|
2918
2924
|
};
|
|
2919
2925
|
let fontNameLocale = [
|
|
2920
2926
|
{ locale: 'fontNameSegoeUI', value: 'Segoe UI' },
|
|
@@ -3443,6 +3449,9 @@ function updateTextNode(value, rteObj) {
|
|
|
3443
3449
|
}
|
|
3444
3450
|
const imageElm = resultElm.querySelectorAll('img');
|
|
3445
3451
|
for (let i = 0; i < imageElm.length; i++) {
|
|
3452
|
+
if (imageElm[i].classList.contains('e-rte-image-unsupported')) {
|
|
3453
|
+
continue; // Should not add the class if the image is Broken.
|
|
3454
|
+
}
|
|
3446
3455
|
if (!imageElm[i].classList.contains(CLS_RTE_IMAGE)) {
|
|
3447
3456
|
imageElm[i].classList.add(CLS_RTE_IMAGE);
|
|
3448
3457
|
}
|
|
@@ -3671,6 +3680,19 @@ class ToolbarRenderer {
|
|
|
3671
3680
|
addClass([listEle[1], listEle[2]], 'e-disabled');
|
|
3672
3681
|
}
|
|
3673
3682
|
}
|
|
3683
|
+
if (this.parent.showTooltip) {
|
|
3684
|
+
this.dropdownTooltip = new Tooltip({
|
|
3685
|
+
target: '[aria-owns="' + this.parent.getID() + '"].e-rte-elements [title]',
|
|
3686
|
+
showTipPointer: true,
|
|
3687
|
+
openDelay: 400,
|
|
3688
|
+
opensOn: 'Hover',
|
|
3689
|
+
beforeRender: this.tooltipBeforeRender.bind(this),
|
|
3690
|
+
cssClass: this.parent.getCssClass(),
|
|
3691
|
+
windowCollision: true,
|
|
3692
|
+
position: 'BottomCenter'
|
|
3693
|
+
});
|
|
3694
|
+
this.dropdownTooltip.appendTo(args.element);
|
|
3695
|
+
}
|
|
3674
3696
|
this.parent.notify(selectionSave, args);
|
|
3675
3697
|
}
|
|
3676
3698
|
dropDownClose(args) {
|
|
@@ -3715,19 +3737,6 @@ class ToolbarRenderer {
|
|
|
3715
3737
|
});
|
|
3716
3738
|
this.tooltip.appendTo(args.target);
|
|
3717
3739
|
}
|
|
3718
|
-
if (this.parent.showTooltip) {
|
|
3719
|
-
this.dropdownTooltip = new Tooltip({
|
|
3720
|
-
target: '[aria-owns="' + this.parent.getID() + '"].e-rte-elements [title]',
|
|
3721
|
-
showTipPointer: true,
|
|
3722
|
-
openDelay: 400,
|
|
3723
|
-
opensOn: 'Hover',
|
|
3724
|
-
beforeRender: this.tooltipBeforeRender.bind(this),
|
|
3725
|
-
cssClass: this.parent.getCssClass(),
|
|
3726
|
-
windowCollision: true,
|
|
3727
|
-
position: 'BottomCenter'
|
|
3728
|
-
});
|
|
3729
|
-
this.dropdownTooltip.appendTo(document.body);
|
|
3730
|
-
}
|
|
3731
3740
|
}
|
|
3732
3741
|
/**
|
|
3733
3742
|
* renderDropDownButton method
|
|
@@ -5058,7 +5067,7 @@ class ToolbarAction {
|
|
|
5058
5067
|
if (args.item.command === 'Lists') {
|
|
5059
5068
|
if (args.originalEvent.target.classList.contains('e-caret') &&
|
|
5060
5069
|
(args.originalEvent.target.parentElement.classList.contains('e-rte-bulletformatlist-dropdown') || args.originalEvent.target.parentElement.classList.contains('e-rte-numberformatlist-dropdown'))) {
|
|
5061
|
-
|
|
5070
|
+
return;
|
|
5062
5071
|
}
|
|
5063
5072
|
}
|
|
5064
5073
|
this.parent.notify(htmlToolbarClick, args);
|
|
@@ -5139,6 +5148,9 @@ class Toolbar$2 {
|
|
|
5139
5148
|
if (e.target.classList.contains('e-hor-nav')) {
|
|
5140
5149
|
this.adjustContentHeight(e.target, true);
|
|
5141
5150
|
}
|
|
5151
|
+
if (!isNullOrUndefined(e.target) && (e.target.classList.contains("e-rte-fontcolor-dropdown") || e.target.classList.contains("e-rte-backgroundcolor-dropdown"))) {
|
|
5152
|
+
this.parent.notify(showColorPicker, { toolbarClick: e.target.classList.contains("e-rte-fontcolor-dropdown") ? "fontcolor" : "backgroundcolor" });
|
|
5153
|
+
}
|
|
5142
5154
|
}
|
|
5143
5155
|
}
|
|
5144
5156
|
createToolbarElement() {
|
|
@@ -5668,7 +5680,7 @@ class Toolbar$2 {
|
|
|
5668
5680
|
else if (Browser.isDevice || this.parent.inlineMode.enable) {
|
|
5669
5681
|
this.isToolbar = true;
|
|
5670
5682
|
}
|
|
5671
|
-
if (isNullOrUndefined(trg) && this.parent.toolbarSettings.type === ToolbarType.Expand) {
|
|
5683
|
+
if (isNullOrUndefined(trg) && this.parent.toolbarSettings.type === ToolbarType.Expand && this.parent.toolbarModule.getExpandTBarPopHeight() === 0) {
|
|
5672
5684
|
removeClass([this.tbElement], [CLS_EXPAND_OPEN]);
|
|
5673
5685
|
}
|
|
5674
5686
|
}
|
|
@@ -6177,6 +6189,15 @@ class ColorPickerInput {
|
|
|
6177
6189
|
this.parent.on(destroyColorPicker, this.destroyColorPicker, this);
|
|
6178
6190
|
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
|
6179
6191
|
this.parent.on(bindCssClass, this.setCssClass, this);
|
|
6192
|
+
this.parent.on(showColorPicker, this.showColorPicker, this);
|
|
6193
|
+
}
|
|
6194
|
+
showColorPicker(e) {
|
|
6195
|
+
if (!isNullOrUndefined(this.fontColorPicker) && (e.toolbarClick === "fontcolor")) {
|
|
6196
|
+
this.fontColorDropDown.toggle();
|
|
6197
|
+
}
|
|
6198
|
+
else if (!isNullOrUndefined(this.backgroundColorPicker) && (e.toolbarClick === "backgroundcolor")) {
|
|
6199
|
+
this.backgroundColorDropDown.toggle();
|
|
6200
|
+
}
|
|
6180
6201
|
}
|
|
6181
6202
|
onPropertyChanged(model) {
|
|
6182
6203
|
const newProp = model.newProp;
|
|
@@ -6247,6 +6268,7 @@ class ColorPickerInput {
|
|
|
6247
6268
|
this.parent.off(destroyColorPicker, this.destroyColorPicker);
|
|
6248
6269
|
this.parent.off(modelChanged, this.onPropertyChanged);
|
|
6249
6270
|
this.parent.off(bindCssClass, this.setCssClass);
|
|
6271
|
+
this.parent.off(showColorPicker, this.showColorPicker);
|
|
6250
6272
|
}
|
|
6251
6273
|
}
|
|
6252
6274
|
|
|
@@ -6321,7 +6343,7 @@ class BaseQuickToolbar {
|
|
|
6321
6343
|
e.target.classList.contains('e-imgbreak')) ? false : true;
|
|
6322
6344
|
let target = !isNullOrUndefined(imgWrapper) ? imgWrapper : e.target;
|
|
6323
6345
|
addClass([this.toolbarElement], [CLS_RM_WHITE_SPACE]);
|
|
6324
|
-
const targetOffsetTop = target.offsetTop;
|
|
6346
|
+
const targetOffsetTop = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetTop : target.offsetTop;
|
|
6325
6347
|
const parentOffsetTop = window.pageYOffset + e.parentData.top;
|
|
6326
6348
|
if ((targetOffsetTop - e.editTop) > e.popHeight) {
|
|
6327
6349
|
y = parentOffsetTop + e.tBarElementHeight + (targetOffsetTop - e.editTop) - e.popHeight - 5;
|
|
@@ -6334,7 +6356,7 @@ class BaseQuickToolbar {
|
|
|
6334
6356
|
}
|
|
6335
6357
|
target = isAligned ? e.target : target;
|
|
6336
6358
|
if (target.offsetWidth > e.popWidth) {
|
|
6337
|
-
x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + target.offsetLeft;
|
|
6359
|
+
x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + ((target.classList.contains("e-rte-audio")) ? target.parentElement.offsetLeft : target.offsetLeft);
|
|
6338
6360
|
}
|
|
6339
6361
|
else {
|
|
6340
6362
|
x = e.parentData.left + target.offsetLeft;
|
|
@@ -6505,9 +6527,9 @@ class BaseQuickToolbar {
|
|
|
6505
6527
|
parentData: parent.getBoundingClientRect(),
|
|
6506
6528
|
tBarElementHeight: tBarHeight
|
|
6507
6529
|
};
|
|
6508
|
-
if (target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
|
|
6530
|
+
if ((target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
|
|
6509
6531
|
(target.classList.contains(CLS_AUDIOWRAP) || target.classList.contains(CLS_CLICKELEM) ||
|
|
6510
|
-
target.classList.contains(CLS_VID_CLICK_ELEM)))) {
|
|
6532
|
+
target.classList.contains(CLS_VID_CLICK_ELEM)))) && (x == beforeQuickToolbarArgs.positionX || y == beforeQuickToolbarArgs.positionY)) {
|
|
6511
6533
|
this.setPosition(showPopupData);
|
|
6512
6534
|
}
|
|
6513
6535
|
if (!this.parent.inlineMode.enable) {
|
|
@@ -7778,7 +7800,7 @@ function updateTextNode$1(value, enterAction) {
|
|
|
7778
7800
|
tableElm[i].classList.add('e-rte-paste-table');
|
|
7779
7801
|
if (tableElm[i].classList.contains('e-rte-paste-word-table')) {
|
|
7780
7802
|
tableElm[i].classList.remove('e-rte-paste-word-table');
|
|
7781
|
-
continue; //
|
|
7803
|
+
continue; // Skiping the removal of the border if the source is from word.
|
|
7782
7804
|
}
|
|
7783
7805
|
else if (tableElm[i].classList.contains('e-rte-paste-excel-table')) {
|
|
7784
7806
|
tableElm[i].classList.remove('e-rte-paste-excel-table');
|
|
@@ -7812,6 +7834,9 @@ function updateTextNode$1(value, enterAction) {
|
|
|
7812
7834
|
}
|
|
7813
7835
|
const imageElm = resultElm.querySelectorAll('img');
|
|
7814
7836
|
for (let i = 0; i < imageElm.length; i++) {
|
|
7837
|
+
if (imageElm[i].classList.contains('e-rte-image-unsupported')) {
|
|
7838
|
+
continue; // Should not add the class if the image is Broken.
|
|
7839
|
+
}
|
|
7815
7840
|
if (!imageElm[i].classList.contains('e-rte-image')) {
|
|
7816
7841
|
imageElm[i].classList.add('e-rte-image');
|
|
7817
7842
|
}
|
|
@@ -11691,9 +11716,11 @@ class DOMNode {
|
|
|
11691
11716
|
const range = save.range;
|
|
11692
11717
|
const startChildNodes = range.startContainer.childNodes;
|
|
11693
11718
|
const isTableStart = startChildNodes.length > 1 && startChildNodes[0].nodeName === 'TABLE';
|
|
11719
|
+
const isImgOnlySelected = startChildNodes.length > 1 && startChildNodes[0].nodeName === 'IMAGE' &&
|
|
11720
|
+
range.endOffset === 1 && range.endContainer.nodeName === '#text' && range.endContainer.textContent.length === 0;
|
|
11694
11721
|
let start = ((isTableStart ? getLastTextNode(startChildNodes[range.startOffset + 1]) :
|
|
11695
11722
|
startChildNodes[(range.startOffset > 0) ? (range.startOffset - 1) : range.startOffset]) || range.startContainer);
|
|
11696
|
-
let end = (range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) : range.endOffset]
|
|
11723
|
+
let end = (range.endContainer.childNodes[(range.endOffset > 0) ? (isImgOnlySelected ? range.endOffset : (range.endOffset - 1)) : range.endOffset]
|
|
11697
11724
|
|| range.endContainer);
|
|
11698
11725
|
if ((start.nodeType === Node.ELEMENT_NODE && end.nodeType === Node.ELEMENT_NODE) && (start.contains(end) || end.contains(start))) {
|
|
11699
11726
|
const existNode = start.contains(end) ? start : end;
|
|
@@ -12041,14 +12068,21 @@ class Lists {
|
|
|
12041
12068
|
const preElementOLTest = this.testList(preElement);
|
|
12042
12069
|
const nextElementOLTest = this.testList(nextElement);
|
|
12043
12070
|
if (!preElementOLTest && !nextElementOLTest && preElemULStart !== '*' && nextElemULStart !== '*') {
|
|
12071
|
+
const brElement = createElement('br');
|
|
12044
12072
|
if (startElementOLTest) {
|
|
12045
12073
|
range.startContainer.textContent = range.startContainer.textContent.slice(range.startOffset, range.startContainer.textContent.length);
|
|
12074
|
+
if (range.startContainer.nodeName === '#text' && range.startContainer.textContent.length === 0) {
|
|
12075
|
+
this.parent.domNode.insertAfter(brElement, range.startContainer);
|
|
12076
|
+
}
|
|
12046
12077
|
this.applyListsHandler({ subCommand: 'OL', callBack: e.callBack });
|
|
12047
12078
|
e.event.preventDefault();
|
|
12048
12079
|
}
|
|
12049
12080
|
else if (range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '*' ||
|
|
12050
12081
|
range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '-') {
|
|
12051
12082
|
range.startContainer.textContent = range.startContainer.textContent.slice(range.startOffset, range.startContainer.textContent.length);
|
|
12083
|
+
if (range.startContainer.nodeName === '#text' && range.startContainer.textContent.length === 0) {
|
|
12084
|
+
this.parent.domNode.insertAfter(brElement, range.startContainer);
|
|
12085
|
+
}
|
|
12052
12086
|
this.applyListsHandler({ subCommand: 'UL', callBack: e.callBack });
|
|
12053
12087
|
e.event.preventDefault();
|
|
12054
12088
|
}
|
|
@@ -12159,11 +12193,11 @@ class Lists {
|
|
|
12159
12193
|
}
|
|
12160
12194
|
removeList(range, e) {
|
|
12161
12195
|
let startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
|
|
12162
|
-
let endNode = this.parent.domNode.getSelectedNode(range.endContainer, range.endOffset);
|
|
12196
|
+
let endNode = (!isNullOrUndefined(range.endContainer.parentElement.closest('li')) && range.endContainer.parentElement.closest('li').childElementCount > 1 && range.endContainer.nodeName === '#text') ? range.endContainer : this.parent.domNode.getSelectedNode(range.endContainer, range.endOffset);
|
|
12163
12197
|
startNode = startNode.nodeName === 'BR' ? startNode.parentElement : startNode;
|
|
12164
12198
|
endNode = endNode.nodeName === 'BR' ? endNode.parentElement : endNode;
|
|
12165
12199
|
startNode = startNode.nodeName !== 'LI' && !isNullOrUndefined(startNode.closest('LI')) ? startNode.closest('LI') : startNode;
|
|
12166
|
-
endNode = endNode.nodeName !== 'LI' && !isNullOrUndefined(endNode.closest('LI')) ? endNode.closest('LI') : endNode;
|
|
12200
|
+
endNode = endNode.nodeName !== 'LI' && endNode.nodeName !== '#text' && !isNullOrUndefined(endNode.closest('LI')) ? endNode.closest('LI') : endNode;
|
|
12167
12201
|
if (((range.commonAncestorContainer.nodeName === 'OL' || range.commonAncestorContainer.nodeName === 'UL' || range.commonAncestorContainer.nodeName === 'LI') &&
|
|
12168
12202
|
isNullOrUndefined(endNode.nextElementSibling) && endNode.textContent.length === range.endOffset &&
|
|
12169
12203
|
isNullOrUndefined(startNode.previousElementSibling) && range.startOffset === 0) ||
|
|
@@ -12568,7 +12602,7 @@ class Lists {
|
|
|
12568
12602
|
}
|
|
12569
12603
|
}
|
|
12570
12604
|
applyLists(elements, type, selector, item, e) {
|
|
12571
|
-
if (this.isRevert(elements, type, item) && isNullOrUndefined(item)) {
|
|
12605
|
+
if (this.isRevert(elements, type, item) && isNullOrUndefined(item) || (!isNullOrUndefined(item) && item.listStyle === 'none')) {
|
|
12572
12606
|
this.revertList(elements, e);
|
|
12573
12607
|
this.removeEmptyListElements();
|
|
12574
12608
|
}
|
|
@@ -12641,6 +12675,9 @@ class Lists {
|
|
|
12641
12675
|
isNullOrUndefined(item) && nodes[i].parentNode.style.listStyleType !== '') {
|
|
12642
12676
|
isRevert = false;
|
|
12643
12677
|
}
|
|
12678
|
+
if (nodes[i].parentNode.tagName === tagName && nodes[i].parentNode.style.listStyleType !== '') {
|
|
12679
|
+
isRevert = true;
|
|
12680
|
+
}
|
|
12644
12681
|
}
|
|
12645
12682
|
return isRevert;
|
|
12646
12683
|
}
|
|
@@ -12753,66 +12790,78 @@ class Lists {
|
|
|
12753
12790
|
const viewNode = [];
|
|
12754
12791
|
for (let i = 0; i < elements.length; i++) {
|
|
12755
12792
|
const element = elements[i];
|
|
12756
|
-
if (
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
}
|
|
12776
|
-
if (element.parentNode.insertBefore(this.closeTag(parentNode.tagName), element), 'LI' === parentNode.parentNode.tagName || 'OL' === parentNode.parentNode.tagName ||
|
|
12777
|
-
'UL' === parentNode.parentNode.tagName) {
|
|
12778
|
-
element.parentNode.insertBefore(this.closeTag('LI'), element);
|
|
12779
|
-
}
|
|
12780
|
-
else {
|
|
12781
|
-
if (DEFAULT_TAG && 0 === element.querySelectorAll(BLOCK_TAGS.join(', ')).length) {
|
|
12782
|
-
const wrapperclass = isNullOrUndefined(className) ? ' class="e-rte-wrap-inner"' :
|
|
12783
|
-
' class="' + className + ' e-rte-wrap-inner"';
|
|
12784
|
-
const wrapper = '<' + DEFAULT_TAG + wrapperclass +
|
|
12785
|
-
this.domNode.attributes(parentNode) + '></' + DEFAULT_TAG + '>';
|
|
12786
|
-
if (e.enterAction !== 'BR') {
|
|
12787
|
-
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
|
|
12793
|
+
if ((isNullOrUndefined(e.item)) || ((element.nodeName === 'LI' && e.item.listStyle === 'none'))) {
|
|
12794
|
+
if (this.domNode.contents(element)[0].nodeType === 3 && this.domNode.contents(element)[0].textContent.trim().length === 0) {
|
|
12795
|
+
detach(this.domNode.contents(element)[0]);
|
|
12796
|
+
}
|
|
12797
|
+
let parentNode = elements[i].parentNode;
|
|
12798
|
+
let className = element.getAttribute('class');
|
|
12799
|
+
if (temp.length === 0) {
|
|
12800
|
+
const siblingList = elements[i].querySelectorAll('ul, ol');
|
|
12801
|
+
const firstNode = siblingList[0];
|
|
12802
|
+
if (firstNode) {
|
|
12803
|
+
const child = firstNode
|
|
12804
|
+
.querySelectorAll('li');
|
|
12805
|
+
if (child) {
|
|
12806
|
+
const nestedElement = createElement(firstNode.tagName);
|
|
12807
|
+
append([nestedElement], firstNode.parentNode);
|
|
12808
|
+
const nestedElementLI = createElement('li', { styles: 'list-style-type: none;' });
|
|
12809
|
+
append([nestedElementLI], nestedElement);
|
|
12810
|
+
append([firstNode], nestedElementLI);
|
|
12811
|
+
}
|
|
12788
12812
|
}
|
|
12789
12813
|
}
|
|
12790
|
-
|
|
12791
|
-
|
|
12792
|
-
|
|
12793
|
-
}
|
|
12794
|
-
else if (this.domNode.contents(element)[0].classList.contains(markerClassName.startSelection) ||
|
|
12795
|
-
this.domNode.contents(element)[0].classList.contains(markerClassName.endSelection)) {
|
|
12796
|
-
const replace = this.domNode.createTagString(DEFAULT_TAG, parentNode, this.domNode.contents(element)[0].outerHTML);
|
|
12797
|
-
this.domNode.replaceWith(this.domNode.contents(element)[0], replace);
|
|
12814
|
+
if (element.parentNode.insertBefore(this.closeTag(parentNode.tagName), element), 'LI' === parentNode.parentNode.tagName || 'OL' === parentNode.parentNode.tagName ||
|
|
12815
|
+
'UL' === parentNode.parentNode.tagName) {
|
|
12816
|
+
element.parentNode.insertBefore(this.closeTag('LI'), element);
|
|
12798
12817
|
}
|
|
12799
12818
|
else {
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12819
|
+
if (DEFAULT_TAG && 0 === element.querySelectorAll(BLOCK_TAGS.join(', ')).length) {
|
|
12820
|
+
const wrapperclass = isNullOrUndefined(className) ? ' class="e-rte-wrap-inner"' :
|
|
12821
|
+
' class="' + className + ' e-rte-wrap-inner"';
|
|
12822
|
+
let parentElement = parentNode;
|
|
12823
|
+
if (!isNullOrUndefined(parentElement.style.listStyleType)) {
|
|
12824
|
+
parentNode.style.removeProperty("list-style-type");
|
|
12825
|
+
}
|
|
12826
|
+
if (!isNullOrUndefined(parentElement.style.listStyleImage)) {
|
|
12827
|
+
parentNode.style.removeProperty("list-style-image");
|
|
12828
|
+
}
|
|
12829
|
+
if (parentElement.style.length === 0) {
|
|
12830
|
+
parentNode.removeAttribute("style");
|
|
12831
|
+
}
|
|
12832
|
+
const wrapper = '<' + DEFAULT_TAG + wrapperclass +
|
|
12833
|
+
this.domNode.attributes(parentElement) + '></' + DEFAULT_TAG + '>';
|
|
12834
|
+
if (e.enterAction !== 'BR') {
|
|
12835
|
+
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
|
|
12836
|
+
}
|
|
12837
|
+
}
|
|
12838
|
+
else if (this.domNode.contents(element)[0].nodeType === 3) {
|
|
12839
|
+
const replace = this.domNode.createTagString(DEFAULT_TAG, parentNode, this.parent.domNode.encode(this.domNode.contents(element)[0].textContent));
|
|
12840
|
+
this.domNode.replaceWith(this.domNode.contents(element)[0], replace);
|
|
12841
|
+
}
|
|
12842
|
+
else if (this.domNode.contents(element)[0].classList.contains(markerClassName.startSelection) ||
|
|
12843
|
+
this.domNode.contents(element)[0].classList.contains(markerClassName.endSelection)) {
|
|
12844
|
+
const replace = this.domNode.createTagString(DEFAULT_TAG, parentNode, this.domNode.contents(element)[0].outerHTML);
|
|
12845
|
+
this.domNode.replaceWith(this.domNode.contents(element)[0], replace);
|
|
12805
12846
|
}
|
|
12847
|
+
else {
|
|
12848
|
+
const childNode = element.firstChild;
|
|
12849
|
+
className = childNode.getAttribute('class');
|
|
12850
|
+
attributes(childNode, this.domNode.rawAttributes(parentNode));
|
|
12851
|
+
if (className && childNode.getAttribute('class')) {
|
|
12852
|
+
attributes(childNode, { 'class': className + ' ' + childNode.getAttribute('class') });
|
|
12853
|
+
}
|
|
12854
|
+
}
|
|
12855
|
+
append([this.openTag('LI')], element);
|
|
12856
|
+
prepend([this.closeTag('LI')], element);
|
|
12857
|
+
}
|
|
12858
|
+
this.domNode.insertAfter(this.openTag(parentNode.tagName), element);
|
|
12859
|
+
if (parentNode.parentNode.tagName === 'LI') {
|
|
12860
|
+
parentNode = parentNode.parentNode.parentNode;
|
|
12861
|
+
}
|
|
12862
|
+
if (viewNode.indexOf(parentNode) < 0) {
|
|
12863
|
+
viewNode.push(parentNode);
|
|
12806
12864
|
}
|
|
12807
|
-
append([this.openTag('LI')], element);
|
|
12808
|
-
prepend([this.closeTag('LI')], element);
|
|
12809
|
-
}
|
|
12810
|
-
this.domNode.insertAfter(this.openTag(parentNode.tagName), element);
|
|
12811
|
-
if (parentNode.parentNode.tagName === 'LI') {
|
|
12812
|
-
parentNode = parentNode.parentNode.parentNode;
|
|
12813
|
-
}
|
|
12814
|
-
if (viewNode.indexOf(parentNode) < 0) {
|
|
12815
|
-
viewNode.push(parentNode);
|
|
12816
12865
|
}
|
|
12817
12866
|
}
|
|
12818
12867
|
for (let i = 0; i < viewNode.length; i++) {
|
|
@@ -13038,7 +13087,7 @@ class NodeCutter {
|
|
|
13038
13087
|
else if (len > -1) {
|
|
13039
13088
|
this.spliceEmptyNode(fragment.childNodes[0], isStart);
|
|
13040
13089
|
}
|
|
13041
|
-
else if (fragment.nodeType !== 3 && fragment.nodeType !== 11 && fragment.nodeName !== 'IMG' && !(fragment.classList.contains('e-video-wrap')) && !(fragment.classList.contains('e-audio-wrap'))) {
|
|
13090
|
+
else if (fragment.nodeType !== 3 && fragment.nodeType !== 11 && fragment.nodeName !== 'IMG' && !(fragment.querySelectorAll('img').length > 0) && !(fragment.classList.contains('e-video-wrap')) && !(fragment.classList.contains('e-audio-wrap'))) {
|
|
13042
13091
|
fragment.parentNode.removeChild(fragment);
|
|
13043
13092
|
}
|
|
13044
13093
|
return fragment;
|
|
@@ -13171,6 +13220,14 @@ class Formats {
|
|
|
13171
13220
|
}
|
|
13172
13221
|
}
|
|
13173
13222
|
}
|
|
13223
|
+
getBlockParent(node, endNode) {
|
|
13224
|
+
let currentParent;
|
|
13225
|
+
while (node != endNode) {
|
|
13226
|
+
currentParent = node;
|
|
13227
|
+
node = node.parentElement;
|
|
13228
|
+
}
|
|
13229
|
+
return currentParent;
|
|
13230
|
+
}
|
|
13174
13231
|
onKeyDown(e) {
|
|
13175
13232
|
if (e.event.which === 13) {
|
|
13176
13233
|
let range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
@@ -13180,6 +13237,8 @@ class Formats {
|
|
|
13180
13237
|
? range.endContainer : range.endContainer.parentElement;
|
|
13181
13238
|
const preElem = closest(startCon, 'pre');
|
|
13182
13239
|
const endPreElem = closest(endCon, 'pre');
|
|
13240
|
+
const blockquoteEle = closest(startCon, 'blockquote');
|
|
13241
|
+
const endBlockquoteEle = closest(endCon, 'blockquote');
|
|
13183
13242
|
const liParent = !isNullOrUndefined(preElem) && !isNullOrUndefined(preElem.parentElement) && preElem.parentElement.tagName === 'LI';
|
|
13184
13243
|
if (liParent) {
|
|
13185
13244
|
return;
|
|
@@ -13191,6 +13250,17 @@ class Formats {
|
|
|
13191
13250
|
range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
13192
13251
|
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, endCon, 0);
|
|
13193
13252
|
}
|
|
13253
|
+
if (e.event.which === 13 && ((!isNullOrUndefined(blockquoteEle) && !isNullOrUndefined(endBlockquoteEle)) || (!isNullOrUndefined(blockquoteEle) && isNullOrUndefined(endBlockquoteEle)))) {
|
|
13254
|
+
let startParent = this.getBlockParent(range.startContainer, blockquoteEle);
|
|
13255
|
+
if ((startParent.textContent.charCodeAt(0) === 8203 &&
|
|
13256
|
+
startParent.textContent.length === 1) || startParent.textContent.length === 0) {
|
|
13257
|
+
if (isNullOrUndefined(startParent.nextSibling) && ((startParent.previousSibling.textContent.charCodeAt(0) === 8203 &&
|
|
13258
|
+
startParent.previousSibling.textContent.length === 1) || startParent.previousSibling.textContent.length === 0)) {
|
|
13259
|
+
e.event.preventDefault();
|
|
13260
|
+
this.paraFocus(startParent.parentElement); //Revert from blockquotes while pressing enter key
|
|
13261
|
+
}
|
|
13262
|
+
}
|
|
13263
|
+
}
|
|
13194
13264
|
if (e.event.which === 13 && !isNullOrUndefined(preElem) && !isNullOrUndefined(endPreElem)) {
|
|
13195
13265
|
e.event.preventDefault();
|
|
13196
13266
|
this.deleteContent(range);
|
|
@@ -13414,7 +13484,7 @@ class Formats {
|
|
|
13414
13484
|
replaceHTML = parentNode.innerHTML;
|
|
13415
13485
|
}
|
|
13416
13486
|
if ((e.subCommand.toLowerCase() === parentNode.tagName.toLowerCase() &&
|
|
13417
|
-
(e.subCommand.toLowerCase() !== 'pre' ||
|
|
13487
|
+
(e.subCommand.toLowerCase() !== 'pre' && e.subCommand.toLowerCase() !== 'blockquote' ||
|
|
13418
13488
|
(!isNullOrUndefined(e.exeValue) && e.exeValue.name === 'dropDownSelect'))) ||
|
|
13419
13489
|
isNullOrUndefined(parentNode.parentNode) ||
|
|
13420
13490
|
(parentNode.tagName === 'TABLE' && e.subCommand.toLowerCase() === 'pre')) {
|
|
@@ -13423,7 +13493,21 @@ class Formats {
|
|
|
13423
13493
|
this.cleanFormats(parentNode, e.subCommand);
|
|
13424
13494
|
const replaceNode = (e.subCommand.toLowerCase() === 'pre' && parentNode.tagName.toLowerCase() === 'pre') ?
|
|
13425
13495
|
'p' : e.subCommand;
|
|
13426
|
-
const
|
|
13496
|
+
const isToggleBlockquoteList = e.subCommand.toLowerCase() === parentNode.tagName.toLowerCase() &&
|
|
13497
|
+
e.subCommand.toLowerCase() === 'blockquote' && this.parent.domNode.isList(parentNode.firstElementChild);
|
|
13498
|
+
const isToggleBlockquote = e.subCommand.toLowerCase() === parentNode.tagName.toLowerCase()
|
|
13499
|
+
&& e.subCommand.toLowerCase() === 'blockquote';
|
|
13500
|
+
let replaceTag;
|
|
13501
|
+
if (isToggleBlockquoteList) {
|
|
13502
|
+
replaceTag = replaceHTML.replace(/>\s+</g, '><');
|
|
13503
|
+
}
|
|
13504
|
+
else if (isToggleBlockquote) {
|
|
13505
|
+
let tagWrap = (e.enterAction == 'BR' || e.enterAction == 'P') ? 'P' : e.enterAction;
|
|
13506
|
+
replaceTag = this.parent.domNode.createTagString(tagWrap, parentNode, replaceHTML.replace(/>\s+</g, '><'));
|
|
13507
|
+
}
|
|
13508
|
+
else {
|
|
13509
|
+
replaceTag = this.parent.domNode.createTagString(replaceNode, parentNode, replaceHTML.replace(/>\s+</g, '><'));
|
|
13510
|
+
}
|
|
13427
13511
|
if (parentNode.tagName === 'LI') {
|
|
13428
13512
|
parentNode.innerHTML = '';
|
|
13429
13513
|
parentNode.insertAdjacentHTML('beforeend', replaceTag);
|
|
@@ -13732,12 +13816,17 @@ class InsertHtml {
|
|
|
13732
13816
|
preNode.parentNode.replaceChild(fragment, preNode);
|
|
13733
13817
|
}
|
|
13734
13818
|
else {
|
|
13819
|
+
const startContainerParent = range.startContainer.parentNode;
|
|
13820
|
+
// Get the index of the start container among its siblings
|
|
13821
|
+
const startIndex = Array.prototype.indexOf.call(startContainerParent.childNodes, range.startContainer);
|
|
13735
13822
|
range.deleteContents();
|
|
13823
|
+
range.setStart(startContainerParent, startIndex);
|
|
13824
|
+
range.setEnd(startContainerParent, startIndex);
|
|
13736
13825
|
if (!isNullOrUndefined(lasNode)) {
|
|
13737
13826
|
detach(lasNode);
|
|
13738
13827
|
}
|
|
13739
13828
|
// eslint-disable-next-line
|
|
13740
|
-
!isNullOrUndefined(sibNode) ? sibNode.parentNode.appendChild(fragment) :
|
|
13829
|
+
!isNullOrUndefined(sibNode) ? (sibNode.parentNode === editNode ? sibNode.appendChild(fragment) : sibNode.parentNode.appendChild(fragment)) : range.insertNode(fragment);
|
|
13741
13830
|
}
|
|
13742
13831
|
}
|
|
13743
13832
|
else {
|
|
@@ -13962,7 +14051,15 @@ class InsertHtml {
|
|
|
13962
14051
|
}
|
|
13963
14052
|
static imageFocus(node, nodeSelection, docElement) {
|
|
13964
14053
|
const focusNode = document.createTextNode(' ');
|
|
13965
|
-
node.parentNode
|
|
14054
|
+
if (node.parentNode && node.parentNode.nodeName === 'A') {
|
|
14055
|
+
const anchorTag = node.parentNode;
|
|
14056
|
+
const parentNode = anchorTag.parentNode;
|
|
14057
|
+
parentNode.insertBefore(focusNode, anchorTag.nextSibling);
|
|
14058
|
+
parentNode.insertBefore(node, focusNode);
|
|
14059
|
+
}
|
|
14060
|
+
else {
|
|
14061
|
+
node.parentNode.insertBefore(focusNode, node.nextSibling);
|
|
14062
|
+
}
|
|
13966
14063
|
nodeSelection.setSelectionText(docElement, node.nextSibling, node.nextSibling, 0, 0);
|
|
13967
14064
|
}
|
|
13968
14065
|
// eslint-disable-next-line
|
|
@@ -15889,7 +15986,7 @@ class TableCommand {
|
|
|
15889
15986
|
const eleArray = elements;
|
|
15890
15987
|
//eslint-disable-next-line
|
|
15891
15988
|
if (min < (max = Math.min(max, eleArray[0].length - 1))) {
|
|
15892
|
-
for (colIndex
|
|
15989
|
+
for (colIndex = min; colIndex <= max; colIndex++) {
|
|
15893
15990
|
// eslint-disable-next-line
|
|
15894
15991
|
if (!(min < colIndex && eleArray[0][colIndex] === eleArray[0][colIndex - 1]) && 1 < (index =
|
|
15895
15992
|
Math.min(parseInt(eleArray[0][colIndex].getAttribute('colspan'), 10) || 1, max - min + 1)) &&
|
|
@@ -16567,6 +16664,29 @@ class SelectionCommands {
|
|
|
16567
16664
|
const nodeCutter = new NodeCutter();
|
|
16568
16665
|
const isFormatted = new IsFormatted();
|
|
16569
16666
|
let range = domSelection.getRange(docElement);
|
|
16667
|
+
let currentAnchorNode = range.startContainer.parentElement;
|
|
16668
|
+
if (range.collapsed && !isNullOrUndefined(currentAnchorNode) &&
|
|
16669
|
+
currentAnchorNode.tagName === 'A' &&
|
|
16670
|
+
(range.startOffset === currentAnchorNode.textContent.length || range.startOffset === 0)) {
|
|
16671
|
+
const emptyTextNode = document.createTextNode('');
|
|
16672
|
+
if (range.startOffset === 0) {
|
|
16673
|
+
currentAnchorNode.parentNode.insertBefore(emptyTextNode, currentAnchorNode);
|
|
16674
|
+
}
|
|
16675
|
+
else {
|
|
16676
|
+
if (!isNullOrUndefined(currentAnchorNode.nextSibling)) {
|
|
16677
|
+
currentAnchorNode.parentElement.insertBefore(emptyTextNode, currentAnchorNode.nextSibling);
|
|
16678
|
+
}
|
|
16679
|
+
else {
|
|
16680
|
+
currentAnchorNode.parentNode.appendChild(emptyTextNode);
|
|
16681
|
+
}
|
|
16682
|
+
}
|
|
16683
|
+
// Set the range to the empty text node
|
|
16684
|
+
const newRange = docElement.createRange();
|
|
16685
|
+
range.setStart(emptyTextNode, 0);
|
|
16686
|
+
range.setEnd(emptyTextNode, 0);
|
|
16687
|
+
range.collapse(true);
|
|
16688
|
+
domSelection.setRange(docElement, newRange);
|
|
16689
|
+
}
|
|
16570
16690
|
if (Browser.userAgent.indexOf('Firefox') !== -1 && range.startContainer === range.endContainer && !isNullOrUndefined(endNode) && range.startContainer === endNode) {
|
|
16571
16691
|
const startChildNodes = range.startContainer.childNodes;
|
|
16572
16692
|
const startNode = ((startChildNodes[(range.startOffset > 0) ? (range.startOffset - 1) :
|
|
@@ -16942,7 +17062,10 @@ class SelectionCommands {
|
|
|
16942
17062
|
}
|
|
16943
17063
|
let num = index;
|
|
16944
17064
|
let liChildContent = '';
|
|
16945
|
-
|
|
17065
|
+
/* eslint-disable security/detect-object-injection */
|
|
17066
|
+
while (num >= 0 && !isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' && liElement.contains(nodes[num]) &&
|
|
17067
|
+
liElement.textContent.replace('/\u200B/g', '').trim().includes(nodes[num].textContent.trim())) {
|
|
17068
|
+
/* eslint-enable security/detect-object-injection */
|
|
16946
17069
|
liChildContent = ' ' + nodes[num].textContent.trim() + liChildContent;
|
|
16947
17070
|
num--;
|
|
16948
17071
|
}
|
|
@@ -17014,6 +17137,23 @@ class SelectionCommands {
|
|
|
17014
17137
|
parentElement = parentElement.parentElement;
|
|
17015
17138
|
liElement = parentElement;
|
|
17016
17139
|
}
|
|
17140
|
+
if (format === 'fontcolor') {
|
|
17141
|
+
const parentElem = nodes[index].parentElement;
|
|
17142
|
+
if (!isNullOrUndefined(parentElem) && parentElem.childNodes) {
|
|
17143
|
+
for (let i = 0; i < parentElem.childNodes.length; i++) {
|
|
17144
|
+
if (this.concatenateTextExcludingList(nodes, index) === nodes[index].textContent) {
|
|
17145
|
+
if (parentElem.tagName === 'LI') {
|
|
17146
|
+
parentElem.style.color = value;
|
|
17147
|
+
}
|
|
17148
|
+
}
|
|
17149
|
+
// eslint-disable-next-line
|
|
17150
|
+
const childElement = parentElem.childNodes[i];
|
|
17151
|
+
if (childElement.tagName === 'OL' || childElement.tagName === 'UL') {
|
|
17152
|
+
childElement.style.color = 'initial';
|
|
17153
|
+
}
|
|
17154
|
+
}
|
|
17155
|
+
}
|
|
17156
|
+
}
|
|
17017
17157
|
if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
17018
17158
|
liElement.textContent.trim() === nodes[index].textContent.trim()) {
|
|
17019
17159
|
if (format === 'fontsize') {
|
|
@@ -17313,6 +17453,18 @@ class SelectionCommands {
|
|
|
17313
17453
|
}
|
|
17314
17454
|
}
|
|
17315
17455
|
}
|
|
17456
|
+
static concatenateTextExcludingList(nodes, index) {
|
|
17457
|
+
let result = '';
|
|
17458
|
+
const parentNode = nodes[index].parentElement;
|
|
17459
|
+
for (let i = 0; i < parentNode.childNodes.length; i++) {
|
|
17460
|
+
// eslint-disable-next-line
|
|
17461
|
+
const childNode = parentNode.childNodes[i];
|
|
17462
|
+
if ((childNode.nodeType === 3) || (childNode.nodeType === 1 && (childNode.tagName !== 'OL' && childNode.tagName !== 'UL'))) {
|
|
17463
|
+
result += childNode.textContent;
|
|
17464
|
+
}
|
|
17465
|
+
}
|
|
17466
|
+
return result;
|
|
17467
|
+
}
|
|
17316
17468
|
}
|
|
17317
17469
|
SelectionCommands.enterAction = 'P';
|
|
17318
17470
|
|
|
@@ -18021,7 +18173,6 @@ class MsWordPaste {
|
|
|
18021
18173
|
if (patern.test(tempHTMLContent) || patern2.test(tempHTMLContent) || patern3.test(tempHTMLContent) ||
|
|
18022
18174
|
pattern4.test(tempHTMLContent)) {
|
|
18023
18175
|
const source = this.findSource(elm);
|
|
18024
|
-
this.imageConversion(elm, rtfData);
|
|
18025
18176
|
tempHTMLContent = tempHTMLContent.replace(/<img[^>]+>/i, '');
|
|
18026
18177
|
this.addListClass(elm);
|
|
18027
18178
|
listNodes = this.cleanUp(elm, listNodes);
|
|
@@ -18029,6 +18180,7 @@ class MsWordPaste {
|
|
|
18029
18180
|
listNodes[0].parentElement.tagName !== 'OL') {
|
|
18030
18181
|
this.listConverter(listNodes);
|
|
18031
18182
|
}
|
|
18183
|
+
this.imageConversion(elm, rtfData);
|
|
18032
18184
|
this.cleanList(elm, 'UL');
|
|
18033
18185
|
this.cleanList(elm, 'OL');
|
|
18034
18186
|
this.styleCorrection(elm, wordPasteStyleConfig);
|
|
@@ -18037,11 +18189,11 @@ class MsWordPaste {
|
|
|
18037
18189
|
this.removeEmptyElements(elm);
|
|
18038
18190
|
this.removeEmptyAnchorTag(elm);
|
|
18039
18191
|
this.breakLineAddition(elm);
|
|
18192
|
+
this.processMargin(elm);
|
|
18040
18193
|
this.removeClassName(elm);
|
|
18041
18194
|
if (pattern4.test(tempHTMLContent)) {
|
|
18042
18195
|
this.addTableBorderClass(elm);
|
|
18043
18196
|
}
|
|
18044
|
-
this.processMargin(elm);
|
|
18045
18197
|
e.callBack(elm.innerHTML, this.cropImageDimensions, source);
|
|
18046
18198
|
}
|
|
18047
18199
|
else {
|
|
@@ -18112,8 +18264,9 @@ class MsWordPaste {
|
|
|
18112
18264
|
imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
|
|
18113
18265
|
imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0 &&
|
|
18114
18266
|
imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0) {
|
|
18115
|
-
|
|
18267
|
+
imgElem[i].classList.add('e-rte-image-unsupported');
|
|
18116
18268
|
}
|
|
18269
|
+
imgElem[i].removeAttribute('v:shapes');
|
|
18117
18270
|
}
|
|
18118
18271
|
imgElem = elm.querySelectorAll('img');
|
|
18119
18272
|
const imgSrc = [];
|
|
@@ -18143,6 +18296,7 @@ class MsWordPaste {
|
|
|
18143
18296
|
});
|
|
18144
18297
|
}
|
|
18145
18298
|
}
|
|
18299
|
+
imgElem = elm.querySelectorAll('img:not(.e-rte-image-unsupported');
|
|
18146
18300
|
for (let i = 0; i < imgElem.length; i++) {
|
|
18147
18301
|
if (imgSrc[i].match(linkRegex)) {
|
|
18148
18302
|
imgElem[i].setAttribute('src', imgSrc[i]);
|
|
@@ -18153,7 +18307,7 @@ class MsWordPaste {
|
|
|
18153
18307
|
}
|
|
18154
18308
|
else {
|
|
18155
18309
|
imgElem[i].removeAttribute('src');
|
|
18156
|
-
imgElem[i].
|
|
18310
|
+
imgElem[i].classList.add('e-rte-image-unsupported');
|
|
18157
18311
|
}
|
|
18158
18312
|
if (!isNullOrUndefined(base64Src[i]) && base64Src[i].isCroppedImage) {
|
|
18159
18313
|
imgElem[i].classList.add('e-img-cropped');
|
|
@@ -18161,6 +18315,10 @@ class MsWordPaste {
|
|
|
18161
18315
|
}
|
|
18162
18316
|
imgElem[i].setAttribute('id', 'msWordImg-' + imgName[i]);
|
|
18163
18317
|
}
|
|
18318
|
+
imgElem = elm.querySelectorAll('.e-rte-image-unsupported');
|
|
18319
|
+
for (let i = 0; i < imgElem.length; i++) {
|
|
18320
|
+
imgElem[i].removeAttribute('src');
|
|
18321
|
+
}
|
|
18164
18322
|
}
|
|
18165
18323
|
}
|
|
18166
18324
|
checkVShape(elm) {
|
|
@@ -18234,6 +18392,9 @@ class MsWordPaste {
|
|
|
18234
18392
|
const result = [];
|
|
18235
18393
|
if (!isNullOrUndefined(fullImg)) {
|
|
18236
18394
|
for (let i = 0; i < fullImg.length; i++) {
|
|
18395
|
+
if (fullImg[i].indexOf('fIsBullet') !== -1 && fullImg[i].indexOf('wzName') === -1) {
|
|
18396
|
+
continue;
|
|
18397
|
+
}
|
|
18237
18398
|
let isCroppedImage = false;
|
|
18238
18399
|
let goalWidth = 0;
|
|
18239
18400
|
let goalHeight = 0;
|
|
@@ -18248,7 +18409,7 @@ class MsWordPaste {
|
|
|
18248
18409
|
else if (fullImg[i].indexOf('\\jpegblip') !== -1) {
|
|
18249
18410
|
imgType = 'image/jpeg';
|
|
18250
18411
|
}
|
|
18251
|
-
else if (fullImg[i].indexOf('\\
|
|
18412
|
+
else if (fullImg[i].indexOf('\\emfblip') !== -1) {
|
|
18252
18413
|
imgType = null;
|
|
18253
18414
|
}
|
|
18254
18415
|
else {
|
|
@@ -18288,7 +18449,7 @@ class MsWordPaste {
|
|
|
18288
18449
|
return parseInt(result, 10);
|
|
18289
18450
|
}
|
|
18290
18451
|
removeClassName(elm) {
|
|
18291
|
-
const elmWithClass = elm.querySelectorAll('*[class]:not(.e-img-cropped)');
|
|
18452
|
+
const elmWithClass = elm.querySelectorAll('*[class]:not(.e-img-cropped):not(.e-rte-image-unsupported)');
|
|
18292
18453
|
for (let i = 0; i < elmWithClass.length; i++) {
|
|
18293
18454
|
elmWithClass[i].removeAttribute('class');
|
|
18294
18455
|
}
|
|
@@ -18325,7 +18486,7 @@ class MsWordPaste {
|
|
|
18325
18486
|
return removableElement;
|
|
18326
18487
|
}
|
|
18327
18488
|
removeUnwantedElements(elm) {
|
|
18328
|
-
|
|
18489
|
+
const styleElm = elm.querySelector('style');
|
|
18329
18490
|
if (!isNullOrUndefined(styleElm)) {
|
|
18330
18491
|
detach(styleElm);
|
|
18331
18492
|
}
|
|
@@ -18561,6 +18722,7 @@ class MsWordPaste {
|
|
|
18561
18722
|
listConverter(listNodes) {
|
|
18562
18723
|
let level;
|
|
18563
18724
|
const data = [];
|
|
18725
|
+
let listFormatOverride;
|
|
18564
18726
|
let collection = [];
|
|
18565
18727
|
let content = '';
|
|
18566
18728
|
let stNode;
|
|
@@ -18582,6 +18744,17 @@ class MsWordPaste {
|
|
|
18582
18744
|
else {
|
|
18583
18745
|
level = 1;
|
|
18584
18746
|
}
|
|
18747
|
+
if (content && content.indexOf('mso-list:') !== -1) {
|
|
18748
|
+
let msoListValue;
|
|
18749
|
+
if (content.match(/mso-list:[^;]+;?/)) {
|
|
18750
|
+
const changedContent = content.replace('\n', '').split(' ').join('');
|
|
18751
|
+
msoListValue = changedContent.match(/mso-list:[^;]+;?/)[0].split(':l');
|
|
18752
|
+
listFormatOverride = isNullOrUndefined(msoListValue) ? null : parseInt(msoListValue[1].split('level')[0], 10);
|
|
18753
|
+
}
|
|
18754
|
+
else {
|
|
18755
|
+
listFormatOverride = null;
|
|
18756
|
+
}
|
|
18757
|
+
}
|
|
18585
18758
|
this.listContents = [];
|
|
18586
18759
|
this.getListContent(listNodes[i]);
|
|
18587
18760
|
let type;
|
|
@@ -18617,9 +18790,9 @@ class MsWordPaste {
|
|
|
18617
18790
|
startAttr = this.lowerGreekNumber.indexOf(this.listContents[0].split('.')[0]) + 1;
|
|
18618
18791
|
}
|
|
18619
18792
|
}
|
|
18620
|
-
|
|
18621
|
-
|
|
18622
|
-
|
|
18793
|
+
}
|
|
18794
|
+
if (listNodes[i].style.marginLeft !== '') {
|
|
18795
|
+
styleMarginLeft = listNodes[i].style.marginLeft;
|
|
18623
18796
|
}
|
|
18624
18797
|
const tempNode = [];
|
|
18625
18798
|
for (let j = 1; j < this.listContents.length; j++) {
|
|
@@ -18635,7 +18808,8 @@ class MsWordPaste {
|
|
|
18635
18808
|
currentListStyle = listNodes[i].getAttribute('style');
|
|
18636
18809
|
}
|
|
18637
18810
|
collection.push({
|
|
18638
|
-
listType: type, content: tempNode, nestedLevel: level,
|
|
18811
|
+
listType: type, content: tempNode, nestedLevel: level,
|
|
18812
|
+
listFormatOverride: listFormatOverride, class: currentClassName,
|
|
18639
18813
|
listStyle: currentListStyle, listStyleTypeName: listStyleType, start: startAttr, styleMarginLeft: styleMarginLeft
|
|
18640
18814
|
});
|
|
18641
18815
|
}
|
|
@@ -18708,6 +18882,7 @@ class MsWordPaste {
|
|
|
18708
18882
|
let prevList;
|
|
18709
18883
|
let listCount = 0;
|
|
18710
18884
|
let elem;
|
|
18885
|
+
let lfo = collection[0].listFormatOverride;
|
|
18711
18886
|
for (let index = 0; index < collection.length; index++) {
|
|
18712
18887
|
const listClass = ['MsoListParagraphCxSpFirst', 'MsoListParagraphCxSpMiddle', 'MsoListParagraphCxSpLast'];
|
|
18713
18888
|
let isNormalList = false;
|
|
@@ -18724,16 +18899,24 @@ class MsWordPaste {
|
|
|
18724
18899
|
}
|
|
18725
18900
|
const pElement = createElement('p', { className: 'MsoNormal' });
|
|
18726
18901
|
pElement.innerHTML = collection[index].content.join(' ');
|
|
18727
|
-
if ((collection[index].nestedLevel === 1) &&
|
|
18902
|
+
if ((collection[index].nestedLevel === 1) &&
|
|
18903
|
+
(listCount === 0 || lfo !== collection[index].listFormatOverride) &&
|
|
18904
|
+
collection[index].content) {
|
|
18728
18905
|
root.appendChild(temp = createElement(collection[index].listType, { className: collection[index].class }));
|
|
18729
18906
|
prevList = createElement('li');
|
|
18730
18907
|
prevList.appendChild(pElement);
|
|
18731
18908
|
temp.appendChild(prevList);
|
|
18732
18909
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
18733
|
-
|
|
18910
|
+
if (collection[index].class !== 'msolistparagraph') {
|
|
18911
|
+
temp.style.marginLeft = collection[index].styleMarginLeft;
|
|
18912
|
+
}
|
|
18913
|
+
else {
|
|
18914
|
+
addClass([temp], 'marginLeftIgnore');
|
|
18915
|
+
}
|
|
18734
18916
|
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
18735
18917
|
}
|
|
18736
|
-
else if (collection[index].nestedLevel === pLevel
|
|
18918
|
+
else if (collection[index].nestedLevel === pLevel &&
|
|
18919
|
+
lfo === collection[index].listFormatOverride) {
|
|
18737
18920
|
if (!isNullOrUndefined(prevList) && !isNullOrUndefined(prevList.parentElement)
|
|
18738
18921
|
&& prevList.parentElement.tagName.toLowerCase() === collection[index].listType) {
|
|
18739
18922
|
prevList.parentElement.appendChild(prevList = createElement('li'));
|
|
@@ -18796,6 +18979,12 @@ class MsWordPaste {
|
|
|
18796
18979
|
prevList.appendChild(pElement);
|
|
18797
18980
|
temp.appendChild(prevList);
|
|
18798
18981
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
18982
|
+
if (collection[index].class !== 'msolistparagraph') {
|
|
18983
|
+
temp.style.marginLeft = collection[index].styleMarginLeft;
|
|
18984
|
+
}
|
|
18985
|
+
else {
|
|
18986
|
+
addClass([temp], 'marginLeftIgnore');
|
|
18987
|
+
}
|
|
18799
18988
|
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
18800
18989
|
}
|
|
18801
18990
|
}
|
|
@@ -18819,14 +19008,34 @@ class MsWordPaste {
|
|
|
18819
19008
|
elem = elem.parentElement;
|
|
18820
19009
|
if (elem.attributes.getNamedItem('level')) {
|
|
18821
19010
|
// eslint-disable-next-line
|
|
18822
|
-
if (parseInt(elem.attributes.getNamedItem('level').textContent, null) === collection[index].nestedLevel
|
|
19011
|
+
if (parseInt(elem.attributes.getNamedItem('level').textContent, null) === collection[index].nestedLevel &&
|
|
19012
|
+
lfo === collection[index].listFormatOverride) {
|
|
18823
19013
|
prevList = createElement('li');
|
|
18824
19014
|
prevList.appendChild(pElement);
|
|
18825
19015
|
elem.appendChild(prevList);
|
|
18826
19016
|
break;
|
|
18827
19017
|
// eslint-disable-next-line
|
|
18828
19018
|
}
|
|
18829
|
-
else if (
|
|
19019
|
+
else if (parseInt(elem.attributes.getNamedItem('level').textContent, null) === collection[index].nestedLevel &&
|
|
19020
|
+
lfo !== collection[index].listFormatOverride) {
|
|
19021
|
+
temp = createElement(collection[index].listType);
|
|
19022
|
+
prevList = createElement('li');
|
|
19023
|
+
temp.appendChild(prevList);
|
|
19024
|
+
if (collection[index].nestedLevel > 1) {
|
|
19025
|
+
for (let k = 0; k < collection[index].nestedLevel - 1; k++) {
|
|
19026
|
+
prevList.appendChild(temp = createElement(collection[index].listType));
|
|
19027
|
+
prevList = createElement('li');
|
|
19028
|
+
temp.appendChild(prevList);
|
|
19029
|
+
temp.style.listStyleType = 'none';
|
|
19030
|
+
}
|
|
19031
|
+
}
|
|
19032
|
+
prevList.appendChild(pElement);
|
|
19033
|
+
elem.appendChild(temp);
|
|
19034
|
+
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
19035
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
19036
|
+
break;
|
|
19037
|
+
}
|
|
19038
|
+
else if (collection[index].nestedLevel > parseInt(elem.attributes.getNamedItem('level').textContent, 10)) {
|
|
18830
19039
|
elem.appendChild(temp = createElement(collection[index].listType));
|
|
18831
19040
|
prevList = createElement('li');
|
|
18832
19041
|
prevList.appendChild(pElement);
|
|
@@ -18842,8 +19051,9 @@ class MsWordPaste {
|
|
|
18842
19051
|
prevList.setAttribute('class', collection[index].class);
|
|
18843
19052
|
prevList.setAttribute('style', (!isNullOrUndefined(collection[index].listStyle) ? collection[index].listStyle : ''));
|
|
18844
19053
|
pLevel = collection[index].nestedLevel;
|
|
19054
|
+
lfo = collection[index].listFormatOverride;
|
|
18845
19055
|
listCount++;
|
|
18846
|
-
if (!isNullOrUndefined(collection[index].start)) {
|
|
19056
|
+
if (!isNullOrUndefined(collection[index].start && collection[index].start !== 1 && collection[index].listType === 'ol')) {
|
|
18847
19057
|
temp.setAttribute('start', collection[index].start.toString());
|
|
18848
19058
|
}
|
|
18849
19059
|
}
|
|
@@ -18880,7 +19090,7 @@ class MsWordPaste {
|
|
|
18880
19090
|
const liChildren = element.querySelectorAll('li');
|
|
18881
19091
|
if (liChildren.length > 0) {
|
|
18882
19092
|
for (let i = 0; i < liChildren.length; i++) {
|
|
18883
|
-
if (!isNullOrUndefined((liChildren[i]).style.marginLeft)) {
|
|
19093
|
+
if (!isNullOrUndefined((liChildren[i]).style.marginLeft) && !liChildren[i].parentElement.classList.contains('marginLeftIgnore')) {
|
|
18884
19094
|
(liChildren[i]).style.marginLeft = '';
|
|
18885
19095
|
}
|
|
18886
19096
|
}
|
|
@@ -18894,6 +19104,17 @@ class MsWordPaste {
|
|
|
18894
19104
|
}
|
|
18895
19105
|
}
|
|
18896
19106
|
}
|
|
19107
|
+
const ignoredNode = element.querySelectorAll('.marginLeftIgnore li');
|
|
19108
|
+
if (ignoredNode.length > 0) {
|
|
19109
|
+
for (let i = 0; i < ignoredNode.length; i++) {
|
|
19110
|
+
if (!isNullOrUndefined((ignoredNode[i]).style.marginLeft) && (ignoredNode[i]).style.marginLeft !== '') {
|
|
19111
|
+
const marginLeft = (ignoredNode[i]).style.marginLeft;
|
|
19112
|
+
const marginLeftValue = parseFloat(marginLeft.split('in')[0]);
|
|
19113
|
+
const result = marginLeftValue - 0.5;
|
|
19114
|
+
(ignoredNode[i]).style.marginLeft = result.toString() + 'in';
|
|
19115
|
+
}
|
|
19116
|
+
}
|
|
19117
|
+
}
|
|
18897
19118
|
}
|
|
18898
19119
|
removeEmptyAnchorTag(element) {
|
|
18899
19120
|
const removableElement = element.querySelectorAll('a:not([href])');
|
|
@@ -19743,6 +19964,14 @@ class FormatPainterActions {
|
|
|
19743
19964
|
const range = this.parent.nodeSelection.getRange(docElement);
|
|
19744
19965
|
const isCollapsed = range.collapsed;
|
|
19745
19966
|
const blockNodes = this.parent.domNode.blockNodes();
|
|
19967
|
+
const isListCopied = this.isListCopied();
|
|
19968
|
+
if (isListCopied) {
|
|
19969
|
+
for (let i = 0; i < blockNodes.length; i++) {
|
|
19970
|
+
if (closest(blockNodes[i], 'li')) {
|
|
19971
|
+
blockNodes[i] = closest(blockNodes[i], 'li');
|
|
19972
|
+
}
|
|
19973
|
+
}
|
|
19974
|
+
}
|
|
19746
19975
|
let isFullNodeSelected = false;
|
|
19747
19976
|
if (blockNodes.length === 1) {
|
|
19748
19977
|
isFullNodeSelected = blockNodes[0].textContent.trim() === range.toString().trim();
|
|
@@ -19751,6 +19980,16 @@ class FormatPainterActions {
|
|
|
19751
19980
|
this.insertBlockNode(clonedElem, range, docElement, blockNodes);
|
|
19752
19981
|
}
|
|
19753
19982
|
}
|
|
19983
|
+
isListCopied() {
|
|
19984
|
+
let isListCopied = false;
|
|
19985
|
+
for (let i = 0; i < this.copyCollection.length; i++) {
|
|
19986
|
+
if (this.copyCollection[i].tagName === 'OL' || this.copyCollection[i].tagName === 'UL') {
|
|
19987
|
+
isListCopied = true;
|
|
19988
|
+
break;
|
|
19989
|
+
}
|
|
19990
|
+
}
|
|
19991
|
+
return isListCopied;
|
|
19992
|
+
}
|
|
19754
19993
|
insertBlockNode(element, range, docElement, nodes) {
|
|
19755
19994
|
const domSelection = this.parent.nodeSelection;
|
|
19756
19995
|
const saveSelection = domSelection.save(range, docElement);
|
|
@@ -20443,9 +20682,12 @@ const IFRAMEHEADER = `
|
|
|
20443
20682
|
span.e-selected-node {background-color: #939393;color: white;}
|
|
20444
20683
|
span.e-selected-node.e-highlight {background-color: #1d9dd8;}
|
|
20445
20684
|
body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}
|
|
20446
|
-
.e-rte-image, .e-rte-
|
|
20685
|
+
.e-rte-image, .e-rte-video {border: 0;cursor: pointer;display:
|
|
20447
20686
|
block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
|
|
20448
|
-
.e-rte-
|
|
20687
|
+
.e-rte-audio {border: 0;cursor: pointer;display:
|
|
20688
|
+
block;float: none;margin: 5px auto;max-width: 100%;position: relative;}
|
|
20689
|
+
.e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;
|
|
20690
|
+
margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}
|
|
20449
20691
|
.e-rte-image.e-imgcenter, .e-rte-video.e-video-center {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}
|
|
20450
20692
|
.e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}
|
|
20451
20693
|
.e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}
|
|
@@ -20453,6 +20695,10 @@ const IFRAMEHEADER = `
|
|
|
20453
20695
|
.e-img-caption.e-caption-inline {display: inline-block;float: none;
|
|
20454
20696
|
margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));
|
|
20455
20697
|
position: relativetext-align: center;vertical-align: bottom;}
|
|
20698
|
+
.e-rte-img-caption.e-imgcenter {display: contents; margin-left: auto; margin-right: auto;}
|
|
20699
|
+
.e-rte-img-caption.e-imgright {display: contents; margin-left: auto; margin-right: 0;}
|
|
20700
|
+
.e-rte-img-caption.e-imgleft {display: contents;margin-left: 0;margin-right: auto;}
|
|
20701
|
+
.e-img-caption.e-rte-img-caption.e-imgbreak {display: contents;}
|
|
20456
20702
|
.e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;
|
|
20457
20703
|
margin: auto;opacity: .9;text-align: center;width: 100%;}
|
|
20458
20704
|
.e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}
|
|
@@ -20936,9 +21182,12 @@ class HtmlEditor {
|
|
|
20936
21182
|
const range = this.parent.getRange();
|
|
20937
21183
|
// eslint-disable-next-line
|
|
20938
21184
|
const regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
21185
|
+
const isEmptyNode = range.startContainer === range.endContainer && range.startOffset === range.endOffset &&
|
|
21186
|
+
range.startOffset === 1 && range.startContainer.textContent.length === 1 && range.startContainer.textContent.charCodeAt(0) == 8203 &&
|
|
21187
|
+
range.startContainer.textContent.replace(regEx, '').length === 0;
|
|
20939
21188
|
let pointer;
|
|
20940
21189
|
let isRootParent = false;
|
|
20941
|
-
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
|
|
21190
|
+
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey && !isEmptyNode) {
|
|
20942
21191
|
pointer = range.startOffset;
|
|
20943
21192
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
20944
21193
|
range.startContainer.nodeName === '#text' ? range.startContainer.parentElement !== this.parent.inputElement ? range.startContainer.parentElement.classList.add('currentStartMark')
|
|
@@ -21060,8 +21309,13 @@ class HtmlEditor {
|
|
|
21060
21309
|
else {
|
|
21061
21310
|
this.parent.notify(enterHandler, { args: e.args });
|
|
21062
21311
|
const newRange = this.parent.getRange();
|
|
21063
|
-
if (!isNullOrUndefined(newRange.startContainer) &&
|
|
21064
|
-
newRange.startContainer.
|
|
21312
|
+
if (!isNullOrUndefined(newRange.startContainer) && this.parent.height !== 'auto' && newRange.startContainer.nodeName !== '#text'
|
|
21313
|
+
&& !this.parent.iframeSettings.enable && newRange.startContainer.getBoundingClientRect().bottom > this.parent.element.getBoundingClientRect().bottom) {
|
|
21314
|
+
this.parent.element.querySelector('.e-rte-content').scrollTop += newRange.startContainer.getBoundingClientRect().bottom - this.parent.element.getBoundingClientRect().bottom;
|
|
21315
|
+
}
|
|
21316
|
+
else if (!isNullOrUndefined(newRange.startContainer) && this.parent.height === 'auto' && newRange.startContainer.nodeName !== '#text'
|
|
21317
|
+
&& !this.parent.iframeSettings.enable && window.innerHeight < newRange.startContainer.getBoundingClientRect().top) {
|
|
21318
|
+
newRange.startContainer.scrollIntoView({ block: 'end', inline: 'nearest' });
|
|
21065
21319
|
}
|
|
21066
21320
|
}
|
|
21067
21321
|
}
|
|
@@ -21143,11 +21397,13 @@ class HtmlEditor {
|
|
|
21143
21397
|
currentRange.startContainer.previousSibling.nodeName === 'SPAN') {
|
|
21144
21398
|
isPreviousNotContentEditable = currentRange.startContainer.previousSibling.contentEditable === 'false' ? false : true;
|
|
21145
21399
|
}
|
|
21400
|
+
const checkNode = currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer;
|
|
21401
|
+
const isSelectedPositionNotStart = closest(currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer, 'li') ?
|
|
21402
|
+
checkNode.nodeName !== 'li' && isNullOrUndefined(checkNode.previousSibling) : true;
|
|
21146
21403
|
if (e.args.code === 'Backspace' && e.args.keyCode === 8 && currentRange.startOffset === 0 &&
|
|
21147
21404
|
currentRange.endOffset === 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.textContent.length > 0 &&
|
|
21148
21405
|
currentRange.startContainer.parentElement.tagName !== 'TD' && currentRange.startContainer.parentElement.tagName !== 'TH' &&
|
|
21149
|
-
isPreviousNotContentEditable) {
|
|
21150
|
-
const checkNode = currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer;
|
|
21406
|
+
isPreviousNotContentEditable && isSelectedPositionNotStart) {
|
|
21151
21407
|
if ((!this.parent.formatter.editorManager.domNode.isBlockNode(checkNode) &&
|
|
21152
21408
|
!isNullOrUndefined(checkNode.previousSibling) && checkNode.previousSibling.nodeName === 'BR') ||
|
|
21153
21409
|
(!isNullOrUndefined(currentRange.startContainer.previousSibling) && currentRange.startContainer.previousSibling.nodeName === 'BR')) {
|
|
@@ -21159,7 +21415,8 @@ class HtmlEditor {
|
|
|
21159
21415
|
if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
|
|
21160
21416
|
this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
|
|
21161
21417
|
liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
|
|
21162
|
-
if (!isNullOrUndefined(liElement.lastElementChild) && liElement.lastElementChild.nodeName !== 'BR'
|
|
21418
|
+
if (!isNullOrUndefined(liElement.lastElementChild) && liElement.lastElementChild.nodeName !== 'BR' &&
|
|
21419
|
+
isNullOrUndefined(liElement.lastElementChild.previousSibling)) {
|
|
21163
21420
|
this.rangeElement = liElement.lastElementChild;
|
|
21164
21421
|
isLiElement = true;
|
|
21165
21422
|
}
|
|
@@ -21450,9 +21707,11 @@ class HtmlEditor {
|
|
|
21450
21707
|
this.tooltipTargetEle = closest(args.originalEvent.target, '[data-tooltip-id]');
|
|
21451
21708
|
if (!isNullOrUndefined(this.tooltipTargetEle) && this.parent.showTooltip && !isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
21452
21709
|
this.parent.notify(destroyTooltip, { args: event });
|
|
21453
|
-
this.tooltipTargetEle.
|
|
21454
|
-
|
|
21455
|
-
|
|
21710
|
+
if (!this.tooltipTargetEle.closest('.e-rte-quick-popup')) {
|
|
21711
|
+
this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
|
|
21712
|
+
this.tooltipTargetEle.removeAttribute('title');
|
|
21713
|
+
EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
|
|
21714
|
+
}
|
|
21456
21715
|
}
|
|
21457
21716
|
if (item.command !== 'FormatPainter') {
|
|
21458
21717
|
if (closestElement && !closestElement.classList.contains('e-rte-inline-popup') && !closestElement.classList.contains('e-rte-text-popup')) {
|
|
@@ -21745,6 +22004,7 @@ class PasteCleanup {
|
|
|
21745
22004
|
this.parent.on(pasteClean, this.pasteClean, this);
|
|
21746
22005
|
this.parent.on(bindCssClass, this.setCssClass, this);
|
|
21747
22006
|
this.parent.on(destroy, this.destroy, this);
|
|
22007
|
+
this.parent.on(docClick, this.docClick, this);
|
|
21748
22008
|
}
|
|
21749
22009
|
destroy() {
|
|
21750
22010
|
this.removeEventListener();
|
|
@@ -21756,6 +22016,7 @@ class PasteCleanup {
|
|
|
21756
22016
|
this.parent.off(pasteClean, this.pasteClean);
|
|
21757
22017
|
this.parent.off(bindCssClass, this.setCssClass);
|
|
21758
22018
|
this.parent.off(destroy, this.destroy);
|
|
22019
|
+
this.parent.off(docClick, this.docClick);
|
|
21759
22020
|
}
|
|
21760
22021
|
pasteClean(e) {
|
|
21761
22022
|
const args = {
|
|
@@ -21824,6 +22085,12 @@ class PasteCleanup {
|
|
|
21824
22085
|
this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
|
|
21825
22086
|
const tempDivElem = this.parent.createElement('div');
|
|
21826
22087
|
tempDivElem.innerHTML = value;
|
|
22088
|
+
const unsupportedImg = tempDivElem.querySelectorAll('.e-rte-image-unsupported');
|
|
22089
|
+
for (let index = 0; index < unsupportedImg.length; index++) {
|
|
22090
|
+
unsupportedImg[index].setAttribute('alt', this.i10n.getConstant('unsupportedImage'));
|
|
22091
|
+
unsupportedImg[index].classList.remove('e-rte-image-unsupported');
|
|
22092
|
+
}
|
|
22093
|
+
value = tempDivElem.innerHTML;
|
|
21827
22094
|
const isValueNotEmpty = tempDivElem.textContent !== '' || !isNullOrUndefined(tempDivElem.querySelector('img')) ||
|
|
21828
22095
|
!isNullOrUndefined(tempDivElem.querySelector('table'));
|
|
21829
22096
|
this.parent.notify(cleanupResizeElements, {
|
|
@@ -22103,7 +22370,9 @@ class PasteCleanup {
|
|
|
22103
22370
|
});
|
|
22104
22371
|
popupObj.close();
|
|
22105
22372
|
imgElem.style.opacity = '1';
|
|
22106
|
-
uploadObj.
|
|
22373
|
+
if (!uploadObj.isDestroyed) {
|
|
22374
|
+
uploadObj.destroy();
|
|
22375
|
+
}
|
|
22107
22376
|
this.toolbarEnableDisable(false);
|
|
22108
22377
|
}
|
|
22109
22378
|
refreshPopup(imageElement, popupObj) {
|
|
@@ -22253,7 +22522,7 @@ class PasteCleanup {
|
|
|
22253
22522
|
width: '300px',
|
|
22254
22523
|
height: '265px',
|
|
22255
22524
|
cssClass: CLS_RTE_DIALOG_MIN_HEIGHT,
|
|
22256
|
-
isModal:
|
|
22525
|
+
isModal: Browser.isDevice,
|
|
22257
22526
|
visible: false
|
|
22258
22527
|
};
|
|
22259
22528
|
this.dialogObj = this.dialogRenderObj.render(dialogModel);
|
|
@@ -22307,13 +22576,22 @@ class PasteCleanup {
|
|
|
22307
22576
|
this.updateCss(this.keepRadioButton, e);
|
|
22308
22577
|
}
|
|
22309
22578
|
destroyDialog(rteDialogWrapper) {
|
|
22310
|
-
const rteDialogContainer = this.parent.element.querySelector('.e-
|
|
22579
|
+
const rteDialogContainer = this.parent.element.querySelector('.e-rte-dialog-minheight');
|
|
22311
22580
|
detach(rteDialogContainer);
|
|
22312
22581
|
const rteDialogWrapperChildLength = rteDialogWrapper.children.length;
|
|
22313
22582
|
for (let i = 0; i < rteDialogWrapperChildLength; i++) {
|
|
22314
22583
|
detach(rteDialogWrapper.children[0]);
|
|
22315
22584
|
}
|
|
22316
22585
|
}
|
|
22586
|
+
docClick(e) {
|
|
22587
|
+
const target = e.args.target;
|
|
22588
|
+
if (target && target.classList && ((this.dialogObj && !closest(target, '[id=' + "'" + this.dialogObj.element.id + "'" + ']')))
|
|
22589
|
+
&& (!target.classList.contains('e-toolbar-item'))) {
|
|
22590
|
+
if (this.dialogObj) {
|
|
22591
|
+
this.dialogObj.hide();
|
|
22592
|
+
}
|
|
22593
|
+
}
|
|
22594
|
+
}
|
|
22317
22595
|
cleanAppleClass(elem) {
|
|
22318
22596
|
const appleClassElem = elem.querySelectorAll('br.Apple-interchange-newline');
|
|
22319
22597
|
for (let i = 0; i < appleClassElem.length; i++) {
|
|
@@ -22386,7 +22664,8 @@ class PasteCleanup {
|
|
|
22386
22664
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, (returnArgs) => {
|
|
22387
22665
|
extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
22388
22666
|
this.parent.formatter.onSuccess(this.parent, args);
|
|
22389
|
-
if (!isNullOrUndefined(returnArgs.elements) && !isNullOrUndefined(returnArgs.imgElem)
|
|
22667
|
+
if (!isNullOrUndefined(returnArgs.elements) && !isNullOrUndefined(returnArgs.imgElem) &&
|
|
22668
|
+
returnArgs.imgElem.length > 0) {
|
|
22390
22669
|
const pasteContent = returnArgs.elements;
|
|
22391
22670
|
const imageContent = returnArgs.imgElem;
|
|
22392
22671
|
const lastElementChild = this.findLastElement(pasteContent[pasteContent.length - 1]);
|
|
@@ -22451,6 +22730,7 @@ class PasteCleanup {
|
|
|
22451
22730
|
}
|
|
22452
22731
|
}
|
|
22453
22732
|
addTableClass(element, source) {
|
|
22733
|
+
source = isNullOrUndefined(source) ? '' : source;
|
|
22454
22734
|
const tableElement = element.querySelectorAll('table');
|
|
22455
22735
|
for (let i = 0; i < tableElement.length; i++) {
|
|
22456
22736
|
if (!tableElement[i].classList.contains('e-rte-table') && (source === 'html' || source === '')) {
|
|
@@ -25277,6 +25557,7 @@ class Image$1 {
|
|
|
25277
25557
|
}
|
|
25278
25558
|
});
|
|
25279
25559
|
}
|
|
25560
|
+
EventHandler.add(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing, this);
|
|
25280
25561
|
EventHandler.add(this.contentModule.getDocument(), Browser.touchEndEvent, this.resizeEnd, this);
|
|
25281
25562
|
}
|
|
25282
25563
|
}
|
|
@@ -25328,7 +25609,6 @@ class Image$1 {
|
|
|
25328
25609
|
this.imgResizePos(e, this.imgResizeDiv);
|
|
25329
25610
|
this.resizeImgDupPos(e);
|
|
25330
25611
|
this.contentModule.getEditPanel().appendChild(this.imgResizeDiv);
|
|
25331
|
-
EventHandler.add(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing, this);
|
|
25332
25612
|
}
|
|
25333
25613
|
getPointX(e) {
|
|
25334
25614
|
if (e.touches && e.touches.length) {
|
|
@@ -25686,7 +25966,9 @@ class Image$1 {
|
|
|
25686
25966
|
}
|
|
25687
25967
|
}
|
|
25688
25968
|
if (originalEvent.ctrlKey && (originalEvent.keyCode === 89 || originalEvent.keyCode === 90)) {
|
|
25689
|
-
|
|
25969
|
+
if (this.parent.editorMode !== 'Markdown') {
|
|
25970
|
+
this.undoStack({ subCommand: (originalEvent.keyCode === 90 ? 'undo' : 'redo') });
|
|
25971
|
+
}
|
|
25690
25972
|
}
|
|
25691
25973
|
if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
|
|
25692
25974
|
if (selectNodeEle && selectNodeEle[0].nodeName === 'IMG' && selectNodeEle.length < 1) {
|
|
@@ -26054,7 +26336,7 @@ class Image$1 {
|
|
|
26054
26336
|
this.checkBoxObj.createElement = this.parent.createElement;
|
|
26055
26337
|
this.checkBoxObj.appendTo(linkTarget);
|
|
26056
26338
|
let target = this.checkBoxObj.checked ? '_blank' : null;
|
|
26057
|
-
let imageLabel = this.checkBoxObj.checked ? this.i10n.getConstant('
|
|
26339
|
+
let imageLabel = this.checkBoxObj.checked ? this.i10n.getConstant('imageLinkAriaLabel') : null;
|
|
26058
26340
|
const linkUpdate = this.i10n.getConstant('dialogUpdate');
|
|
26059
26341
|
const linkargs = {
|
|
26060
26342
|
args: e.args,
|
|
@@ -26173,14 +26455,14 @@ class Image$1 {
|
|
|
26173
26455
|
}
|
|
26174
26456
|
if (e.selectNode[0].parentElement.nodeName === 'A') {
|
|
26175
26457
|
proxy.parent.formatter.process(proxy.parent, e.args, e.args, {
|
|
26176
|
-
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('
|
|
26458
|
+
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('imageLinkAriaLabel') : null, selectNode: e.selectNode,
|
|
26177
26459
|
subCommand: e.args.item.subCommand
|
|
26178
26460
|
});
|
|
26179
26461
|
proxy.dialogObj.hide({ returnValue: true });
|
|
26180
26462
|
return;
|
|
26181
26463
|
}
|
|
26182
26464
|
proxy.parent.formatter.process(proxy.parent, e.args, e.args, {
|
|
26183
|
-
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('
|
|
26465
|
+
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('imageLinkAriaLabel') : null, selectNode: e.selectNode,
|
|
26184
26466
|
subCommand: e.args.item.subCommand, selection: e.selection
|
|
26185
26467
|
});
|
|
26186
26468
|
const captionEle = closest(e.selectNode[0], '.e-img-caption');
|
|
@@ -26208,7 +26490,29 @@ class Image$1 {
|
|
|
26208
26490
|
if (this.parent.formatter.getUndoRedoStack().length === 0) {
|
|
26209
26491
|
this.parent.formatter.saveData();
|
|
26210
26492
|
}
|
|
26211
|
-
e.selection.
|
|
26493
|
+
let restoreStartElement = e.selection.range.startContainer;
|
|
26494
|
+
if (e.selection.range.startContainer.nodeName === 'SPAN' &&
|
|
26495
|
+
restoreStartElement.classList.contains('e-img-wrap') &&
|
|
26496
|
+
restoreStartElement.parentElement.classList.contains('e-img-caption')) {
|
|
26497
|
+
restoreStartElement = restoreStartElement.parentElement;
|
|
26498
|
+
if (!isNullOrUndefined(restoreStartElement.previousSibling)) {
|
|
26499
|
+
let lastNode = restoreStartElement.previousSibling;
|
|
26500
|
+
while (lastNode.nodeName !== '#text' && lastNode.nodeName !== 'BR') {
|
|
26501
|
+
lastNode = lastNode.lastChild;
|
|
26502
|
+
}
|
|
26503
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), lastNode, lastNode.nodeName !== 'BR' ? lastNode.textContent.length : 0);
|
|
26504
|
+
}
|
|
26505
|
+
else if (!isNullOrUndefined(restoreStartElement.nextSibling)) {
|
|
26506
|
+
let firstNode = restoreStartElement.nextSibling;
|
|
26507
|
+
while (firstNode.nodeName !== '#text' && firstNode.nodeName !== 'BR') {
|
|
26508
|
+
firstNode = firstNode.firstChild;
|
|
26509
|
+
}
|
|
26510
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), firstNode, 0);
|
|
26511
|
+
}
|
|
26512
|
+
}
|
|
26513
|
+
else {
|
|
26514
|
+
e.selection.restore();
|
|
26515
|
+
}
|
|
26212
26516
|
if (this.contentModule.getEditPanel().querySelector('.e-img-resize')) {
|
|
26213
26517
|
this.removeResizeEle();
|
|
26214
26518
|
}
|
|
@@ -26420,7 +26724,7 @@ class Image$1 {
|
|
|
26420
26724
|
animationSettings: { effect: 'None' },
|
|
26421
26725
|
close: (event) => {
|
|
26422
26726
|
if (this.isImgUploaded) {
|
|
26423
|
-
this.uploadObj.
|
|
26727
|
+
this.uploadObj.remove();
|
|
26424
26728
|
}
|
|
26425
26729
|
this.parent.isBlur = false;
|
|
26426
26730
|
if (event && event.event.returnValue) {
|
|
@@ -26488,9 +26792,6 @@ class Image$1 {
|
|
|
26488
26792
|
cancelDialog(e) {
|
|
26489
26793
|
this.parent.isBlur = false;
|
|
26490
26794
|
this.dialogObj.hide({ returnValue: true });
|
|
26491
|
-
if (this.isImgUploaded) {
|
|
26492
|
-
this.uploadObj.removing();
|
|
26493
|
-
}
|
|
26494
26795
|
}
|
|
26495
26796
|
onDocumentClick(e) {
|
|
26496
26797
|
const target = e.target;
|
|
@@ -29906,7 +30207,6 @@ class Table {
|
|
|
29906
30207
|
this.pageY = null;
|
|
29907
30208
|
this.moveEle = null;
|
|
29908
30209
|
this.currentColumnResize = '';
|
|
29909
|
-
this.currentMarginLeft = 0;
|
|
29910
30210
|
this.parent = parent;
|
|
29911
30211
|
this.rteID = parent.element.id;
|
|
29912
30212
|
this.l10n = serviceLocator.getService('rteLocale');
|
|
@@ -30522,7 +30822,7 @@ class Table {
|
|
|
30522
30822
|
}
|
|
30523
30823
|
tableResizeEleCreation(table, e) {
|
|
30524
30824
|
this.parent.preventDefaultResize(e);
|
|
30525
|
-
const columns =
|
|
30825
|
+
const columns = this.calMaxCol(this.curTable);
|
|
30526
30826
|
const rows = [];
|
|
30527
30827
|
for (let i = 0; i < table.rows.length; i++) {
|
|
30528
30828
|
for (let j = 0; j < table.rows[i].cells.length; j++) {
|
|
@@ -30544,11 +30844,11 @@ class Table {
|
|
|
30544
30844
|
colReEle.classList.add(CLS_RTE_TABLE_RESIZE, CLS_TB_COL_RES);
|
|
30545
30845
|
if (columns.length === i) {
|
|
30546
30846
|
colReEle.style.cssText = 'height: ' + height + 'px; width: 4px; top: ' + pos.top +
|
|
30547
|
-
'px; left:' + (pos.left + this.calcPos(columns[i - 1]).left + columns[i - 1].offsetWidth) + 'px;';
|
|
30847
|
+
'px; left:' + (pos.left + this.calcPos(columns[i - 1]).left + columns[i - 1].offsetWidth - 2) + 'px;';
|
|
30548
30848
|
}
|
|
30549
30849
|
else {
|
|
30550
30850
|
colReEle.style.cssText = 'height: ' + height + 'px; width: 4px; top: ' + pos.top +
|
|
30551
|
-
'px; left:' + (pos.left + this.calcPos(columns[i]).left) + 'px;';
|
|
30851
|
+
'px; left:' + (pos.left + this.calcPos(columns[i]).left - 2) + 'px;';
|
|
30552
30852
|
}
|
|
30553
30853
|
this.contentModule.getEditPanel().appendChild(colReEle);
|
|
30554
30854
|
}
|
|
@@ -30580,7 +30880,7 @@ class Table {
|
|
|
30580
30880
|
}
|
|
30581
30881
|
removeResizeElement() {
|
|
30582
30882
|
const item = this.parent.contentModule.getEditPanel().
|
|
30583
|
-
querySelectorAll('.e-column-resize, .e-row-resize, .e-table-box
|
|
30883
|
+
querySelectorAll('.e-column-resize, .e-row-resize, .e-table-box');
|
|
30584
30884
|
if (item.length > 0) {
|
|
30585
30885
|
for (let i = 0; i < item.length; i++) {
|
|
30586
30886
|
detach(item[i]);
|
|
@@ -30653,6 +30953,7 @@ class Table {
|
|
|
30653
30953
|
if (target.classList.contains(CLS_TB_COL_RES) ||
|
|
30654
30954
|
target.classList.contains(CLS_TB_ROW_RES) ||
|
|
30655
30955
|
target.classList.contains(CLS_TB_BOX_RES)) {
|
|
30956
|
+
this.resetResizeHelper(this.curTable);
|
|
30656
30957
|
e.preventDefault();
|
|
30657
30958
|
this.parent.preventDefaultResize(e);
|
|
30658
30959
|
removeClass(this.curTable.querySelectorAll('td,th'), CLS_TABLE_SEL);
|
|
@@ -30663,9 +30964,10 @@ class Table {
|
|
|
30663
30964
|
this.hideTableQuickToolbar();
|
|
30664
30965
|
if (target.classList.contains(CLS_TB_COL_RES)) {
|
|
30665
30966
|
this.resizeBtnStat.column = true;
|
|
30666
|
-
if (parseInt(target.getAttribute('data-col'), 10) === this.
|
|
30967
|
+
if (parseInt(target.getAttribute('data-col'), 10) === this.calMaxCol(this.curTable).length) {
|
|
30667
30968
|
this.currentColumnResize = 'last';
|
|
30668
|
-
this.
|
|
30969
|
+
this.colIndex = parseInt(target.getAttribute('data-col'), 10) - 1;
|
|
30970
|
+
this.columnEle = this.calMaxCol(this.curTable)[this.colIndex];
|
|
30669
30971
|
}
|
|
30670
30972
|
else {
|
|
30671
30973
|
if (parseInt(target.getAttribute('data-col'), 10) === 0) {
|
|
@@ -30673,10 +30975,48 @@ class Table {
|
|
|
30673
30975
|
}
|
|
30674
30976
|
else {
|
|
30675
30977
|
this.currentColumnResize = 'middle';
|
|
30978
|
+
const cellColl = this.curTable.rows[0].cells;
|
|
30979
|
+
let cellCount = 0;
|
|
30980
|
+
for (let cell = 0; cell < cellColl.length; cell++) {
|
|
30981
|
+
cellCount = cellCount + cellColl[cell].colSpan;
|
|
30982
|
+
}
|
|
30983
|
+
const sizes = new Array(cellCount);
|
|
30984
|
+
const colGroupEle = createElement('colgroup');
|
|
30985
|
+
const rowSpanCells = new Map();
|
|
30986
|
+
for (let i = 0; i < this.curTable.rows.length; i++) {
|
|
30987
|
+
let currentColIndex = 0;
|
|
30988
|
+
for (let k = 0; k < this.curTable.rows[i].cells.length; k++) {
|
|
30989
|
+
for (let l = 1; l < this.curTable.rows[i].cells[k].rowSpan; l++) {
|
|
30990
|
+
const key = `${i + l}${currentColIndex}`;
|
|
30991
|
+
rowSpanCells.set(key, this.curTable.rows[i].cells[k]);
|
|
30992
|
+
}
|
|
30993
|
+
const cellIndex = this.getCellIndex(rowSpanCells, i, k);
|
|
30994
|
+
if (cellIndex > currentColIndex) {
|
|
30995
|
+
currentColIndex = cellIndex;
|
|
30996
|
+
}
|
|
30997
|
+
const width = this.curTable.rows[i].cells[k].offsetWidth;
|
|
30998
|
+
if (!sizes[currentColIndex] || width < sizes[currentColIndex]) {
|
|
30999
|
+
sizes[currentColIndex] = width;
|
|
31000
|
+
}
|
|
31001
|
+
currentColIndex += 1 + this.curTable.rows[i].cells[k].colSpan - 1;
|
|
31002
|
+
}
|
|
31003
|
+
}
|
|
31004
|
+
for (let size = 0; size < sizes.length; size++) {
|
|
31005
|
+
const cell = createElement('col');
|
|
31006
|
+
cell.appendChild(createElement('br'));
|
|
31007
|
+
cell.style.width = this.convertPixelToPercentage(sizes[size], parseInt(getComputedStyle(this.curTable).width, 10)) + '%';
|
|
31008
|
+
colGroupEle.appendChild(cell);
|
|
31009
|
+
}
|
|
31010
|
+
this.curTable.insertBefore(colGroupEle, this.curTable.firstChild);
|
|
31011
|
+
for (let i = 0; i < this.curTable.rows.length; i++) {
|
|
31012
|
+
for (let k = 0; k < this.curTable.rows[i].cells.length; k++) {
|
|
31013
|
+
this.curTable.rows[i].cells[k].style.width = '';
|
|
31014
|
+
}
|
|
31015
|
+
}
|
|
30676
31016
|
}
|
|
30677
|
-
this.
|
|
31017
|
+
this.colIndex = parseInt(target.getAttribute('data-col'), 10);
|
|
31018
|
+
this.columnEle = this.calMaxCol(this.curTable)[this.colIndex];
|
|
30678
31019
|
}
|
|
30679
|
-
this.colIndex = this.columnEle.cellIndex;
|
|
30680
31020
|
this.moveEle = e.target;
|
|
30681
31021
|
this.appendHelper();
|
|
30682
31022
|
}
|
|
@@ -30705,6 +31045,16 @@ class Table {
|
|
|
30705
31045
|
EventHandler.add(this.contentModule.getDocument(), Browser.touchEndEvent, this.resizeEnd, this);
|
|
30706
31046
|
}
|
|
30707
31047
|
}
|
|
31048
|
+
getCellIndex(rowSpanCells, rowIndex, colIndex) {
|
|
31049
|
+
const cellKey = `${rowIndex}${colIndex}`;
|
|
31050
|
+
const spannedCell = rowSpanCells.get(cellKey);
|
|
31051
|
+
if (spannedCell) {
|
|
31052
|
+
return this.getCellIndex(rowSpanCells, rowIndex, colIndex + spannedCell.colSpan);
|
|
31053
|
+
}
|
|
31054
|
+
else {
|
|
31055
|
+
return colIndex;
|
|
31056
|
+
}
|
|
31057
|
+
}
|
|
30708
31058
|
removeHelper(e) {
|
|
30709
31059
|
const cls = e.target.classList;
|
|
30710
31060
|
if (!(cls.contains('e-reicon')) && this.helper) {
|
|
@@ -30733,12 +31083,12 @@ class Table {
|
|
|
30733
31083
|
this.helper.classList.add('e-column-helper');
|
|
30734
31084
|
this.helper.style.cssText = 'height: ' + getComputedStyle(this.curTable).height + '; top: ' +
|
|
30735
31085
|
pos.top + 'px; left:' + ((pos.left + this.calcPos(this.columnEle).left) +
|
|
30736
|
-
(this.currentColumnResize === 'last' ? this.columnEle.offsetWidth
|
|
31086
|
+
(this.currentColumnResize === 'last' ? this.columnEle.offsetWidth : 0) - 1) + 'px;';
|
|
30737
31087
|
}
|
|
30738
31088
|
else {
|
|
30739
31089
|
this.helper.classList.add('e-row-helper');
|
|
30740
31090
|
this.helper.style.cssText = 'width: ' + getComputedStyle(this.curTable).width + '; top: ' +
|
|
30741
|
-
(this.calcPos(this.rowEle).top + pos.top + this.rowEle.offsetHeight) +
|
|
31091
|
+
(this.calcPos(this.rowEle).top + pos.top + this.rowEle.offsetHeight - 1) +
|
|
30742
31092
|
'px; left:' + (this.calcPos(this.rowEle).left + pos.left) + 'px;';
|
|
30743
31093
|
}
|
|
30744
31094
|
}
|
|
@@ -30746,24 +31096,42 @@ class Table {
|
|
|
30746
31096
|
const pos = this.calcPos(this.curTable);
|
|
30747
31097
|
if (this.resizeBtnStat.column) {
|
|
30748
31098
|
const left = (pos.left + this.calcPos(this.columnEle).left) +
|
|
30749
|
-
(this.currentColumnResize === 'last' ? this.columnEle.offsetWidth
|
|
31099
|
+
(this.currentColumnResize === 'last' ? this.columnEle.offsetWidth : 0) - 1;
|
|
30750
31100
|
this.helper.style.left = left + 'px';
|
|
31101
|
+
this.helper.style.height = this.curTable.offsetHeight + 'px';
|
|
30751
31102
|
}
|
|
30752
31103
|
else {
|
|
30753
|
-
const top = this.calcPos(this.rowEle).top + pos.top + this.rowEle.offsetHeight;
|
|
31104
|
+
const top = this.calcPos(this.rowEle).top + pos.top + this.rowEle.offsetHeight - 1;
|
|
30754
31105
|
this.helper.style.top = top + 'px';
|
|
30755
31106
|
}
|
|
30756
31107
|
}
|
|
30757
|
-
calMaxCol(
|
|
30758
|
-
|
|
30759
|
-
let
|
|
30760
|
-
for (let
|
|
30761
|
-
|
|
30762
|
-
|
|
30763
|
-
|
|
31108
|
+
calMaxCol(curTable) {
|
|
31109
|
+
const cellColl = curTable.rows[0].cells;
|
|
31110
|
+
let cellCount = 0;
|
|
31111
|
+
for (let cell = 0; cell < cellColl.length; cell++) {
|
|
31112
|
+
cellCount = cellCount + cellColl[cell].colSpan;
|
|
31113
|
+
}
|
|
31114
|
+
const cells = new Array(cellCount);
|
|
31115
|
+
const rowSpanCells = new Map();
|
|
31116
|
+
for (let i = 0; i < curTable.rows.length; i++) {
|
|
31117
|
+
let currentColIndex = 0;
|
|
31118
|
+
for (let k = 0; k < curTable.rows[i].cells.length; k++) {
|
|
31119
|
+
for (let l = 1; l < curTable.rows[i].cells[k].rowSpan; l++) {
|
|
31120
|
+
const key = `${i + l}${currentColIndex}`;
|
|
31121
|
+
rowSpanCells.set(key, curTable.rows[i].cells[k]);
|
|
31122
|
+
}
|
|
31123
|
+
const cellIndex = this.getCellIndex(rowSpanCells, i, k);
|
|
31124
|
+
if (cellIndex > currentColIndex) {
|
|
31125
|
+
currentColIndex = cellIndex;
|
|
31126
|
+
}
|
|
31127
|
+
const width = curTable.rows[i].cells[k].offsetWidth;
|
|
31128
|
+
if (!cells[currentColIndex] || width < cells[currentColIndex].offsetWidth) {
|
|
31129
|
+
cells[currentColIndex] = curTable.rows[i].cells[k];
|
|
31130
|
+
}
|
|
31131
|
+
currentColIndex += 1 + curTable.rows[i].cells[k].colSpan - 1;
|
|
30764
31132
|
}
|
|
30765
31133
|
}
|
|
30766
|
-
return
|
|
31134
|
+
return cells;
|
|
30767
31135
|
}
|
|
30768
31136
|
resizing(e) {
|
|
30769
31137
|
const pageX = this.getPointX(e);
|
|
@@ -30775,10 +31143,6 @@ class Table {
|
|
|
30775
31143
|
let maxiumWidth;
|
|
30776
31144
|
const currentTdElement = this.curTable.closest('td');
|
|
30777
31145
|
const args = { event: e, requestType: 'table' };
|
|
30778
|
-
let isRowCellsMerged = false;
|
|
30779
|
-
let isColCellsMerged = false;
|
|
30780
|
-
let mergedCellIndex;
|
|
30781
|
-
let mergedElement;
|
|
30782
31146
|
this.parent.trigger(onResize, args, (resizingArgs) => {
|
|
30783
31147
|
if (resizingArgs.cancel) {
|
|
30784
31148
|
this.cancelResizeAction();
|
|
@@ -30803,8 +31167,7 @@ class Table {
|
|
|
30803
31167
|
widthCompare = rteWidth;
|
|
30804
31168
|
}
|
|
30805
31169
|
if (this.resizeBtnStat.column) {
|
|
30806
|
-
const
|
|
30807
|
-
const cellRow = this.curTable.rows[0].cells[0].nodeName === 'TH' ? 1 : 0;
|
|
31170
|
+
const colGroup = this.curTable.querySelectorAll('colgroup > col');
|
|
30808
31171
|
let currentTableWidth;
|
|
30809
31172
|
if (this.curTable.style.width !== '' && this.curTable.style.width.includes('%')) {
|
|
30810
31173
|
currentTableWidth = parseFloat(this.curTable.style.width.split('%')[0]);
|
|
@@ -30812,7 +31175,8 @@ class Table {
|
|
|
30812
31175
|
else {
|
|
30813
31176
|
currentTableWidth = this.getCurrentTableWidth(this.curTable.offsetWidth, this.parent.inputElement.offsetWidth);
|
|
30814
31177
|
}
|
|
30815
|
-
const
|
|
31178
|
+
const currentCol = this.calMaxCol(this.curTable)[this.colIndex];
|
|
31179
|
+
let currentColResizableWidth = this.getCurrentColWidth(currentCol, tableWidth);
|
|
30816
31180
|
if (this.currentColumnResize === 'first') {
|
|
30817
31181
|
mouseX = mouseX - 0.75; //This was done for to make the gripper and the table first/last column will be close.
|
|
30818
31182
|
this.removeResizeElement();
|
|
@@ -30821,16 +31185,25 @@ class Table {
|
|
|
30821
31185
|
this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
30822
31186
|
}
|
|
30823
31187
|
// Below the value '100' is the 100% width of the parent element.
|
|
30824
|
-
if (((mouseX !== 0 && 5 <
|
|
31188
|
+
if (((mouseX !== 0 && 5 < currentColResizableWidth) || mouseX < 0) && currentTableWidth <= 100 &&
|
|
30825
31189
|
this.convertPixelToPercentage(tableWidth - mouseX, widthCompare) <= 100) {
|
|
30826
31190
|
const firstColumnsCell = this.findFirstLastColCells(this.curTable, true);
|
|
30827
31191
|
this.curTable.style.width = this.convertPixelToPercentage(tableWidth - mouseX, widthCompare) > 100 ? (100 + '%') :
|
|
30828
31192
|
(this.convertPixelToPercentage(tableWidth - mouseX, widthCompare) + '%');
|
|
30829
31193
|
const differenceWidth = currentTableWidth - this.convertPixelToPercentage(tableWidth - mouseX, widthCompare);
|
|
30830
|
-
|
|
30831
|
-
this.curTable.style.marginLeft
|
|
31194
|
+
let preMarginLeft = 0;
|
|
31195
|
+
if (!isNullOrUndefined(this.curTable.style.marginLeft) && this.curTable.style.marginLeft !== '') {
|
|
31196
|
+
const regex = /[-+]?\d*\.\d+|\d+/;
|
|
31197
|
+
const value = this.curTable.style.marginLeft.match(regex);
|
|
31198
|
+
if (!isNullOrUndefined(value)) {
|
|
31199
|
+
preMarginLeft = parseFloat(value[0]);
|
|
31200
|
+
}
|
|
31201
|
+
}
|
|
31202
|
+
const currentMarginLeft = preMarginLeft + differenceWidth;
|
|
31203
|
+
this.curTable.style.marginLeft = 'calc(' + (this.curTable.style.width === '100%' ? 0 : currentMarginLeft) + '%)';
|
|
30832
31204
|
for (let i = 0; i < firstColumnsCell.length; i++) {
|
|
30833
|
-
this.
|
|
31205
|
+
const currentColumnCellWidth = this.getCurrentColWidth(firstColumnsCell[i], tableWidth);
|
|
31206
|
+
firstColumnsCell[i].style.width = (currentColumnCellWidth - differenceWidth) + '%';
|
|
30834
31207
|
}
|
|
30835
31208
|
}
|
|
30836
31209
|
}
|
|
@@ -30842,112 +31215,48 @@ class Table {
|
|
|
30842
31215
|
this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
30843
31216
|
}
|
|
30844
31217
|
// Below the value '100' is the 100% width of the parent element.
|
|
30845
|
-
if (((mouseX !== 0 && 5 <
|
|
31218
|
+
if (((mouseX !== 0 && 5 < currentColResizableWidth) || mouseX > 0) &&
|
|
30846
31219
|
currentTableWidth <= 100 && this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) <= 100) {
|
|
30847
31220
|
const lastColumnsCell = this.findFirstLastColCells(this.curTable, false);
|
|
30848
31221
|
this.curTable.style.width = this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) > 100 ? (100 + '%') : (this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%');
|
|
30849
31222
|
const differenceWidth = currentTableWidth - this.convertPixelToPercentage(tableWidth + mouseX, widthCompare);
|
|
30850
31223
|
for (let i = 0; i < lastColumnsCell.length; i++) {
|
|
30851
|
-
|
|
30852
|
-
|
|
30853
|
-
this.colIndex - 1 : this.colIndex].style.width = (currentColumnCellWidth - differenceWidth) + '%';
|
|
30854
|
-
}
|
|
31224
|
+
const currentColumnCellWidth = this.getCurrentColWidth(lastColumnsCell[i], tableWidth);
|
|
31225
|
+
lastColumnsCell[i].style.width = (currentColumnCellWidth - differenceWidth) + '%';
|
|
30855
31226
|
}
|
|
30856
31227
|
}
|
|
30857
31228
|
}
|
|
30858
31229
|
else {
|
|
30859
|
-
const
|
|
30860
|
-
|
|
30861
|
-
const totalwid =
|
|
30862
|
-
|
|
30863
|
-
|
|
30864
|
-
const
|
|
30865
|
-
|
|
30866
|
-
|
|
30867
|
-
const rightColWidth = actualwid;
|
|
30868
|
-
let index;
|
|
30869
|
-
let isMergedEleResize = false;
|
|
30870
|
-
let leftTableCell;
|
|
30871
|
-
let rightTableCell;
|
|
30872
|
-
isColCellsMerged = false;
|
|
30873
|
-
isRowCellsMerged = false;
|
|
30874
|
-
/* eslint-disable */
|
|
30875
|
-
for (let j = 0; j < currentRow.cells.length; j++) {
|
|
30876
|
-
if (currentRow.cells[j].hasAttribute('rowspan') && j <= this.colIndex) {
|
|
30877
|
-
isRowCellsMerged = true;
|
|
30878
|
-
mergedCellIndex = i;
|
|
30879
|
-
mergedElement = currentRow.cells[j];
|
|
30880
|
-
}
|
|
30881
|
-
else if (currentRow.cells[j].hasAttribute('colspan') && j <= currentRow.cells.length) {
|
|
30882
|
-
isColCellsMerged = true;
|
|
30883
|
-
mergedCellIndex = i;
|
|
30884
|
-
mergedElement = currentRow.cells[j];
|
|
30885
|
-
}
|
|
30886
|
-
}
|
|
30887
|
-
if (!isNullOrUndefined(currentRow.cells[i]) && currentRow.cells[i].hasAttribute('colspan')) {
|
|
30888
|
-
index = parseInt(currentRow.cells[i].getAttribute('colspan'), 10) - 1;
|
|
30889
|
-
}
|
|
30890
|
-
else {
|
|
30891
|
-
index = this.colIndex;
|
|
30892
|
-
}
|
|
30893
|
-
if (isRowCellsMerged || isColCellsMerged) {
|
|
30894
|
-
let currentResizeRow;
|
|
30895
|
-
if (currentRow.cells.length < cellColl.length) {
|
|
30896
|
-
index = currentRow.cells.length === this.colIndex || currentRow === this.curTable.rows[this.curTable.rows.length - 1] ?
|
|
30897
|
-
this.colIndex - 1 : this.colIndex;
|
|
30898
|
-
currentResizeRow = this.curTable.rows[!isNullOrUndefined(mergedCellIndex) ?
|
|
30899
|
-
mergedCellIndex : this.colIndex - 1];
|
|
30900
|
-
if (currentResizeRow && currentResizeRow !== currentRow && (currentResizeRow.cells[this.colIndex - 1] === mergedElement ||
|
|
30901
|
-
currentResizeRow.cells[currentResizeRow.cells.length - 1] === mergedElement)) {
|
|
30902
|
-
isMergedEleResize = true;
|
|
30903
|
-
}
|
|
30904
|
-
else {
|
|
30905
|
-
isMergedEleResize = false;
|
|
30906
|
-
}
|
|
30907
|
-
}
|
|
30908
|
-
else {
|
|
30909
|
-
index = this.colIndex;
|
|
30910
|
-
}
|
|
30911
|
-
leftTableCell = !isMergedEleResize ? currentRow.cells[index - 1] : (currentResizeRow &&
|
|
30912
|
-
currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement) ?
|
|
30913
|
-
currentResizeRow.cells[this.colIndex - 1] : currentRow.cells[currentRow.cells.length - 1];
|
|
30914
|
-
rightTableCell = !isMergedEleResize ? currentRow.cells[index] : rightTableCell && rightTableCell.hasAttribute('rowspan') ?
|
|
30915
|
-
currentResizeRow.cells[this.colIndex] : currentResizeRow && currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement ?
|
|
30916
|
-
currentRow.cells[index - 1] : currentResizeRow.cells[currentResizeRow.cells.length - 1];
|
|
30917
|
-
}
|
|
30918
|
-
if (!isNullOrUndefined(currentRow.cells[index - 1]) && !isRowCellsMerged && !isColCellsMerged) {
|
|
30919
|
-
currentRow.cells[index - 1].style.width =
|
|
30920
|
-
this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
|
|
30921
|
-
}
|
|
30922
|
-
else {
|
|
30923
|
-
if (leftTableCell) {
|
|
30924
|
-
leftTableCell.style.width =
|
|
30925
|
-
this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
|
|
30926
|
-
}
|
|
30927
|
-
}
|
|
30928
|
-
if (!isNullOrUndefined(currentRow.cells[index]) && !isRowCellsMerged && !isColCellsMerged) {
|
|
30929
|
-
currentRow.cells[index].style.width =
|
|
30930
|
-
this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
|
|
30931
|
-
}
|
|
30932
|
-
else {
|
|
30933
|
-
if (rightTableCell) {
|
|
30934
|
-
rightTableCell.style.width =
|
|
30935
|
-
this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
|
|
30936
|
-
}
|
|
30937
|
-
}
|
|
30938
|
-
/* eslint-enable */
|
|
30939
|
-
}
|
|
31230
|
+
const actualwid = colGroup[this.colIndex].offsetWidth - mouseX;
|
|
31231
|
+
// eslint-disable-next-line
|
|
31232
|
+
const totalwid = colGroup[this.colIndex].offsetWidth + colGroup[this.colIndex - 1].offsetWidth;
|
|
31233
|
+
if ((totalwid - actualwid) > 20 && actualwid > 20) {
|
|
31234
|
+
const leftColumnWidth = totalwid - actualwid;
|
|
31235
|
+
const rightColWidth = actualwid;
|
|
31236
|
+
colGroup[this.colIndex - 1].style.width = this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
|
|
31237
|
+
colGroup[this.colIndex].style.width = this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
|
|
30940
31238
|
}
|
|
30941
31239
|
}
|
|
30942
31240
|
this.updateHelper();
|
|
30943
31241
|
}
|
|
30944
31242
|
else if (this.resizeBtnStat.row) {
|
|
30945
31243
|
this.parent.preventDefaultResize(e);
|
|
30946
|
-
const
|
|
30947
|
-
|
|
30948
|
-
|
|
31244
|
+
const tableTrElementPixel = [];
|
|
31245
|
+
const currentTableTrElement = this.curTable.querySelectorAll('tr');
|
|
31246
|
+
for (let i = 0; i < currentTableTrElement.length; i++) {
|
|
31247
|
+
if (this.rowEle !== currentTableTrElement[i]) {
|
|
31248
|
+
tableTrElementPixel[i] = (parseFloat(currentTableTrElement[i].clientHeight.toString()));
|
|
31249
|
+
}
|
|
31250
|
+
}
|
|
31251
|
+
this.curTable.style.height = (parseFloat(this.curTable.clientHeight.toString()) + ((mouseY > 0) ? 0 : mouseY)) + 'px';
|
|
31252
|
+
for (let i = 0; i < currentTableTrElement.length; i++) {
|
|
31253
|
+
if (this.rowEle === currentTableTrElement[i]) {
|
|
31254
|
+
currentTableTrElement[i].style.height = (parseFloat(currentTableTrElement[i].clientHeight.toString()) + mouseY) + 'px';
|
|
31255
|
+
}
|
|
31256
|
+
else {
|
|
31257
|
+
currentTableTrElement[i].style.height = tableTrElementPixel[i] + 'px';
|
|
31258
|
+
}
|
|
30949
31259
|
}
|
|
30950
|
-
this.curTable.style.height = '';
|
|
30951
31260
|
if (!isNullOrUndefined(tableReBox)) {
|
|
30952
31261
|
tableReBox.style.cssText = 'top: ' + (this.calcPos(this.curTable).top + tableHeight - 4) +
|
|
30953
31262
|
'px; left:' + (this.calcPos(this.curTable).left + tableWidth - 4) + 'px;';
|
|
@@ -30974,6 +31283,16 @@ class Table {
|
|
|
30974
31283
|
}
|
|
30975
31284
|
});
|
|
30976
31285
|
}
|
|
31286
|
+
getCurrentColWidth(col, tableWidth) {
|
|
31287
|
+
let currentColWidth = 0;
|
|
31288
|
+
if (col.style.width !== '' && col.style.width.includes('%')) {
|
|
31289
|
+
currentColWidth = parseFloat(col.style.width.split('%')[0]);
|
|
31290
|
+
}
|
|
31291
|
+
else {
|
|
31292
|
+
currentColWidth = this.convertPixelToPercentage(col.offsetWidth, tableWidth);
|
|
31293
|
+
}
|
|
31294
|
+
return currentColWidth;
|
|
31295
|
+
}
|
|
30977
31296
|
getCurrentTableWidth(tableWidth, parentWidth) {
|
|
30978
31297
|
let currentTableWidth = 0;
|
|
30979
31298
|
currentTableWidth = tableWidth / parentWidth * 100;
|
|
@@ -30981,11 +31300,18 @@ class Table {
|
|
|
30981
31300
|
}
|
|
30982
31301
|
findFirstLastColCells(table, isFirst) {
|
|
30983
31302
|
const resultColumns = [];
|
|
30984
|
-
const rows = table.
|
|
31303
|
+
const rows = table.rows;
|
|
31304
|
+
const rowSpanCellIndexs = new Array();
|
|
30985
31305
|
for (let i = 0; i < rows.length; i++) {
|
|
30986
|
-
|
|
30987
|
-
|
|
30988
|
-
|
|
31306
|
+
const cellIndex = isFirst ? 0 : rows[i].cells.length - 1;
|
|
31307
|
+
const column = rows[i].cells[cellIndex];
|
|
31308
|
+
for (let rowSpan = 1; rowSpan < column.rowSpan; rowSpan++) {
|
|
31309
|
+
const key = `${i + rowSpan}-${cellIndex}`;
|
|
31310
|
+
rowSpanCellIndexs.push(key);
|
|
31311
|
+
}
|
|
31312
|
+
const spannedCellKey = `${i}-${cellIndex}`;
|
|
31313
|
+
if (rowSpanCellIndexs.length === 0 || (isFirst && rowSpanCellIndexs.indexOf(spannedCellKey) === -1) || (!isFirst && rowSpanCellIndexs.indexOf(spannedCellKey) === -1 && rowSpanCellIndexs.every((key) => key.split('-')[0] !== i.toString()))) {
|
|
31314
|
+
resultColumns.push(column);
|
|
30989
31315
|
}
|
|
30990
31316
|
}
|
|
30991
31317
|
return resultColumns;
|
|
@@ -31010,13 +31336,47 @@ class Table {
|
|
|
31010
31336
|
detach(this.helper);
|
|
31011
31337
|
this.helper = null;
|
|
31012
31338
|
}
|
|
31339
|
+
this.resetResizeHelper(this.curTable);
|
|
31013
31340
|
this.pageX = null;
|
|
31014
31341
|
this.pageY = null;
|
|
31015
31342
|
this.moveEle = null;
|
|
31343
|
+
const currentTableTrElement = this.curTable.querySelectorAll("tr");
|
|
31344
|
+
const tableTrPercentage = [];
|
|
31345
|
+
for (let i = 0; i < currentTableTrElement.length; i++) {
|
|
31346
|
+
const percentage = (parseFloat(currentTableTrElement[i].clientHeight.toString()) / parseFloat(this.curTable.clientHeight.toString())) * 100;
|
|
31347
|
+
tableTrPercentage[i] = percentage;
|
|
31348
|
+
}
|
|
31349
|
+
for (let i = 0; i < currentTableTrElement.length; i++) {
|
|
31350
|
+
currentTableTrElement[i].style.height = tableTrPercentage[i] + '%';
|
|
31351
|
+
}
|
|
31016
31352
|
const args = { event: e, requestType: 'table' };
|
|
31017
31353
|
this.parent.trigger(resizeStop, args);
|
|
31018
31354
|
this.parent.formatter.saveData();
|
|
31019
31355
|
}
|
|
31356
|
+
resetResizeHelper(curTable) {
|
|
31357
|
+
const colHelper = this.parent.element.querySelectorAll('.e-table-rhelper.e-column-helper');
|
|
31358
|
+
Array.from(colHelper).forEach((element) => {
|
|
31359
|
+
if (element.parentNode) {
|
|
31360
|
+
element.parentNode.removeChild(element);
|
|
31361
|
+
}
|
|
31362
|
+
});
|
|
31363
|
+
const rowHelper = this.parent.element.querySelectorAll('.e-table-rhelper.e-row-helper');
|
|
31364
|
+
Array.from(rowHelper).forEach((element) => {
|
|
31365
|
+
if (element.parentNode) {
|
|
31366
|
+
element.parentNode.removeChild(element);
|
|
31367
|
+
}
|
|
31368
|
+
});
|
|
31369
|
+
const colGroup = curTable.querySelector('colgroup');
|
|
31370
|
+
if (colGroup) {
|
|
31371
|
+
for (let i = 0; i < curTable.rows.length; i++) {
|
|
31372
|
+
for (let k = 0; k < curTable.rows[i].cells.length; k++) {
|
|
31373
|
+
const width = this.convertPixelToPercentage(curTable.rows[i].cells[k].offsetWidth, parseInt(getComputedStyle(curTable).width, 10)) + '%';
|
|
31374
|
+
curTable.rows[i].cells[k].style.width = width;
|
|
31375
|
+
}
|
|
31376
|
+
}
|
|
31377
|
+
curTable.removeChild(colGroup);
|
|
31378
|
+
}
|
|
31379
|
+
}
|
|
31020
31380
|
resizeBtnInit() {
|
|
31021
31381
|
return this.resizeBtnStat = { column: false, row: false, tableBox: false };
|
|
31022
31382
|
}
|
|
@@ -31125,6 +31485,7 @@ class Table {
|
|
|
31125
31485
|
if (!isNullOrUndefined(this.parent.cssClass)) {
|
|
31126
31486
|
addClass([this.popupObj.element], this.parent.getCssClass());
|
|
31127
31487
|
}
|
|
31488
|
+
btnEle.focus();
|
|
31128
31489
|
this.popupObj.refreshPosition(target);
|
|
31129
31490
|
}
|
|
31130
31491
|
onIframeMouseDown() {
|
|
@@ -31454,12 +31815,18 @@ class Table {
|
|
|
31454
31815
|
afterKeyDown(e) {
|
|
31455
31816
|
if (this.curTable) {
|
|
31456
31817
|
setTimeout(() => {
|
|
31457
|
-
|
|
31458
|
-
mouseOverEvent.initEvent('mouseover', true, true);
|
|
31459
|
-
this.curTable.dispatchEvent(mouseOverEvent);
|
|
31818
|
+
this.updateResizeIconPosition();
|
|
31460
31819
|
}, 1);
|
|
31461
31820
|
}
|
|
31462
31821
|
}
|
|
31822
|
+
updateResizeIconPosition() {
|
|
31823
|
+
const tableReBox = this.parent.contentModule.getEditPanel().querySelector('.e-table-box');
|
|
31824
|
+
if (!isNullOrUndefined(tableReBox)) {
|
|
31825
|
+
const tablePosition = this.calcPos(this.curTable);
|
|
31826
|
+
tableReBox.style.cssText = 'top: ' + (tablePosition.top + parseInt(getComputedStyle(this.curTable).height, 10) - 4) +
|
|
31827
|
+
'px; left:' + (tablePosition.left + parseInt(getComputedStyle(this.curTable).width, 10) - 4) + 'px;';
|
|
31828
|
+
}
|
|
31829
|
+
}
|
|
31463
31830
|
}
|
|
31464
31831
|
|
|
31465
31832
|
/**
|
|
@@ -31498,7 +31865,11 @@ class DialogRenderer {
|
|
|
31498
31865
|
let dlgObj;
|
|
31499
31866
|
e.beforeOpen = this.beforeOpen.bind(this);
|
|
31500
31867
|
e.open = this.open.bind(this);
|
|
31501
|
-
e.position = {
|
|
31868
|
+
e.position = {
|
|
31869
|
+
X: 'center',
|
|
31870
|
+
Y: (e.target !== 'string' && e.target.nodeName === 'BODY' &&
|
|
31871
|
+
!isNullOrUndefined(e.position)) ? e.position.Y : this.getDialogPosition()
|
|
31872
|
+
};
|
|
31502
31873
|
if (isNullOrUndefined(e.close)) {
|
|
31503
31874
|
e.close = this.close.bind(this);
|
|
31504
31875
|
}
|
|
@@ -32705,10 +33076,10 @@ class EnterKeyAction {
|
|
|
32705
33076
|
}
|
|
32706
33077
|
const previousBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].previousSibling;
|
|
32707
33078
|
const nextBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].nextSibling;
|
|
32708
|
-
if (!isNullOrUndefined(previousBlockNode) && previousBlockNode.hasAttribute('style')) {
|
|
33079
|
+
if (!isNullOrUndefined(previousBlockNode) && previousBlockNode.hasAttribute('style') && previousBlockNode.nodeName !== 'TABLE') {
|
|
32709
33080
|
insertElem.setAttribute('style', previousBlockNode.getAttribute('style'));
|
|
32710
33081
|
}
|
|
32711
|
-
if (isNullOrUndefined(previousBlockNode) && !isNullOrUndefined(nextBlockNode) && nextBlockNode.hasAttribute('style')) {
|
|
33082
|
+
if (isNullOrUndefined(previousBlockNode) && !isNullOrUndefined(nextBlockNode) && nextBlockNode.hasAttribute('style') && nextBlockNode.nodeName !== 'TABLE') {
|
|
32712
33083
|
insertElem.setAttribute('style', nextBlockNode.getAttribute('style'));
|
|
32713
33084
|
}
|
|
32714
33085
|
return insertElem;
|
|
@@ -33463,6 +33834,16 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
33463
33834
|
keyUp(e) {
|
|
33464
33835
|
if (this.editorMode === 'HTML') {
|
|
33465
33836
|
const range = this.getRange();
|
|
33837
|
+
if (!isNullOrUndefined(e) && !isNullOrUndefined(e.code) && (e.code === 'Backspace' || e.code === 'Delete')) {
|
|
33838
|
+
// To prevent the reformatting the content removed browser behavior.
|
|
33839
|
+
const currentRange = this.getRange();
|
|
33840
|
+
const selection = this.iframeSettings.enable ? this.contentModule.getPanel().ownerDocument.getSelection() :
|
|
33841
|
+
this.contentModule.getDocument().getSelection();
|
|
33842
|
+
if (selection.rangeCount > 0) {
|
|
33843
|
+
selection.removeAllRanges();
|
|
33844
|
+
selection.addRange(currentRange);
|
|
33845
|
+
}
|
|
33846
|
+
}
|
|
33466
33847
|
if (Browser.userAgent.indexOf('Firefox') !== -1 && range.startContainer.nodeName === '#text' &&
|
|
33467
33848
|
range.startContainer.parentElement === this.inputElement && this.enterKey !== 'BR') {
|
|
33468
33849
|
const range = this.getRange();
|
|
@@ -33562,11 +33943,14 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
33562
33943
|
clientX: touch.clientX, clientY: touch.clientY }
|
|
33563
33944
|
});
|
|
33564
33945
|
if (this.inputElement && ((this.editorMode === 'HTML' && this.inputElement.textContent.length !== 0) ||
|
|
33565
|
-
(this.editorMode === 'Markdown' && this.inputElement.value.length !== 0)) ||
|
|
33566
|
-
|
|
33567
|
-
(e.target.
|
|
33568
|
-
e.target.
|
|
33569
|
-
e.target.
|
|
33946
|
+
(this.editorMode === 'Markdown' && this.inputElement.value.length !== 0)) ||
|
|
33947
|
+
(e.target && !isNullOrUndefined(closest(e.target, 'table'))) ||
|
|
33948
|
+
(e.target && (e.target.nodeName === 'VIDEO' ||
|
|
33949
|
+
e.target.querySelectorAll('.' + CLS_VIDEOWRAP).length > 0) ||
|
|
33950
|
+
(e.target && e.target.nodeName !== 'BR' &&
|
|
33951
|
+
(e.target.classList.contains(CLS_AUDIOWRAP) ||
|
|
33952
|
+
e.target.classList.contains(CLS_CLICKELEM) ||
|
|
33953
|
+
e.target.classList.contains(CLS_VID_CLICK_ELEM))))) {
|
|
33570
33954
|
this.notify(toolbarRefresh, { args: e });
|
|
33571
33955
|
}
|
|
33572
33956
|
this.triggerEditArea(e);
|
|
@@ -34330,10 +34714,10 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
34330
34714
|
if (this.iframeSettings.resources) {
|
|
34331
34715
|
const styleSrc = this.iframeSettings.resources.styles;
|
|
34332
34716
|
const scriptSrc = this.iframeSettings.resources.scripts;
|
|
34333
|
-
if (this.iframeSettings.resources.scripts.length > 0) {
|
|
34717
|
+
if (!isNullOrUndefined(this.iframeSettings.resources.scripts) && this.iframeSettings.resources.scripts.length > 0) {
|
|
34334
34718
|
this.InjectSheet(true, scriptSrc);
|
|
34335
34719
|
}
|
|
34336
|
-
if (this.iframeSettings.resources.styles.length > 0) {
|
|
34720
|
+
if (!isNullOrUndefined(this.iframeSettings.resources.styles) && this.iframeSettings.resources.styles.length > 0) {
|
|
34337
34721
|
this.InjectSheet(false, styleSrc);
|
|
34338
34722
|
}
|
|
34339
34723
|
}
|
|
@@ -34445,7 +34829,14 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
34445
34829
|
// eslint-disable-next-line
|
|
34446
34830
|
const imgPadding = 12;
|
|
34447
34831
|
const imgResizeBorder = 2;
|
|
34448
|
-
|
|
34832
|
+
let editEle = this.contentModule.getEditPanel();
|
|
34833
|
+
if (this.editorMode === "HTML" && !isNullOrUndefined(this.formatter.editorManager.nodeSelection) && !isNullOrUndefined(this.formatter.editorManager.nodeSelection.range)) {
|
|
34834
|
+
const currentRange = this.formatter.editorManager.nodeSelection.range;
|
|
34835
|
+
if (currentRange.startContainer.nodeType !== 3 && currentRange.startContainer.closest &&
|
|
34836
|
+
!isNullOrUndefined(currentRange.startContainer.closest('TD'))) {
|
|
34837
|
+
editEle = currentRange.startContainer;
|
|
34838
|
+
}
|
|
34839
|
+
}
|
|
34449
34840
|
const eleStyle = window.getComputedStyle(editEle);
|
|
34450
34841
|
const editEleMaxWidth = editEle.offsetWidth - (imgPadding + imgResizeBorder +
|
|
34451
34842
|
parseFloat(eleStyle.paddingLeft.split('px')[0]) + parseFloat(eleStyle.paddingRight.split('px')[0]) +
|
|
@@ -34888,7 +35279,13 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
34888
35279
|
blurHandler(e) {
|
|
34889
35280
|
let trg = e.relatedTarget;
|
|
34890
35281
|
if (trg) {
|
|
34891
|
-
|
|
35282
|
+
let rteElement = closest(trg, '.' + CLS_RTE);
|
|
35283
|
+
if (!rteElement && this.iframeSettings.enable) {
|
|
35284
|
+
const iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
|
|
35285
|
+
if (iframeElement && iframeElement.contentWindow.document.body.contains(trg)) {
|
|
35286
|
+
rteElement = closest(iframeElement, '.' + CLS_RTE);
|
|
35287
|
+
}
|
|
35288
|
+
}
|
|
34892
35289
|
if (rteElement && rteElement === this.element) {
|
|
34893
35290
|
this.isBlur = false;
|
|
34894
35291
|
if (trg === this.getToolbarElement()) {
|
|
@@ -35549,5 +35946,5 @@ RichTextEditor = __decorate$1([
|
|
|
35549
35946
|
* Rich Text Editor component exported items
|
|
35550
35947
|
*/
|
|
35551
35948
|
|
|
35552
|
-
export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, FormatPainter, EmojiPicker, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image$1 as Image, Audio, Video, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, tableclass, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, tableModulekeyUp, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, audioToolbarAction, videoToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertAudio, insertVideo, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, audioDelete, videoDelete, imageCaption, imageSize, videoSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, moduleDestroy, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, fileSelected, fileUploading, fileUploadSuccess, fileUploadFailed, fileRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeFileUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, showAudioDialog, showVideoDialog, closeImageDialog, closeAudioDialog, closeVideoDialog, showTableDialog, closeTableDialog, bindCssClass, formatPainterClick, formatPainterDoubleClick, emojiPicker, destroyTooltip, hidePopup, cleanupResizeElements, afterKeyDown, updateValueOnIdle, documentClickClosedBy, blockEmptyNodes, inlineEmptyNodes, supportedUnits, conversionFactors, onHandleFontsizeChange, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_TEXT_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_TEXT_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_AUDIOBREAK, CLS_CLICKELEM, CLS_VID_CLICK_ELEM, CLS_AUDIOWRAP, CLS_VIDEOWRAP, CLS_VIDEOBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_AUDIOINLINE, CLS_VIDEOINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_AUD_FOCUS, CLS_VID_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, CLS_RTE_SOURCE_CODE_TXTAREA, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, getTooltipTextDropdownItems, getQuickToolbarTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, AUDIO, VIDEO, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, PASTE_SOURCE, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_VIDEO_RIGHT, CLASS_VIDEO_LEFT, CLASS_VIDEO_CENTER, CLASS_IMAGE_BREAK, CLASS_AUDIO_BREAK, CLASS_VIDEO_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, CLASS_AUDIO_INLINE, CLASS_CLICK_ELEM, CLASS_VIDEO_CLICK_ELEM, CLASS_AUDIO, CLASS_VIDEO, CLASS_AUDIO_WRAP, CLASS_VIDEO_WRAP, CLASS_EMBED_VIDEO_WRAP, CLASS_AUDIO_FOCUS, CLASS_VIDEO_FOCUS, CLASS_VIDEO_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, AudioCommand, VideoCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, FormatPainterActions, EmojiPickerAction, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION, FORMAT_PAINTER_ACTIONS, EMOJI_PICKER_ACTIONS, MOUSE_DOWN };
|
|
35949
|
+
export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, FormatPainter, EmojiPicker, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image$1 as Image, Audio, Video, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, tableclass, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, tableModulekeyUp, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, audioToolbarAction, videoToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertAudio, insertVideo, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, audioDelete, videoDelete, imageCaption, imageSize, videoSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, moduleDestroy, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, fileSelected, fileUploading, fileUploadSuccess, fileUploadFailed, fileRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeFileUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, showAudioDialog, showVideoDialog, closeImageDialog, closeAudioDialog, closeVideoDialog, showTableDialog, closeTableDialog, bindCssClass, formatPainterClick, formatPainterDoubleClick, emojiPicker, destroyTooltip, hidePopup, cleanupResizeElements, afterKeyDown, updateValueOnIdle, documentClickClosedBy, showColorPicker, blockEmptyNodes, inlineEmptyNodes, supportedUnits, conversionFactors, onHandleFontsizeChange, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_TEXT_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_TEXT_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_AUDIOBREAK, CLS_CLICKELEM, CLS_VID_CLICK_ELEM, CLS_AUDIOWRAP, CLS_VIDEOWRAP, CLS_VIDEOBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_AUDIOINLINE, CLS_VIDEOINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_AUD_FOCUS, CLS_VID_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, CLS_RTE_SOURCE_CODE_TXTAREA, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, getTooltipTextDropdownItems, getQuickToolbarTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, AUDIO, VIDEO, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, PASTE_SOURCE, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_VIDEO_RIGHT, CLASS_VIDEO_LEFT, CLASS_VIDEO_CENTER, CLASS_IMAGE_BREAK, CLASS_AUDIO_BREAK, CLASS_VIDEO_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, CLASS_AUDIO_INLINE, CLASS_CLICK_ELEM, CLASS_VIDEO_CLICK_ELEM, CLASS_AUDIO, CLASS_VIDEO, CLASS_AUDIO_WRAP, CLASS_VIDEO_WRAP, CLASS_EMBED_VIDEO_WRAP, CLASS_AUDIO_FOCUS, CLASS_VIDEO_FOCUS, CLASS_VIDEO_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, AudioCommand, VideoCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, FormatPainterActions, EmojiPickerAction, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION, FORMAT_PAINTER_ACTIONS, EMOJI_PICKER_ACTIONS, MOUSE_DOWN };
|
|
35553
35950
|
//# sourceMappingURL=ej2-richtexteditor.es2015.js.map
|