@syncfusion/ej2-richtexteditor 23.2.7 → 24.1.43
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 +35 -1
- 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 +574 -309
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +573 -308
- 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 +13 -13
- package/src/common/config.js +1 -1
- package/src/editor-manager/plugin/audio.js +13 -3
- package/src/editor-manager/plugin/dom-node.js +1 -14
- package/src/editor-manager/plugin/image.js +30 -3
- package/src/editor-manager/plugin/inserthtml.js +5 -2
- package/src/editor-manager/plugin/ms-word-clean-up.js +4 -1
- package/src/editor-manager/plugin/nodecutter.js +1 -1
- package/src/editor-manager/plugin/selection-commands.js +39 -0
- package/src/rich-text-editor/actions/base-quick-toolbar.js +18 -4
- package/src/rich-text-editor/actions/color-picker.js +3 -3
- package/src/rich-text-editor/actions/dropdown-buttons.js +4 -2
- package/src/rich-text-editor/actions/emoji-picker.js +12 -3
- package/src/rich-text-editor/actions/enter-key.js +2 -1
- package/src/rich-text-editor/actions/file-manager.js +1 -1
- package/src/rich-text-editor/actions/format-painter.js +1 -1
- package/src/rich-text-editor/actions/full-screen.js +2 -2
- package/src/rich-text-editor/actions/html-editor.d.ts +2 -0
- package/src/rich-text-editor/actions/html-editor.js +36 -5
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +2 -0
- package/src/rich-text-editor/actions/paste-clean-up.js +75 -19
- package/src/rich-text-editor/actions/quick-toolbar.js +24 -5
- package/src/rich-text-editor/actions/toolbar.d.ts +1 -0
- package/src/rich-text-editor/actions/toolbar.js +18 -10
- package/src/rich-text-editor/base/classes.d.ts +5 -0
- package/src/rich-text-editor/base/classes.js +5 -0
- package/src/rich-text-editor/base/constant.d.ts +6 -1
- package/src/rich-text-editor/base/constant.js +6 -1
- package/src/rich-text-editor/base/interface.d.ts +11 -0
- 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 +9 -0
- package/src/rich-text-editor/base/rich-text-editor.js +80 -17
- package/src/rich-text-editor/base/util.js +11 -2
- package/src/rich-text-editor/formatter/formatter.js +1 -1
- package/src/rich-text-editor/models/default-locale.js +2 -0
- package/src/rich-text-editor/models/items.js +1 -1
- package/src/rich-text-editor/renderer/dialog-renderer.js +10 -1
- package/src/rich-text-editor/renderer/image-module.js +68 -59
- package/src/rich-text-editor/renderer/link-module.js +43 -23
- package/src/rich-text-editor/renderer/table-module.d.ts +2 -0
- package/src/rich-text-editor/renderer/table-module.js +43 -30
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -6
- package/src/rich-text-editor/renderer/toolbar-renderer.js +13 -93
- package/src/rich-text-editor/renderer/view-source.js +3 -1
- package/styles/bootstrap-dark.css +194 -52
- package/styles/bootstrap.css +197 -53
- package/styles/bootstrap4.css +194 -52
- package/styles/bootstrap5-dark.css +195 -53
- package/styles/bootstrap5.css +195 -53
- package/styles/fabric-dark.css +194 -52
- package/styles/fabric.css +194 -52
- package/styles/fluent-dark.css +197 -53
- package/styles/fluent.css +197 -53
- package/styles/highcontrast-light.css +194 -52
- package/styles/highcontrast.css +194 -52
- package/styles/material-dark.css +196 -53
- package/styles/material.css +196 -53
- package/styles/material3-dark.css +194 -52
- package/styles/material3.css +194 -52
- package/styles/rich-text-editor/_bootstrap5-definition.scss +1 -1
- package/styles/rich-text-editor/_fluent-definition.scss +1 -1
- package/styles/rich-text-editor/_layout.scss +78 -3
- package/styles/rich-text-editor/_theme.scss +1 -1
- package/styles/rich-text-editor/bootstrap-dark.css +194 -52
- package/styles/rich-text-editor/bootstrap.css +197 -53
- package/styles/rich-text-editor/bootstrap4.css +194 -52
- package/styles/rich-text-editor/bootstrap5-dark.css +195 -53
- package/styles/rich-text-editor/bootstrap5.css +195 -53
- package/styles/rich-text-editor/fabric-dark.css +194 -52
- package/styles/rich-text-editor/fabric.css +194 -52
- package/styles/rich-text-editor/fluent-dark.css +197 -53
- package/styles/rich-text-editor/fluent.css +197 -53
- package/styles/rich-text-editor/highcontrast-light.css +194 -52
- package/styles/rich-text-editor/highcontrast.css +194 -52
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +3 -3
- package/styles/rich-text-editor/icons/_bootstrap.scss +3 -3
- package/styles/rich-text-editor/icons/_bootstrap4.scss +3 -3
- package/styles/rich-text-editor/icons/_bootstrap5.scss +3 -3
- package/styles/rich-text-editor/icons/_fabric-dark.scss +3 -3
- package/styles/rich-text-editor/icons/_fabric.scss +3 -3
- package/styles/rich-text-editor/icons/_fluent.scss +3 -3
- package/styles/rich-text-editor/icons/_fusionnew.scss +3 -3
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +3 -3
- package/styles/rich-text-editor/icons/_highcontrast.scss +3 -3
- package/styles/rich-text-editor/icons/_material-dark.scss +3 -3
- package/styles/rich-text-editor/icons/_material.scss +3 -3
- package/styles/rich-text-editor/icons/_material3.scss +3 -3
- package/styles/rich-text-editor/icons/_tailwind.scss +3 -3
- package/styles/rich-text-editor/material-dark.css +196 -53
- package/styles/rich-text-editor/material.css +196 -53
- package/styles/rich-text-editor/material3-dark.css +194 -52
- package/styles/rich-text-editor/material3.css +194 -52
- package/styles/rich-text-editor/tailwind-dark.css +194 -52
- package/styles/rich-text-editor/tailwind.css +194 -52
- package/styles/tailwind-dark.css +194 -52
- package/styles/tailwind.css +194 -52
|
@@ -738,12 +738,17 @@ var emojiPicker = 'emojiPicker';
|
|
|
738
738
|
* @hidden
|
|
739
739
|
* @deprecated
|
|
740
740
|
*/
|
|
741
|
-
var
|
|
741
|
+
var destroyTooltip = 'destroyTooltip';
|
|
742
742
|
/**
|
|
743
743
|
* @hidden
|
|
744
744
|
* @deprecated
|
|
745
745
|
*/
|
|
746
746
|
var hidePopup = 'hidePopup';
|
|
747
|
+
/**
|
|
748
|
+
* @hidden
|
|
749
|
+
* @deprecated
|
|
750
|
+
*/
|
|
751
|
+
var cleanupResizeElements = 'cleanupResizeElements';
|
|
747
752
|
/**
|
|
748
753
|
* @hidden
|
|
749
754
|
* @deprecated
|
|
@@ -833,6 +838,11 @@ var CLS_FULL_SCREEN = 'e-rte-full-screen';
|
|
|
833
838
|
* @deprecated
|
|
834
839
|
*/
|
|
835
840
|
var CLS_QUICK_TB = 'e-rte-quick-toolbar';
|
|
841
|
+
/**
|
|
842
|
+
* @hidden
|
|
843
|
+
* @deprecated
|
|
844
|
+
*/
|
|
845
|
+
var CLS_TEXT_QUICK_TB = 'e-rte-text-quicktoolbar';
|
|
836
846
|
/**
|
|
837
847
|
* @hidden
|
|
838
848
|
* @deprecated
|
|
@@ -2210,7 +2220,7 @@ var windowKeys = {
|
|
|
2210
2220
|
'Number Format List': 'Ctrl+Shift+O',
|
|
2211
2221
|
'Bullet Format List': 'Ctrl+Alt+O',
|
|
2212
2222
|
'Insert Audio': 'Ctrl+Shift+A',
|
|
2213
|
-
'Insert Video': 'Ctrl+
|
|
2223
|
+
'Insert Video': 'Ctrl+Alt+V',
|
|
2214
2224
|
'Increase Indent': 'Ctrl+]',
|
|
2215
2225
|
'Decrease Indent': 'Ctrl+[',
|
|
2216
2226
|
'Decrease Fontsize': 'Ctrl+Shift+<',
|
|
@@ -2631,6 +2641,7 @@ var toolsLocale = {
|
|
|
2631
2641
|
'bulletformatlist': 'bulletFormatList',
|
|
2632
2642
|
'undo': 'undo',
|
|
2633
2643
|
'redo': 'redo',
|
|
2644
|
+
'filemanager': 'fileManager',
|
|
2634
2645
|
'superscript': 'superscript',
|
|
2635
2646
|
'subscript': 'subscript',
|
|
2636
2647
|
'createlink': 'createLink',
|
|
@@ -2697,6 +2708,7 @@ var toolsLocale = {
|
|
|
2697
2708
|
'emojiPickerTypeToFind': 'Type to find',
|
|
2698
2709
|
'emojiPickerNoResultFound': 'No results found',
|
|
2699
2710
|
'emojiPickerTrySomethingElse': 'Try something else',
|
|
2711
|
+
'ImageLinkAriaLabel': 'Open in new window',
|
|
2700
2712
|
};
|
|
2701
2713
|
var fontNameLocale = [
|
|
2702
2714
|
{ locale: 'fontNameSegoeUI', value: 'Segoe UI' },
|
|
@@ -2993,11 +3005,11 @@ function getTBarItemsIndex(items, toolbarItems) {
|
|
|
2993
3005
|
continue;
|
|
2994
3006
|
}
|
|
2995
3007
|
else {
|
|
2996
|
-
if (items[i] === 'OrderedList' && toolbarItems[j].subCommand === 'OL') {
|
|
3008
|
+
if ((items[i] === 'OrderedList' || items[i] === 'NumberFormatList') && toolbarItems[j].subCommand === 'OL') {
|
|
2997
3009
|
itemsIndex.push(j);
|
|
2998
3010
|
break;
|
|
2999
3011
|
}
|
|
3000
|
-
else if (items[i] === 'UnorderedList' && toolbarItems[j].subCommand === 'UL') {
|
|
3012
|
+
else if ((items[i] === 'UnorderedList' || items[i] === 'BulletFormatList') && toolbarItems[j].subCommand === 'UL') {
|
|
3001
3013
|
itemsIndex.push(j);
|
|
3002
3014
|
break;
|
|
3003
3015
|
}
|
|
@@ -3150,6 +3162,15 @@ function updateTextNode(value, rteObj) {
|
|
|
3150
3162
|
for (var i = 0; i < emptyBlockElem.length; i++) {
|
|
3151
3163
|
emptyBlockElem[i].innerHTML = '<br>';
|
|
3152
3164
|
}
|
|
3165
|
+
// To handle the Empty block node with \n
|
|
3166
|
+
var allPNodes = tempNode.querySelectorAll('p');
|
|
3167
|
+
for (var i = 0; i < allPNodes.length; i++) {
|
|
3168
|
+
if (allPNodes[i].textContent.trim().length === 0 && allPNodes[i].childNodes.length === 1
|
|
3169
|
+
&& allPNodes[i].childNodes[0].nodeName === '#text' &&
|
|
3170
|
+
isNullOrUndefined(allPNodes[i].childNodes[0].textContent.match(/\u00a0/g))) {
|
|
3171
|
+
allPNodes[i].innerHTML = '<br>';
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3153
3174
|
var emptyInlineElem = tempNode.querySelectorAll(inlineEmptyNodes);
|
|
3154
3175
|
for (var i = 0; i < emptyInlineElem.length; i++) {
|
|
3155
3176
|
emptyInlineElem[i].innerHTML = '​';
|
|
@@ -3336,21 +3357,19 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3336
3357
|
}
|
|
3337
3358
|
ToolbarRenderer.prototype.wireEvent = function () {
|
|
3338
3359
|
this.parent.on(destroy, this.unWireEvent, this);
|
|
3339
|
-
this.parent.on(
|
|
3360
|
+
this.parent.on(destroyTooltip, this.destroyTooltip, this);
|
|
3340
3361
|
};
|
|
3341
3362
|
ToolbarRenderer.prototype.destroyTooltip = function () {
|
|
3342
|
-
|
|
3343
|
-
|
|
3363
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
3364
|
+
this.parent.contentModule.getDocument();
|
|
3365
|
+
if (!isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap')) && !isNullOrUndefined(currentDocument.querySelector('[data-tooltip-id]'))) {
|
|
3366
|
+
var tooltipTargetEle = currentDocument.querySelector('[data-tooltip-id]');
|
|
3344
3367
|
var event_1 = new MouseEvent('mouseleave', { bubbles: true, cancelable: true });
|
|
3345
3368
|
tooltipTargetEle.dispatchEvent(event_1);
|
|
3346
3369
|
}
|
|
3347
3370
|
};
|
|
3348
3371
|
ToolbarRenderer.prototype.unWireEvent = function () {
|
|
3349
3372
|
this.parent.off(destroy, this.unWireEvent);
|
|
3350
|
-
if (this.popupOverlay) {
|
|
3351
|
-
EventHandler.remove(this.popupOverlay, 'click touchmove', this.onPopupOverlay);
|
|
3352
|
-
}
|
|
3353
|
-
this.removePopupContainer();
|
|
3354
3373
|
};
|
|
3355
3374
|
ToolbarRenderer.prototype.toolbarBeforeCreate = function (e) {
|
|
3356
3375
|
if (this.mode === 'Extended') {
|
|
@@ -3371,7 +3390,6 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3371
3390
|
};
|
|
3372
3391
|
ToolbarRenderer.prototype.dropDownSelected = function (args) {
|
|
3373
3392
|
this.parent.notify(dropDownSelect, args);
|
|
3374
|
-
this.onPopupOverlay();
|
|
3375
3393
|
};
|
|
3376
3394
|
ToolbarRenderer.prototype.beforeDropDownItemRender = function (args) {
|
|
3377
3395
|
if (this.parent.readonly || !this.parent.enabled) {
|
|
@@ -3408,27 +3426,11 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3408
3426
|
addClass([listEle[1], listEle[2]], 'e-disabled');
|
|
3409
3427
|
}
|
|
3410
3428
|
}
|
|
3411
|
-
if (Browser.isDevice && !args.element.parentElement.classList.contains(CLS_QUICK_DROPDOWN)) {
|
|
3412
|
-
this.popupModal(args.element.parentElement);
|
|
3413
|
-
}
|
|
3414
3429
|
this.parent.notify(selectionSave, args);
|
|
3415
3430
|
};
|
|
3416
3431
|
ToolbarRenderer.prototype.dropDownClose = function (args) {
|
|
3417
|
-
this.removePopupContainer();
|
|
3418
3432
|
this.parent.notify(selectionRestore, args);
|
|
3419
3433
|
};
|
|
3420
|
-
ToolbarRenderer.prototype.removePopupContainer = function () {
|
|
3421
|
-
if (Browser.isDevice && !isNullOrUndefined(this.popupContainer)) {
|
|
3422
|
-
var popupEle = this.popupContainer.querySelector('.e-dropdown-popup.e-tbar-btn.e-control');
|
|
3423
|
-
if (popupEle) {
|
|
3424
|
-
this.popupContainer.parentNode.insertBefore(popupEle, this.popupContainer.nextSibling);
|
|
3425
|
-
popupEle.style.removeProperty('position');
|
|
3426
|
-
removeClass([popupEle], 'e-popup-modal');
|
|
3427
|
-
}
|
|
3428
|
-
detach(this.popupContainer);
|
|
3429
|
-
this.popupContainer = undefined;
|
|
3430
|
-
}
|
|
3431
|
-
};
|
|
3432
3434
|
/**
|
|
3433
3435
|
* renderToolbar method
|
|
3434
3436
|
*
|
|
@@ -3462,7 +3464,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3462
3464
|
openDelay: 400,
|
|
3463
3465
|
opensOn: 'Hover',
|
|
3464
3466
|
beforeRender: this.tooltipBeforeRender.bind(this),
|
|
3465
|
-
cssClass: this.parent.
|
|
3467
|
+
cssClass: this.parent.getCssClass(),
|
|
3466
3468
|
windowCollision: true,
|
|
3467
3469
|
position: 'BottomCenter'
|
|
3468
3470
|
});
|
|
@@ -3522,7 +3524,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3522
3524
|
}
|
|
3523
3525
|
//Alignments preselect
|
|
3524
3526
|
var alignEle = proxy.parent.getRange().startContainer;
|
|
3525
|
-
while (alignEle !== proxy.parent.
|
|
3527
|
+
while (alignEle !== proxy.parent.inputElement && !isNullOrUndefined(alignEle.parentElement)) {
|
|
3526
3528
|
if (alignEle.nodeName === '#text') {
|
|
3527
3529
|
alignEle = alignEle.parentElement;
|
|
3528
3530
|
}
|
|
@@ -3548,7 +3550,8 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3548
3550
|
alignEle = alignEle.parentElement;
|
|
3549
3551
|
}
|
|
3550
3552
|
//image preselect
|
|
3551
|
-
var
|
|
3553
|
+
var closestNode = startNode.closest('img');
|
|
3554
|
+
var imageEle = closestNode ? closestNode : startNode.querySelector('img');
|
|
3552
3555
|
if (args.items[0].command === 'Images') {
|
|
3553
3556
|
if (!isNullOrUndefined(imageEle)) {
|
|
3554
3557
|
var index = void 0;
|
|
@@ -3660,39 +3663,6 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3660
3663
|
};
|
|
3661
3664
|
return dropDown;
|
|
3662
3665
|
};
|
|
3663
|
-
// eslint-disable-next-line
|
|
3664
|
-
ToolbarRenderer.prototype.onPopupOverlay = function (args) {
|
|
3665
|
-
if (!isNullOrUndefined(this.popupOverlay)) {
|
|
3666
|
-
closest(this.popupOverlay, '.e-popup-container').style.display = 'none';
|
|
3667
|
-
this.popupOverlay.style.display = 'none';
|
|
3668
|
-
removeClass([this.popupOverlay], 'e-popup-overlay');
|
|
3669
|
-
}
|
|
3670
|
-
};
|
|
3671
|
-
ToolbarRenderer.prototype.setIsModel = function (element) {
|
|
3672
|
-
if (!closest(element, '.e-popup-container')) {
|
|
3673
|
-
this.popupContainer = this.parent.createElement('div', {
|
|
3674
|
-
className: 'e-rte-modal-popup e-popup-container e-center'
|
|
3675
|
-
});
|
|
3676
|
-
element.parentNode.insertBefore(this.popupContainer, element);
|
|
3677
|
-
this.popupContainer.appendChild(element);
|
|
3678
|
-
this.popupContainer.style.zIndex = element.style.zIndex;
|
|
3679
|
-
this.popupContainer.style.display = 'flex';
|
|
3680
|
-
element.style.position = 'relative';
|
|
3681
|
-
addClass([element], 'e-popup-modal');
|
|
3682
|
-
this.popupOverlay = this.parent.createElement('div', { className: 'e-popup-overlay' });
|
|
3683
|
-
// eslint-disable-next-line
|
|
3684
|
-
this.popupOverlay.style.zIndex = (parseInt(element.style.zIndex, null) - 1).toString();
|
|
3685
|
-
this.popupOverlay.style.display = 'block';
|
|
3686
|
-
this.popupContainer.appendChild(this.popupOverlay);
|
|
3687
|
-
EventHandler.add(this.popupOverlay, 'click touchmove', this.onPopupOverlay, this);
|
|
3688
|
-
}
|
|
3689
|
-
else {
|
|
3690
|
-
element.parentElement.style.display = 'flex';
|
|
3691
|
-
this.popupOverlay = element.nextElementSibling;
|
|
3692
|
-
this.popupOverlay.style.display = 'block';
|
|
3693
|
-
addClass([this.popupOverlay], 'e-popup-overlay');
|
|
3694
|
-
}
|
|
3695
|
-
};
|
|
3696
3666
|
ToolbarRenderer.prototype.paletteSelection = function (dropDownArgs, currentElement) {
|
|
3697
3667
|
var ele = dropDownArgs.element.querySelector('.e-control.e-colorpicker');
|
|
3698
3668
|
var colorbox = [].slice.call(selectAll('.e-tile', ele.parentElement));
|
|
@@ -3721,7 +3691,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3721
3691
|
var proxy = this;
|
|
3722
3692
|
var css = CLS_RTE_ELEMENTS + ' ' + CLS_TB_BTN + ((this.parent.inlineMode) ? (' ' + CLS_INLINE_DROPDOWN) : '');
|
|
3723
3693
|
css += (' ' + ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_DROPDOWN : CLS_FONT_COLOR_DROPDOWN));
|
|
3724
|
-
css +=
|
|
3694
|
+
css += this.parent.getCssClass(true);
|
|
3725
3695
|
var content = proxy.parent.createElement('span', { className: CLS_COLOR_CONTENT });
|
|
3726
3696
|
var inlineEle = proxy.parent.createElement('span', { className: args.cssClass });
|
|
3727
3697
|
var range;
|
|
@@ -3793,9 +3763,6 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3793
3763
|
if (focusEle) {
|
|
3794
3764
|
focusEle.focus();
|
|
3795
3765
|
}
|
|
3796
|
-
if (Browser.isDevice) {
|
|
3797
|
-
_this.popupModal(dropDownArgs.element.parentElement);
|
|
3798
|
-
}
|
|
3799
3766
|
_this.pickerRefresh(dropDownArgs);
|
|
3800
3767
|
},
|
|
3801
3768
|
beforeClose: function (dropDownArgs) {
|
|
@@ -3823,22 +3790,6 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3823
3790
|
},
|
|
3824
3791
|
close: function (dropDownArgs) {
|
|
3825
3792
|
proxy.parent.notify(selectionRestore, {});
|
|
3826
|
-
var dropElement = closest(dropDownArgs.element.parentElement, '.e-popup-container');
|
|
3827
|
-
if (dropElement) {
|
|
3828
|
-
dropElement.style.display = 'none';
|
|
3829
|
-
dropElement.lastElementChild.style.display = 'none';
|
|
3830
|
-
removeClass([dropElement.lastElementChild], 'e-popup-overlay');
|
|
3831
|
-
}
|
|
3832
|
-
if (Browser.isDevice && !isNullOrUndefined(dropElement)) {
|
|
3833
|
-
var popupEle = dropElement.querySelector('.e-dropdown-popup.e-tbar-btn.e-control');
|
|
3834
|
-
if (popupEle) {
|
|
3835
|
-
dropElement.parentNode.insertBefore(popupEle, dropElement.nextSibling);
|
|
3836
|
-
popupEle.style.removeProperty('position');
|
|
3837
|
-
removeClass([popupEle], 'e-popup-modal');
|
|
3838
|
-
}
|
|
3839
|
-
detach(dropElement);
|
|
3840
|
-
proxy.popupContainer = undefined;
|
|
3841
|
-
}
|
|
3842
3793
|
}
|
|
3843
3794
|
});
|
|
3844
3795
|
dropDown.isStringTemplate = true;
|
|
@@ -3866,16 +3817,6 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3866
3817
|
popupElem.style.width = (popupElem.offsetWidth - 5).toString() + 'px';
|
|
3867
3818
|
}
|
|
3868
3819
|
};
|
|
3869
|
-
ToolbarRenderer.prototype.popupModal = function (element) {
|
|
3870
|
-
var popupInst = getInstance(element, Popup);
|
|
3871
|
-
popupInst.relateTo = document.body;
|
|
3872
|
-
popupInst.position = { X: 0, Y: 0 };
|
|
3873
|
-
popupInst.targetType = 'container';
|
|
3874
|
-
popupInst.collision = { X: 'fit', Y: 'fit' };
|
|
3875
|
-
popupInst.offsetY = 4;
|
|
3876
|
-
popupInst.dataBind();
|
|
3877
|
-
this.setIsModel(element);
|
|
3878
|
-
};
|
|
3879
3820
|
ToolbarRenderer.prototype.setColorPickerContentWidth = function (colorPicker) {
|
|
3880
3821
|
var colorPickerContent = colorPicker.element.nextSibling;
|
|
3881
3822
|
if (colorPickerContent.style.width === '0px') {
|
|
@@ -3914,7 +3855,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3914
3855
|
args.element.classList.add(CLS_COLOR_PALETTE);
|
|
3915
3856
|
args.element.classList.add(CLS_CUSTOM_TILE);
|
|
3916
3857
|
if (!isNullOrUndefined(_this.parent.cssClass)) {
|
|
3917
|
-
var allClassName = _this.parent.
|
|
3858
|
+
var allClassName = _this.parent.getCssClass().split(' ');
|
|
3918
3859
|
for (var i = 0; i < allClassName.length; i++) {
|
|
3919
3860
|
if (allClassName[i].trim() !== '') {
|
|
3920
3861
|
args.element.classList.add(allClassName[i]);
|
|
@@ -4390,7 +4331,7 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
4390
4331
|
}
|
|
4391
4332
|
});
|
|
4392
4333
|
if (this.parent.inlineMode.enable) {
|
|
4393
|
-
this.setCssClass({ cssClass: this.parent.
|
|
4334
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
4394
4335
|
}
|
|
4395
4336
|
};
|
|
4396
4337
|
DropDownButtons.prototype.getUpdateItems = function (items, value) {
|
|
@@ -4711,7 +4652,9 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
4711
4652
|
this.parent.on(bindCssClass, this.setCssClass, this);
|
|
4712
4653
|
};
|
|
4713
4654
|
DropDownButtons.prototype.onIframeMouseDown = function () {
|
|
4714
|
-
|
|
4655
|
+
if (this.parent.getToolbarElement().querySelectorAll('.e-rte-dropdown-btn[aria-expanded="true"]').length > 0) {
|
|
4656
|
+
dispatchEvent(document, 'mousedown');
|
|
4657
|
+
}
|
|
4715
4658
|
};
|
|
4716
4659
|
DropDownButtons.prototype.removeEventListener = function () {
|
|
4717
4660
|
if (this.parent.isDestroyed) {
|
|
@@ -4932,6 +4875,10 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
4932
4875
|
case 'escape':
|
|
4933
4876
|
this.parent.contentModule.getEditPanel().focus();
|
|
4934
4877
|
break;
|
|
4878
|
+
case 'enter':
|
|
4879
|
+
if (e.target.classList.contains('e-hor-nav')) {
|
|
4880
|
+
this.adjustContentHeight(e.target, true);
|
|
4881
|
+
}
|
|
4935
4882
|
}
|
|
4936
4883
|
};
|
|
4937
4884
|
Toolbar$$1.prototype.createToolbarElement = function () {
|
|
@@ -4987,7 +4934,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
4987
4934
|
items: this.parent.toolbarSettings.items,
|
|
4988
4935
|
mode: tBarMode,
|
|
4989
4936
|
target: ele,
|
|
4990
|
-
cssClass: this.parent.
|
|
4937
|
+
cssClass: this.parent.getCssClass()
|
|
4991
4938
|
});
|
|
4992
4939
|
if (this.parent.toolbarSettings.type === ToolbarType.Expand) {
|
|
4993
4940
|
addClass([ele], ['e-rte-tb-mobile']);
|
|
@@ -5106,7 +5053,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5106
5053
|
items: this.parent.toolbarSettings.items,
|
|
5107
5054
|
mode: this.getToolbarMode(),
|
|
5108
5055
|
target: this.tbElement,
|
|
5109
|
-
cssClass: this.parent.
|
|
5056
|
+
cssClass: this.parent.getCssClass()
|
|
5110
5057
|
});
|
|
5111
5058
|
if (!this.parent.inlineMode.enable) {
|
|
5112
5059
|
if (this.parent.toolbarSettings.enableFloating) {
|
|
@@ -5136,7 +5083,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5136
5083
|
});
|
|
5137
5084
|
this.refreshToolbarOverflow();
|
|
5138
5085
|
}
|
|
5139
|
-
var divEle = this.parent.element.querySelector('.
|
|
5086
|
+
var divEle = this.parent.element.querySelector('.' + CLS_RTE_SOURCE_CODE_TXTAREA);
|
|
5140
5087
|
var iframeEle = this.parent.element.querySelector('.e-source-content');
|
|
5141
5088
|
if ((!this.parent.iframeSettings.enable && (!isNullOrUndefined(divEle) && divEle.style.display === 'block')) ||
|
|
5142
5089
|
(this.parent.iframeSettings.enable && (!isNullOrUndefined(iframeEle) && iframeEle.style.display === 'block'))) {
|
|
@@ -5266,7 +5213,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5266
5213
|
baseToolbar.toolbarObj.enableItems(item, isEnable);
|
|
5267
5214
|
}
|
|
5268
5215
|
}
|
|
5269
|
-
if (!select('.
|
|
5216
|
+
if (!select('.' + CLS_RTE_SOURCE_CODE_TXTAREA, this.parent.element) && !muteToolbarUpdate) {
|
|
5270
5217
|
updateUndoRedoStatus(baseToolbar, this.parent.formatter.editorManager.undoRedoManager.getUndoStatus());
|
|
5271
5218
|
}
|
|
5272
5219
|
};
|
|
@@ -5439,20 +5386,24 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5439
5386
|
};
|
|
5440
5387
|
Toolbar$$1.prototype.toolbarClickHandler = function (e) {
|
|
5441
5388
|
var trg = closest(e.originalEvent.target, '.e-hor-nav');
|
|
5389
|
+
this.adjustContentHeight(trg, false);
|
|
5390
|
+
};
|
|
5391
|
+
Toolbar$$1.prototype.adjustContentHeight = function (trg, isKeyboard) {
|
|
5442
5392
|
if (trg && this.parent.toolbarSettings.type === ToolbarType.Expand && !isNullOrUndefined(trg)) {
|
|
5443
5393
|
var extendedTbar = this.tbElement.querySelector('.e-toolbar-extended');
|
|
5444
5394
|
if (!isNullOrUndefined(extendedTbar)) {
|
|
5445
5395
|
setStyleAttribute(extendedTbar, { maxHeight: '', display: 'block' });
|
|
5446
5396
|
setStyleAttribute(extendedTbar, { maxHeight: extendedTbar.offsetHeight + 'px', display: '' });
|
|
5447
5397
|
}
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5398
|
+
var hasActiveClass = trg.classList.contains('e-nav-active');
|
|
5399
|
+
var isExpand = isKeyboard ? (hasActiveClass ? false : true) : (hasActiveClass ? true : false);
|
|
5400
|
+
if (isExpand) {
|
|
5401
|
+
addClass([this.tbElement], [CLS_EXPAND_OPEN]);
|
|
5451
5402
|
}
|
|
5452
5403
|
else {
|
|
5453
|
-
|
|
5454
|
-
this.parent.setContentHeight('toolbar', true);
|
|
5404
|
+
removeClass([this.tbElement], [CLS_EXPAND_OPEN]);
|
|
5455
5405
|
}
|
|
5406
|
+
this.parent.setContentHeight('toolbar', isExpand);
|
|
5456
5407
|
}
|
|
5457
5408
|
else if (Browser.isDevice || this.parent.inlineMode.enable) {
|
|
5458
5409
|
this.isToolbar = true;
|
|
@@ -5576,7 +5527,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5576
5527
|
this.addEventListener();
|
|
5577
5528
|
this.renderToolbar();
|
|
5578
5529
|
this.parent.wireScrollElementsEvents();
|
|
5579
|
-
if (!select('.
|
|
5530
|
+
if (!select('.' + CLS_RTE_SOURCE_CODE_TXTAREA, this.parent.element)) {
|
|
5580
5531
|
updateUndoRedoStatus(this.baseToolbar, this.parent.formatter.editorManager.undoRedoManager.getUndoStatus());
|
|
5581
5532
|
}
|
|
5582
5533
|
this.parent.notify(dynamicModule, {});
|
|
@@ -5874,7 +5825,7 @@ var ColorPickerInput = /** @__PURE__ @class */ (function () {
|
|
|
5874
5825
|
document.body.appendChild(fontNode);
|
|
5875
5826
|
options = {
|
|
5876
5827
|
cssClass: _this.tools[item.toLocaleLowerCase()].icon
|
|
5877
|
-
+ ' ' + CLS_RTE_ELEMENTS + ' ' + CLS_ICONS +
|
|
5828
|
+
+ ' ' + CLS_RTE_ELEMENTS + ' ' + CLS_ICONS + _this.parent.getCssClass(true),
|
|
5878
5829
|
value: _this.tools[item.toLocaleLowerCase()].value,
|
|
5879
5830
|
command: _this.tools[item.toLocaleLowerCase()].command,
|
|
5880
5831
|
subCommand: _this.tools[item.toLocaleLowerCase()].subCommand,
|
|
@@ -5901,7 +5852,7 @@ var ColorPickerInput = /** @__PURE__ @class */ (function () {
|
|
|
5901
5852
|
document.body.appendChild(backNode);
|
|
5902
5853
|
options = {
|
|
5903
5854
|
cssClass: _this.tools[item.toLocaleLowerCase()].icon
|
|
5904
|
-
+ ' ' + CLS_RTE_ELEMENTS + ' ' + CLS_ICONS +
|
|
5855
|
+
+ ' ' + CLS_RTE_ELEMENTS + ' ' + CLS_ICONS + _this.parent.getCssClass(true),
|
|
5905
5856
|
value: _this.tools[item.toLocaleLowerCase()].value,
|
|
5906
5857
|
command: _this.tools[item.toLocaleLowerCase()].command,
|
|
5907
5858
|
subCommand: _this.tools[item.toLocaleLowerCase()].subCommand,
|
|
@@ -5916,7 +5867,7 @@ var ColorPickerInput = /** @__PURE__ @class */ (function () {
|
|
|
5916
5867
|
}
|
|
5917
5868
|
});
|
|
5918
5869
|
if (this.parent.inlineMode.enable) {
|
|
5919
|
-
this.setCssClass({ cssClass: this.parent.
|
|
5870
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
5920
5871
|
}
|
|
5921
5872
|
};
|
|
5922
5873
|
ColorPickerInput.prototype.destroy = function () {
|
|
@@ -6079,6 +6030,9 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6079
6030
|
}
|
|
6080
6031
|
BaseQuickToolbar.prototype.appendPopupContent = function () {
|
|
6081
6032
|
this.toolbarElement = this.parent.createElement('div', { className: CLS_QUICK_TB });
|
|
6033
|
+
if (this.element.classList.contains(CLS_TEXT_POP)) {
|
|
6034
|
+
this.toolbarElement.classList.add(CLS_TEXT_QUICK_TB);
|
|
6035
|
+
}
|
|
6082
6036
|
this.element.appendChild(this.toolbarElement);
|
|
6083
6037
|
};
|
|
6084
6038
|
/**
|
|
@@ -6271,7 +6225,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6271
6225
|
editPanelTop = (cntEle) ? cntEle.scrollTop : 0;
|
|
6272
6226
|
editPanelHeight = (cntEle) ? cntEle.offsetHeight : 0;
|
|
6273
6227
|
}
|
|
6274
|
-
if (!_this.parent.inlineMode.enable && !closest(target, 'table') && type !== 'text') {
|
|
6228
|
+
if ((!_this.parent.inlineMode.enable && !closest(target, 'table') && type !== 'text' && type !== 'link') || target.tagName === 'IMG') {
|
|
6275
6229
|
_this.parent.disableToolbarItem(_this.parent.toolbarSettings.items);
|
|
6276
6230
|
_this.parent.enableToolbarItem(['Undo', 'Redo']);
|
|
6277
6231
|
}
|
|
@@ -6414,7 +6368,18 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6414
6368
|
tbItems: this.quickTBarObj.toolbarObj.items
|
|
6415
6369
|
};
|
|
6416
6370
|
setToolbarStatus(options, true, this.parent);
|
|
6417
|
-
if (
|
|
6371
|
+
if (this.parent.quickToolbarSettings.text && this.parent.quickToolbarModule.textQTBar) {
|
|
6372
|
+
var options_1 = {
|
|
6373
|
+
args: args,
|
|
6374
|
+
dropDownModule: this.parent.quickToolbarModule.textQTBar.dropDownButtons,
|
|
6375
|
+
parent: this.parent,
|
|
6376
|
+
tbElements: selectAll('.' + CLS_TB_ITEM, this.parent.quickToolbarModule.textQTBar.element),
|
|
6377
|
+
tbItems: this.parent.quickToolbarModule.textQTBar.quickTBarObj.toolbarObj.items
|
|
6378
|
+
};
|
|
6379
|
+
setToolbarStatus(options_1, true, this.parent);
|
|
6380
|
+
updateUndoRedoStatus(this.parent.quickToolbarModule.textQTBar.quickTBarObj, this.parent.formatter.editorManager.undoRedoManager.getUndoStatus());
|
|
6381
|
+
}
|
|
6382
|
+
if (!select('.' + CLS_RTE_SOURCE_CODE_TXTAREA, this.parent.element)) {
|
|
6418
6383
|
updateUndoRedoStatus(this.parent.getBaseToolbarObject(), this.parent.formatter.editorManager.undoRedoManager.getUndoStatus());
|
|
6419
6384
|
}
|
|
6420
6385
|
};
|
|
@@ -6446,7 +6411,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6446
6411
|
}
|
|
6447
6412
|
this.parent.on(destroy, this.destroy, this);
|
|
6448
6413
|
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
|
6449
|
-
if (this.parent.inlineMode.enable) {
|
|
6414
|
+
if (this.parent.inlineMode.enable || this.parent.quickToolbarSettings.text) {
|
|
6450
6415
|
this.parent.on(toolbarUpdated, this.updateStatus, this);
|
|
6451
6416
|
}
|
|
6452
6417
|
};
|
|
@@ -6488,7 +6453,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6488
6453
|
}
|
|
6489
6454
|
this.parent.off(destroy, this.destroy);
|
|
6490
6455
|
this.parent.off(modelChanged, this.onPropertyChanged);
|
|
6491
|
-
if (this.parent.inlineMode.enable) {
|
|
6456
|
+
if (this.parent.inlineMode.enable || this.parent.quickToolbarSettings.text) {
|
|
6492
6457
|
this.parent.off(toolbarUpdated, this.updateStatus);
|
|
6493
6458
|
}
|
|
6494
6459
|
};
|
|
@@ -6609,7 +6574,7 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6609
6574
|
toolbarItems: items,
|
|
6610
6575
|
mode: mode,
|
|
6611
6576
|
renderType: type,
|
|
6612
|
-
cssClass: this.parent.
|
|
6577
|
+
cssClass: this.parent.getCssClass()
|
|
6613
6578
|
};
|
|
6614
6579
|
};
|
|
6615
6580
|
/**
|
|
@@ -6823,6 +6788,9 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6823
6788
|
&& !isNullOrUndefined(select('.' + CLS_INLINE_POP, document))) {
|
|
6824
6789
|
this.hideInlineQTBar();
|
|
6825
6790
|
}
|
|
6791
|
+
if (this.textQTBar && !hasClass(this.textQTBar.element, 'e-popup-close')) {
|
|
6792
|
+
this.textQTBar.hidePopup();
|
|
6793
|
+
}
|
|
6826
6794
|
};
|
|
6827
6795
|
QuickToolbar.prototype.inlineQTBarMouseDownHandler = function () {
|
|
6828
6796
|
if ((this.parent.inlineMode.enable && (!Browser.isDevice || isIDevice()))
|
|
@@ -6836,8 +6804,8 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6836
6804
|
}
|
|
6837
6805
|
};
|
|
6838
6806
|
QuickToolbar.prototype.keyUpHandler = function (e) {
|
|
6807
|
+
var args = e.args;
|
|
6839
6808
|
if (this.parent.inlineMode.enable && !Browser.isDevice) {
|
|
6840
|
-
var args = e.args;
|
|
6841
6809
|
if (this.parent.inlineMode.onSelection) {
|
|
6842
6810
|
if (this.parent.getSelection().length > 0) {
|
|
6843
6811
|
if ((args.ctrlKey && args.keyCode === 65) || (args.shiftKey && (args.keyCode === 33 || args.keyCode === 34 ||
|
|
@@ -6850,6 +6818,13 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6850
6818
|
}
|
|
6851
6819
|
this.deBounce(this.offsetX, this.offsetY, args.target);
|
|
6852
6820
|
}
|
|
6821
|
+
if (this.parent.quickToolbarSettings.text && !Browser.isDevice) {
|
|
6822
|
+
if ((args.ctrlKey && args.keyCode === 65) || (args.shiftKey && (args.keyCode === 33 || args.keyCode === 34 ||
|
|
6823
|
+
args.keyCode === 35 || args.keyCode === 36 || args.keyCode === 37 || args.keyCode === 38 ||
|
|
6824
|
+
args.keyCode === 39 || args.keyCode === 40))) {
|
|
6825
|
+
this.textQTBar.showPopup(this.offsetX, this.offsetY, args.target, 'text');
|
|
6826
|
+
}
|
|
6827
|
+
}
|
|
6853
6828
|
};
|
|
6854
6829
|
QuickToolbar.prototype.selectionChangeHandler = function (e) {
|
|
6855
6830
|
var _this = this;
|
|
@@ -7009,6 +6984,15 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7009
6984
|
if (this.videoQTBar && !hasClass(this.videoQTBar.element, 'e-popup-close')) {
|
|
7010
6985
|
this.videoQTBar.hidePopup();
|
|
7011
6986
|
}
|
|
6987
|
+
if (this.tableQTBar && !hasClass(this.tableQTBar.element, 'e-popup-close')) {
|
|
6988
|
+
this.tableQTBar.hidePopup();
|
|
6989
|
+
}
|
|
6990
|
+
if (this.linkQTBar && !hasClass(this.linkQTBar.element, 'e-popup-close')) {
|
|
6991
|
+
this.linkQTBar.hidePopup();
|
|
6992
|
+
}
|
|
6993
|
+
if (this.textQTBar && !hasClass(this.textQTBar.element, 'e-popup-close')) {
|
|
6994
|
+
this.textQTBar.hidePopup();
|
|
6995
|
+
}
|
|
7012
6996
|
}
|
|
7013
6997
|
};
|
|
7014
6998
|
QuickToolbar.prototype.onIframeMouseDown = function () {
|
|
@@ -7061,6 +7045,9 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7061
7045
|
* @deprecated
|
|
7062
7046
|
*/
|
|
7063
7047
|
QuickToolbar.prototype.removeEventListener = function () {
|
|
7048
|
+
if (this.deBouncer) {
|
|
7049
|
+
clearTimeout(this.deBouncer);
|
|
7050
|
+
}
|
|
7064
7051
|
if (this.parent.isDestroyed) {
|
|
7065
7052
|
return;
|
|
7066
7053
|
}
|
|
@@ -7081,9 +7068,6 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7081
7068
|
this.parent.off(rtlMode, this.setRtl);
|
|
7082
7069
|
this.parent.off(bindCssClass, this.setCssClass);
|
|
7083
7070
|
this.parent.off(hidePopup, this.hideQuickToolbars);
|
|
7084
|
-
if (this.deBouncer) {
|
|
7085
|
-
clearTimeout(this.deBouncer);
|
|
7086
|
-
}
|
|
7087
7071
|
};
|
|
7088
7072
|
/**
|
|
7089
7073
|
* Called internally if any of the property value changed.
|
|
@@ -7963,7 +7947,7 @@ var Formatter = /** @__PURE__ @class */ (function () {
|
|
|
7963
7947
|
if (args.item.command === 'Images' || args.item.command === 'Videos' || args.item.command === 'Table' || args.item.command === 'Files') {
|
|
7964
7948
|
currentInsertContentLength = 1;
|
|
7965
7949
|
}
|
|
7966
|
-
var currentLength = self.getText().trim().length;
|
|
7950
|
+
var currentLength = self.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
7967
7951
|
var selectionLength = self.getSelection().length;
|
|
7968
7952
|
var totalLength = (currentLength - selectionLength) + currentInsertContentLength;
|
|
7969
7953
|
if (!(self.maxLength === -1 || totalLength <= self.maxLength)) {
|
|
@@ -9274,7 +9258,7 @@ var htmlKeyConfig = {
|
|
|
9274
9258
|
'insert-link': 'ctrl+k',
|
|
9275
9259
|
'insert-image': 'ctrl+shift+i',
|
|
9276
9260
|
'insert-audio': 'ctrl+shift+a',
|
|
9277
|
-
'insert-video': 'ctrl+
|
|
9261
|
+
'insert-video': 'ctrl+alt+v',
|
|
9278
9262
|
'insert-table': 'ctrl+shift+e',
|
|
9279
9263
|
'undo': 'ctrl+z',
|
|
9280
9264
|
'redo': 'ctrl+y',
|
|
@@ -11413,19 +11397,6 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
11413
11397
|
var end = this.parent.querySelector('.' + markerClassName.endSelection);
|
|
11414
11398
|
var startTextNode;
|
|
11415
11399
|
var endTextNode;
|
|
11416
|
-
if (start.textContent === '' && isNullOrUndefined(end) && action !== 'tab') {
|
|
11417
|
-
// To Do Apply Heading and Back space press in empty content.
|
|
11418
|
-
// if (isNOU(action) && save.range.startContainer.nodeType === 1 &&
|
|
11419
|
-
// (save.range.startContainer as HTMLElement).querySelectorAll('audio,video,image').length === 0) {
|
|
11420
|
-
// start.innerHTML = '<br>';
|
|
11421
|
-
// }
|
|
11422
|
-
if (start.childNodes.length === 1 && start.childNodes[0].nodeName === 'BR') {
|
|
11423
|
-
start.innerHTML = '<br>';
|
|
11424
|
-
}
|
|
11425
|
-
else {
|
|
11426
|
-
start.innerHTML = '';
|
|
11427
|
-
}
|
|
11428
|
-
}
|
|
11429
11400
|
if (this.hasClass(start, markerClassName.startSelection) && start.classList.length > 1) {
|
|
11430
11401
|
var replace = this.createTagString(DEFAULT_TAG, start, this.encode(start.textContent));
|
|
11431
11402
|
this.replaceWith(start, replace);
|
|
@@ -11548,7 +11519,7 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
11548
11519
|
else if (start.tagName === 'BR') {
|
|
11549
11520
|
this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
|
|
11550
11521
|
var markerStart = range.startContainer.querySelector('.' + className);
|
|
11551
|
-
markerStart.appendChild(start);
|
|
11522
|
+
markerStart.parentElement.appendChild(start);
|
|
11552
11523
|
}
|
|
11553
11524
|
else {
|
|
11554
11525
|
if (start.tagName === 'IMG') {
|
|
@@ -12861,7 +12832,7 @@ var NodeCutter = /** @__PURE__ @class */ (function () {
|
|
|
12861
12832
|
if ((indexes.indexOf(range.startOffset) >= 0)
|
|
12862
12833
|
|| ((indexes.indexOf(range.startOffset - 1) >= 0) && (range.startOffset !== 1
|
|
12863
12834
|
|| (range.startOffset === 1 && new RegExp('\\s').test(str[0])))
|
|
12864
|
-
|| ((indexes[indexes.length - 1] - 1) === range.startOffset))) {
|
|
12835
|
+
|| (((indexes[indexes.length - 1] - 1) === range.startOffset) && !new RegExp('\\s').test(str[0])))) {
|
|
12865
12836
|
cursorRange = range;
|
|
12866
12837
|
this.position = 1;
|
|
12867
12838
|
}
|
|
@@ -13384,6 +13355,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
13384
13355
|
InsertMethods.AppendBefore(node, parentNode.firstChild, false);
|
|
13385
13356
|
}
|
|
13386
13357
|
}
|
|
13358
|
+
else if (isNullOrUndefined(preNode.previousSibling) && insertNode.tagName === 'TABLE') {
|
|
13359
|
+
parentNode.prepend(node);
|
|
13360
|
+
}
|
|
13387
13361
|
else {
|
|
13388
13362
|
parentNode.appendChild(node);
|
|
13389
13363
|
}
|
|
@@ -13561,7 +13535,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
13561
13535
|
(this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0 && isFirstTextNode)) {
|
|
13562
13536
|
lastSelectionNode = node.firstChild;
|
|
13563
13537
|
if (isNullOrUndefined(node.previousElementSibling)) {
|
|
13564
|
-
var firstParaElm = createElement('p');
|
|
13538
|
+
var firstParaElm = enterAction === 'DIV' ? createElement('div') : createElement('p');
|
|
13565
13539
|
node.parentElement.insertBefore(firstParaElm, node);
|
|
13566
13540
|
}
|
|
13567
13541
|
if (node.previousElementSibling.nodeName === 'BR') {
|
|
@@ -13576,7 +13550,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
13576
13550
|
if (node.firstChild.nodeName === '#text' ||
|
|
13577
13551
|
(this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
|
|
13578
13552
|
if (!isPreviousInlineElem) {
|
|
13579
|
-
paraElm = createElement('p');
|
|
13553
|
+
paraElm = enterAction === 'DIV' ? createElement('div') : createElement('p');
|
|
13580
13554
|
paraElm.appendChild(node.firstChild);
|
|
13581
13555
|
fragment.appendChild(paraElm);
|
|
13582
13556
|
}
|
|
@@ -14439,8 +14413,8 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
14439
14413
|
e.item.url = isNullOrUndefined(e.item.url) || e.item.url === 'undefined' ? e.item.src : e.item.url;
|
|
14440
14414
|
if (!isNullOrUndefined(e.item.selectParent) && e.item.selectParent[0].tagName === 'IMG') {
|
|
14441
14415
|
var imgEle = e.item.selectParent[0];
|
|
14442
|
-
this.setStyle(imgEle, e);
|
|
14443
14416
|
isReplaced = true;
|
|
14417
|
+
this.setStyle(imgEle, e, isReplaced);
|
|
14444
14418
|
}
|
|
14445
14419
|
else {
|
|
14446
14420
|
var imgElement = createElement('img');
|
|
@@ -14476,12 +14450,33 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
14476
14450
|
}
|
|
14477
14451
|
});
|
|
14478
14452
|
}
|
|
14453
|
+
if (e.value === 'Replace') {
|
|
14454
|
+
e.item.subCommand = 'Replace';
|
|
14455
|
+
this.callBack(e);
|
|
14456
|
+
}
|
|
14479
14457
|
};
|
|
14480
|
-
ImageCommand.prototype.setStyle = function (imgElement, e) {
|
|
14458
|
+
ImageCommand.prototype.setStyle = function (imgElement, e, imgReplace) {
|
|
14481
14459
|
if (!isNullOrUndefined(e.item.url)) {
|
|
14482
14460
|
imgElement.setAttribute('src', e.item.url);
|
|
14483
14461
|
}
|
|
14484
|
-
|
|
14462
|
+
var alignClassName;
|
|
14463
|
+
if (imgReplace) {
|
|
14464
|
+
var alignClass = {
|
|
14465
|
+
'e-imgcenter': 'e-imgcenter',
|
|
14466
|
+
'e-imgright': 'e-imgright',
|
|
14467
|
+
'e-imgleft': 'e-imgleft'
|
|
14468
|
+
};
|
|
14469
|
+
var imgClassList = imgElement.classList;
|
|
14470
|
+
for (var i = 0; i < imgClassList.length; i++) {
|
|
14471
|
+
// eslint-disable-next-line
|
|
14472
|
+
if (!isNullOrUndefined(alignClass[imgClassList[i]])) {
|
|
14473
|
+
// eslint-disable-next-line
|
|
14474
|
+
alignClassName = alignClass[imgClassList[i]];
|
|
14475
|
+
}
|
|
14476
|
+
}
|
|
14477
|
+
}
|
|
14478
|
+
imgElement.setAttribute('class', 'e-rte-image' + (isNullOrUndefined(e.item.cssClass) ? '' : ' ' + e.item.cssClass)
|
|
14479
|
+
+ (isNullOrUndefined(alignClassName) ? '' : ' ' + alignClassName));
|
|
14485
14480
|
if (!isNullOrUndefined(e.item.altText)) {
|
|
14486
14481
|
imgElement.setAttribute('alt', e.item.altText);
|
|
14487
14482
|
}
|
|
@@ -14533,6 +14528,9 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
14533
14528
|
if (!isNullOrUndefined(e.item.target)) {
|
|
14534
14529
|
anchor.setAttribute('target', e.item.target);
|
|
14535
14530
|
}
|
|
14531
|
+
if (!isNullOrUndefined(e.item.ariaLabel)) {
|
|
14532
|
+
anchor.setAttribute('aria-label', e.item.ariaLabel);
|
|
14533
|
+
}
|
|
14536
14534
|
InsertHtml.Insert(this.parent.currentDocument, anchor, this.parent.editableElement);
|
|
14537
14535
|
this.callBack(e);
|
|
14538
14536
|
};
|
|
@@ -14564,9 +14562,11 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
14564
14562
|
e.item.selectNode[0].parentElement.href = e.item.url;
|
|
14565
14563
|
if (isNullOrUndefined(e.item.target)) {
|
|
14566
14564
|
e.item.selectNode[0].parentElement.removeAttribute('target');
|
|
14565
|
+
e.item.selectNode[0].parentElement.removeAttribute('aria-label');
|
|
14567
14566
|
}
|
|
14568
14567
|
else {
|
|
14569
14568
|
e.item.selectNode[0].parentElement.target = e.item.target;
|
|
14569
|
+
e.item.selectNode[0].parentElement.ariaLabel = e.item.ariaLabel;
|
|
14570
14570
|
}
|
|
14571
14571
|
this.callBack(e);
|
|
14572
14572
|
};
|
|
@@ -14833,9 +14833,19 @@ var AudioCommand = /** @__PURE__ @class */ (function () {
|
|
|
14833
14833
|
if (!isNullOrUndefined(e.item.url)) {
|
|
14834
14834
|
sourceElement.setAttribute('src', e.item.url);
|
|
14835
14835
|
}
|
|
14836
|
-
|
|
14837
|
-
|
|
14838
|
-
|
|
14836
|
+
var fileExtension = e.item.fileName ? e.item.fileName.split('.').pop().toLowerCase() :
|
|
14837
|
+
e.item.url ? e.item.url.split('.').pop().toLowerCase() : '';
|
|
14838
|
+
if (fileExtension === 'opus') {
|
|
14839
|
+
sourceElement.type = 'audio/ogg';
|
|
14840
|
+
}
|
|
14841
|
+
else if (fileExtension === 'm4a') {
|
|
14842
|
+
sourceElement.type = 'audio/mp4';
|
|
14843
|
+
}
|
|
14844
|
+
else {
|
|
14845
|
+
sourceElement.type = e.item.fileName && e.item.fileName.split('.').length > 0 ?
|
|
14846
|
+
'audio/' + e.item.fileName.split('.')[e.item.fileName.split('.').length - 1] :
|
|
14847
|
+
e.item.url && e.item.url.split('.').length > 0 ? 'audio/' + e.item.url.split('.')[e.item.url.split('.').length - 1] : '';
|
|
14848
|
+
}
|
|
14839
14849
|
};
|
|
14840
14850
|
AudioCommand.prototype.callBack = function (e) {
|
|
14841
14851
|
if (e.callBack) {
|
|
@@ -16589,6 +16599,19 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
16589
16599
|
}
|
|
16590
16600
|
else {
|
|
16591
16601
|
child = InsertMethods.unwrap(formatNode);
|
|
16602
|
+
var liElement = nodes[index].parentElement;
|
|
16603
|
+
if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() !== 'li') {
|
|
16604
|
+
liElement = closest(liElement, 'li');
|
|
16605
|
+
}
|
|
16606
|
+
if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
16607
|
+
liElement.textContent.trim() === nodes[index].textContent.trim()) {
|
|
16608
|
+
if (format === 'bold') {
|
|
16609
|
+
liElement.style.fontWeight = 'normal';
|
|
16610
|
+
}
|
|
16611
|
+
else if (format === "italic") {
|
|
16612
|
+
liElement.style.fontStyle = 'normal';
|
|
16613
|
+
}
|
|
16614
|
+
}
|
|
16592
16615
|
}
|
|
16593
16616
|
if (child[0] && !isFontStyle) {
|
|
16594
16617
|
var nodeTraverse = child[index] ? child[index] : child[0];
|
|
@@ -16637,6 +16660,16 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
16637
16660
|
if (child[num].nodeType !== 3 || (child[num].textContent &&
|
|
16638
16661
|
child[num].textContent.trim().length > 0)) {
|
|
16639
16662
|
child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
|
|
16663
|
+
var liElement = nodes[index].parentElement;
|
|
16664
|
+
if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() !== 'li') {
|
|
16665
|
+
liElement = closest(liElement, 'li');
|
|
16666
|
+
}
|
|
16667
|
+
if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
16668
|
+
liElement.textContent.trim() === nodes[index].textContent.trim()) {
|
|
16669
|
+
if (format === 'fontname') {
|
|
16670
|
+
liElement.style.fontFamily = value;
|
|
16671
|
+
}
|
|
16672
|
+
}
|
|
16640
16673
|
if (child[num].textContent === startText) {
|
|
16641
16674
|
if (num === 0) {
|
|
16642
16675
|
range.setStartBefore(child[num]);
|
|
@@ -16750,6 +16783,9 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
16750
16783
|
liElement.style.color = value;
|
|
16751
16784
|
liElement.style.textDecoration = 'inherit';
|
|
16752
16785
|
}
|
|
16786
|
+
else if (format === 'fontname') {
|
|
16787
|
+
liElement.style.fontFamily = value;
|
|
16788
|
+
}
|
|
16753
16789
|
}
|
|
16754
16790
|
if (value === 'formatPainter') {
|
|
16755
16791
|
return this.insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode);
|
|
@@ -16797,6 +16833,19 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
16797
16833
|
}
|
|
16798
16834
|
else {
|
|
16799
16835
|
nodes[index] = this.applyStyles(nodes, index, element);
|
|
16836
|
+
var liElement = nodes[index].parentElement;
|
|
16837
|
+
if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() !== 'li') {
|
|
16838
|
+
liElement = closest(liElement, 'li');
|
|
16839
|
+
}
|
|
16840
|
+
if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
16841
|
+
liElement.textContent.trim() === nodes[index].textContent.trim()) {
|
|
16842
|
+
if (format === 'bold') {
|
|
16843
|
+
liElement.style.fontWeight = 'bold';
|
|
16844
|
+
}
|
|
16845
|
+
else if (format === "italic") {
|
|
16846
|
+
liElement.style.fontStyle = 'italic';
|
|
16847
|
+
}
|
|
16848
|
+
}
|
|
16800
16849
|
}
|
|
16801
16850
|
}
|
|
16802
16851
|
}
|
|
@@ -18128,6 +18177,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
18128
18177
|
resultElem = elm.querySelectorAll(keys[i]);
|
|
18129
18178
|
}
|
|
18130
18179
|
for (var j = 0; j < resultElem.length; j++) {
|
|
18180
|
+
if (resultElem[j].closest('li') && keys[i] === 'p') {
|
|
18181
|
+
continue;
|
|
18182
|
+
}
|
|
18131
18183
|
var styleProperty = resultElem[j].getAttribute('style');
|
|
18132
18184
|
if (!isNullOrUndefined(styleProperty) && styleProperty.trim() !== '') {
|
|
18133
18185
|
var valueSplit = values[i].split(';');
|
|
@@ -18426,7 +18478,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
18426
18478
|
!isNormalList) {
|
|
18427
18479
|
prevList = null;
|
|
18428
18480
|
}
|
|
18429
|
-
var pElement = createElement('p');
|
|
18481
|
+
var pElement = createElement('p', { className: 'MsoNormal' });
|
|
18430
18482
|
pElement.innerHTML = collection[index].content.join(' ');
|
|
18431
18483
|
if ((collection[index].nestedLevel === 1) && listCount === 0 && collection[index].content) {
|
|
18432
18484
|
root.appendChild(temp = createElement(collection[index].listType, { className: collection[index].class }));
|
|
@@ -20530,7 +20582,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
20530
20582
|
e.args.keyCode === 13) {
|
|
20531
20583
|
this.spaceLink(e.args);
|
|
20532
20584
|
if (this.parent.editorMode === 'HTML' && !this.parent.readonly) {
|
|
20533
|
-
var currentLength = this.parent.getText().trim().length;
|
|
20585
|
+
var currentLength = this.parent.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
20534
20586
|
var selectionLength = this.parent.getSelection().length;
|
|
20535
20587
|
var totalLength = (currentLength - selectionLength) + 1;
|
|
20536
20588
|
if (!(this.parent.maxLength === -1 || totalLength <= this.parent.maxLength) &&
|
|
@@ -20540,6 +20592,10 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
20540
20592
|
}
|
|
20541
20593
|
else {
|
|
20542
20594
|
this.parent.notify(enterHandler, { args: e.args });
|
|
20595
|
+
var newRange = this.parent.getRange();
|
|
20596
|
+
if (!isNullOrUndefined(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text') {
|
|
20597
|
+
newRange.startContainer.scrollIntoView({ block: "end", inline: "nearest" });
|
|
20598
|
+
}
|
|
20543
20599
|
}
|
|
20544
20600
|
}
|
|
20545
20601
|
}
|
|
@@ -20688,7 +20744,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
20688
20744
|
var liElement;
|
|
20689
20745
|
var rootElement;
|
|
20690
20746
|
if (e.args.code === 'Delete' && e.args.keyCode === 46 &&
|
|
20691
|
-
this.parent.contentModule.getText().trim().length !== 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.parentElement.tagName !== 'TD' &&
|
|
20747
|
+
this.parent.contentModule.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length !== 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.parentElement.tagName !== 'TD' &&
|
|
20692
20748
|
currentRange.startContainer.parentElement.tagName !== 'TH') {
|
|
20693
20749
|
this.deleteRangeElement = rootElement = this.getRootBlockNode(currentRange.startContainer);
|
|
20694
20750
|
if (this.deleteRangeElement.tagName === 'OL' || this.deleteRangeElement.tagName === 'UL') {
|
|
@@ -20736,8 +20792,13 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
20736
20792
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.deleteRangeElement, this.deleteRangeElement.childNodes.length);
|
|
20737
20793
|
this.isImageDelete = false;
|
|
20738
20794
|
}
|
|
20739
|
-
|
|
20740
|
-
|
|
20795
|
+
var brNode = this.deleteRangeElement.querySelector('BR');
|
|
20796
|
+
if (brNode && brNode.classList.contains('e-rte-image-remove-focus')) {
|
|
20797
|
+
removeClass([brNode], ['e-rte-image-focus']);
|
|
20798
|
+
return;
|
|
20799
|
+
}
|
|
20800
|
+
else if (brNode) {
|
|
20801
|
+
detach(brNode);
|
|
20741
20802
|
}
|
|
20742
20803
|
if (!isNullOrUndefined(this.deleteRangeElement) && (this.deleteOldRangeElement.tagName !== 'OL' && this.deleteOldRangeElement.tagName !== 'UL')
|
|
20743
20804
|
&& this.deleteOldRangeElement !== this.deleteRangeElement) {
|
|
@@ -20898,6 +20959,19 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
20898
20959
|
}, e, value);
|
|
20899
20960
|
}
|
|
20900
20961
|
};
|
|
20962
|
+
HtmlEditor.prototype.mouseOutHandler = function () {
|
|
20963
|
+
if (!isNullOrUndefined(this.tooltipTargetEle)) {
|
|
20964
|
+
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
20965
|
+
}
|
|
20966
|
+
else {
|
|
20967
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
20968
|
+
this.parent.contentModule.getDocument();
|
|
20969
|
+
this.tooltipTargetEle = currentDocument.querySelector('[data-title]');
|
|
20970
|
+
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
20971
|
+
}
|
|
20972
|
+
this.tooltipTargetEle.removeAttribute('data-title');
|
|
20973
|
+
EventHandler.remove(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler);
|
|
20974
|
+
};
|
|
20901
20975
|
HtmlEditor.prototype.onToolbarClick = function (args) {
|
|
20902
20976
|
var _this = this;
|
|
20903
20977
|
var save;
|
|
@@ -20905,6 +20979,15 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
20905
20979
|
var selectParentEle;
|
|
20906
20980
|
var item = args.item;
|
|
20907
20981
|
var closestElement = closest(args.originalEvent.target, '.e-rte-quick-popup');
|
|
20982
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
20983
|
+
this.parent.contentModule.getDocument();
|
|
20984
|
+
this.tooltipTargetEle = closest(args.originalEvent.target, '[data-tooltip-id]');
|
|
20985
|
+
if (!isNullOrUndefined(this.tooltipTargetEle) && this.parent.showTooltip && !isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
20986
|
+
this.parent.notify(destroyTooltip, { args: event });
|
|
20987
|
+
this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
|
|
20988
|
+
this.tooltipTargetEle.removeAttribute('title');
|
|
20989
|
+
EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
|
|
20990
|
+
}
|
|
20908
20991
|
if (item.command !== 'FormatPainter') {
|
|
20909
20992
|
if (closestElement && !closestElement.classList.contains('e-rte-inline-popup') && !closestElement.classList.contains('e-rte-text-popup')) {
|
|
20910
20993
|
if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
|
|
@@ -21217,6 +21300,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21217
21300
|
event: e
|
|
21218
21301
|
};
|
|
21219
21302
|
var value = null;
|
|
21303
|
+
var isClipboardHTMLDataNull = false;
|
|
21220
21304
|
var imageproperties;
|
|
21221
21305
|
if (e.args && !isNullOrUndefined(e.args.clipboardData)) {
|
|
21222
21306
|
value = e.args.clipboardData.getData('text/html');
|
|
@@ -21255,6 +21339,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21255
21339
|
var divElement = this.parent.createElement('div');
|
|
21256
21340
|
divElement.innerHTML = this.splitBreakLine(value);
|
|
21257
21341
|
value = divElement.innerHTML;
|
|
21342
|
+
isClipboardHTMLDataNull = true;
|
|
21258
21343
|
}
|
|
21259
21344
|
}
|
|
21260
21345
|
else if (value.length > 0) {
|
|
@@ -21276,10 +21361,16 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21276
21361
|
tempDivElem.innerHTML = value;
|
|
21277
21362
|
var isValueNotEmpty = tempDivElem.textContent !== '' || !isNullOrUndefined(tempDivElem.querySelector('img')) ||
|
|
21278
21363
|
!isNullOrUndefined(tempDivElem.querySelector('table'));
|
|
21364
|
+
this.parent.notify(cleanupResizeElements, {
|
|
21365
|
+
value: value,
|
|
21366
|
+
callBack: function (currentValue) {
|
|
21367
|
+
value = currentValue;
|
|
21368
|
+
}
|
|
21369
|
+
});
|
|
21279
21370
|
if (this.parent.pasteCleanupSettings.prompt) {
|
|
21280
21371
|
if (isValueNotEmpty) {
|
|
21281
21372
|
e.args.preventDefault();
|
|
21282
|
-
this.pasteDialog(value, args);
|
|
21373
|
+
this.pasteDialog(value, args, isClipboardHTMLDataNull);
|
|
21283
21374
|
}
|
|
21284
21375
|
else if (Browser.userAgent.indexOf('Firefox') !== -1 && isNullOrUndefined(file)) {
|
|
21285
21376
|
this.fireFoxImageUpload();
|
|
@@ -21291,7 +21382,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21291
21382
|
}
|
|
21292
21383
|
else if (this.parent.pasteCleanupSettings.plainText) {
|
|
21293
21384
|
e.args.preventDefault();
|
|
21294
|
-
this.plainFormatting(value, args);
|
|
21385
|
+
this.plainFormatting(value, args, isClipboardHTMLDataNull);
|
|
21295
21386
|
}
|
|
21296
21387
|
else if (this.parent.pasteCleanupSettings.keepFormat) {
|
|
21297
21388
|
e.args.preventDefault();
|
|
@@ -21333,13 +21424,17 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21333
21424
|
PasteCleanup.prototype.splitBreakLine = function (value) {
|
|
21334
21425
|
var enterSplitText = value.split('\n');
|
|
21335
21426
|
var contentInnerElem = '';
|
|
21427
|
+
var startNode = this.parent.enterKey === 'P' ? '<p>' : (this.parent.enterKey === 'DIV' ? '<div>' : '');
|
|
21428
|
+
var endNode = this.parent.enterKey === 'P' ? '</p>' : (this.parent.enterKey === 'DIV' ? '</div>' : '<br>');
|
|
21336
21429
|
for (var i = 0; i < enterSplitText.length; i++) {
|
|
21337
21430
|
if (enterSplitText[i].trim() === '') {
|
|
21338
21431
|
contentInnerElem += getDefaultValue(this.parent);
|
|
21339
21432
|
}
|
|
21340
21433
|
else {
|
|
21341
21434
|
var contentWithSpace = this.makeSpace(enterSplitText[i]);
|
|
21342
|
-
contentInnerElem += '<
|
|
21435
|
+
contentInnerElem += (i === 0 && this.parent.enterKey !== 'BR' ? '<span>' : startNode) +
|
|
21436
|
+
(contentWithSpace.trim() === '' ? '<br>' : contentWithSpace.trim()) +
|
|
21437
|
+
(enterSplitText.length - 1 === i && this.parent.enterKey === 'BR' ? '' : (i === 0 && this.parent.enterKey !== 'BR' ? '</span>' : endNode));
|
|
21343
21438
|
}
|
|
21344
21439
|
}
|
|
21345
21440
|
return contentInnerElem;
|
|
@@ -21605,10 +21700,10 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21605
21700
|
var range = this.nodeSelectionObj.getRange(currentDocument);
|
|
21606
21701
|
this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
|
|
21607
21702
|
if (this.parent.pasteCleanupSettings.prompt) {
|
|
21608
|
-
this.pasteDialog(imageValue, pasteArgs);
|
|
21703
|
+
this.pasteDialog(imageValue, pasteArgs, false);
|
|
21609
21704
|
}
|
|
21610
21705
|
else if (this.parent.pasteCleanupSettings.plainText) {
|
|
21611
|
-
this.plainFormatting(imageValue, pasteArgs);
|
|
21706
|
+
this.plainFormatting(imageValue, pasteArgs, false);
|
|
21612
21707
|
}
|
|
21613
21708
|
else if (this.parent.pasteCleanupSettings.keepFormat) {
|
|
21614
21709
|
this.formatting(imageValue, false, pasteArgs);
|
|
@@ -21632,7 +21727,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21632
21727
|
var plainTextElement = this.parent.element.querySelector('#plainTextFormat');
|
|
21633
21728
|
this.plainTextRadioButton.appendTo(plainTextElement);
|
|
21634
21729
|
};
|
|
21635
|
-
PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked) {
|
|
21730
|
+
PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked, isClipboardHTMLDataNull) {
|
|
21636
21731
|
if (keepChecked) {
|
|
21637
21732
|
this.formatting(value, false, args);
|
|
21638
21733
|
}
|
|
@@ -21640,10 +21735,10 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21640
21735
|
this.formatting(value, true, args);
|
|
21641
21736
|
}
|
|
21642
21737
|
else {
|
|
21643
|
-
this.plainFormatting(value, args);
|
|
21738
|
+
this.plainFormatting(value, args, isClipboardHTMLDataNull);
|
|
21644
21739
|
}
|
|
21645
21740
|
};
|
|
21646
|
-
PasteCleanup.prototype.pasteDialog = function (value, args) {
|
|
21741
|
+
PasteCleanup.prototype.pasteDialog = function (value, args, isClipboardHTMLDataNull) {
|
|
21647
21742
|
var _this = this;
|
|
21648
21743
|
var isHeight = false;
|
|
21649
21744
|
var preRTEHeight = this.parent.height;
|
|
@@ -21660,7 +21755,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21660
21755
|
var argument = _this.dialogObj;
|
|
21661
21756
|
_this.dialogRenderObj.close(argument);
|
|
21662
21757
|
_this.dialogObj.destroy();
|
|
21663
|
-
_this.selectFormatting(value, args, keepChecked, cleanChecked);
|
|
21758
|
+
_this.selectFormatting(value, args, keepChecked, cleanChecked, isClipboardHTMLDataNull);
|
|
21664
21759
|
}
|
|
21665
21760
|
},
|
|
21666
21761
|
buttonModel: {
|
|
@@ -21721,7 +21816,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21721
21816
|
isHeight = true;
|
|
21722
21817
|
}
|
|
21723
21818
|
this.dialogObj.show();
|
|
21724
|
-
this.setCssClass({ cssClass: this.parent.
|
|
21819
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
21725
21820
|
};
|
|
21726
21821
|
PasteCleanup.prototype.updateCss = function (currentObj, e) {
|
|
21727
21822
|
if (currentObj && e.cssClass) {
|
|
@@ -21934,7 +22029,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21934
22029
|
return value;
|
|
21935
22030
|
};
|
|
21936
22031
|
//Plain Formatting
|
|
21937
|
-
PasteCleanup.prototype.plainFormatting = function (value, args) {
|
|
22032
|
+
PasteCleanup.prototype.plainFormatting = function (value, args, isClipboardHTMLDataNull) {
|
|
21938
22033
|
var _this = this;
|
|
21939
22034
|
var clipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
|
|
21940
22035
|
clipBoardElem.innerHTML = value;
|
|
@@ -21972,6 +22067,13 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21972
22067
|
this.saveSelection.restore();
|
|
21973
22068
|
clipBoardElem.innerHTML = this.sanitizeHelper(clipBoardElem.innerHTML);
|
|
21974
22069
|
this.addTempClass(clipBoardElem);
|
|
22070
|
+
this.removingComments(clipBoardElem);
|
|
22071
|
+
if (this.parent.enterKey === 'BR' && !isClipboardHTMLDataNull) {
|
|
22072
|
+
clipBoardElem = this.reframeToBrContent(clipBoardElem);
|
|
22073
|
+
}
|
|
22074
|
+
else if (this.parent.enterKey === 'DIV') {
|
|
22075
|
+
clipBoardElem.innerHTML = clipBoardElem.innerHTML.replace(/<p class="pasteContent_RTE">/g, '<div>').replace(/<\/p>/g, '</div>');
|
|
22076
|
+
}
|
|
21975
22077
|
this.parent.trigger(afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: null }, function (updatedArgs) { value = updatedArgs.value; });
|
|
21976
22078
|
clipBoardElem.innerHTML = value;
|
|
21977
22079
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
@@ -21986,6 +22088,41 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21986
22088
|
this.parent.formatter.onSuccess(this.parent, args);
|
|
21987
22089
|
}
|
|
21988
22090
|
};
|
|
22091
|
+
PasteCleanup.prototype.removingComments = function (elm) {
|
|
22092
|
+
var innerElement = elm.innerHTML;
|
|
22093
|
+
innerElement = innerElement.replace(/<!--[\s\S]*?-->/g, '');
|
|
22094
|
+
elm.innerHTML = innerElement;
|
|
22095
|
+
};
|
|
22096
|
+
PasteCleanup.prototype.reframeToBrContent = function (clipBoardElem) {
|
|
22097
|
+
var newClipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
|
|
22098
|
+
while (!isNullOrUndefined(clipBoardElem.firstChild)) {
|
|
22099
|
+
var brElem = this.parent.createElement('br');
|
|
22100
|
+
var currentFirstChild = clipBoardElem.firstChild;
|
|
22101
|
+
if (currentFirstChild.nodeName === '#text') {
|
|
22102
|
+
var isNextSibPresent = !isNullOrUndefined(currentFirstChild.nextSibling);
|
|
22103
|
+
newClipBoardElem.appendChild(currentFirstChild);
|
|
22104
|
+
if (isNextSibPresent) {
|
|
22105
|
+
newClipBoardElem.appendChild(brElem);
|
|
22106
|
+
}
|
|
22107
|
+
}
|
|
22108
|
+
else {
|
|
22109
|
+
var isCurrentNodeBRElm = currentFirstChild.nodeName === 'BR';
|
|
22110
|
+
if (isCurrentNodeBRElm) {
|
|
22111
|
+
newClipBoardElem.appendChild(currentFirstChild);
|
|
22112
|
+
}
|
|
22113
|
+
else {
|
|
22114
|
+
newClipBoardElem.appendChild(currentFirstChild.childNodes[0]);
|
|
22115
|
+
}
|
|
22116
|
+
if (!isNullOrUndefined(currentFirstChild) && !isNullOrUndefined(currentFirstChild.nextSibling)) {
|
|
22117
|
+
newClipBoardElem.appendChild(brElem);
|
|
22118
|
+
}
|
|
22119
|
+
if (!isCurrentNodeBRElm && !isNullOrUndefined(currentFirstChild)) {
|
|
22120
|
+
detach(currentFirstChild);
|
|
22121
|
+
}
|
|
22122
|
+
}
|
|
22123
|
+
}
|
|
22124
|
+
return newClipBoardElem;
|
|
22125
|
+
};
|
|
21989
22126
|
PasteCleanup.prototype.getTextContent = function (clipBoardElem) {
|
|
21990
22127
|
for (var i = 0; i < this.blockNode.length; i++) {
|
|
21991
22128
|
var inElem = clipBoardElem.querySelectorAll(this.blockNode[i]);
|
|
@@ -22033,14 +22170,16 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
22033
22170
|
for (var i = 0; i < this.inlineNode.length; i++) {
|
|
22034
22171
|
var inElem = clipBoardElem.querySelectorAll(this.inlineNode[i]);
|
|
22035
22172
|
for (var j = 0; j < inElem.length; j++) {
|
|
22036
|
-
|
|
22037
|
-
|
|
22038
|
-
|
|
22039
|
-
|
|
22040
|
-
|
|
22041
|
-
|
|
22042
|
-
|
|
22043
|
-
|
|
22173
|
+
if (!(inElem[j] === clipBoardElem.firstChild && inElem[j].nodeName === 'SPAN')) {
|
|
22174
|
+
var parElem = void 0;
|
|
22175
|
+
for (var k = 0; k < inElem[j].childNodes.length; k++) {
|
|
22176
|
+
parElem = inElem[j].childNodes[k].parentElement;
|
|
22177
|
+
inElem[j].childNodes[k].parentElement.parentElement.insertBefore(inElem[j].childNodes[k], inElem[j].childNodes[k].parentElement);
|
|
22178
|
+
k--;
|
|
22179
|
+
}
|
|
22180
|
+
if (!isNullOrUndefined(parElem)) {
|
|
22181
|
+
detach(parElem);
|
|
22182
|
+
}
|
|
22044
22183
|
}
|
|
22045
22184
|
}
|
|
22046
22185
|
}
|
|
@@ -22399,7 +22538,7 @@ var FileManager$1 = /** @__PURE__ @class */ (function () {
|
|
|
22399
22538
|
this.dialogObj.createElement = this.parent.createElement;
|
|
22400
22539
|
this.dialogObj.appendTo(dlgTarget);
|
|
22401
22540
|
this.dialogObj.show(Browser.isDevice ? true : false);
|
|
22402
|
-
this.setCssClass({ cssClass: this.parent.
|
|
22541
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
22403
22542
|
};
|
|
22404
22543
|
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
22405
22544
|
FileManager$$1.prototype.setCssClass = function (e) {
|
|
@@ -22599,7 +22738,7 @@ var FullScreen = /** @__PURE__ @class */ (function () {
|
|
|
22599
22738
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
22600
22739
|
}
|
|
22601
22740
|
if (this.parent.showTooltip && !isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
22602
|
-
this.parent.notify(
|
|
22741
|
+
this.parent.notify(destroyTooltip, { args: event });
|
|
22603
22742
|
}
|
|
22604
22743
|
this.scrollableParent = getScrollableParent(this.parent.element);
|
|
22605
22744
|
if (!this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
|
|
@@ -22654,7 +22793,7 @@ var FullScreen = /** @__PURE__ @class */ (function () {
|
|
|
22654
22793
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
22655
22794
|
}
|
|
22656
22795
|
if (this.parent.showTooltip && !isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
22657
|
-
this.parent.notify(
|
|
22796
|
+
this.parent.notify(destroyTooltip, { args: event });
|
|
22658
22797
|
}
|
|
22659
22798
|
if (this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
|
|
22660
22799
|
var evenArgs = {
|
|
@@ -22847,7 +22986,7 @@ var FormatPainter = /** @__PURE__ @class */ (function () {
|
|
|
22847
22986
|
};
|
|
22848
22987
|
FormatPainter.prototype.onKeyDown = function (event) {
|
|
22849
22988
|
var originalEvent = event.args;
|
|
22850
|
-
if ((originalEvent
|
|
22989
|
+
if (!isNullOrUndefined(originalEvent) && !isNullOrUndefined(originalEvent.action) && (originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste')
|
|
22851
22990
|
|| (originalEvent.action === 'escape' && (this.previousAction === 'format-copy' || this.previousAction === 'format-paste'))) {
|
|
22852
22991
|
if ((originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste')) {
|
|
22853
22992
|
originalEvent.stopPropagation();
|
|
@@ -23004,6 +23143,9 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
23004
23143
|
spanElement = this.parent.element.ownerDocument.querySelector('.e-emoji');
|
|
23005
23144
|
}
|
|
23006
23145
|
this.divElement = spanElement.closest('div');
|
|
23146
|
+
if (!(this.parent.inputElement.contains(this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()).startContainer))) {
|
|
23147
|
+
this.parent.contentModule.getEditPanel().focus();
|
|
23148
|
+
}
|
|
23007
23149
|
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
23008
23150
|
this.save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
23009
23151
|
this.clickEvent = args.args;
|
|
@@ -23643,7 +23785,8 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
23643
23785
|
};
|
|
23644
23786
|
EmojiPicker.prototype.onkeyPress = function (e) {
|
|
23645
23787
|
var originalEvent = e.args;
|
|
23646
|
-
var selection = this.parent.contentModule.
|
|
23788
|
+
var selection = (this.parent.iframeSettings.enable) ? this.parent.contentModule.getPanel().contentWindow.getSelection() :
|
|
23789
|
+
this.parent.contentModule.getDocument().getSelection();
|
|
23647
23790
|
if (selection.rangeCount <= 0) {
|
|
23648
23791
|
return;
|
|
23649
23792
|
}
|
|
@@ -23663,6 +23806,10 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
23663
23806
|
}
|
|
23664
23807
|
if (originalEvent.keyCode === 32 && isPrevColon && this.popupObj) {
|
|
23665
23808
|
removeClass([this.divElement], 'e-active');
|
|
23809
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument : this.parent.contentModule.getDocument();
|
|
23810
|
+
if (this.parent.showTooltip && !isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
23811
|
+
this.parent.notify(destroyTooltip, { args: event });
|
|
23812
|
+
}
|
|
23666
23813
|
this.popupObj.hide();
|
|
23667
23814
|
}
|
|
23668
23815
|
if (this.popupObj && (originalEvent.keyCode === 37 || originalEvent.keyCode === 38 || originalEvent.keyCode === 39
|
|
@@ -23673,7 +23820,8 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
23673
23820
|
};
|
|
23674
23821
|
EmojiPicker.prototype.onkeyUp = function (e) {
|
|
23675
23822
|
var originalEvent = e.args;
|
|
23676
|
-
var selection = this.parent.contentModule.
|
|
23823
|
+
var selection = (this.parent.iframeSettings.enable) ? this.parent.contentModule.getPanel().contentWindow.getSelection() :
|
|
23824
|
+
this.parent.contentModule.getDocument().getSelection();
|
|
23677
23825
|
if (selection.rangeCount <= 0) {
|
|
23678
23826
|
return;
|
|
23679
23827
|
}
|
|
@@ -23699,7 +23847,7 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
23699
23847
|
};
|
|
23700
23848
|
EmojiPicker.prototype.getCoordinates = function () {
|
|
23701
23849
|
var coordinates;
|
|
23702
|
-
var selection = this.parent.contentModule.
|
|
23850
|
+
var selection = (this.parent.iframeSettings.enable) ? this.parent.contentModule.getPanel().contentWindow.getSelection() : window.getSelection();
|
|
23703
23851
|
var range = selection.getRangeAt(0);
|
|
23704
23852
|
var firstChild;
|
|
23705
23853
|
if (range.startContainer.nodeName === 'P' || range.startContainer.nodeName === 'DIV') {
|
|
@@ -23991,7 +24139,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
23991
24139
|
pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset + parentTop + args.clientY : args.pageY;
|
|
23992
24140
|
}
|
|
23993
24141
|
if (this.quickToolObj.linkQTBar) {
|
|
23994
|
-
this.quickToolObj.linkQTBar.showPopup(pageX, pageY, range.endContainer);
|
|
24142
|
+
this.quickToolObj.linkQTBar.showPopup(pageX, pageY, range.endContainer, 'link');
|
|
23995
24143
|
}
|
|
23996
24144
|
}
|
|
23997
24145
|
};
|
|
@@ -24022,12 +24170,32 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
24022
24170
|
if (isPopupOpen) {
|
|
24023
24171
|
return;
|
|
24024
24172
|
}
|
|
24025
|
-
|
|
24026
|
-
|
|
24027
|
-
|
|
24028
|
-
|
|
24029
|
-
|
|
24030
|
-
|
|
24173
|
+
if (e.args.ctrlKey === false) {
|
|
24174
|
+
this.showLinkQuickToolbar({
|
|
24175
|
+
args: args,
|
|
24176
|
+
isNotify: false,
|
|
24177
|
+
type: 'Links',
|
|
24178
|
+
elements: [args.target]
|
|
24179
|
+
});
|
|
24180
|
+
}
|
|
24181
|
+
else {
|
|
24182
|
+
var selection = this.parent.formatter.editorManager.nodeSelection;
|
|
24183
|
+
var range = selection.getRange(this.parent.contentModule.getDocument());
|
|
24184
|
+
var args_1 = {
|
|
24185
|
+
args: {
|
|
24186
|
+
item: {
|
|
24187
|
+
subCommand: 'OpenLink',
|
|
24188
|
+
command: 'Links',
|
|
24189
|
+
name: ''
|
|
24190
|
+
},
|
|
24191
|
+
originalEvent: e.args
|
|
24192
|
+
},
|
|
24193
|
+
selectNode: selection.getNodeCollection(range),
|
|
24194
|
+
selectParent: selection.getParentNodeCollection(range),
|
|
24195
|
+
selection: selection.save(range, this.parent.contentModule.getDocument())
|
|
24196
|
+
};
|
|
24197
|
+
this.parent.notify(openLink, args_1);
|
|
24198
|
+
}
|
|
24031
24199
|
}
|
|
24032
24200
|
else {
|
|
24033
24201
|
this.hideLinkQuickToolbar();
|
|
@@ -24084,7 +24252,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
24084
24252
|
};
|
|
24085
24253
|
Link.prototype.showDialog = function () {
|
|
24086
24254
|
this.openDialog(false);
|
|
24087
|
-
this.setCssClass({ cssClass: this.parent.
|
|
24255
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
24088
24256
|
};
|
|
24089
24257
|
Link.prototype.closeDialog = function () {
|
|
24090
24258
|
if (this.dialogObj) {
|
|
@@ -24117,22 +24285,22 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
24117
24285
|
var textPlace = this.i10n.getConstant('textPlaceholder');
|
|
24118
24286
|
var title = this.i10n.getConstant('linkTitle');
|
|
24119
24287
|
var linkDialogEle = this.parent.createElement('div', {
|
|
24120
|
-
className: 'e-rte-link-dialog' +
|
|
24288
|
+
className: 'e-rte-link-dialog' + this.parent.getCssClass(true), id: this.rteID + '_rtelink'
|
|
24121
24289
|
});
|
|
24122
24290
|
this.parent.element.appendChild(linkDialogEle);
|
|
24123
24291
|
var linkContent = this.parent.createElement('div', {
|
|
24124
|
-
className: 'e-rte-linkcontent' +
|
|
24292
|
+
className: 'e-rte-linkcontent' + this.parent.getCssClass(true), id: this.rteID + '_linkContent'
|
|
24125
24293
|
});
|
|
24126
24294
|
var htmlTextbox = (this.parent.editorMode === 'HTML') ? '<label>' + linkTooltip +
|
|
24127
|
-
'</label></div><div class="e-rte-field' +
|
|
24128
|
-
'<input type="text" data-role ="none" spellcheck="false" placeholder = "' + title + '"aria-label="' + this.i10n.getConstant('linkTitle') + '" class="e-input e-rte-linkTitle' +
|
|
24129
|
-
'<div class="e-rte-label' +
|
|
24130
|
-
'<input type="checkbox" class="e-rte-linkTarget' +
|
|
24131
|
-
var content = '<div class="e-rte-label' +
|
|
24132
|
-
'<input type="text" data-role ="none" spellcheck="false" placeholder="' + urlPlace + '"aria-label="' + this.i10n.getConstant('linkWebUrl') + '" class="e-input e-rte-linkurl' +
|
|
24133
|
-
'<div class="e-rte-label' +
|
|
24134
|
-
'<input type="text" data-role ="none" spellcheck="false" class="e-input e-rte-linkText' +
|
|
24135
|
-
'</div><div class="e-rte-label' +
|
|
24295
|
+
'</label></div><div class="e-rte-field' + this.parent.getCssClass(true) + '">' +
|
|
24296
|
+
'<input type="text" data-role ="none" spellcheck="false" placeholder = "' + title + '"aria-label="' + this.i10n.getConstant('linkTitle') + '" class="e-input e-rte-linkTitle' + this.parent.getCssClass(true) + '"></div>' +
|
|
24297
|
+
'<div class="e-rte-label' + this.parent.getCssClass(true) + '"></div>' + '<div class="e-rte-field' + this.parent.getCssClass(true) + '">' +
|
|
24298
|
+
'<input type="checkbox" class="e-rte-linkTarget' + this.parent.getCssClass(true) + '" data-role ="none"></div>' : '';
|
|
24299
|
+
var content = '<div class="e-rte-label' + this.parent.getCssClass(true) + '"><label>' + linkWebAddress + '</label></div>' + '<div class="e-rte-field' + this.parent.getCssClass(true) + '">' +
|
|
24300
|
+
'<input type="text" data-role ="none" spellcheck="false" placeholder="' + urlPlace + '"aria-label="' + this.i10n.getConstant('linkWebUrl') + '" class="e-input e-rte-linkurl' + this.parent.getCssClass(true) + '"/></div>' +
|
|
24301
|
+
'<div class="e-rte-label' + this.parent.getCssClass(true) + '">' + '<label>' + linkDisplayText + '</label></div><div class="e-rte-field' + this.parent.getCssClass(true) + '"> ' +
|
|
24302
|
+
'<input type="text" data-role ="none" spellcheck="false" class="e-input e-rte-linkText' + this.parent.getCssClass(true) + '"aria-label="' + this.i10n.getConstant('linkText') + '" placeholder="' + textPlace + '">' +
|
|
24303
|
+
'</div><div class="e-rte-label' + this.parent.getCssClass(true) + '">' + htmlTextbox;
|
|
24136
24304
|
var contentElem = parseHtml(content);
|
|
24137
24305
|
linkContent.appendChild(contentElem);
|
|
24138
24306
|
var linkTarget = linkContent.querySelector('.e-rte-linkTarget');
|
|
@@ -24141,7 +24309,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
24141
24309
|
var linkTitle = linkContent.querySelector('.e-rte-linkTitle');
|
|
24142
24310
|
var linkOpenLabel = this.i10n.getConstant('linkOpenInNewWindow');
|
|
24143
24311
|
this.checkBoxObj = new CheckBox({ label: linkOpenLabel, checked: true, enableRtl: this.parent.enableRtl,
|
|
24144
|
-
cssClass: this.parent.
|
|
24312
|
+
cssClass: this.parent.getCssClass() });
|
|
24145
24313
|
this.checkBoxObj.isStringTemplate = true;
|
|
24146
24314
|
this.checkBoxObj.createElement = this.parent.createElement;
|
|
24147
24315
|
this.checkBoxObj.appendTo(linkTarget);
|
|
@@ -24154,16 +24322,16 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
24154
24322
|
var dialogModel = {
|
|
24155
24323
|
header: this.i10n.getConstant('linkHeader'),
|
|
24156
24324
|
content: linkContent,
|
|
24157
|
-
cssClass: CLS_RTE_ELEMENTS +
|
|
24325
|
+
cssClass: CLS_RTE_ELEMENTS + this.parent.getCssClass(true),
|
|
24158
24326
|
enableRtl: this.parent.enableRtl,
|
|
24159
24327
|
locale: this.parent.locale,
|
|
24160
24328
|
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '310px',
|
|
24161
24329
|
isModal: Browser.isDevice,
|
|
24162
24330
|
buttons: [{
|
|
24163
24331
|
click: this.insertlink.bind(selectObj),
|
|
24164
|
-
buttonModel: { content: linkInsert, cssClass: 'e-flat e-insertLink' +
|
|
24332
|
+
buttonModel: { content: linkInsert, cssClass: 'e-flat e-insertLink' + this.parent.getCssClass(true), isPrimary: true }
|
|
24165
24333
|
},
|
|
24166
|
-
{ click: this.cancelDialog.bind(selectObj), buttonModel: { cssClass: 'e-flat' +
|
|
24334
|
+
{ click: this.cancelDialog.bind(selectObj), buttonModel: { cssClass: 'e-flat' + this.parent.getCssClass(true), content: linkCancel } }],
|
|
24167
24335
|
target: (Browser.isDevice) ? document.body : this.parent.element,
|
|
24168
24336
|
animationSettings: { effect: 'None' },
|
|
24169
24337
|
close: function (event) {
|
|
@@ -24665,18 +24833,18 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
24665
24833
|
this.resizeBtnInit();
|
|
24666
24834
|
this.imgEle = e;
|
|
24667
24835
|
addClass([this.imgEle], 'e-resize');
|
|
24668
|
-
this.imgResizeDiv = this.parent.createElement('span', { className: 'e-img-resize' +
|
|
24836
|
+
this.imgResizeDiv = this.parent.createElement('span', { className: 'e-img-resize' + this.parent.getCssClass(true), id: this.rteID + '_imgResize' });
|
|
24669
24837
|
this.imgResizeDiv.appendChild(this.parent.createElement('span', {
|
|
24670
|
-
className: 'e-rte-imageboxmark e-rte-topLeft' +
|
|
24838
|
+
className: 'e-rte-imageboxmark e-rte-topLeft' + this.parent.getCssClass(true), styles: 'cursor: nwse-resize'
|
|
24671
24839
|
}));
|
|
24672
24840
|
this.imgResizeDiv.appendChild(this.parent.createElement('span', {
|
|
24673
|
-
className: 'e-rte-imageboxmark e-rte-topRight' +
|
|
24841
|
+
className: 'e-rte-imageboxmark e-rte-topRight' + this.parent.getCssClass(true), styles: 'cursor: nesw-resize'
|
|
24674
24842
|
}));
|
|
24675
24843
|
this.imgResizeDiv.appendChild(this.parent.createElement('span', {
|
|
24676
|
-
className: 'e-rte-imageboxmark e-rte-botLeft' +
|
|
24844
|
+
className: 'e-rte-imageboxmark e-rte-botLeft' + this.parent.getCssClass(true), styles: 'cursor: nesw-resize'
|
|
24677
24845
|
}));
|
|
24678
24846
|
this.imgResizeDiv.appendChild(this.parent.createElement('span', {
|
|
24679
|
-
className: 'e-rte-imageboxmark e-rte-botRight' +
|
|
24847
|
+
className: 'e-rte-imageboxmark e-rte-botRight' + this.parent.getCssClass(true), styles: 'cursor: nwse-resize'
|
|
24680
24848
|
}));
|
|
24681
24849
|
if (Browser.isDevice) {
|
|
24682
24850
|
addClass([this.imgResizeDiv], 'e-mob-rte');
|
|
@@ -24829,8 +24997,8 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
24829
24997
|
img.removeAttribute('height');
|
|
24830
24998
|
}
|
|
24831
24999
|
else {
|
|
24832
|
-
img.style.width = expectedX + 'px';
|
|
24833
|
-
img.style.height = expectedX + 'px';
|
|
25000
|
+
img.style.width = ((expectedX >= 15) ? expectedX : 15) + 'px';
|
|
25001
|
+
img.style.height = ((expectedX >= 15) ? expectedX : 15) + 'px';
|
|
24834
25002
|
}
|
|
24835
25003
|
}
|
|
24836
25004
|
};
|
|
@@ -24859,7 +25027,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
24859
25027
|
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10), args);
|
|
24860
25028
|
_this.resizeImgDupPos(_this.imgEle);
|
|
24861
25029
|
_this.imgResizePos(_this.imgEle, _this.imgResizeDiv);
|
|
24862
|
-
_this.parent.setContentHeight('', false);
|
|
24863
25030
|
}
|
|
24864
25031
|
});
|
|
24865
25032
|
};
|
|
@@ -24874,7 +25041,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
24874
25041
|
else if (isNullOrUndefined(this.parent.insertImageSettings.maxHeight)) {
|
|
24875
25042
|
this.imgEle.style.maxHeight = '';
|
|
24876
25043
|
}
|
|
24877
|
-
this.imgEle.style.maxWidth = this.parent.getInsertImgMaxWidth() + 'px';
|
|
25044
|
+
this.imgEle.style.maxWidth = (closest(this.imgEle, 'ol,ul') != null ? this.parent.getInsertImgMaxWidth() - parseInt((getComputedStyle(closest(this.imgEle, 'ol,ul')).paddingLeft), 0) : this.parent.getInsertImgMaxWidth()) + 'px';
|
|
24878
25045
|
var pageX = this.getPointX(e);
|
|
24879
25046
|
var pageY = this.getPointY(e);
|
|
24880
25047
|
var mouseX = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageX - this.pageX) : (pageX - this.pageX);
|
|
@@ -25099,13 +25266,22 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25099
25266
|
}
|
|
25100
25267
|
}
|
|
25101
25268
|
}
|
|
25102
|
-
else if (
|
|
25103
|
-
range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE))
|
|
25104
|
-
|
|
25105
|
-
|
|
25106
|
-
|
|
25107
|
-
|
|
25108
|
-
|
|
25269
|
+
else if (range.startContainer.nodeType === 1) {
|
|
25270
|
+
if (range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE)) {
|
|
25271
|
+
detach(range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE));
|
|
25272
|
+
}
|
|
25273
|
+
else if (range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_IMGBREAK)) {
|
|
25274
|
+
detach(range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_IMGBREAK));
|
|
25275
|
+
}
|
|
25276
|
+
else if (range.startContainer.classList.contains('e-img-wrap') && closest(range.startContainer, '.' + CLS_CAPTION)) {
|
|
25277
|
+
var parentElem = range.startContainer.parentElement.parentElement;
|
|
25278
|
+
detach(closest(range.startContainer, '.' + CLS_CAPTION));
|
|
25279
|
+
if (parentElem && parentElem.textContent.trim() === '') {
|
|
25280
|
+
var brElem = this.parent.createElement('br');
|
|
25281
|
+
brElem.classList.add('e-rte-image-remove-focus');
|
|
25282
|
+
parentElem.appendChild(brElem);
|
|
25283
|
+
}
|
|
25284
|
+
}
|
|
25109
25285
|
}
|
|
25110
25286
|
}
|
|
25111
25287
|
break;
|
|
@@ -25162,7 +25338,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25162
25338
|
};
|
|
25163
25339
|
Image.prototype.showDialog = function () {
|
|
25164
25340
|
this.openDialog(false);
|
|
25165
|
-
this.setCssClass({ cssClass: this.parent.
|
|
25341
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
25166
25342
|
};
|
|
25167
25343
|
Image.prototype.closeDialog = function () {
|
|
25168
25344
|
if (this.dialogObj) {
|
|
@@ -25370,19 +25546,19 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25370
25546
|
}
|
|
25371
25547
|
this.imagDialog(e);
|
|
25372
25548
|
if (!isNullOrUndefined(this.dialogObj)) {
|
|
25373
|
-
var linkWrap = this.parent.createElement('div', { className: 'e-img-linkwrap' +
|
|
25549
|
+
var linkWrap = this.parent.createElement('div', { className: 'e-img-linkwrap' + this.parent.getCssClass(true) });
|
|
25374
25550
|
var linkUrl = this.i10n.getConstant('linkurl');
|
|
25375
|
-
var content = '<div class="e-rte-field' +
|
|
25376
|
-
'<input type="text" data-role ="none" class="e-input e-img-link' +
|
|
25551
|
+
var content = '<div class="e-rte-field' + this.parent.getCssClass(true) + '">' +
|
|
25552
|
+
'<input type="text" data-role ="none" class="e-input e-img-link' + this.parent.getCssClass(true) + '" spellcheck="false" placeholder="' + linkUrl + '"/></div>' +
|
|
25377
25553
|
'<div class="e-rte-label"></div>' + '<div class="e-rte-field">' +
|
|
25378
|
-
'<input type="checkbox" class="e-rte-linkTarget' +
|
|
25554
|
+
'<input type="checkbox" class="e-rte-linkTarget' + this.parent.getCssClass(true) + '" data-role ="none"></div>';
|
|
25379
25555
|
var contentElem = parseHtml(content);
|
|
25380
25556
|
linkWrap.appendChild(contentElem);
|
|
25381
25557
|
var linkTarget = linkWrap.querySelector('.e-rte-linkTarget');
|
|
25382
25558
|
var inputLink = linkWrap.querySelector('.e-img-link');
|
|
25383
25559
|
var linkOpenLabel = this.i10n.getConstant('linkOpenInNewWindow');
|
|
25384
25560
|
this.checkBoxObj = new CheckBox({
|
|
25385
|
-
label: linkOpenLabel, checked: true, enableRtl: this.parent.enableRtl, cssClass: this.parent.
|
|
25561
|
+
label: linkOpenLabel, checked: true, enableRtl: this.parent.enableRtl, cssClass: this.parent.getCssClass(),
|
|
25386
25562
|
change: function (e) {
|
|
25387
25563
|
if (e.checked) {
|
|
25388
25564
|
target_1 = '_blank';
|
|
@@ -25396,11 +25572,12 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25396
25572
|
this.checkBoxObj.createElement = this.parent.createElement;
|
|
25397
25573
|
this.checkBoxObj.appendTo(linkTarget);
|
|
25398
25574
|
var target_1 = this.checkBoxObj.checked ? '_blank' : null;
|
|
25575
|
+
var imageLabel = this.checkBoxObj.checked ? this.i10n.getConstant('ImageLinkAriaLabel') : null;
|
|
25399
25576
|
var linkUpdate = this.i10n.getConstant('dialogUpdate');
|
|
25400
25577
|
var linkargs_1 = {
|
|
25401
25578
|
args: e.args,
|
|
25402
25579
|
selfImage: this, selection: e.selection,
|
|
25403
|
-
selectNode: e.selectNode, selectParent: e.selectParent, link: inputLink, target: target_1
|
|
25580
|
+
selectNode: e.selectNode, selectParent: e.selectParent, link: inputLink, target: target_1, ariaLabel: imageLabel
|
|
25404
25581
|
};
|
|
25405
25582
|
this.dialogObj.setProperties({
|
|
25406
25583
|
height: 'inherit',
|
|
@@ -25413,7 +25590,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25413
25590
|
_this.insertlink(linkargs_1);
|
|
25414
25591
|
},
|
|
25415
25592
|
buttonModel: {
|
|
25416
|
-
content: linkUpdate, cssClass: 'e-flat e-update-link' +
|
|
25593
|
+
content: linkUpdate, cssClass: 'e-flat e-update-link' + this.parent.getCssClass(true), isPrimary: true
|
|
25417
25594
|
}
|
|
25418
25595
|
}],
|
|
25419
25596
|
cssClass: this.dialogObj.cssClass + ' e-rte-img-link-dialog'
|
|
@@ -25439,13 +25616,13 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25439
25616
|
this.imagDialog(e);
|
|
25440
25617
|
var altText = this.i10n.getConstant('altText');
|
|
25441
25618
|
if (!isNullOrUndefined(this.dialogObj)) {
|
|
25442
|
-
var altWrap = this.parent.createElement('div', { className: 'e-img-altwrap' +
|
|
25619
|
+
var altWrap = this.parent.createElement('div', { className: 'e-img-altwrap' + this.parent.getCssClass(true) });
|
|
25443
25620
|
var altHeader = this.i10n.getConstant('alternateHeader');
|
|
25444
25621
|
var linkUpdate = this.i10n.getConstant('dialogUpdate');
|
|
25445
25622
|
var getAlt = (e.selectNode[0].getAttribute('alt') === null) ? '' :
|
|
25446
25623
|
e.selectNode[0].getAttribute('alt');
|
|
25447
|
-
var content = '<div class="e-rte-field' +
|
|
25448
|
-
'<input type="text" spellcheck="false" class="e-input e-img-alt' +
|
|
25624
|
+
var content = '<div class="e-rte-field' + this.parent.getCssClass(true) + '">' +
|
|
25625
|
+
'<input type="text" spellcheck="false" class="e-input e-img-alt' + this.parent.getCssClass(true) + '" placeholder="' + altText + '"/>' +
|
|
25449
25626
|
'</div>';
|
|
25450
25627
|
var contentElem = parseHtml(content);
|
|
25451
25628
|
contentElem.querySelector('input').setAttribute('value', getAlt);
|
|
@@ -25463,7 +25640,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25463
25640
|
_this.insertAlt(altArgs_1);
|
|
25464
25641
|
},
|
|
25465
25642
|
buttonModel: {
|
|
25466
|
-
content: linkUpdate, cssClass: 'e-flat e-update-alt' +
|
|
25643
|
+
content: linkUpdate, cssClass: 'e-flat e-update-alt' + this.parent.getCssClass(true), isPrimary: true
|
|
25467
25644
|
}
|
|
25468
25645
|
}],
|
|
25469
25646
|
cssClass: this.dialogObj.cssClass + ' e-rte-img-alt-dialog'
|
|
@@ -25515,14 +25692,14 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25515
25692
|
}
|
|
25516
25693
|
if (e.selectNode[0].parentElement.nodeName === 'A') {
|
|
25517
25694
|
proxy.parent.formatter.process(proxy.parent, e.args, e.args, {
|
|
25518
|
-
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, selectNode: e.selectNode,
|
|
25695
|
+
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('ImageLinkAriaLabel') : null, selectNode: e.selectNode,
|
|
25519
25696
|
subCommand: e.args.item.subCommand
|
|
25520
25697
|
});
|
|
25521
25698
|
proxy.dialogObj.hide({ returnValue: true });
|
|
25522
25699
|
return;
|
|
25523
25700
|
}
|
|
25524
25701
|
proxy.parent.formatter.process(proxy.parent, e.args, e.args, {
|
|
25525
|
-
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, selectNode: e.selectNode,
|
|
25702
|
+
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('ImageLinkAriaLabel') : null, selectNode: e.selectNode,
|
|
25526
25703
|
subCommand: e.args.item.subCommand, selection: e.selection
|
|
25527
25704
|
});
|
|
25528
25705
|
var captionEle = closest(e.selectNode[0], '.e-img-caption');
|
|
@@ -25633,11 +25810,11 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25633
25810
|
}
|
|
25634
25811
|
else {
|
|
25635
25812
|
this.captionEle = this.parent.createElement('span', {
|
|
25636
|
-
className: CLS_CAPTION + ' ' + CLS_RTE_CAPTION +
|
|
25813
|
+
className: CLS_CAPTION + ' ' + CLS_RTE_CAPTION + this.parent.getCssClass(true),
|
|
25637
25814
|
attrs: { contenteditable: 'false', draggable: 'false', style: 'width:' + this.parent.insertImageSettings.width }
|
|
25638
25815
|
});
|
|
25639
|
-
var imgWrap = this.parent.createElement('span', { className: 'e-img-wrap' +
|
|
25640
|
-
var imgInner = this.parent.createElement('span', { className: 'e-img-inner' +
|
|
25816
|
+
var imgWrap = this.parent.createElement('span', { className: 'e-img-wrap' + this.parent.getCssClass(true) });
|
|
25817
|
+
var imgInner = this.parent.createElement('span', { className: 'e-img-inner' + this.parent.getCssClass(true),
|
|
25641
25818
|
attrs: { contenteditable: 'true' } });
|
|
25642
25819
|
var parent_1 = e.selectNode[0].parentElement;
|
|
25643
25820
|
if (parent_1.tagName === 'A') {
|
|
@@ -25690,7 +25867,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25690
25867
|
_this.insertSize(selectObj_1);
|
|
25691
25868
|
},
|
|
25692
25869
|
buttonModel: {
|
|
25693
|
-
content: linkUpdate, cssClass: 'e-flat e-update-size' +
|
|
25870
|
+
content: linkUpdate, cssClass: 'e-flat e-update-size' + this.parent.getCssClass(true), isPrimary: true
|
|
25694
25871
|
}
|
|
25695
25872
|
}],
|
|
25696
25873
|
cssClass: this.dialogObj.cssClass + ' e-rte-img-size-dialog'
|
|
@@ -25736,7 +25913,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25736
25913
|
this.dialogObj.hide({ returnValue: true });
|
|
25737
25914
|
return;
|
|
25738
25915
|
}
|
|
25739
|
-
var imgDialog = this.parent.createElement('div', { className: 'e-rte-img-dialog' +
|
|
25916
|
+
var imgDialog = this.parent.createElement('div', { className: 'e-rte-img-dialog' + this.parent.getCssClass(true), id: this.rteID + '_image' });
|
|
25740
25917
|
this.parent.element.appendChild(imgDialog);
|
|
25741
25918
|
var imgInsert = this.i10n.getConstant('dialogInsert');
|
|
25742
25919
|
var imglinkCancel = this.i10n.getConstant('dialogCancel');
|
|
@@ -25745,20 +25922,20 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25745
25922
|
var selectObj = { selfImage: this, selection: e.selection, args: e.args, selectParent: e.selectParent };
|
|
25746
25923
|
var dialogModel = {
|
|
25747
25924
|
header: imgHeader,
|
|
25748
|
-
cssClass: CLS_RTE_ELEMENTS +
|
|
25925
|
+
cssClass: CLS_RTE_ELEMENTS + this.parent.getCssClass(true),
|
|
25749
25926
|
enableRtl: this.parent.enableRtl,
|
|
25750
25927
|
locale: this.parent.locale,
|
|
25751
25928
|
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
25752
25929
|
isModal: Browser.isDevice,
|
|
25753
25930
|
buttons: [{
|
|
25754
25931
|
click: this.insertImageUrl.bind(selectObj),
|
|
25755
|
-
buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage' +
|
|
25932
|
+
buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage' + this.parent.getCssClass(true), isPrimary: true, disabled: true }
|
|
25756
25933
|
},
|
|
25757
25934
|
{
|
|
25758
25935
|
click: function (e) {
|
|
25759
25936
|
_this.cancelDialog(e);
|
|
25760
25937
|
},
|
|
25761
|
-
buttonModel: { cssClass: 'e-flat e-cancel' +
|
|
25938
|
+
buttonModel: { cssClass: 'e-flat e-cancel' + this.parent.getCssClass(true), content: imglinkCancel }
|
|
25762
25939
|
}],
|
|
25763
25940
|
target: (Browser.isDevice) ? document.body : this.parent.element,
|
|
25764
25941
|
animationSettings: { effect: 'None' },
|
|
@@ -25781,12 +25958,12 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25781
25958
|
_this.dialogObj = null;
|
|
25782
25959
|
}
|
|
25783
25960
|
};
|
|
25784
|
-
var dialogContent = this.parent.createElement('div', { className: 'e-img-content' +
|
|
25961
|
+
var dialogContent = this.parent.createElement('div', { className: 'e-img-content' + this.parent.getCssClass(true) });
|
|
25785
25962
|
if ((!isNullOrUndefined(this.parent.insertImageSettings.path) && this.parent.editorMode === 'Markdown')
|
|
25786
25963
|
|| this.parent.editorMode === 'HTML') {
|
|
25787
25964
|
dialogContent.appendChild(this.imgUpload(e));
|
|
25788
25965
|
}
|
|
25789
|
-
var linkHeader = this.parent.createElement('div', { className: 'e-linkheader' +
|
|
25966
|
+
var linkHeader = this.parent.createElement('div', { className: 'e-linkheader' + this.parent.getCssClass(true) });
|
|
25790
25967
|
var linkHeaderText = this.i10n.getConstant('imageLinkHeader');
|
|
25791
25968
|
if (this.parent.editorMode === 'HTML') {
|
|
25792
25969
|
linkHeader.innerHTML = linkHeaderText;
|
|
@@ -25903,10 +26080,10 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25903
26080
|
// eslint-disable-next-line
|
|
25904
26081
|
Image.prototype.imageUrlPopup = function (e) {
|
|
25905
26082
|
var _this = this;
|
|
25906
|
-
var imgUrl = this.parent.createElement('div', { className: 'imgUrl' +
|
|
26083
|
+
var imgUrl = this.parent.createElement('div', { className: 'imgUrl' + this.parent.getCssClass(true) });
|
|
25907
26084
|
var placeUrl = this.i10n.getConstant('imageUrl');
|
|
25908
26085
|
this.inputUrl = this.parent.createElement('input', {
|
|
25909
|
-
className: 'e-input e-img-url' +
|
|
26086
|
+
className: 'e-input e-img-url' + this.parent.getCssClass(true),
|
|
25910
26087
|
attrs: { placeholder: placeUrl, spellcheck: 'false', 'aria-label': this.i10n.getConstant('imageLinkHeader') }
|
|
25911
26088
|
});
|
|
25912
26089
|
this.inputUrl.addEventListener('input', function () {
|
|
@@ -25973,7 +26150,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25973
26150
|
var selectNode = e.selectNode[0];
|
|
25974
26151
|
var imgHeight = this.i10n.getConstant('imageHeight');
|
|
25975
26152
|
var imgWidth = this.i10n.getConstant('imageWidth');
|
|
25976
|
-
var imgSizeWrap = this.parent.createElement('div', { className: 'e-img-sizewrap' +
|
|
26153
|
+
var imgSizeWrap = this.parent.createElement('div', { className: 'e-img-sizewrap' + this.parent.getCssClass(true) });
|
|
25977
26154
|
var widthVal = isNullOrUndefined(this.changedWidthValue) && (selectNode.style.width.toString() === 'auto' ||
|
|
25978
26155
|
selectNode.style.width !== '') ? selectNode.style.width : !isNullOrUndefined(this.changedWidthValue) ?
|
|
25979
26156
|
this.changedWidthValue : (parseInt(selectNode.getClientRects()[0].width.toString(), 10)).toString();
|
|
@@ -25982,10 +26159,10 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25982
26159
|
this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString(), 10)).toString();
|
|
25983
26160
|
this.changedWidthValue = null;
|
|
25984
26161
|
this.changedHeightValue = null;
|
|
25985
|
-
var content = '<div class="e-rte-label' +
|
|
25986
|
-
'</label></div><div class="e-rte-field' +
|
|
25987
|
-
'<div class="e-rte-label' +
|
|
25988
|
-
'<input type="text" id="imgheight" class="e-img-height' +
|
|
26162
|
+
var content = '<div class="e-rte-label' + this.parent.getCssClass(true) + '"><label>' + imgWidth +
|
|
26163
|
+
'</label></div><div class="e-rte-field' + this.parent.getCssClass(true) + '"><input type="text" id="imgwidth" class="e-img-width' + this.parent.getCssClass(true) + '"/></div>' +
|
|
26164
|
+
'<div class="e-rte-label' + this.parent.getCssClass(true) + '">' + '<label>' + imgHeight + '</label></div><div class="e-rte-field' + this.parent.getCssClass(true) + '"> ' +
|
|
26165
|
+
'<input type="text" id="imgheight" class="e-img-height' + this.parent.getCssClass(true) + '"/></div>';
|
|
25989
26166
|
var contentElem = parseHtml(content);
|
|
25990
26167
|
contentElem.getElementById('imgwidth').setAttribute('value', widthVal);
|
|
25991
26168
|
contentElem.getElementById('imgheight').setAttribute('value', heightVal);
|
|
@@ -25993,7 +26170,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25993
26170
|
this.widthNum = new TextBox({
|
|
25994
26171
|
value: formatUnit(widthVal),
|
|
25995
26172
|
enableRtl: this.parent.enableRtl,
|
|
25996
|
-
cssClass: this.parent.
|
|
26173
|
+
cssClass: this.parent.getCssClass(),
|
|
25997
26174
|
input: function (e) {
|
|
25998
26175
|
_this.inputWidthValue = formatUnit(_this.inputValue(e.value));
|
|
25999
26176
|
}
|
|
@@ -26003,7 +26180,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26003
26180
|
this.heightNum = new TextBox({
|
|
26004
26181
|
value: formatUnit(heightVal),
|
|
26005
26182
|
enableRtl: this.parent.enableRtl,
|
|
26006
|
-
cssClass: this.parent.
|
|
26183
|
+
cssClass: this.parent.getCssClass(),
|
|
26007
26184
|
input: function (e) {
|
|
26008
26185
|
_this.inputHeightValue = formatUnit(_this.inputValue(e.value));
|
|
26009
26186
|
}
|
|
@@ -26075,16 +26252,16 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26075
26252
|
save = e.selection;
|
|
26076
26253
|
selectParent = e.selectParent;
|
|
26077
26254
|
}
|
|
26078
|
-
var uploadParentEle = this.parent.createElement('div', { className: 'e-img-uploadwrap e-droparea' +
|
|
26255
|
+
var uploadParentEle = this.parent.createElement('div', { className: 'e-img-uploadwrap e-droparea' + this.parent.getCssClass(true) });
|
|
26079
26256
|
var deviceImgUpMsg = this.i10n.getConstant('imageDeviceUploadMessage');
|
|
26080
26257
|
var imgUpMsg = this.i10n.getConstant('imageUploadMessage');
|
|
26081
|
-
var span = this.parent.createElement('span', { className: 'e-droptext' +
|
|
26258
|
+
var span = this.parent.createElement('span', { className: 'e-droptext' + this.parent.getCssClass(true) });
|
|
26082
26259
|
var spanMsg = this.parent.createElement('span', {
|
|
26083
|
-
className: 'e-rte-upload-text' +
|
|
26260
|
+
className: 'e-rte-upload-text' + this.parent.getCssClass(true), innerHTML: ((Browser.isDevice) ? deviceImgUpMsg : imgUpMsg)
|
|
26084
26261
|
});
|
|
26085
26262
|
span.appendChild(spanMsg);
|
|
26086
26263
|
var btnEle = this.parent.createElement('button', {
|
|
26087
|
-
className: 'e-browsebtn' +
|
|
26264
|
+
className: 'e-browsebtn' + this.parent.getCssClass(true), id: this.rteID + '_insertImage', attrs: { autofocus: 'true', type: 'button' }
|
|
26088
26265
|
});
|
|
26089
26266
|
span.appendChild(btnEle);
|
|
26090
26267
|
uploadParentEle.appendChild(span);
|
|
@@ -26096,7 +26273,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26096
26273
|
var btnClick = (Browser.isDevice) ? span : btnEle;
|
|
26097
26274
|
EventHandler.add(btnClick, 'click', this.fileSelect, this);
|
|
26098
26275
|
var uploadEle = this.parent.createElement('input', {
|
|
26099
|
-
id: this.rteID + '_upload', attrs: { type: 'File', name: 'UploadFiles' }, className: this.parent.
|
|
26276
|
+
id: this.rteID + '_upload', attrs: { type: 'File', name: 'UploadFiles' }, className: this.parent.getCssClass()
|
|
26100
26277
|
});
|
|
26101
26278
|
uploadParentEle.appendChild(uploadEle);
|
|
26102
26279
|
var altText;
|
|
@@ -26104,7 +26281,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26104
26281
|
var filesData;
|
|
26105
26282
|
this.uploadObj = new Uploader({
|
|
26106
26283
|
asyncSettings: { saveUrl: this.parent.insertImageSettings.saveUrl, removeUrl: this.parent.insertImageSettings.removeUrl },
|
|
26107
|
-
dropArea: span, multiple: false, enableRtl: this.parent.enableRtl, cssClass: this.parent.
|
|
26284
|
+
dropArea: span, multiple: false, enableRtl: this.parent.enableRtl, cssClass: this.parent.getCssClass(),
|
|
26108
26285
|
allowedExtensions: this.parent.insertImageSettings.allowedTypes.toString(),
|
|
26109
26286
|
selected: function (e) {
|
|
26110
26287
|
proxy.isImgUploaded = true;
|
|
@@ -26177,9 +26354,9 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26177
26354
|
failure: function (e) {
|
|
26178
26355
|
_this.parent.trigger(imageUploadFailed, e);
|
|
26179
26356
|
},
|
|
26180
|
-
removing: function () {
|
|
26357
|
+
removing: function (removeEventArgs) {
|
|
26181
26358
|
// eslint-disable-next-line
|
|
26182
|
-
_this.parent.trigger(imageRemoving,
|
|
26359
|
+
_this.parent.trigger(imageRemoving, removeEventArgs, function (e) {
|
|
26183
26360
|
proxy.isImgUploaded = false;
|
|
26184
26361
|
_this.dialogObj.getButtons(0).element.disabled = true;
|
|
26185
26362
|
proxy.inputUrl.removeAttribute('disabled');
|
|
@@ -26468,7 +26645,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26468
26645
|
saveUrl: this.parent.insertImageSettings.saveUrl,
|
|
26469
26646
|
removeUrl: this.parent.insertImageSettings.removeUrl
|
|
26470
26647
|
},
|
|
26471
|
-
cssClass: CLS_RTE_DIALOG_UPLOAD +
|
|
26648
|
+
cssClass: CLS_RTE_DIALOG_UPLOAD + this.parent.getCssClass(true),
|
|
26472
26649
|
dropArea: this.parent.element,
|
|
26473
26650
|
allowedExtensions: this.parent.insertImageSettings.allowedTypes.toString(),
|
|
26474
26651
|
removing: function () {
|
|
@@ -26674,10 +26851,10 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26674
26851
|
*/
|
|
26675
26852
|
/* eslint-enable */
|
|
26676
26853
|
Image.prototype.destroy = function () {
|
|
26677
|
-
this.prevSelectedImgEle = undefined;
|
|
26678
26854
|
if (isNullOrUndefined(this.parent)) {
|
|
26679
26855
|
return;
|
|
26680
26856
|
}
|
|
26857
|
+
this.prevSelectedImgEle = undefined;
|
|
26681
26858
|
this.removeEventListener();
|
|
26682
26859
|
};
|
|
26683
26860
|
Image.prototype.moduleDestroy = function () {
|
|
@@ -28982,7 +29159,7 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
28982
29159
|
this.parent.formatter.editorManager.observer.off(KEY_DOWN_HANDLER, this.onKeyDown);
|
|
28983
29160
|
};
|
|
28984
29161
|
ViewSource.prototype.getSourceCode = function () {
|
|
28985
|
-
return this.parent.createElement('textarea', { className: CLS_RTE_SOURCE_CODE_TXTAREA +
|
|
29162
|
+
return this.parent.createElement('textarea', { className: CLS_RTE_SOURCE_CODE_TXTAREA + this.parent.getCssClass(true) });
|
|
28986
29163
|
};
|
|
28987
29164
|
ViewSource.prototype.wireEvent = function (element) {
|
|
28988
29165
|
this.keyboardModule = new KeyboardEvents$1(element, {
|
|
@@ -29079,8 +29256,10 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
29079
29256
|
this.getPanel().style.display = 'block';
|
|
29080
29257
|
}
|
|
29081
29258
|
else {
|
|
29259
|
+
var height = this.parent.inputElement.offsetHeight;
|
|
29082
29260
|
this.contentModule.getPanel().appendChild(this.previewElement);
|
|
29083
29261
|
this.getPanel().value = this.getTextAreaValue();
|
|
29262
|
+
this.previewElement.style.height = height + 'px';
|
|
29084
29263
|
this.contentModule.getEditPanel().style.display = 'none';
|
|
29085
29264
|
this.previewElement.style.display = 'block';
|
|
29086
29265
|
}
|
|
@@ -29243,6 +29422,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29243
29422
|
this.parent.on(showTableDialog, this.showDialog, this);
|
|
29244
29423
|
this.parent.on(closeTableDialog, this.closeDialog, this);
|
|
29245
29424
|
this.parent.on(docClick, this.docClick, this);
|
|
29425
|
+
this.parent.on(iframeMouseDown, this.onIframeMouseDown, this);
|
|
29246
29426
|
this.parent.on(editAreaClick, this.editAreaClickHandler, this);
|
|
29247
29427
|
this.parent.on(clearDialogObj, this.clearDialogObj, this);
|
|
29248
29428
|
this.parent.on(tableToolbarAction, this.onToolbarAction, this);
|
|
@@ -29263,6 +29443,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29263
29443
|
this.parent.off(initialEnd, this.afterRender);
|
|
29264
29444
|
this.parent.off(dynamicModule, this.afterRender);
|
|
29265
29445
|
this.parent.off(docClick, this.docClick);
|
|
29446
|
+
this.parent.off(iframeMouseDown, this.onIframeMouseDown);
|
|
29266
29447
|
this.parent.off(showTableDialog, this.showDialog);
|
|
29267
29448
|
this.parent.off(closeTableDialog, this.closeDialog);
|
|
29268
29449
|
this.parent.off(editAreaClick, this.editAreaClickHandler);
|
|
@@ -29271,8 +29452,8 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29271
29452
|
this.parent.off(dropDownSelect, this.dropdownSelect);
|
|
29272
29453
|
this.parent.off(mouseDown, this.cellSelect);
|
|
29273
29454
|
this.parent.off(tableColorPickerChanged, this.setBGColor);
|
|
29274
|
-
this.parent.off(keyUp, this.keyUp);
|
|
29275
29455
|
this.parent.off(keyDown, this.keyDown);
|
|
29456
|
+
this.parent.off(keyUp, this.keyUp);
|
|
29276
29457
|
this.parent.off(mouseUp, this.selectionTable);
|
|
29277
29458
|
this.parent.off(tableModulekeyUp, this.tableModulekeyUp);
|
|
29278
29459
|
this.parent.off(bindCssClass, this.setCssClass);
|
|
@@ -29468,11 +29649,12 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29468
29649
|
name: !isInternal ? 'showDialog' : null
|
|
29469
29650
|
};
|
|
29470
29651
|
this.insertTableDialog({ self: this, args: args, selection: selection });
|
|
29652
|
+
this.parent.formatter.editorManager.nodeSelection.restore();
|
|
29471
29653
|
}
|
|
29472
29654
|
};
|
|
29473
29655
|
Table.prototype.showDialog = function () {
|
|
29474
29656
|
this.openDialog(false);
|
|
29475
|
-
this.setCssClass({ cssClass: this.parent.
|
|
29657
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
29476
29658
|
};
|
|
29477
29659
|
Table.prototype.closeDialog = function () {
|
|
29478
29660
|
if (this.editdlgObj) {
|
|
@@ -29662,6 +29844,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29662
29844
|
Table.prototype.tableHeader = function (selection, e) {
|
|
29663
29845
|
this.parent.formatter.process(this.parent, e, e.originalEvent, { selection: selection, subCommand: e.item.subCommand });
|
|
29664
29846
|
};
|
|
29847
|
+
Table.prototype.getAnchorNode = function (element) {
|
|
29848
|
+
var selectParent = closest(element, 'a');
|
|
29849
|
+
return (selectParent ? selectParent : element);
|
|
29850
|
+
};
|
|
29665
29851
|
Table.prototype.editAreaClickHandler = function (e) {
|
|
29666
29852
|
if (this.parent.readonly || !isNullOrUndefined(closest(e.args.target, '.e-img-caption'))) {
|
|
29667
29853
|
return;
|
|
@@ -29683,7 +29869,8 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29683
29869
|
var closestTable = closest(target, 'table');
|
|
29684
29870
|
var startNode = this.parent.getRange().startContainer.parentElement;
|
|
29685
29871
|
var endNode = this.parent.getRange().endContainer.parentElement;
|
|
29686
|
-
|
|
29872
|
+
var isAnchorEle = this.getAnchorNode(target);
|
|
29873
|
+
if (target && target.nodeName !== 'A' && isAnchorEle.nodeName !== 'A' && target.nodeName !== 'IMG' && target.nodeName !== 'VIDEO' && !target.classList.contains(CLS_CLICKELEM) &&
|
|
29687
29874
|
target.nodeName !== 'AUDIO' && startNode === endNode && (target.nodeName === 'TD' || target.nodeName === 'TH' ||
|
|
29688
29875
|
target.nodeName === 'TABLE' || (closestTable && this.parent.contentModule.getEditPanel().contains(closestTable)))
|
|
29689
29876
|
&& !(range.startContainer.nodeType === 3 && !range.collapsed)) {
|
|
@@ -29869,7 +30056,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29869
30056
|
this.contentModule.getEditPanel().appendChild(rowReEle);
|
|
29870
30057
|
}
|
|
29871
30058
|
var tableReBox = this.parent.createElement('span', {
|
|
29872
|
-
className: CLS_TB_BOX_RES +
|
|
30059
|
+
className: CLS_TB_BOX_RES + this.parent.getCssClass(true), attrs: {
|
|
29873
30060
|
'data-col': columns.length.toString(), 'unselectable': 'on', 'contenteditable': 'false'
|
|
29874
30061
|
}
|
|
29875
30062
|
});
|
|
@@ -30022,7 +30209,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30022
30209
|
};
|
|
30023
30210
|
Table.prototype.appendHelper = function () {
|
|
30024
30211
|
this.helper = this.parent.createElement('div', {
|
|
30025
|
-
className: 'e-table-rhelper' +
|
|
30212
|
+
className: 'e-table-rhelper' + this.parent.getCssClass(true)
|
|
30026
30213
|
});
|
|
30027
30214
|
if (Browser.isDevice) {
|
|
30028
30215
|
this.helper.classList.add('e-reicon');
|
|
@@ -30383,16 +30570,16 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30383
30570
|
this.hideTableQuickToolbar();
|
|
30384
30571
|
var header = '1X1';
|
|
30385
30572
|
var insertbtn = this.l10n.getConstant('inserttablebtn');
|
|
30386
|
-
this.dlgDiv = this.parent.createElement('div', { className: 'e-rte-table-popup' +
|
|
30387
|
-
this.tblHeader = this.parent.createElement('div', { className: 'e-rte-popup-header' +
|
|
30573
|
+
this.dlgDiv = this.parent.createElement('div', { className: 'e-rte-table-popup' + this.parent.getCssClass(true), id: this.rteID + '_table' });
|
|
30574
|
+
this.tblHeader = this.parent.createElement('div', { className: 'e-rte-popup-header' + this.parent.getCssClass(true) });
|
|
30388
30575
|
this.tblHeader.innerHTML = header;
|
|
30389
30576
|
this.dlgDiv.appendChild(this.tblHeader);
|
|
30390
|
-
var tableDiv = this.parent.createElement('div', { className: 'e-rte-table-span' +
|
|
30577
|
+
var tableDiv = this.parent.createElement('div', { className: 'e-rte-table-span' + this.parent.getCssClass(true) });
|
|
30391
30578
|
this.drawTable(tableDiv, args);
|
|
30392
30579
|
this.dlgDiv.appendChild(tableDiv);
|
|
30393
|
-
this.dlgDiv.appendChild(this.parent.createElement('span', { className: 'e-span-border' +
|
|
30580
|
+
this.dlgDiv.appendChild(this.parent.createElement('span', { className: 'e-span-border' + this.parent.getCssClass(true) }));
|
|
30394
30581
|
var btnEle = this.parent.createElement('button', {
|
|
30395
|
-
className: 'e-insert-table-btn' +
|
|
30582
|
+
className: 'e-insert-table-btn' + this.parent.getCssClass(true), id: this.rteID + '_insertTable',
|
|
30396
30583
|
attrs: { type: 'button', tabindex: '0' }
|
|
30397
30584
|
});
|
|
30398
30585
|
if (!isNullOrUndefined(this.parent.getToolbarElement().querySelector('.e-expended-nav'))) {
|
|
@@ -30400,7 +30587,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30400
30587
|
}
|
|
30401
30588
|
this.dlgDiv.appendChild(btnEle);
|
|
30402
30589
|
this.createTableButton = new Button({
|
|
30403
|
-
iconCss: 'e-icons e-create-table', content: insertbtn, cssClass: 'e-flat' +
|
|
30590
|
+
iconCss: 'e-icons e-create-table', content: insertbtn, cssClass: 'e-flat' + this.parent.getCssClass(true),
|
|
30404
30591
|
enableRtl: this.parent.enableRtl, locale: this.parent.locale
|
|
30405
30592
|
});
|
|
30406
30593
|
this.createTableButton.isStringTemplate = true;
|
|
@@ -30428,10 +30615,15 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30428
30615
|
});
|
|
30429
30616
|
addClass([this.popupObj.element], 'e-popup-open');
|
|
30430
30617
|
if (!isNullOrUndefined(this.parent.cssClass)) {
|
|
30431
|
-
addClass([this.popupObj.element], this.parent.
|
|
30618
|
+
addClass([this.popupObj.element], this.parent.getCssClass());
|
|
30432
30619
|
}
|
|
30433
30620
|
this.popupObj.refreshPosition(target);
|
|
30434
30621
|
};
|
|
30622
|
+
Table.prototype.onIframeMouseDown = function () {
|
|
30623
|
+
if (this.popupObj) {
|
|
30624
|
+
this.popupObj.hide();
|
|
30625
|
+
}
|
|
30626
|
+
};
|
|
30435
30627
|
Table.prototype.docClick = function (e) {
|
|
30436
30628
|
var target = e.args.target;
|
|
30437
30629
|
// eslint-disable-next-line
|
|
@@ -30468,10 +30660,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30468
30660
|
var rowDiv;
|
|
30469
30661
|
var tableCell;
|
|
30470
30662
|
for (var row = 0; row < 3; row++) {
|
|
30471
|
-
rowDiv = this.parent.createElement('div', { className: 'e-rte-table-row' +
|
|
30663
|
+
rowDiv = this.parent.createElement('div', { className: 'e-rte-table-row' + this.parent.getCssClass(true), attrs: { 'data-column': '' + row } });
|
|
30472
30664
|
for (var col = 0; col < 10; col++) {
|
|
30473
30665
|
var display = (row > 2) ? 'none' : 'inline-block';
|
|
30474
|
-
tableCell = this.parent.createElement('div', { className: 'e-rte-tablecell e-default' +
|
|
30666
|
+
tableCell = this.parent.createElement('div', { className: 'e-rte-tablecell e-default' + this.parent.getCssClass(true), attrs: { 'data-cell': '' + col } });
|
|
30475
30667
|
rowDiv.appendChild(tableCell);
|
|
30476
30668
|
tableCell.style.display = display;
|
|
30477
30669
|
if (col === 0 && row === 0) {
|
|
@@ -30495,13 +30687,13 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30495
30687
|
height: 'initial', width: '290px', content: editContent, header: editHeader,
|
|
30496
30688
|
buttons: [{
|
|
30497
30689
|
click: this.applyProperties.bind(this, args),
|
|
30498
|
-
buttonModel: { content: update, cssClass: 'e-flat e-size-update' +
|
|
30690
|
+
buttonModel: { content: update, cssClass: 'e-flat e-size-update' + this.parent.getCssClass(true), isPrimary: true }
|
|
30499
30691
|
},
|
|
30500
30692
|
{
|
|
30501
30693
|
click: function (e) {
|
|
30502
30694
|
_this.cancelDialog(e);
|
|
30503
30695
|
},
|
|
30504
|
-
buttonModel: { cssClass: 'e-flat e-cancel' +
|
|
30696
|
+
buttonModel: { cssClass: 'e-flat e-cancel' + this.parent.getCssClass(true), content: cancel }
|
|
30505
30697
|
}],
|
|
30506
30698
|
cssClass: this.editdlgObj.cssClass + ' e-rte-edit-table-prop-dialog'
|
|
30507
30699
|
});
|
|
@@ -30543,10 +30735,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30543
30735
|
Table.prototype.tableCellDlgContent = function () {
|
|
30544
30736
|
var tableColumn = this.l10n.getConstant('columns');
|
|
30545
30737
|
var tableRow = this.l10n.getConstant('rows');
|
|
30546
|
-
var tableWrap = this.parent.createElement('div', { className: 'e-cell-wrap' +
|
|
30547
|
-
var content = '<div class="e-rte-field' +
|
|
30548
|
-
+ ' data-role ="none" id="tableColumn" class="e-table-column' +
|
|
30549
|
-
+ '<div class="e-rte-field' +
|
|
30738
|
+
var tableWrap = this.parent.createElement('div', { className: 'e-cell-wrap' + this.parent.getCssClass(true) });
|
|
30739
|
+
var content = '<div class="e-rte-field' + this.parent.getCssClass(true) + '"><input type="text" '
|
|
30740
|
+
+ ' data-role ="none" id="tableColumn" class="e-table-column' + this.parent.getCssClass(true) + '"/></div>'
|
|
30741
|
+
+ '<div class="e-rte-field' + this.parent.getCssClass(true) + '"><input type="text" data-role ="none" id="tableRow" class="e-table-row' + this.parent.getCssClass(true) + '" /></div>';
|
|
30550
30742
|
var contentElem = parseHtml(content);
|
|
30551
30743
|
tableWrap.appendChild(contentElem);
|
|
30552
30744
|
this.columnTextBox = new NumericTextBox({
|
|
@@ -30557,7 +30749,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30557
30749
|
floatLabelType: 'Auto',
|
|
30558
30750
|
max: 50,
|
|
30559
30751
|
enableRtl: this.parent.enableRtl, locale: this.parent.locale,
|
|
30560
|
-
cssClass: this.parent.
|
|
30752
|
+
cssClass: this.parent.getCssClass()
|
|
30561
30753
|
});
|
|
30562
30754
|
this.columnTextBox.isStringTemplate = true;
|
|
30563
30755
|
this.columnTextBox.appendTo(tableWrap.querySelector('#tableColumn'));
|
|
@@ -30569,7 +30761,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30569
30761
|
floatLabelType: 'Auto',
|
|
30570
30762
|
max: 1000,
|
|
30571
30763
|
enableRtl: this.parent.enableRtl, locale: this.parent.locale,
|
|
30572
|
-
cssClass: this.parent.
|
|
30764
|
+
cssClass: this.parent.getCssClass()
|
|
30573
30765
|
});
|
|
30574
30766
|
this.rowTextBox.isStringTemplate = true;
|
|
30575
30767
|
this.rowTextBox.appendTo(tableWrap.querySelector('#tableRow'));
|
|
@@ -30590,7 +30782,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30590
30782
|
return;
|
|
30591
30783
|
}
|
|
30592
30784
|
var tableDialog = this.parent.createElement('div', {
|
|
30593
|
-
className: 'e-rte-edit-table' +
|
|
30785
|
+
className: 'e-rte-edit-table' + this.parent.getCssClass(true), id: this.rteID + '_tabledialog'
|
|
30594
30786
|
});
|
|
30595
30787
|
this.parent.element.appendChild(tableDialog);
|
|
30596
30788
|
var insert = this.l10n.getConstant('dialogInsert');
|
|
@@ -30598,20 +30790,20 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30598
30790
|
var header = this.l10n.getConstant('tabledialogHeader');
|
|
30599
30791
|
var dialogModel = {
|
|
30600
30792
|
header: header,
|
|
30601
|
-
cssClass: CLS_RTE_ELEMENTS +
|
|
30793
|
+
cssClass: CLS_RTE_ELEMENTS + this.parent.getCssClass(true),
|
|
30602
30794
|
enableRtl: this.parent.enableRtl,
|
|
30603
30795
|
locale: this.parent.locale,
|
|
30604
30796
|
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px', height: 'initial',
|
|
30605
30797
|
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
30606
30798
|
isModal: Browser.isDevice,
|
|
30607
30799
|
buttons: [{
|
|
30608
|
-
buttonModel: { content: insert, cssClass: 'e-flat e-insert-table' +
|
|
30800
|
+
buttonModel: { content: insert, cssClass: 'e-flat e-insert-table' + this.parent.getCssClass(true), isPrimary: true }
|
|
30609
30801
|
},
|
|
30610
30802
|
{
|
|
30611
30803
|
click: function (e) {
|
|
30612
30804
|
_this.cancelDialog(e);
|
|
30613
30805
|
},
|
|
30614
|
-
buttonModel: { cssClass: 'e-flat e-cancel' +
|
|
30806
|
+
buttonModel: { cssClass: 'e-flat e-cancel' + this.parent.getCssClass(true), content: cancel }
|
|
30615
30807
|
}],
|
|
30616
30808
|
target: (Browser.isDevice) ? document.body : this.parent.element,
|
|
30617
30809
|
animationSettings: { effect: 'None' },
|
|
@@ -30684,13 +30876,13 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30684
30876
|
var tableWidth = this.l10n.getConstant('tableWidth');
|
|
30685
30877
|
var cellPadding = this.l10n.getConstant('cellpadding');
|
|
30686
30878
|
var cellSpacing = this.l10n.getConstant('cellspacing');
|
|
30687
|
-
var tableWrap = this.parent.createElement('div', { className: 'e-table-sizewrap' +
|
|
30879
|
+
var tableWrap = this.parent.createElement('div', { className: 'e-table-sizewrap' + this.parent.getCssClass(true) });
|
|
30688
30880
|
var widthVal = closest(selectNode, 'table').getClientRects()[0].width;
|
|
30689
30881
|
var padVal = closest(selectNode, 'td').style.padding;
|
|
30690
30882
|
var brdSpcVal = closest(selectNode, 'table').getAttribute('cellspacing');
|
|
30691
|
-
var content = '<div class="e-rte-field' +
|
|
30692
|
-
+ ' /></div>' + '<div class="e-rte-field' +
|
|
30693
|
-
+ ' </div><div class="e-rte-field' +
|
|
30883
|
+
var content = '<div class="e-rte-field' + this.parent.getCssClass(true) + '"><input type="text" data-role ="none" id="tableWidth" class="e-table-width' + this.parent.getCssClass(true) + '" '
|
|
30884
|
+
+ ' /></div>' + '<div class="e-rte-field' + this.parent.getCssClass(true) + '"><input type="text" data-role ="none" id="cellPadding" class="e-cell-padding' + this.parent.getCssClass(true) + '" />'
|
|
30885
|
+
+ ' </div><div class="e-rte-field' + this.parent.getCssClass(true) + '"><input type="text" data-role ="none" id="cellSpacing" class="e-cell-spacing' + this.parent.getCssClass(true) + '" /></div>';
|
|
30694
30886
|
var contentElem = parseHtml(content);
|
|
30695
30887
|
tableWrap.appendChild(contentElem);
|
|
30696
30888
|
this.tableWidthNum = new NumericTextBox({
|
|
@@ -30837,7 +31029,16 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
|
|
|
30837
31029
|
DialogRenderer.prototype.getDialogPosition = function () {
|
|
30838
31030
|
var distanceFromVisibleTop = this.parent.element.getBoundingClientRect().top;
|
|
30839
31031
|
if (distanceFromVisibleTop < 0) {
|
|
30840
|
-
|
|
31032
|
+
var topHeight = 0;
|
|
31033
|
+
var parentElement = this.parent.element;
|
|
31034
|
+
while (parentElement.nodeName !== 'BODY') {
|
|
31035
|
+
var top_1 = parentElement.getBoundingClientRect().top;
|
|
31036
|
+
if (top_1 > 0) {
|
|
31037
|
+
topHeight = top_1;
|
|
31038
|
+
}
|
|
31039
|
+
parentElement = parentElement.parentElement;
|
|
31040
|
+
}
|
|
31041
|
+
distanceFromVisibleTop = Math.abs(distanceFromVisibleTop) + topHeight;
|
|
30841
31042
|
return distanceFromVisibleTop.toString();
|
|
30842
31043
|
}
|
|
30843
31044
|
else {
|
|
@@ -31875,7 +32076,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
31875
32076
|
}
|
|
31876
32077
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem.nextElementSibling, 0);
|
|
31877
32078
|
}
|
|
31878
|
-
else if (nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG'
|
|
32079
|
+
else if (nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
32080
|
+
(nearBlockNode.querySelectorAll('video').length > 0) || (nearBlockNode.querySelectorAll('audio').length > 0) || (nearBlockNode.querySelectorAll('img').length > 0))) {
|
|
31879
32081
|
if (!isNullOrUndefined(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
|
|
31880
32082
|
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
31881
32083
|
_this.parent.formatter.editorManager.domNode.insertAfter(newElem, nearBlockNode);
|
|
@@ -32496,7 +32698,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32496
32698
|
if (tool.command === 'InsertText') {
|
|
32497
32699
|
currentInsertContentLength = value.length;
|
|
32498
32700
|
}
|
|
32499
|
-
var currentLength = this.getText().trim().length;
|
|
32701
|
+
var currentLength = this.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
32500
32702
|
var selectionLength = this.getSelection().length;
|
|
32501
32703
|
var totalLength = (currentLength - selectionLength) + currentInsertContentLength;
|
|
32502
32704
|
if (!(this.maxLength === -1 || totalLength <= this.maxLength)) {
|
|
@@ -32671,7 +32873,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32671
32873
|
if (this.enableXhtml) {
|
|
32672
32874
|
this.setProperties({ value: this.getXhtml() }, true);
|
|
32673
32875
|
}
|
|
32674
|
-
if (this.toolbarSettings.enable && this.toolbarSettings.type === 'Expand' && !isNullOrUndefined(this.getToolbar()) &&
|
|
32876
|
+
if (this.toolbarSettings.enable && (this.toolbarSettings.type === 'Expand' || this.toolbarSettings.type === 'MultiRow' || this.toolbarSettings.type === 'Scrollable') && !isNullOrUndefined(this.getToolbar()) &&
|
|
32675
32877
|
(this.toolbarSettings.items.indexOf('Undo') > -1 && this.toolbarSettings.items.indexOf('Redo') > -1)) {
|
|
32676
32878
|
this.disableToolbarItem(['Undo', 'Redo']);
|
|
32677
32879
|
}
|
|
@@ -32681,7 +32883,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32681
32883
|
}
|
|
32682
32884
|
// eslint-disable-next-line
|
|
32683
32885
|
(this.enabled && !this.readonly) ? this.eventInitializer() : this.unWireEvents();
|
|
32684
|
-
this.notify(bindCssClass, { cssClass: this.
|
|
32886
|
+
this.notify(bindCssClass, { cssClass: this.getCssClass() });
|
|
32685
32887
|
this.addAudioVideoWrapper();
|
|
32686
32888
|
this.notify(tableclass, {});
|
|
32687
32889
|
this.renderComplete();
|
|
@@ -32772,7 +32974,13 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32772
32974
|
range.endContainer;
|
|
32773
32975
|
var closestLI = closest(endNode, 'LI');
|
|
32774
32976
|
var isDetached = false;
|
|
32775
|
-
|
|
32977
|
+
var currentRangeEndOffset = range.endOffset;
|
|
32978
|
+
if (currentEndContainer.nodeType === Node.TEXT_NODE) {
|
|
32979
|
+
if (currentEndContainer.textContent.charAt(currentRangeEndOffset - 1) === '\uFEFF') {
|
|
32980
|
+
currentRangeEndOffset--;
|
|
32981
|
+
}
|
|
32982
|
+
}
|
|
32983
|
+
if (!isNullOrUndefined(closestLI) && endNode.textContent.trim().length === currentRangeEndOffset &&
|
|
32776
32984
|
!range.collapsed && isNullOrUndefined(endNode.nextElementSibling)) {
|
|
32777
32985
|
for (var i = 0; i < closestLI.childNodes.length; i++) {
|
|
32778
32986
|
if (closestLI.childNodes[i].nodeName === '#text' && closestLI.childNodes[i].textContent.trim().length === 0) {
|
|
@@ -32851,7 +33059,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32851
33059
|
}
|
|
32852
33060
|
var notFormatPainterCopy = isNullOrUndefined(e.action) ? true : (e.action !== 'format-copy' ? true : false);
|
|
32853
33061
|
if (this.formatter.getUndoRedoStack().length === 0 && notFormatPainterCopy &&
|
|
32854
|
-
!(e.altKey || e.shiftKey || (e.altKey && e.shiftKey && e.which
|
|
33062
|
+
!(e.altKey || e.shiftKey || (e.altKey && e.shiftKey && e.which == 67))) {
|
|
32855
33063
|
this.formatter.saveData();
|
|
32856
33064
|
}
|
|
32857
33065
|
if (e.action !== 'insert-link' &&
|
|
@@ -32920,7 +33128,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32920
33128
|
this.formatter.onKeyHandler(this, e);
|
|
32921
33129
|
}
|
|
32922
33130
|
if (this.inputElement && this.inputElement.textContent.length !== 0
|
|
32923
|
-
|| this.element.querySelectorAll('.e-toolbar-item.e-active').length > 0) {
|
|
33131
|
+
|| this.element.querySelectorAll('.e-toolbar-item.e-active').length > 0 || this.formatter.getUndoRedoStack().length > 0) {
|
|
32924
33132
|
this.notify(toolbarRefresh, { args: e });
|
|
32925
33133
|
}
|
|
32926
33134
|
if (!isNullOrUndefined(this.placeholder)) {
|
|
@@ -33012,20 +33220,61 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33012
33220
|
return;
|
|
33013
33221
|
}
|
|
33014
33222
|
}
|
|
33015
|
-
this.notifyMouseUp(e);
|
|
33016
33223
|
if (e.detail === 3) {
|
|
33017
33224
|
var range = this.getRange();
|
|
33018
33225
|
var selection = this.formatter.editorManager.domNode.getSelection();
|
|
33019
|
-
|
|
33020
|
-
|
|
33021
|
-
|
|
33022
|
-
|
|
33023
|
-
|
|
33024
|
-
|
|
33025
|
-
|
|
33226
|
+
// To handle the triple click node selection improper range due to browser behavior.
|
|
33227
|
+
if (selection.rangeCount > 0 && !isNullOrUndefined(range.startContainer.parentElement) && (!isNullOrUndefined(range.startContainer.parentElement.nextSibling) &&
|
|
33228
|
+
(range.startContainer.parentElement.nextSibling.nodeType !== 3 ||
|
|
33229
|
+
/\s+$/.test(range.startContainer.parentElement.nextSibling.textContent)) || range.startOffset === range.endOffset)
|
|
33230
|
+
|| range.startContainer.parentElement.tagName.toLocaleLowerCase() === 'li') {
|
|
33231
|
+
var newRange = new Range();
|
|
33232
|
+
var start = range.startContainer;
|
|
33233
|
+
var end = range.endContainer;
|
|
33234
|
+
var isInvalid = false;
|
|
33235
|
+
var isInsideList = range.commonAncestorContainer.nodeName === 'OL' || range.commonAncestorContainer.nodeName === 'UL'
|
|
33236
|
+
|| range.commonAncestorContainer.nodeName === 'LI';
|
|
33237
|
+
if (!isInsideList && end.nodeType === 1 && end.nodeName === 'LI') {
|
|
33238
|
+
end = closest(end, 'ol, ul').previousElementSibling.lastElementChild;
|
|
33239
|
+
}
|
|
33240
|
+
else if (isInsideList && end.nodeType === 1 && range.endOffset === 0) {
|
|
33241
|
+
if (end.previousElementSibling && end.previousElementSibling.lastElementChild) {
|
|
33242
|
+
end = end.previousElementSibling.lastElementChild;
|
|
33243
|
+
}
|
|
33244
|
+
else {
|
|
33245
|
+
end = closest(end.parentElement, 'li');
|
|
33246
|
+
if (end && end.nodeName === 'LI') {
|
|
33247
|
+
end = end.previousElementSibling;
|
|
33248
|
+
}
|
|
33249
|
+
}
|
|
33250
|
+
}
|
|
33251
|
+
else {
|
|
33252
|
+
if (!closest(end, 'li') && end.previousElementSibling && end.previousElementSibling.lastChild &&
|
|
33253
|
+
end.previousElementSibling.textContent.trim().length > 0) {
|
|
33254
|
+
end = end.previousElementSibling.lastChild;
|
|
33255
|
+
}
|
|
33256
|
+
else if (closest(end, 'li') && end.previousElementSibling && end.previousElementSibling.lastChild) {
|
|
33257
|
+
end = closest(end, 'li').parentElement.previousElementSibling.lastChild;
|
|
33258
|
+
}
|
|
33259
|
+
}
|
|
33260
|
+
if (!end || end === this.inputElement) {
|
|
33261
|
+
end = start;
|
|
33262
|
+
isInvalid = true;
|
|
33026
33263
|
}
|
|
33264
|
+
while (end.nodeName !== '#text' && !isInvalid) {
|
|
33265
|
+
if (end.lastElementChild) {
|
|
33266
|
+
end = end.lastElementChild;
|
|
33267
|
+
}
|
|
33268
|
+
else {
|
|
33269
|
+
end = end.lastChild;
|
|
33270
|
+
}
|
|
33271
|
+
}
|
|
33272
|
+
newRange.setStart(start, 0);
|
|
33273
|
+
newRange.setEnd(end, end.textContent.length);
|
|
33274
|
+
this.formatter.editorManager.nodeSelection.setRange(this.contentModule.getDocument(), newRange);
|
|
33027
33275
|
}
|
|
33028
33276
|
}
|
|
33277
|
+
this.notifyMouseUp(e);
|
|
33029
33278
|
};
|
|
33030
33279
|
/**
|
|
33031
33280
|
* @param {Function} module - specifies the module function.
|
|
@@ -33069,7 +33318,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33069
33318
|
var currentLength = _this.inputElement.textContent.length;
|
|
33070
33319
|
var selectionLength = _this.getSelection().length;
|
|
33071
33320
|
var pastedContentLength = (isNullOrUndefined(e) || isNullOrUndefined(e.clipboardData))
|
|
33072
|
-
? 0 : e.clipboardData.getData('text/plain').length;
|
|
33321
|
+
? 0 : e.clipboardData.getData('text/plain').replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
33073
33322
|
var totalLength = (currentLength - selectionLength) + pastedContentLength;
|
|
33074
33323
|
if (_this.editorMode === 'Markdown') {
|
|
33075
33324
|
var args_1 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
|
|
@@ -33501,7 +33750,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33501
33750
|
RichTextEditor.prototype.updatePanelValue = function () {
|
|
33502
33751
|
var value = this.value;
|
|
33503
33752
|
value = (this.enableHtmlEncode && this.value) ? decode(value) : value;
|
|
33504
|
-
var getTextArea = this.element.querySelector('.
|
|
33753
|
+
var getTextArea = this.element.querySelector('.' + CLS_RTE_SOURCE_CODE_TXTAREA);
|
|
33505
33754
|
if (value) {
|
|
33506
33755
|
if (getTextArea && getTextArea.style.display === 'block') {
|
|
33507
33756
|
getTextArea.value = this.value;
|
|
@@ -34132,6 +34381,16 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34132
34381
|
RichTextEditor.prototype.getID = function () {
|
|
34133
34382
|
return (this.originalElement.tagName === 'TEXTAREA' ? this.valueContainer.id : this.element.id);
|
|
34134
34383
|
};
|
|
34384
|
+
/**
|
|
34385
|
+
* @returns {void}
|
|
34386
|
+
* getCssClass method
|
|
34387
|
+
*
|
|
34388
|
+
* @hidden
|
|
34389
|
+
* @deprecated
|
|
34390
|
+
*/
|
|
34391
|
+
RichTextEditor.prototype.getCssClass = function (isSpace) {
|
|
34392
|
+
return (isNullOrUndefined(this.cssClass) ? '' : isSpace ? ' ' + this.cssClass : this.cssClass);
|
|
34393
|
+
};
|
|
34135
34394
|
RichTextEditor.prototype.mouseDownHandler = function (e) {
|
|
34136
34395
|
var touch = (e.touches ? e.changedTouches[0] : e);
|
|
34137
34396
|
addClass([this.element], [CLS_FOCUS]);
|
|
@@ -34243,7 +34502,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34243
34502
|
};
|
|
34244
34503
|
RichTextEditor.prototype.getUpdatedValue = function () {
|
|
34245
34504
|
var value;
|
|
34246
|
-
var getTextArea = this.element.querySelector('.
|
|
34505
|
+
var getTextArea = this.element.querySelector('.' + CLS_RTE_SOURCE_CODE_TXTAREA);
|
|
34247
34506
|
if (this.editorMode === 'HTML') {
|
|
34248
34507
|
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
34249
34508
|
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
@@ -34274,6 +34533,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34274
34533
|
clearTimeout(this.idleInterval);
|
|
34275
34534
|
this.idleInterval = setTimeout(this.updateValueOnIdle.bind(this), 0);
|
|
34276
34535
|
};
|
|
34536
|
+
RichTextEditor.prototype.cleanupResizeElements = function (args) {
|
|
34537
|
+
var value = this.removeResizeElement(args.value);
|
|
34538
|
+
args.callBack(value);
|
|
34539
|
+
};
|
|
34277
34540
|
RichTextEditor.prototype.removeResizeElement = function (value) {
|
|
34278
34541
|
var valueElementWrapper = document.createElement("div");
|
|
34279
34542
|
valueElementWrapper.innerHTML = value;
|
|
@@ -34495,6 +34758,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34495
34758
|
this.on(contentChanged, this.contentChanged, this);
|
|
34496
34759
|
this.on(resizeInitialized, this.updateResizeFlag, this);
|
|
34497
34760
|
this.on(updateTbItemsStatus, this.updateStatus, this);
|
|
34761
|
+
this.on(cleanupResizeElements, this.cleanupResizeElements, this);
|
|
34498
34762
|
if (this.readonly && this.enabled) {
|
|
34499
34763
|
return;
|
|
34500
34764
|
}
|
|
@@ -34581,6 +34845,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34581
34845
|
this.off(contentChanged, this.contentChanged);
|
|
34582
34846
|
this.off(resizeInitialized, this.updateResizeFlag);
|
|
34583
34847
|
this.off(updateTbItemsStatus, this.updateStatus);
|
|
34848
|
+
this.off(cleanupResizeElements, this.cleanupResizeElements);
|
|
34584
34849
|
if (this.readonly && this.enabled) {
|
|
34585
34850
|
return;
|
|
34586
34851
|
}
|
|
@@ -34953,5 +35218,5 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34953
35218
|
* Rich Text Editor component exported items
|
|
34954
35219
|
*/
|
|
34955
35220
|
|
|
34956
|
-
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,
|
|
35221
|
+
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, blockEmptyNodes, inlineEmptyNodes, 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, 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, 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 };
|
|
34957
35222
|
//# sourceMappingURL=ej2-richtexteditor.es5.js.map
|