@syncfusion/ej2-richtexteditor 23.2.7 → 24.1.41
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 +27 -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 +571 -309
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +570 -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 +72 -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 +10 -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,13 @@ 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.trigger(cleanupResizeElements, { value: value }, function (args) {
|
|
21365
|
+
value = args.value;
|
|
21366
|
+
});
|
|
21279
21367
|
if (this.parent.pasteCleanupSettings.prompt) {
|
|
21280
21368
|
if (isValueNotEmpty) {
|
|
21281
21369
|
e.args.preventDefault();
|
|
21282
|
-
this.pasteDialog(value, args);
|
|
21370
|
+
this.pasteDialog(value, args, isClipboardHTMLDataNull);
|
|
21283
21371
|
}
|
|
21284
21372
|
else if (Browser.userAgent.indexOf('Firefox') !== -1 && isNullOrUndefined(file)) {
|
|
21285
21373
|
this.fireFoxImageUpload();
|
|
@@ -21291,7 +21379,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21291
21379
|
}
|
|
21292
21380
|
else if (this.parent.pasteCleanupSettings.plainText) {
|
|
21293
21381
|
e.args.preventDefault();
|
|
21294
|
-
this.plainFormatting(value, args);
|
|
21382
|
+
this.plainFormatting(value, args, isClipboardHTMLDataNull);
|
|
21295
21383
|
}
|
|
21296
21384
|
else if (this.parent.pasteCleanupSettings.keepFormat) {
|
|
21297
21385
|
e.args.preventDefault();
|
|
@@ -21333,13 +21421,17 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21333
21421
|
PasteCleanup.prototype.splitBreakLine = function (value) {
|
|
21334
21422
|
var enterSplitText = value.split('\n');
|
|
21335
21423
|
var contentInnerElem = '';
|
|
21424
|
+
var startNode = this.parent.enterKey === 'P' ? '<p>' : (this.parent.enterKey === 'DIV' ? '<div>' : '');
|
|
21425
|
+
var endNode = this.parent.enterKey === 'P' ? '</p>' : (this.parent.enterKey === 'DIV' ? '</div>' : '<br>');
|
|
21336
21426
|
for (var i = 0; i < enterSplitText.length; i++) {
|
|
21337
21427
|
if (enterSplitText[i].trim() === '') {
|
|
21338
21428
|
contentInnerElem += getDefaultValue(this.parent);
|
|
21339
21429
|
}
|
|
21340
21430
|
else {
|
|
21341
21431
|
var contentWithSpace = this.makeSpace(enterSplitText[i]);
|
|
21342
|
-
contentInnerElem += '<
|
|
21432
|
+
contentInnerElem += (i === 0 && this.parent.enterKey !== 'BR' ? '<span>' : startNode) +
|
|
21433
|
+
(contentWithSpace.trim() === '' ? '<br>' : contentWithSpace.trim()) +
|
|
21434
|
+
(enterSplitText.length - 1 === i && this.parent.enterKey === 'BR' ? '' : (i === 0 && this.parent.enterKey !== 'BR' ? '</span>' : endNode));
|
|
21343
21435
|
}
|
|
21344
21436
|
}
|
|
21345
21437
|
return contentInnerElem;
|
|
@@ -21605,10 +21697,10 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21605
21697
|
var range = this.nodeSelectionObj.getRange(currentDocument);
|
|
21606
21698
|
this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
|
|
21607
21699
|
if (this.parent.pasteCleanupSettings.prompt) {
|
|
21608
|
-
this.pasteDialog(imageValue, pasteArgs);
|
|
21700
|
+
this.pasteDialog(imageValue, pasteArgs, false);
|
|
21609
21701
|
}
|
|
21610
21702
|
else if (this.parent.pasteCleanupSettings.plainText) {
|
|
21611
|
-
this.plainFormatting(imageValue, pasteArgs);
|
|
21703
|
+
this.plainFormatting(imageValue, pasteArgs, false);
|
|
21612
21704
|
}
|
|
21613
21705
|
else if (this.parent.pasteCleanupSettings.keepFormat) {
|
|
21614
21706
|
this.formatting(imageValue, false, pasteArgs);
|
|
@@ -21632,7 +21724,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21632
21724
|
var plainTextElement = this.parent.element.querySelector('#plainTextFormat');
|
|
21633
21725
|
this.plainTextRadioButton.appendTo(plainTextElement);
|
|
21634
21726
|
};
|
|
21635
|
-
PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked) {
|
|
21727
|
+
PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked, isClipboardHTMLDataNull) {
|
|
21636
21728
|
if (keepChecked) {
|
|
21637
21729
|
this.formatting(value, false, args);
|
|
21638
21730
|
}
|
|
@@ -21640,10 +21732,10 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21640
21732
|
this.formatting(value, true, args);
|
|
21641
21733
|
}
|
|
21642
21734
|
else {
|
|
21643
|
-
this.plainFormatting(value, args);
|
|
21735
|
+
this.plainFormatting(value, args, isClipboardHTMLDataNull);
|
|
21644
21736
|
}
|
|
21645
21737
|
};
|
|
21646
|
-
PasteCleanup.prototype.pasteDialog = function (value, args) {
|
|
21738
|
+
PasteCleanup.prototype.pasteDialog = function (value, args, isClipboardHTMLDataNull) {
|
|
21647
21739
|
var _this = this;
|
|
21648
21740
|
var isHeight = false;
|
|
21649
21741
|
var preRTEHeight = this.parent.height;
|
|
@@ -21660,7 +21752,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21660
21752
|
var argument = _this.dialogObj;
|
|
21661
21753
|
_this.dialogRenderObj.close(argument);
|
|
21662
21754
|
_this.dialogObj.destroy();
|
|
21663
|
-
_this.selectFormatting(value, args, keepChecked, cleanChecked);
|
|
21755
|
+
_this.selectFormatting(value, args, keepChecked, cleanChecked, isClipboardHTMLDataNull);
|
|
21664
21756
|
}
|
|
21665
21757
|
},
|
|
21666
21758
|
buttonModel: {
|
|
@@ -21721,7 +21813,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21721
21813
|
isHeight = true;
|
|
21722
21814
|
}
|
|
21723
21815
|
this.dialogObj.show();
|
|
21724
|
-
this.setCssClass({ cssClass: this.parent.
|
|
21816
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
21725
21817
|
};
|
|
21726
21818
|
PasteCleanup.prototype.updateCss = function (currentObj, e) {
|
|
21727
21819
|
if (currentObj && e.cssClass) {
|
|
@@ -21934,7 +22026,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21934
22026
|
return value;
|
|
21935
22027
|
};
|
|
21936
22028
|
//Plain Formatting
|
|
21937
|
-
PasteCleanup.prototype.plainFormatting = function (value, args) {
|
|
22029
|
+
PasteCleanup.prototype.plainFormatting = function (value, args, isClipboardHTMLDataNull) {
|
|
21938
22030
|
var _this = this;
|
|
21939
22031
|
var clipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
|
|
21940
22032
|
clipBoardElem.innerHTML = value;
|
|
@@ -21972,6 +22064,13 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21972
22064
|
this.saveSelection.restore();
|
|
21973
22065
|
clipBoardElem.innerHTML = this.sanitizeHelper(clipBoardElem.innerHTML);
|
|
21974
22066
|
this.addTempClass(clipBoardElem);
|
|
22067
|
+
this.removingComments(clipBoardElem);
|
|
22068
|
+
if (this.parent.enterKey === 'BR' && !isClipboardHTMLDataNull) {
|
|
22069
|
+
clipBoardElem = this.reframeToBrContent(clipBoardElem);
|
|
22070
|
+
}
|
|
22071
|
+
else if (this.parent.enterKey === 'DIV') {
|
|
22072
|
+
clipBoardElem.innerHTML = clipBoardElem.innerHTML.replace(/<p class="pasteContent_RTE">/g, '<div>').replace(/<\/p>/g, '</div>');
|
|
22073
|
+
}
|
|
21975
22074
|
this.parent.trigger(afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: null }, function (updatedArgs) { value = updatedArgs.value; });
|
|
21976
22075
|
clipBoardElem.innerHTML = value;
|
|
21977
22076
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
@@ -21986,6 +22085,41 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
21986
22085
|
this.parent.formatter.onSuccess(this.parent, args);
|
|
21987
22086
|
}
|
|
21988
22087
|
};
|
|
22088
|
+
PasteCleanup.prototype.removingComments = function (elm) {
|
|
22089
|
+
var innerElement = elm.innerHTML;
|
|
22090
|
+
innerElement = innerElement.replace(/<!--[\s\S]*?-->/g, '');
|
|
22091
|
+
elm.innerHTML = innerElement;
|
|
22092
|
+
};
|
|
22093
|
+
PasteCleanup.prototype.reframeToBrContent = function (clipBoardElem) {
|
|
22094
|
+
var newClipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
|
|
22095
|
+
while (!isNullOrUndefined(clipBoardElem.firstChild)) {
|
|
22096
|
+
var brElem = this.parent.createElement('br');
|
|
22097
|
+
var currentFirstChild = clipBoardElem.firstChild;
|
|
22098
|
+
if (currentFirstChild.nodeName === '#text') {
|
|
22099
|
+
var isNextSibPresent = !isNullOrUndefined(currentFirstChild.nextSibling);
|
|
22100
|
+
newClipBoardElem.appendChild(currentFirstChild);
|
|
22101
|
+
if (isNextSibPresent) {
|
|
22102
|
+
newClipBoardElem.appendChild(brElem);
|
|
22103
|
+
}
|
|
22104
|
+
}
|
|
22105
|
+
else {
|
|
22106
|
+
var isCurrentNodeBRElm = currentFirstChild.nodeName === 'BR';
|
|
22107
|
+
if (isCurrentNodeBRElm) {
|
|
22108
|
+
newClipBoardElem.appendChild(currentFirstChild);
|
|
22109
|
+
}
|
|
22110
|
+
else {
|
|
22111
|
+
newClipBoardElem.appendChild(currentFirstChild.childNodes[0]);
|
|
22112
|
+
}
|
|
22113
|
+
if (!isNullOrUndefined(currentFirstChild) && !isNullOrUndefined(currentFirstChild.nextSibling)) {
|
|
22114
|
+
newClipBoardElem.appendChild(brElem);
|
|
22115
|
+
}
|
|
22116
|
+
if (!isCurrentNodeBRElm && !isNullOrUndefined(currentFirstChild)) {
|
|
22117
|
+
detach(currentFirstChild);
|
|
22118
|
+
}
|
|
22119
|
+
}
|
|
22120
|
+
}
|
|
22121
|
+
return newClipBoardElem;
|
|
22122
|
+
};
|
|
21989
22123
|
PasteCleanup.prototype.getTextContent = function (clipBoardElem) {
|
|
21990
22124
|
for (var i = 0; i < this.blockNode.length; i++) {
|
|
21991
22125
|
var inElem = clipBoardElem.querySelectorAll(this.blockNode[i]);
|
|
@@ -22033,14 +22167,16 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
22033
22167
|
for (var i = 0; i < this.inlineNode.length; i++) {
|
|
22034
22168
|
var inElem = clipBoardElem.querySelectorAll(this.inlineNode[i]);
|
|
22035
22169
|
for (var j = 0; j < inElem.length; j++) {
|
|
22036
|
-
|
|
22037
|
-
|
|
22038
|
-
|
|
22039
|
-
|
|
22040
|
-
|
|
22041
|
-
|
|
22042
|
-
|
|
22043
|
-
|
|
22170
|
+
if (!(inElem[j] === clipBoardElem.firstChild && inElem[j].nodeName === 'SPAN')) {
|
|
22171
|
+
var parElem = void 0;
|
|
22172
|
+
for (var k = 0; k < inElem[j].childNodes.length; k++) {
|
|
22173
|
+
parElem = inElem[j].childNodes[k].parentElement;
|
|
22174
|
+
inElem[j].childNodes[k].parentElement.parentElement.insertBefore(inElem[j].childNodes[k], inElem[j].childNodes[k].parentElement);
|
|
22175
|
+
k--;
|
|
22176
|
+
}
|
|
22177
|
+
if (!isNullOrUndefined(parElem)) {
|
|
22178
|
+
detach(parElem);
|
|
22179
|
+
}
|
|
22044
22180
|
}
|
|
22045
22181
|
}
|
|
22046
22182
|
}
|
|
@@ -22399,7 +22535,7 @@ var FileManager$1 = /** @__PURE__ @class */ (function () {
|
|
|
22399
22535
|
this.dialogObj.createElement = this.parent.createElement;
|
|
22400
22536
|
this.dialogObj.appendTo(dlgTarget);
|
|
22401
22537
|
this.dialogObj.show(Browser.isDevice ? true : false);
|
|
22402
|
-
this.setCssClass({ cssClass: this.parent.
|
|
22538
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
22403
22539
|
};
|
|
22404
22540
|
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
22405
22541
|
FileManager$$1.prototype.setCssClass = function (e) {
|
|
@@ -22599,7 +22735,7 @@ var FullScreen = /** @__PURE__ @class */ (function () {
|
|
|
22599
22735
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
22600
22736
|
}
|
|
22601
22737
|
if (this.parent.showTooltip && !isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
22602
|
-
this.parent.notify(
|
|
22738
|
+
this.parent.notify(destroyTooltip, { args: event });
|
|
22603
22739
|
}
|
|
22604
22740
|
this.scrollableParent = getScrollableParent(this.parent.element);
|
|
22605
22741
|
if (!this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
|
|
@@ -22654,7 +22790,7 @@ var FullScreen = /** @__PURE__ @class */ (function () {
|
|
|
22654
22790
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
22655
22791
|
}
|
|
22656
22792
|
if (this.parent.showTooltip && !isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
22657
|
-
this.parent.notify(
|
|
22793
|
+
this.parent.notify(destroyTooltip, { args: event });
|
|
22658
22794
|
}
|
|
22659
22795
|
if (this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
|
|
22660
22796
|
var evenArgs = {
|
|
@@ -22847,7 +22983,7 @@ var FormatPainter = /** @__PURE__ @class */ (function () {
|
|
|
22847
22983
|
};
|
|
22848
22984
|
FormatPainter.prototype.onKeyDown = function (event) {
|
|
22849
22985
|
var originalEvent = event.args;
|
|
22850
|
-
if ((originalEvent
|
|
22986
|
+
if (!isNullOrUndefined(originalEvent) && !isNullOrUndefined(originalEvent.action) && (originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste')
|
|
22851
22987
|
|| (originalEvent.action === 'escape' && (this.previousAction === 'format-copy' || this.previousAction === 'format-paste'))) {
|
|
22852
22988
|
if ((originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste')) {
|
|
22853
22989
|
originalEvent.stopPropagation();
|
|
@@ -23004,6 +23140,9 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
23004
23140
|
spanElement = this.parent.element.ownerDocument.querySelector('.e-emoji');
|
|
23005
23141
|
}
|
|
23006
23142
|
this.divElement = spanElement.closest('div');
|
|
23143
|
+
if (!(this.parent.inputElement.contains(this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()).startContainer))) {
|
|
23144
|
+
this.parent.contentModule.getEditPanel().focus();
|
|
23145
|
+
}
|
|
23007
23146
|
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
23008
23147
|
this.save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
23009
23148
|
this.clickEvent = args.args;
|
|
@@ -23643,7 +23782,8 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
23643
23782
|
};
|
|
23644
23783
|
EmojiPicker.prototype.onkeyPress = function (e) {
|
|
23645
23784
|
var originalEvent = e.args;
|
|
23646
|
-
var selection = this.parent.contentModule.
|
|
23785
|
+
var selection = (this.parent.iframeSettings.enable) ? this.parent.contentModule.getPanel().contentWindow.getSelection() :
|
|
23786
|
+
this.parent.contentModule.getDocument().getSelection();
|
|
23647
23787
|
if (selection.rangeCount <= 0) {
|
|
23648
23788
|
return;
|
|
23649
23789
|
}
|
|
@@ -23663,6 +23803,10 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
23663
23803
|
}
|
|
23664
23804
|
if (originalEvent.keyCode === 32 && isPrevColon && this.popupObj) {
|
|
23665
23805
|
removeClass([this.divElement], 'e-active');
|
|
23806
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument : this.parent.contentModule.getDocument();
|
|
23807
|
+
if (this.parent.showTooltip && !isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
23808
|
+
this.parent.notify(destroyTooltip, { args: event });
|
|
23809
|
+
}
|
|
23666
23810
|
this.popupObj.hide();
|
|
23667
23811
|
}
|
|
23668
23812
|
if (this.popupObj && (originalEvent.keyCode === 37 || originalEvent.keyCode === 38 || originalEvent.keyCode === 39
|
|
@@ -23673,7 +23817,8 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
23673
23817
|
};
|
|
23674
23818
|
EmojiPicker.prototype.onkeyUp = function (e) {
|
|
23675
23819
|
var originalEvent = e.args;
|
|
23676
|
-
var selection = this.parent.contentModule.
|
|
23820
|
+
var selection = (this.parent.iframeSettings.enable) ? this.parent.contentModule.getPanel().contentWindow.getSelection() :
|
|
23821
|
+
this.parent.contentModule.getDocument().getSelection();
|
|
23677
23822
|
if (selection.rangeCount <= 0) {
|
|
23678
23823
|
return;
|
|
23679
23824
|
}
|
|
@@ -23699,7 +23844,7 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
23699
23844
|
};
|
|
23700
23845
|
EmojiPicker.prototype.getCoordinates = function () {
|
|
23701
23846
|
var coordinates;
|
|
23702
|
-
var selection = this.parent.contentModule.
|
|
23847
|
+
var selection = (this.parent.iframeSettings.enable) ? this.parent.contentModule.getPanel().contentWindow.getSelection() : window.getSelection();
|
|
23703
23848
|
var range = selection.getRangeAt(0);
|
|
23704
23849
|
var firstChild;
|
|
23705
23850
|
if (range.startContainer.nodeName === 'P' || range.startContainer.nodeName === 'DIV') {
|
|
@@ -23991,7 +24136,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
23991
24136
|
pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset + parentTop + args.clientY : args.pageY;
|
|
23992
24137
|
}
|
|
23993
24138
|
if (this.quickToolObj.linkQTBar) {
|
|
23994
|
-
this.quickToolObj.linkQTBar.showPopup(pageX, pageY, range.endContainer);
|
|
24139
|
+
this.quickToolObj.linkQTBar.showPopup(pageX, pageY, range.endContainer, 'link');
|
|
23995
24140
|
}
|
|
23996
24141
|
}
|
|
23997
24142
|
};
|
|
@@ -24022,12 +24167,32 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
24022
24167
|
if (isPopupOpen) {
|
|
24023
24168
|
return;
|
|
24024
24169
|
}
|
|
24025
|
-
|
|
24026
|
-
|
|
24027
|
-
|
|
24028
|
-
|
|
24029
|
-
|
|
24030
|
-
|
|
24170
|
+
if (e.args.ctrlKey === false) {
|
|
24171
|
+
this.showLinkQuickToolbar({
|
|
24172
|
+
args: args,
|
|
24173
|
+
isNotify: false,
|
|
24174
|
+
type: 'Links',
|
|
24175
|
+
elements: [args.target]
|
|
24176
|
+
});
|
|
24177
|
+
}
|
|
24178
|
+
else {
|
|
24179
|
+
var selection = this.parent.formatter.editorManager.nodeSelection;
|
|
24180
|
+
var range = selection.getRange(this.parent.contentModule.getDocument());
|
|
24181
|
+
var args_1 = {
|
|
24182
|
+
args: {
|
|
24183
|
+
item: {
|
|
24184
|
+
subCommand: 'OpenLink',
|
|
24185
|
+
command: 'Links',
|
|
24186
|
+
name: ''
|
|
24187
|
+
},
|
|
24188
|
+
originalEvent: e.args
|
|
24189
|
+
},
|
|
24190
|
+
selectNode: selection.getNodeCollection(range),
|
|
24191
|
+
selectParent: selection.getParentNodeCollection(range),
|
|
24192
|
+
selection: selection.save(range, this.parent.contentModule.getDocument())
|
|
24193
|
+
};
|
|
24194
|
+
this.parent.notify(openLink, args_1);
|
|
24195
|
+
}
|
|
24031
24196
|
}
|
|
24032
24197
|
else {
|
|
24033
24198
|
this.hideLinkQuickToolbar();
|
|
@@ -24084,7 +24249,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
24084
24249
|
};
|
|
24085
24250
|
Link.prototype.showDialog = function () {
|
|
24086
24251
|
this.openDialog(false);
|
|
24087
|
-
this.setCssClass({ cssClass: this.parent.
|
|
24252
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
24088
24253
|
};
|
|
24089
24254
|
Link.prototype.closeDialog = function () {
|
|
24090
24255
|
if (this.dialogObj) {
|
|
@@ -24117,22 +24282,22 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
24117
24282
|
var textPlace = this.i10n.getConstant('textPlaceholder');
|
|
24118
24283
|
var title = this.i10n.getConstant('linkTitle');
|
|
24119
24284
|
var linkDialogEle = this.parent.createElement('div', {
|
|
24120
|
-
className: 'e-rte-link-dialog' +
|
|
24285
|
+
className: 'e-rte-link-dialog' + this.parent.getCssClass(true), id: this.rteID + '_rtelink'
|
|
24121
24286
|
});
|
|
24122
24287
|
this.parent.element.appendChild(linkDialogEle);
|
|
24123
24288
|
var linkContent = this.parent.createElement('div', {
|
|
24124
|
-
className: 'e-rte-linkcontent' +
|
|
24289
|
+
className: 'e-rte-linkcontent' + this.parent.getCssClass(true), id: this.rteID + '_linkContent'
|
|
24125
24290
|
});
|
|
24126
24291
|
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' +
|
|
24292
|
+
'</label></div><div class="e-rte-field' + this.parent.getCssClass(true) + '">' +
|
|
24293
|
+
'<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>' +
|
|
24294
|
+
'<div class="e-rte-label' + this.parent.getCssClass(true) + '"></div>' + '<div class="e-rte-field' + this.parent.getCssClass(true) + '">' +
|
|
24295
|
+
'<input type="checkbox" class="e-rte-linkTarget' + this.parent.getCssClass(true) + '" data-role ="none"></div>' : '';
|
|
24296
|
+
var content = '<div class="e-rte-label' + this.parent.getCssClass(true) + '"><label>' + linkWebAddress + '</label></div>' + '<div class="e-rte-field' + this.parent.getCssClass(true) + '">' +
|
|
24297
|
+
'<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>' +
|
|
24298
|
+
'<div class="e-rte-label' + this.parent.getCssClass(true) + '">' + '<label>' + linkDisplayText + '</label></div><div class="e-rte-field' + this.parent.getCssClass(true) + '"> ' +
|
|
24299
|
+
'<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 + '">' +
|
|
24300
|
+
'</div><div class="e-rte-label' + this.parent.getCssClass(true) + '">' + htmlTextbox;
|
|
24136
24301
|
var contentElem = parseHtml(content);
|
|
24137
24302
|
linkContent.appendChild(contentElem);
|
|
24138
24303
|
var linkTarget = linkContent.querySelector('.e-rte-linkTarget');
|
|
@@ -24141,7 +24306,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
24141
24306
|
var linkTitle = linkContent.querySelector('.e-rte-linkTitle');
|
|
24142
24307
|
var linkOpenLabel = this.i10n.getConstant('linkOpenInNewWindow');
|
|
24143
24308
|
this.checkBoxObj = new CheckBox({ label: linkOpenLabel, checked: true, enableRtl: this.parent.enableRtl,
|
|
24144
|
-
cssClass: this.parent.
|
|
24309
|
+
cssClass: this.parent.getCssClass() });
|
|
24145
24310
|
this.checkBoxObj.isStringTemplate = true;
|
|
24146
24311
|
this.checkBoxObj.createElement = this.parent.createElement;
|
|
24147
24312
|
this.checkBoxObj.appendTo(linkTarget);
|
|
@@ -24154,16 +24319,16 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
24154
24319
|
var dialogModel = {
|
|
24155
24320
|
header: this.i10n.getConstant('linkHeader'),
|
|
24156
24321
|
content: linkContent,
|
|
24157
|
-
cssClass: CLS_RTE_ELEMENTS +
|
|
24322
|
+
cssClass: CLS_RTE_ELEMENTS + this.parent.getCssClass(true),
|
|
24158
24323
|
enableRtl: this.parent.enableRtl,
|
|
24159
24324
|
locale: this.parent.locale,
|
|
24160
24325
|
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '310px',
|
|
24161
24326
|
isModal: Browser.isDevice,
|
|
24162
24327
|
buttons: [{
|
|
24163
24328
|
click: this.insertlink.bind(selectObj),
|
|
24164
|
-
buttonModel: { content: linkInsert, cssClass: 'e-flat e-insertLink' +
|
|
24329
|
+
buttonModel: { content: linkInsert, cssClass: 'e-flat e-insertLink' + this.parent.getCssClass(true), isPrimary: true }
|
|
24165
24330
|
},
|
|
24166
|
-
{ click: this.cancelDialog.bind(selectObj), buttonModel: { cssClass: 'e-flat' +
|
|
24331
|
+
{ click: this.cancelDialog.bind(selectObj), buttonModel: { cssClass: 'e-flat' + this.parent.getCssClass(true), content: linkCancel } }],
|
|
24167
24332
|
target: (Browser.isDevice) ? document.body : this.parent.element,
|
|
24168
24333
|
animationSettings: { effect: 'None' },
|
|
24169
24334
|
close: function (event) {
|
|
@@ -24665,18 +24830,18 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
24665
24830
|
this.resizeBtnInit();
|
|
24666
24831
|
this.imgEle = e;
|
|
24667
24832
|
addClass([this.imgEle], 'e-resize');
|
|
24668
|
-
this.imgResizeDiv = this.parent.createElement('span', { className: 'e-img-resize' +
|
|
24833
|
+
this.imgResizeDiv = this.parent.createElement('span', { className: 'e-img-resize' + this.parent.getCssClass(true), id: this.rteID + '_imgResize' });
|
|
24669
24834
|
this.imgResizeDiv.appendChild(this.parent.createElement('span', {
|
|
24670
|
-
className: 'e-rte-imageboxmark e-rte-topLeft' +
|
|
24835
|
+
className: 'e-rte-imageboxmark e-rte-topLeft' + this.parent.getCssClass(true), styles: 'cursor: nwse-resize'
|
|
24671
24836
|
}));
|
|
24672
24837
|
this.imgResizeDiv.appendChild(this.parent.createElement('span', {
|
|
24673
|
-
className: 'e-rte-imageboxmark e-rte-topRight' +
|
|
24838
|
+
className: 'e-rte-imageboxmark e-rte-topRight' + this.parent.getCssClass(true), styles: 'cursor: nesw-resize'
|
|
24674
24839
|
}));
|
|
24675
24840
|
this.imgResizeDiv.appendChild(this.parent.createElement('span', {
|
|
24676
|
-
className: 'e-rte-imageboxmark e-rte-botLeft' +
|
|
24841
|
+
className: 'e-rte-imageboxmark e-rte-botLeft' + this.parent.getCssClass(true), styles: 'cursor: nesw-resize'
|
|
24677
24842
|
}));
|
|
24678
24843
|
this.imgResizeDiv.appendChild(this.parent.createElement('span', {
|
|
24679
|
-
className: 'e-rte-imageboxmark e-rte-botRight' +
|
|
24844
|
+
className: 'e-rte-imageboxmark e-rte-botRight' + this.parent.getCssClass(true), styles: 'cursor: nwse-resize'
|
|
24680
24845
|
}));
|
|
24681
24846
|
if (Browser.isDevice) {
|
|
24682
24847
|
addClass([this.imgResizeDiv], 'e-mob-rte');
|
|
@@ -24829,8 +24994,8 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
24829
24994
|
img.removeAttribute('height');
|
|
24830
24995
|
}
|
|
24831
24996
|
else {
|
|
24832
|
-
img.style.width = expectedX + 'px';
|
|
24833
|
-
img.style.height = expectedX + 'px';
|
|
24997
|
+
img.style.width = ((expectedX >= 15) ? expectedX : 15) + 'px';
|
|
24998
|
+
img.style.height = ((expectedX >= 15) ? expectedX : 15) + 'px';
|
|
24834
24999
|
}
|
|
24835
25000
|
}
|
|
24836
25001
|
};
|
|
@@ -24859,7 +25024,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
24859
25024
|
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10), args);
|
|
24860
25025
|
_this.resizeImgDupPos(_this.imgEle);
|
|
24861
25026
|
_this.imgResizePos(_this.imgEle, _this.imgResizeDiv);
|
|
24862
|
-
_this.parent.setContentHeight('', false);
|
|
24863
25027
|
}
|
|
24864
25028
|
});
|
|
24865
25029
|
};
|
|
@@ -24874,7 +25038,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
24874
25038
|
else if (isNullOrUndefined(this.parent.insertImageSettings.maxHeight)) {
|
|
24875
25039
|
this.imgEle.style.maxHeight = '';
|
|
24876
25040
|
}
|
|
24877
|
-
this.imgEle.style.maxWidth = this.parent.getInsertImgMaxWidth() + 'px';
|
|
25041
|
+
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
25042
|
var pageX = this.getPointX(e);
|
|
24879
25043
|
var pageY = this.getPointY(e);
|
|
24880
25044
|
var mouseX = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageX - this.pageX) : (pageX - this.pageX);
|
|
@@ -25099,13 +25263,22 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25099
25263
|
}
|
|
25100
25264
|
}
|
|
25101
25265
|
}
|
|
25102
|
-
else if (
|
|
25103
|
-
range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE))
|
|
25104
|
-
|
|
25105
|
-
|
|
25106
|
-
|
|
25107
|
-
|
|
25108
|
-
|
|
25266
|
+
else if (range.startContainer.nodeType === 1) {
|
|
25267
|
+
if (range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE)) {
|
|
25268
|
+
detach(range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE));
|
|
25269
|
+
}
|
|
25270
|
+
else if (range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_IMGBREAK)) {
|
|
25271
|
+
detach(range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_IMGBREAK));
|
|
25272
|
+
}
|
|
25273
|
+
else if (range.startContainer.classList.contains('e-img-wrap') && closest(range.startContainer, '.' + CLS_CAPTION)) {
|
|
25274
|
+
var parentElem = range.startContainer.parentElement.parentElement;
|
|
25275
|
+
detach(closest(range.startContainer, '.' + CLS_CAPTION));
|
|
25276
|
+
if (parentElem && parentElem.textContent.trim() === '') {
|
|
25277
|
+
var brElem = this.parent.createElement('br');
|
|
25278
|
+
brElem.classList.add('e-rte-image-remove-focus');
|
|
25279
|
+
parentElem.appendChild(brElem);
|
|
25280
|
+
}
|
|
25281
|
+
}
|
|
25109
25282
|
}
|
|
25110
25283
|
}
|
|
25111
25284
|
break;
|
|
@@ -25162,7 +25335,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25162
25335
|
};
|
|
25163
25336
|
Image.prototype.showDialog = function () {
|
|
25164
25337
|
this.openDialog(false);
|
|
25165
|
-
this.setCssClass({ cssClass: this.parent.
|
|
25338
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
25166
25339
|
};
|
|
25167
25340
|
Image.prototype.closeDialog = function () {
|
|
25168
25341
|
if (this.dialogObj) {
|
|
@@ -25370,19 +25543,19 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25370
25543
|
}
|
|
25371
25544
|
this.imagDialog(e);
|
|
25372
25545
|
if (!isNullOrUndefined(this.dialogObj)) {
|
|
25373
|
-
var linkWrap = this.parent.createElement('div', { className: 'e-img-linkwrap' +
|
|
25546
|
+
var linkWrap = this.parent.createElement('div', { className: 'e-img-linkwrap' + this.parent.getCssClass(true) });
|
|
25374
25547
|
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' +
|
|
25548
|
+
var content = '<div class="e-rte-field' + this.parent.getCssClass(true) + '">' +
|
|
25549
|
+
'<input type="text" data-role ="none" class="e-input e-img-link' + this.parent.getCssClass(true) + '" spellcheck="false" placeholder="' + linkUrl + '"/></div>' +
|
|
25377
25550
|
'<div class="e-rte-label"></div>' + '<div class="e-rte-field">' +
|
|
25378
|
-
'<input type="checkbox" class="e-rte-linkTarget' +
|
|
25551
|
+
'<input type="checkbox" class="e-rte-linkTarget' + this.parent.getCssClass(true) + '" data-role ="none"></div>';
|
|
25379
25552
|
var contentElem = parseHtml(content);
|
|
25380
25553
|
linkWrap.appendChild(contentElem);
|
|
25381
25554
|
var linkTarget = linkWrap.querySelector('.e-rte-linkTarget');
|
|
25382
25555
|
var inputLink = linkWrap.querySelector('.e-img-link');
|
|
25383
25556
|
var linkOpenLabel = this.i10n.getConstant('linkOpenInNewWindow');
|
|
25384
25557
|
this.checkBoxObj = new CheckBox({
|
|
25385
|
-
label: linkOpenLabel, checked: true, enableRtl: this.parent.enableRtl, cssClass: this.parent.
|
|
25558
|
+
label: linkOpenLabel, checked: true, enableRtl: this.parent.enableRtl, cssClass: this.parent.getCssClass(),
|
|
25386
25559
|
change: function (e) {
|
|
25387
25560
|
if (e.checked) {
|
|
25388
25561
|
target_1 = '_blank';
|
|
@@ -25396,11 +25569,12 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25396
25569
|
this.checkBoxObj.createElement = this.parent.createElement;
|
|
25397
25570
|
this.checkBoxObj.appendTo(linkTarget);
|
|
25398
25571
|
var target_1 = this.checkBoxObj.checked ? '_blank' : null;
|
|
25572
|
+
var imageLabel = this.checkBoxObj.checked ? this.i10n.getConstant('ImageLinkAriaLabel') : null;
|
|
25399
25573
|
var linkUpdate = this.i10n.getConstant('dialogUpdate');
|
|
25400
25574
|
var linkargs_1 = {
|
|
25401
25575
|
args: e.args,
|
|
25402
25576
|
selfImage: this, selection: e.selection,
|
|
25403
|
-
selectNode: e.selectNode, selectParent: e.selectParent, link: inputLink, target: target_1
|
|
25577
|
+
selectNode: e.selectNode, selectParent: e.selectParent, link: inputLink, target: target_1, ariaLabel: imageLabel
|
|
25404
25578
|
};
|
|
25405
25579
|
this.dialogObj.setProperties({
|
|
25406
25580
|
height: 'inherit',
|
|
@@ -25413,7 +25587,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25413
25587
|
_this.insertlink(linkargs_1);
|
|
25414
25588
|
},
|
|
25415
25589
|
buttonModel: {
|
|
25416
|
-
content: linkUpdate, cssClass: 'e-flat e-update-link' +
|
|
25590
|
+
content: linkUpdate, cssClass: 'e-flat e-update-link' + this.parent.getCssClass(true), isPrimary: true
|
|
25417
25591
|
}
|
|
25418
25592
|
}],
|
|
25419
25593
|
cssClass: this.dialogObj.cssClass + ' e-rte-img-link-dialog'
|
|
@@ -25439,13 +25613,13 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25439
25613
|
this.imagDialog(e);
|
|
25440
25614
|
var altText = this.i10n.getConstant('altText');
|
|
25441
25615
|
if (!isNullOrUndefined(this.dialogObj)) {
|
|
25442
|
-
var altWrap = this.parent.createElement('div', { className: 'e-img-altwrap' +
|
|
25616
|
+
var altWrap = this.parent.createElement('div', { className: 'e-img-altwrap' + this.parent.getCssClass(true) });
|
|
25443
25617
|
var altHeader = this.i10n.getConstant('alternateHeader');
|
|
25444
25618
|
var linkUpdate = this.i10n.getConstant('dialogUpdate');
|
|
25445
25619
|
var getAlt = (e.selectNode[0].getAttribute('alt') === null) ? '' :
|
|
25446
25620
|
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' +
|
|
25621
|
+
var content = '<div class="e-rte-field' + this.parent.getCssClass(true) + '">' +
|
|
25622
|
+
'<input type="text" spellcheck="false" class="e-input e-img-alt' + this.parent.getCssClass(true) + '" placeholder="' + altText + '"/>' +
|
|
25449
25623
|
'</div>';
|
|
25450
25624
|
var contentElem = parseHtml(content);
|
|
25451
25625
|
contentElem.querySelector('input').setAttribute('value', getAlt);
|
|
@@ -25463,7 +25637,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25463
25637
|
_this.insertAlt(altArgs_1);
|
|
25464
25638
|
},
|
|
25465
25639
|
buttonModel: {
|
|
25466
|
-
content: linkUpdate, cssClass: 'e-flat e-update-alt' +
|
|
25640
|
+
content: linkUpdate, cssClass: 'e-flat e-update-alt' + this.parent.getCssClass(true), isPrimary: true
|
|
25467
25641
|
}
|
|
25468
25642
|
}],
|
|
25469
25643
|
cssClass: this.dialogObj.cssClass + ' e-rte-img-alt-dialog'
|
|
@@ -25515,14 +25689,14 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25515
25689
|
}
|
|
25516
25690
|
if (e.selectNode[0].parentElement.nodeName === 'A') {
|
|
25517
25691
|
proxy.parent.formatter.process(proxy.parent, e.args, e.args, {
|
|
25518
|
-
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, selectNode: e.selectNode,
|
|
25692
|
+
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('ImageLinkAriaLabel') : null, selectNode: e.selectNode,
|
|
25519
25693
|
subCommand: e.args.item.subCommand
|
|
25520
25694
|
});
|
|
25521
25695
|
proxy.dialogObj.hide({ returnValue: true });
|
|
25522
25696
|
return;
|
|
25523
25697
|
}
|
|
25524
25698
|
proxy.parent.formatter.process(proxy.parent, e.args, e.args, {
|
|
25525
|
-
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, selectNode: e.selectNode,
|
|
25699
|
+
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('ImageLinkAriaLabel') : null, selectNode: e.selectNode,
|
|
25526
25700
|
subCommand: e.args.item.subCommand, selection: e.selection
|
|
25527
25701
|
});
|
|
25528
25702
|
var captionEle = closest(e.selectNode[0], '.e-img-caption');
|
|
@@ -25633,11 +25807,11 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25633
25807
|
}
|
|
25634
25808
|
else {
|
|
25635
25809
|
this.captionEle = this.parent.createElement('span', {
|
|
25636
|
-
className: CLS_CAPTION + ' ' + CLS_RTE_CAPTION +
|
|
25810
|
+
className: CLS_CAPTION + ' ' + CLS_RTE_CAPTION + this.parent.getCssClass(true),
|
|
25637
25811
|
attrs: { contenteditable: 'false', draggable: 'false', style: 'width:' + this.parent.insertImageSettings.width }
|
|
25638
25812
|
});
|
|
25639
|
-
var imgWrap = this.parent.createElement('span', { className: 'e-img-wrap' +
|
|
25640
|
-
var imgInner = this.parent.createElement('span', { className: 'e-img-inner' +
|
|
25813
|
+
var imgWrap = this.parent.createElement('span', { className: 'e-img-wrap' + this.parent.getCssClass(true) });
|
|
25814
|
+
var imgInner = this.parent.createElement('span', { className: 'e-img-inner' + this.parent.getCssClass(true),
|
|
25641
25815
|
attrs: { contenteditable: 'true' } });
|
|
25642
25816
|
var parent_1 = e.selectNode[0].parentElement;
|
|
25643
25817
|
if (parent_1.tagName === 'A') {
|
|
@@ -25690,7 +25864,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25690
25864
|
_this.insertSize(selectObj_1);
|
|
25691
25865
|
},
|
|
25692
25866
|
buttonModel: {
|
|
25693
|
-
content: linkUpdate, cssClass: 'e-flat e-update-size' +
|
|
25867
|
+
content: linkUpdate, cssClass: 'e-flat e-update-size' + this.parent.getCssClass(true), isPrimary: true
|
|
25694
25868
|
}
|
|
25695
25869
|
}],
|
|
25696
25870
|
cssClass: this.dialogObj.cssClass + ' e-rte-img-size-dialog'
|
|
@@ -25736,7 +25910,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25736
25910
|
this.dialogObj.hide({ returnValue: true });
|
|
25737
25911
|
return;
|
|
25738
25912
|
}
|
|
25739
|
-
var imgDialog = this.parent.createElement('div', { className: 'e-rte-img-dialog' +
|
|
25913
|
+
var imgDialog = this.parent.createElement('div', { className: 'e-rte-img-dialog' + this.parent.getCssClass(true), id: this.rteID + '_image' });
|
|
25740
25914
|
this.parent.element.appendChild(imgDialog);
|
|
25741
25915
|
var imgInsert = this.i10n.getConstant('dialogInsert');
|
|
25742
25916
|
var imglinkCancel = this.i10n.getConstant('dialogCancel');
|
|
@@ -25745,20 +25919,20 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25745
25919
|
var selectObj = { selfImage: this, selection: e.selection, args: e.args, selectParent: e.selectParent };
|
|
25746
25920
|
var dialogModel = {
|
|
25747
25921
|
header: imgHeader,
|
|
25748
|
-
cssClass: CLS_RTE_ELEMENTS +
|
|
25922
|
+
cssClass: CLS_RTE_ELEMENTS + this.parent.getCssClass(true),
|
|
25749
25923
|
enableRtl: this.parent.enableRtl,
|
|
25750
25924
|
locale: this.parent.locale,
|
|
25751
25925
|
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
25752
25926
|
isModal: Browser.isDevice,
|
|
25753
25927
|
buttons: [{
|
|
25754
25928
|
click: this.insertImageUrl.bind(selectObj),
|
|
25755
|
-
buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage' +
|
|
25929
|
+
buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage' + this.parent.getCssClass(true), isPrimary: true, disabled: true }
|
|
25756
25930
|
},
|
|
25757
25931
|
{
|
|
25758
25932
|
click: function (e) {
|
|
25759
25933
|
_this.cancelDialog(e);
|
|
25760
25934
|
},
|
|
25761
|
-
buttonModel: { cssClass: 'e-flat e-cancel' +
|
|
25935
|
+
buttonModel: { cssClass: 'e-flat e-cancel' + this.parent.getCssClass(true), content: imglinkCancel }
|
|
25762
25936
|
}],
|
|
25763
25937
|
target: (Browser.isDevice) ? document.body : this.parent.element,
|
|
25764
25938
|
animationSettings: { effect: 'None' },
|
|
@@ -25781,12 +25955,12 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25781
25955
|
_this.dialogObj = null;
|
|
25782
25956
|
}
|
|
25783
25957
|
};
|
|
25784
|
-
var dialogContent = this.parent.createElement('div', { className: 'e-img-content' +
|
|
25958
|
+
var dialogContent = this.parent.createElement('div', { className: 'e-img-content' + this.parent.getCssClass(true) });
|
|
25785
25959
|
if ((!isNullOrUndefined(this.parent.insertImageSettings.path) && this.parent.editorMode === 'Markdown')
|
|
25786
25960
|
|| this.parent.editorMode === 'HTML') {
|
|
25787
25961
|
dialogContent.appendChild(this.imgUpload(e));
|
|
25788
25962
|
}
|
|
25789
|
-
var linkHeader = this.parent.createElement('div', { className: 'e-linkheader' +
|
|
25963
|
+
var linkHeader = this.parent.createElement('div', { className: 'e-linkheader' + this.parent.getCssClass(true) });
|
|
25790
25964
|
var linkHeaderText = this.i10n.getConstant('imageLinkHeader');
|
|
25791
25965
|
if (this.parent.editorMode === 'HTML') {
|
|
25792
25966
|
linkHeader.innerHTML = linkHeaderText;
|
|
@@ -25903,10 +26077,10 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25903
26077
|
// eslint-disable-next-line
|
|
25904
26078
|
Image.prototype.imageUrlPopup = function (e) {
|
|
25905
26079
|
var _this = this;
|
|
25906
|
-
var imgUrl = this.parent.createElement('div', { className: 'imgUrl' +
|
|
26080
|
+
var imgUrl = this.parent.createElement('div', { className: 'imgUrl' + this.parent.getCssClass(true) });
|
|
25907
26081
|
var placeUrl = this.i10n.getConstant('imageUrl');
|
|
25908
26082
|
this.inputUrl = this.parent.createElement('input', {
|
|
25909
|
-
className: 'e-input e-img-url' +
|
|
26083
|
+
className: 'e-input e-img-url' + this.parent.getCssClass(true),
|
|
25910
26084
|
attrs: { placeholder: placeUrl, spellcheck: 'false', 'aria-label': this.i10n.getConstant('imageLinkHeader') }
|
|
25911
26085
|
});
|
|
25912
26086
|
this.inputUrl.addEventListener('input', function () {
|
|
@@ -25973,7 +26147,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25973
26147
|
var selectNode = e.selectNode[0];
|
|
25974
26148
|
var imgHeight = this.i10n.getConstant('imageHeight');
|
|
25975
26149
|
var imgWidth = this.i10n.getConstant('imageWidth');
|
|
25976
|
-
var imgSizeWrap = this.parent.createElement('div', { className: 'e-img-sizewrap' +
|
|
26150
|
+
var imgSizeWrap = this.parent.createElement('div', { className: 'e-img-sizewrap' + this.parent.getCssClass(true) });
|
|
25977
26151
|
var widthVal = isNullOrUndefined(this.changedWidthValue) && (selectNode.style.width.toString() === 'auto' ||
|
|
25978
26152
|
selectNode.style.width !== '') ? selectNode.style.width : !isNullOrUndefined(this.changedWidthValue) ?
|
|
25979
26153
|
this.changedWidthValue : (parseInt(selectNode.getClientRects()[0].width.toString(), 10)).toString();
|
|
@@ -25982,10 +26156,10 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25982
26156
|
this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString(), 10)).toString();
|
|
25983
26157
|
this.changedWidthValue = null;
|
|
25984
26158
|
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' +
|
|
26159
|
+
var content = '<div class="e-rte-label' + this.parent.getCssClass(true) + '"><label>' + imgWidth +
|
|
26160
|
+
'</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>' +
|
|
26161
|
+
'<div class="e-rte-label' + this.parent.getCssClass(true) + '">' + '<label>' + imgHeight + '</label></div><div class="e-rte-field' + this.parent.getCssClass(true) + '"> ' +
|
|
26162
|
+
'<input type="text" id="imgheight" class="e-img-height' + this.parent.getCssClass(true) + '"/></div>';
|
|
25989
26163
|
var contentElem = parseHtml(content);
|
|
25990
26164
|
contentElem.getElementById('imgwidth').setAttribute('value', widthVal);
|
|
25991
26165
|
contentElem.getElementById('imgheight').setAttribute('value', heightVal);
|
|
@@ -25993,7 +26167,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25993
26167
|
this.widthNum = new TextBox({
|
|
25994
26168
|
value: formatUnit(widthVal),
|
|
25995
26169
|
enableRtl: this.parent.enableRtl,
|
|
25996
|
-
cssClass: this.parent.
|
|
26170
|
+
cssClass: this.parent.getCssClass(),
|
|
25997
26171
|
input: function (e) {
|
|
25998
26172
|
_this.inputWidthValue = formatUnit(_this.inputValue(e.value));
|
|
25999
26173
|
}
|
|
@@ -26003,7 +26177,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26003
26177
|
this.heightNum = new TextBox({
|
|
26004
26178
|
value: formatUnit(heightVal),
|
|
26005
26179
|
enableRtl: this.parent.enableRtl,
|
|
26006
|
-
cssClass: this.parent.
|
|
26180
|
+
cssClass: this.parent.getCssClass(),
|
|
26007
26181
|
input: function (e) {
|
|
26008
26182
|
_this.inputHeightValue = formatUnit(_this.inputValue(e.value));
|
|
26009
26183
|
}
|
|
@@ -26075,16 +26249,16 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26075
26249
|
save = e.selection;
|
|
26076
26250
|
selectParent = e.selectParent;
|
|
26077
26251
|
}
|
|
26078
|
-
var uploadParentEle = this.parent.createElement('div', { className: 'e-img-uploadwrap e-droparea' +
|
|
26252
|
+
var uploadParentEle = this.parent.createElement('div', { className: 'e-img-uploadwrap e-droparea' + this.parent.getCssClass(true) });
|
|
26079
26253
|
var deviceImgUpMsg = this.i10n.getConstant('imageDeviceUploadMessage');
|
|
26080
26254
|
var imgUpMsg = this.i10n.getConstant('imageUploadMessage');
|
|
26081
|
-
var span = this.parent.createElement('span', { className: 'e-droptext' +
|
|
26255
|
+
var span = this.parent.createElement('span', { className: 'e-droptext' + this.parent.getCssClass(true) });
|
|
26082
26256
|
var spanMsg = this.parent.createElement('span', {
|
|
26083
|
-
className: 'e-rte-upload-text' +
|
|
26257
|
+
className: 'e-rte-upload-text' + this.parent.getCssClass(true), innerHTML: ((Browser.isDevice) ? deviceImgUpMsg : imgUpMsg)
|
|
26084
26258
|
});
|
|
26085
26259
|
span.appendChild(spanMsg);
|
|
26086
26260
|
var btnEle = this.parent.createElement('button', {
|
|
26087
|
-
className: 'e-browsebtn' +
|
|
26261
|
+
className: 'e-browsebtn' + this.parent.getCssClass(true), id: this.rteID + '_insertImage', attrs: { autofocus: 'true', type: 'button' }
|
|
26088
26262
|
});
|
|
26089
26263
|
span.appendChild(btnEle);
|
|
26090
26264
|
uploadParentEle.appendChild(span);
|
|
@@ -26096,7 +26270,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26096
26270
|
var btnClick = (Browser.isDevice) ? span : btnEle;
|
|
26097
26271
|
EventHandler.add(btnClick, 'click', this.fileSelect, this);
|
|
26098
26272
|
var uploadEle = this.parent.createElement('input', {
|
|
26099
|
-
id: this.rteID + '_upload', attrs: { type: 'File', name: 'UploadFiles' }, className: this.parent.
|
|
26273
|
+
id: this.rteID + '_upload', attrs: { type: 'File', name: 'UploadFiles' }, className: this.parent.getCssClass()
|
|
26100
26274
|
});
|
|
26101
26275
|
uploadParentEle.appendChild(uploadEle);
|
|
26102
26276
|
var altText;
|
|
@@ -26104,7 +26278,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26104
26278
|
var filesData;
|
|
26105
26279
|
this.uploadObj = new Uploader({
|
|
26106
26280
|
asyncSettings: { saveUrl: this.parent.insertImageSettings.saveUrl, removeUrl: this.parent.insertImageSettings.removeUrl },
|
|
26107
|
-
dropArea: span, multiple: false, enableRtl: this.parent.enableRtl, cssClass: this.parent.
|
|
26281
|
+
dropArea: span, multiple: false, enableRtl: this.parent.enableRtl, cssClass: this.parent.getCssClass(),
|
|
26108
26282
|
allowedExtensions: this.parent.insertImageSettings.allowedTypes.toString(),
|
|
26109
26283
|
selected: function (e) {
|
|
26110
26284
|
proxy.isImgUploaded = true;
|
|
@@ -26177,9 +26351,9 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26177
26351
|
failure: function (e) {
|
|
26178
26352
|
_this.parent.trigger(imageUploadFailed, e);
|
|
26179
26353
|
},
|
|
26180
|
-
removing: function () {
|
|
26354
|
+
removing: function (removeEventArgs) {
|
|
26181
26355
|
// eslint-disable-next-line
|
|
26182
|
-
_this.parent.trigger(imageRemoving,
|
|
26356
|
+
_this.parent.trigger(imageRemoving, removeEventArgs, function (e) {
|
|
26183
26357
|
proxy.isImgUploaded = false;
|
|
26184
26358
|
_this.dialogObj.getButtons(0).element.disabled = true;
|
|
26185
26359
|
proxy.inputUrl.removeAttribute('disabled');
|
|
@@ -26468,7 +26642,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26468
26642
|
saveUrl: this.parent.insertImageSettings.saveUrl,
|
|
26469
26643
|
removeUrl: this.parent.insertImageSettings.removeUrl
|
|
26470
26644
|
},
|
|
26471
|
-
cssClass: CLS_RTE_DIALOG_UPLOAD +
|
|
26645
|
+
cssClass: CLS_RTE_DIALOG_UPLOAD + this.parent.getCssClass(true),
|
|
26472
26646
|
dropArea: this.parent.element,
|
|
26473
26647
|
allowedExtensions: this.parent.insertImageSettings.allowedTypes.toString(),
|
|
26474
26648
|
removing: function () {
|
|
@@ -26674,10 +26848,10 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26674
26848
|
*/
|
|
26675
26849
|
/* eslint-enable */
|
|
26676
26850
|
Image.prototype.destroy = function () {
|
|
26677
|
-
this.prevSelectedImgEle = undefined;
|
|
26678
26851
|
if (isNullOrUndefined(this.parent)) {
|
|
26679
26852
|
return;
|
|
26680
26853
|
}
|
|
26854
|
+
this.prevSelectedImgEle = undefined;
|
|
26681
26855
|
this.removeEventListener();
|
|
26682
26856
|
};
|
|
26683
26857
|
Image.prototype.moduleDestroy = function () {
|
|
@@ -28982,7 +29156,7 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
28982
29156
|
this.parent.formatter.editorManager.observer.off(KEY_DOWN_HANDLER, this.onKeyDown);
|
|
28983
29157
|
};
|
|
28984
29158
|
ViewSource.prototype.getSourceCode = function () {
|
|
28985
|
-
return this.parent.createElement('textarea', { className: CLS_RTE_SOURCE_CODE_TXTAREA +
|
|
29159
|
+
return this.parent.createElement('textarea', { className: CLS_RTE_SOURCE_CODE_TXTAREA + this.parent.getCssClass(true) });
|
|
28986
29160
|
};
|
|
28987
29161
|
ViewSource.prototype.wireEvent = function (element) {
|
|
28988
29162
|
this.keyboardModule = new KeyboardEvents$1(element, {
|
|
@@ -29079,8 +29253,10 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
29079
29253
|
this.getPanel().style.display = 'block';
|
|
29080
29254
|
}
|
|
29081
29255
|
else {
|
|
29256
|
+
var height = this.parent.inputElement.offsetHeight;
|
|
29082
29257
|
this.contentModule.getPanel().appendChild(this.previewElement);
|
|
29083
29258
|
this.getPanel().value = this.getTextAreaValue();
|
|
29259
|
+
this.previewElement.style.height = height + 'px';
|
|
29084
29260
|
this.contentModule.getEditPanel().style.display = 'none';
|
|
29085
29261
|
this.previewElement.style.display = 'block';
|
|
29086
29262
|
}
|
|
@@ -29243,6 +29419,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29243
29419
|
this.parent.on(showTableDialog, this.showDialog, this);
|
|
29244
29420
|
this.parent.on(closeTableDialog, this.closeDialog, this);
|
|
29245
29421
|
this.parent.on(docClick, this.docClick, this);
|
|
29422
|
+
this.parent.on(iframeMouseDown, this.onIframeMouseDown, this);
|
|
29246
29423
|
this.parent.on(editAreaClick, this.editAreaClickHandler, this);
|
|
29247
29424
|
this.parent.on(clearDialogObj, this.clearDialogObj, this);
|
|
29248
29425
|
this.parent.on(tableToolbarAction, this.onToolbarAction, this);
|
|
@@ -29263,6 +29440,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29263
29440
|
this.parent.off(initialEnd, this.afterRender);
|
|
29264
29441
|
this.parent.off(dynamicModule, this.afterRender);
|
|
29265
29442
|
this.parent.off(docClick, this.docClick);
|
|
29443
|
+
this.parent.off(iframeMouseDown, this.onIframeMouseDown);
|
|
29266
29444
|
this.parent.off(showTableDialog, this.showDialog);
|
|
29267
29445
|
this.parent.off(closeTableDialog, this.closeDialog);
|
|
29268
29446
|
this.parent.off(editAreaClick, this.editAreaClickHandler);
|
|
@@ -29271,8 +29449,8 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29271
29449
|
this.parent.off(dropDownSelect, this.dropdownSelect);
|
|
29272
29450
|
this.parent.off(mouseDown, this.cellSelect);
|
|
29273
29451
|
this.parent.off(tableColorPickerChanged, this.setBGColor);
|
|
29274
|
-
this.parent.off(keyUp, this.keyUp);
|
|
29275
29452
|
this.parent.off(keyDown, this.keyDown);
|
|
29453
|
+
this.parent.off(keyUp, this.keyUp);
|
|
29276
29454
|
this.parent.off(mouseUp, this.selectionTable);
|
|
29277
29455
|
this.parent.off(tableModulekeyUp, this.tableModulekeyUp);
|
|
29278
29456
|
this.parent.off(bindCssClass, this.setCssClass);
|
|
@@ -29468,11 +29646,12 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29468
29646
|
name: !isInternal ? 'showDialog' : null
|
|
29469
29647
|
};
|
|
29470
29648
|
this.insertTableDialog({ self: this, args: args, selection: selection });
|
|
29649
|
+
this.parent.formatter.editorManager.nodeSelection.restore();
|
|
29471
29650
|
}
|
|
29472
29651
|
};
|
|
29473
29652
|
Table.prototype.showDialog = function () {
|
|
29474
29653
|
this.openDialog(false);
|
|
29475
|
-
this.setCssClass({ cssClass: this.parent.
|
|
29654
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
29476
29655
|
};
|
|
29477
29656
|
Table.prototype.closeDialog = function () {
|
|
29478
29657
|
if (this.editdlgObj) {
|
|
@@ -29662,6 +29841,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29662
29841
|
Table.prototype.tableHeader = function (selection, e) {
|
|
29663
29842
|
this.parent.formatter.process(this.parent, e, e.originalEvent, { selection: selection, subCommand: e.item.subCommand });
|
|
29664
29843
|
};
|
|
29844
|
+
Table.prototype.getAnchorNode = function (element) {
|
|
29845
|
+
var selectParent = closest(element, 'a');
|
|
29846
|
+
return (selectParent ? selectParent : element);
|
|
29847
|
+
};
|
|
29665
29848
|
Table.prototype.editAreaClickHandler = function (e) {
|
|
29666
29849
|
if (this.parent.readonly || !isNullOrUndefined(closest(e.args.target, '.e-img-caption'))) {
|
|
29667
29850
|
return;
|
|
@@ -29683,7 +29866,8 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29683
29866
|
var closestTable = closest(target, 'table');
|
|
29684
29867
|
var startNode = this.parent.getRange().startContainer.parentElement;
|
|
29685
29868
|
var endNode = this.parent.getRange().endContainer.parentElement;
|
|
29686
|
-
|
|
29869
|
+
var isAnchorEle = this.getAnchorNode(target);
|
|
29870
|
+
if (target && target.nodeName !== 'A' && isAnchorEle.nodeName !== 'A' && target.nodeName !== 'IMG' && target.nodeName !== 'VIDEO' && !target.classList.contains(CLS_CLICKELEM) &&
|
|
29687
29871
|
target.nodeName !== 'AUDIO' && startNode === endNode && (target.nodeName === 'TD' || target.nodeName === 'TH' ||
|
|
29688
29872
|
target.nodeName === 'TABLE' || (closestTable && this.parent.contentModule.getEditPanel().contains(closestTable)))
|
|
29689
29873
|
&& !(range.startContainer.nodeType === 3 && !range.collapsed)) {
|
|
@@ -29869,7 +30053,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
29869
30053
|
this.contentModule.getEditPanel().appendChild(rowReEle);
|
|
29870
30054
|
}
|
|
29871
30055
|
var tableReBox = this.parent.createElement('span', {
|
|
29872
|
-
className: CLS_TB_BOX_RES +
|
|
30056
|
+
className: CLS_TB_BOX_RES + this.parent.getCssClass(true), attrs: {
|
|
29873
30057
|
'data-col': columns.length.toString(), 'unselectable': 'on', 'contenteditable': 'false'
|
|
29874
30058
|
}
|
|
29875
30059
|
});
|
|
@@ -30022,7 +30206,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30022
30206
|
};
|
|
30023
30207
|
Table.prototype.appendHelper = function () {
|
|
30024
30208
|
this.helper = this.parent.createElement('div', {
|
|
30025
|
-
className: 'e-table-rhelper' +
|
|
30209
|
+
className: 'e-table-rhelper' + this.parent.getCssClass(true)
|
|
30026
30210
|
});
|
|
30027
30211
|
if (Browser.isDevice) {
|
|
30028
30212
|
this.helper.classList.add('e-reicon');
|
|
@@ -30383,16 +30567,16 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30383
30567
|
this.hideTableQuickToolbar();
|
|
30384
30568
|
var header = '1X1';
|
|
30385
30569
|
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' +
|
|
30570
|
+
this.dlgDiv = this.parent.createElement('div', { className: 'e-rte-table-popup' + this.parent.getCssClass(true), id: this.rteID + '_table' });
|
|
30571
|
+
this.tblHeader = this.parent.createElement('div', { className: 'e-rte-popup-header' + this.parent.getCssClass(true) });
|
|
30388
30572
|
this.tblHeader.innerHTML = header;
|
|
30389
30573
|
this.dlgDiv.appendChild(this.tblHeader);
|
|
30390
|
-
var tableDiv = this.parent.createElement('div', { className: 'e-rte-table-span' +
|
|
30574
|
+
var tableDiv = this.parent.createElement('div', { className: 'e-rte-table-span' + this.parent.getCssClass(true) });
|
|
30391
30575
|
this.drawTable(tableDiv, args);
|
|
30392
30576
|
this.dlgDiv.appendChild(tableDiv);
|
|
30393
|
-
this.dlgDiv.appendChild(this.parent.createElement('span', { className: 'e-span-border' +
|
|
30577
|
+
this.dlgDiv.appendChild(this.parent.createElement('span', { className: 'e-span-border' + this.parent.getCssClass(true) }));
|
|
30394
30578
|
var btnEle = this.parent.createElement('button', {
|
|
30395
|
-
className: 'e-insert-table-btn' +
|
|
30579
|
+
className: 'e-insert-table-btn' + this.parent.getCssClass(true), id: this.rteID + '_insertTable',
|
|
30396
30580
|
attrs: { type: 'button', tabindex: '0' }
|
|
30397
30581
|
});
|
|
30398
30582
|
if (!isNullOrUndefined(this.parent.getToolbarElement().querySelector('.e-expended-nav'))) {
|
|
@@ -30400,7 +30584,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30400
30584
|
}
|
|
30401
30585
|
this.dlgDiv.appendChild(btnEle);
|
|
30402
30586
|
this.createTableButton = new Button({
|
|
30403
|
-
iconCss: 'e-icons e-create-table', content: insertbtn, cssClass: 'e-flat' +
|
|
30587
|
+
iconCss: 'e-icons e-create-table', content: insertbtn, cssClass: 'e-flat' + this.parent.getCssClass(true),
|
|
30404
30588
|
enableRtl: this.parent.enableRtl, locale: this.parent.locale
|
|
30405
30589
|
});
|
|
30406
30590
|
this.createTableButton.isStringTemplate = true;
|
|
@@ -30428,10 +30612,15 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30428
30612
|
});
|
|
30429
30613
|
addClass([this.popupObj.element], 'e-popup-open');
|
|
30430
30614
|
if (!isNullOrUndefined(this.parent.cssClass)) {
|
|
30431
|
-
addClass([this.popupObj.element], this.parent.
|
|
30615
|
+
addClass([this.popupObj.element], this.parent.getCssClass());
|
|
30432
30616
|
}
|
|
30433
30617
|
this.popupObj.refreshPosition(target);
|
|
30434
30618
|
};
|
|
30619
|
+
Table.prototype.onIframeMouseDown = function () {
|
|
30620
|
+
if (this.popupObj) {
|
|
30621
|
+
this.popupObj.hide();
|
|
30622
|
+
}
|
|
30623
|
+
};
|
|
30435
30624
|
Table.prototype.docClick = function (e) {
|
|
30436
30625
|
var target = e.args.target;
|
|
30437
30626
|
// eslint-disable-next-line
|
|
@@ -30468,10 +30657,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30468
30657
|
var rowDiv;
|
|
30469
30658
|
var tableCell;
|
|
30470
30659
|
for (var row = 0; row < 3; row++) {
|
|
30471
|
-
rowDiv = this.parent.createElement('div', { className: 'e-rte-table-row' +
|
|
30660
|
+
rowDiv = this.parent.createElement('div', { className: 'e-rte-table-row' + this.parent.getCssClass(true), attrs: { 'data-column': '' + row } });
|
|
30472
30661
|
for (var col = 0; col < 10; col++) {
|
|
30473
30662
|
var display = (row > 2) ? 'none' : 'inline-block';
|
|
30474
|
-
tableCell = this.parent.createElement('div', { className: 'e-rte-tablecell e-default' +
|
|
30663
|
+
tableCell = this.parent.createElement('div', { className: 'e-rte-tablecell e-default' + this.parent.getCssClass(true), attrs: { 'data-cell': '' + col } });
|
|
30475
30664
|
rowDiv.appendChild(tableCell);
|
|
30476
30665
|
tableCell.style.display = display;
|
|
30477
30666
|
if (col === 0 && row === 0) {
|
|
@@ -30495,13 +30684,13 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30495
30684
|
height: 'initial', width: '290px', content: editContent, header: editHeader,
|
|
30496
30685
|
buttons: [{
|
|
30497
30686
|
click: this.applyProperties.bind(this, args),
|
|
30498
|
-
buttonModel: { content: update, cssClass: 'e-flat e-size-update' +
|
|
30687
|
+
buttonModel: { content: update, cssClass: 'e-flat e-size-update' + this.parent.getCssClass(true), isPrimary: true }
|
|
30499
30688
|
},
|
|
30500
30689
|
{
|
|
30501
30690
|
click: function (e) {
|
|
30502
30691
|
_this.cancelDialog(e);
|
|
30503
30692
|
},
|
|
30504
|
-
buttonModel: { cssClass: 'e-flat e-cancel' +
|
|
30693
|
+
buttonModel: { cssClass: 'e-flat e-cancel' + this.parent.getCssClass(true), content: cancel }
|
|
30505
30694
|
}],
|
|
30506
30695
|
cssClass: this.editdlgObj.cssClass + ' e-rte-edit-table-prop-dialog'
|
|
30507
30696
|
});
|
|
@@ -30543,10 +30732,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30543
30732
|
Table.prototype.tableCellDlgContent = function () {
|
|
30544
30733
|
var tableColumn = this.l10n.getConstant('columns');
|
|
30545
30734
|
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' +
|
|
30735
|
+
var tableWrap = this.parent.createElement('div', { className: 'e-cell-wrap' + this.parent.getCssClass(true) });
|
|
30736
|
+
var content = '<div class="e-rte-field' + this.parent.getCssClass(true) + '"><input type="text" '
|
|
30737
|
+
+ ' data-role ="none" id="tableColumn" class="e-table-column' + this.parent.getCssClass(true) + '"/></div>'
|
|
30738
|
+
+ '<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
30739
|
var contentElem = parseHtml(content);
|
|
30551
30740
|
tableWrap.appendChild(contentElem);
|
|
30552
30741
|
this.columnTextBox = new NumericTextBox({
|
|
@@ -30557,7 +30746,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30557
30746
|
floatLabelType: 'Auto',
|
|
30558
30747
|
max: 50,
|
|
30559
30748
|
enableRtl: this.parent.enableRtl, locale: this.parent.locale,
|
|
30560
|
-
cssClass: this.parent.
|
|
30749
|
+
cssClass: this.parent.getCssClass()
|
|
30561
30750
|
});
|
|
30562
30751
|
this.columnTextBox.isStringTemplate = true;
|
|
30563
30752
|
this.columnTextBox.appendTo(tableWrap.querySelector('#tableColumn'));
|
|
@@ -30569,7 +30758,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30569
30758
|
floatLabelType: 'Auto',
|
|
30570
30759
|
max: 1000,
|
|
30571
30760
|
enableRtl: this.parent.enableRtl, locale: this.parent.locale,
|
|
30572
|
-
cssClass: this.parent.
|
|
30761
|
+
cssClass: this.parent.getCssClass()
|
|
30573
30762
|
});
|
|
30574
30763
|
this.rowTextBox.isStringTemplate = true;
|
|
30575
30764
|
this.rowTextBox.appendTo(tableWrap.querySelector('#tableRow'));
|
|
@@ -30590,7 +30779,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30590
30779
|
return;
|
|
30591
30780
|
}
|
|
30592
30781
|
var tableDialog = this.parent.createElement('div', {
|
|
30593
|
-
className: 'e-rte-edit-table' +
|
|
30782
|
+
className: 'e-rte-edit-table' + this.parent.getCssClass(true), id: this.rteID + '_tabledialog'
|
|
30594
30783
|
});
|
|
30595
30784
|
this.parent.element.appendChild(tableDialog);
|
|
30596
30785
|
var insert = this.l10n.getConstant('dialogInsert');
|
|
@@ -30598,20 +30787,20 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30598
30787
|
var header = this.l10n.getConstant('tabledialogHeader');
|
|
30599
30788
|
var dialogModel = {
|
|
30600
30789
|
header: header,
|
|
30601
|
-
cssClass: CLS_RTE_ELEMENTS +
|
|
30790
|
+
cssClass: CLS_RTE_ELEMENTS + this.parent.getCssClass(true),
|
|
30602
30791
|
enableRtl: this.parent.enableRtl,
|
|
30603
30792
|
locale: this.parent.locale,
|
|
30604
30793
|
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px', height: 'initial',
|
|
30605
30794
|
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
30606
30795
|
isModal: Browser.isDevice,
|
|
30607
30796
|
buttons: [{
|
|
30608
|
-
buttonModel: { content: insert, cssClass: 'e-flat e-insert-table' +
|
|
30797
|
+
buttonModel: { content: insert, cssClass: 'e-flat e-insert-table' + this.parent.getCssClass(true), isPrimary: true }
|
|
30609
30798
|
},
|
|
30610
30799
|
{
|
|
30611
30800
|
click: function (e) {
|
|
30612
30801
|
_this.cancelDialog(e);
|
|
30613
30802
|
},
|
|
30614
|
-
buttonModel: { cssClass: 'e-flat e-cancel' +
|
|
30803
|
+
buttonModel: { cssClass: 'e-flat e-cancel' + this.parent.getCssClass(true), content: cancel }
|
|
30615
30804
|
}],
|
|
30616
30805
|
target: (Browser.isDevice) ? document.body : this.parent.element,
|
|
30617
30806
|
animationSettings: { effect: 'None' },
|
|
@@ -30684,13 +30873,13 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30684
30873
|
var tableWidth = this.l10n.getConstant('tableWidth');
|
|
30685
30874
|
var cellPadding = this.l10n.getConstant('cellpadding');
|
|
30686
30875
|
var cellSpacing = this.l10n.getConstant('cellspacing');
|
|
30687
|
-
var tableWrap = this.parent.createElement('div', { className: 'e-table-sizewrap' +
|
|
30876
|
+
var tableWrap = this.parent.createElement('div', { className: 'e-table-sizewrap' + this.parent.getCssClass(true) });
|
|
30688
30877
|
var widthVal = closest(selectNode, 'table').getClientRects()[0].width;
|
|
30689
30878
|
var padVal = closest(selectNode, 'td').style.padding;
|
|
30690
30879
|
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' +
|
|
30880
|
+
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) + '" '
|
|
30881
|
+
+ ' /></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) + '" />'
|
|
30882
|
+
+ ' </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
30883
|
var contentElem = parseHtml(content);
|
|
30695
30884
|
tableWrap.appendChild(contentElem);
|
|
30696
30885
|
this.tableWidthNum = new NumericTextBox({
|
|
@@ -30837,7 +31026,16 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
|
|
|
30837
31026
|
DialogRenderer.prototype.getDialogPosition = function () {
|
|
30838
31027
|
var distanceFromVisibleTop = this.parent.element.getBoundingClientRect().top;
|
|
30839
31028
|
if (distanceFromVisibleTop < 0) {
|
|
30840
|
-
|
|
31029
|
+
var topHeight = 0;
|
|
31030
|
+
var parentElement = this.parent.element;
|
|
31031
|
+
while (parentElement.nodeName !== 'BODY') {
|
|
31032
|
+
var top_1 = parentElement.getBoundingClientRect().top;
|
|
31033
|
+
if (top_1 > 0) {
|
|
31034
|
+
topHeight = top_1;
|
|
31035
|
+
}
|
|
31036
|
+
parentElement = parentElement.parentElement;
|
|
31037
|
+
}
|
|
31038
|
+
distanceFromVisibleTop = Math.abs(distanceFromVisibleTop) + topHeight;
|
|
30841
31039
|
return distanceFromVisibleTop.toString();
|
|
30842
31040
|
}
|
|
30843
31041
|
else {
|
|
@@ -31875,7 +32073,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
31875
32073
|
}
|
|
31876
32074
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem.nextElementSibling, 0);
|
|
31877
32075
|
}
|
|
31878
|
-
else if (nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG'
|
|
32076
|
+
else if (nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
32077
|
+
(nearBlockNode.querySelectorAll('video').length > 0) || (nearBlockNode.querySelectorAll('audio').length > 0) || (nearBlockNode.querySelectorAll('img').length > 0))) {
|
|
31879
32078
|
if (!isNullOrUndefined(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
|
|
31880
32079
|
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
31881
32080
|
_this.parent.formatter.editorManager.domNode.insertAfter(newElem, nearBlockNode);
|
|
@@ -32496,7 +32695,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32496
32695
|
if (tool.command === 'InsertText') {
|
|
32497
32696
|
currentInsertContentLength = value.length;
|
|
32498
32697
|
}
|
|
32499
|
-
var currentLength = this.getText().trim().length;
|
|
32698
|
+
var currentLength = this.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
32500
32699
|
var selectionLength = this.getSelection().length;
|
|
32501
32700
|
var totalLength = (currentLength - selectionLength) + currentInsertContentLength;
|
|
32502
32701
|
if (!(this.maxLength === -1 || totalLength <= this.maxLength)) {
|
|
@@ -32671,7 +32870,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32671
32870
|
if (this.enableXhtml) {
|
|
32672
32871
|
this.setProperties({ value: this.getXhtml() }, true);
|
|
32673
32872
|
}
|
|
32674
|
-
if (this.toolbarSettings.enable && this.toolbarSettings.type === 'Expand' && !isNullOrUndefined(this.getToolbar()) &&
|
|
32873
|
+
if (this.toolbarSettings.enable && (this.toolbarSettings.type === 'Expand' || this.toolbarSettings.type === 'MultiRow' || this.toolbarSettings.type === 'Scrollable') && !isNullOrUndefined(this.getToolbar()) &&
|
|
32675
32874
|
(this.toolbarSettings.items.indexOf('Undo') > -1 && this.toolbarSettings.items.indexOf('Redo') > -1)) {
|
|
32676
32875
|
this.disableToolbarItem(['Undo', 'Redo']);
|
|
32677
32876
|
}
|
|
@@ -32681,7 +32880,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32681
32880
|
}
|
|
32682
32881
|
// eslint-disable-next-line
|
|
32683
32882
|
(this.enabled && !this.readonly) ? this.eventInitializer() : this.unWireEvents();
|
|
32684
|
-
this.notify(bindCssClass, { cssClass: this.
|
|
32883
|
+
this.notify(bindCssClass, { cssClass: this.getCssClass() });
|
|
32685
32884
|
this.addAudioVideoWrapper();
|
|
32686
32885
|
this.notify(tableclass, {});
|
|
32687
32886
|
this.renderComplete();
|
|
@@ -32772,7 +32971,13 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32772
32971
|
range.endContainer;
|
|
32773
32972
|
var closestLI = closest(endNode, 'LI');
|
|
32774
32973
|
var isDetached = false;
|
|
32775
|
-
|
|
32974
|
+
var currentRangeEndOffset = range.endOffset;
|
|
32975
|
+
if (currentEndContainer.nodeType === Node.TEXT_NODE) {
|
|
32976
|
+
if (currentEndContainer.textContent.charAt(currentRangeEndOffset - 1) === '\uFEFF') {
|
|
32977
|
+
currentRangeEndOffset--;
|
|
32978
|
+
}
|
|
32979
|
+
}
|
|
32980
|
+
if (!isNullOrUndefined(closestLI) && endNode.textContent.trim().length === currentRangeEndOffset &&
|
|
32776
32981
|
!range.collapsed && isNullOrUndefined(endNode.nextElementSibling)) {
|
|
32777
32982
|
for (var i = 0; i < closestLI.childNodes.length; i++) {
|
|
32778
32983
|
if (closestLI.childNodes[i].nodeName === '#text' && closestLI.childNodes[i].textContent.trim().length === 0) {
|
|
@@ -32851,7 +33056,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32851
33056
|
}
|
|
32852
33057
|
var notFormatPainterCopy = isNullOrUndefined(e.action) ? true : (e.action !== 'format-copy' ? true : false);
|
|
32853
33058
|
if (this.formatter.getUndoRedoStack().length === 0 && notFormatPainterCopy &&
|
|
32854
|
-
!(e.altKey || e.shiftKey || (e.altKey && e.shiftKey && e.which
|
|
33059
|
+
!(e.altKey || e.shiftKey || (e.altKey && e.shiftKey && e.which == 67))) {
|
|
32855
33060
|
this.formatter.saveData();
|
|
32856
33061
|
}
|
|
32857
33062
|
if (e.action !== 'insert-link' &&
|
|
@@ -32920,7 +33125,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
32920
33125
|
this.formatter.onKeyHandler(this, e);
|
|
32921
33126
|
}
|
|
32922
33127
|
if (this.inputElement && this.inputElement.textContent.length !== 0
|
|
32923
|
-
|| this.element.querySelectorAll('.e-toolbar-item.e-active').length > 0) {
|
|
33128
|
+
|| this.element.querySelectorAll('.e-toolbar-item.e-active').length > 0 || this.formatter.getUndoRedoStack().length > 0) {
|
|
32924
33129
|
this.notify(toolbarRefresh, { args: e });
|
|
32925
33130
|
}
|
|
32926
33131
|
if (!isNullOrUndefined(this.placeholder)) {
|
|
@@ -33012,20 +33217,61 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33012
33217
|
return;
|
|
33013
33218
|
}
|
|
33014
33219
|
}
|
|
33015
|
-
this.notifyMouseUp(e);
|
|
33016
33220
|
if (e.detail === 3) {
|
|
33017
33221
|
var range = this.getRange();
|
|
33018
33222
|
var selection = this.formatter.editorManager.domNode.getSelection();
|
|
33019
|
-
|
|
33020
|
-
|
|
33021
|
-
|
|
33022
|
-
|
|
33023
|
-
|
|
33024
|
-
|
|
33025
|
-
|
|
33223
|
+
// To handle the triple click node selection improper range due to browser behavior.
|
|
33224
|
+
if (selection.rangeCount > 0 && !isNullOrUndefined(range.startContainer.parentElement) && (!isNullOrUndefined(range.startContainer.parentElement.nextSibling) &&
|
|
33225
|
+
(range.startContainer.parentElement.nextSibling.nodeType !== 3 ||
|
|
33226
|
+
/\s+$/.test(range.startContainer.parentElement.nextSibling.textContent)) || range.startOffset === range.endOffset)
|
|
33227
|
+
|| range.startContainer.parentElement.tagName.toLocaleLowerCase() === 'li') {
|
|
33228
|
+
var newRange = new Range();
|
|
33229
|
+
var start = range.startContainer;
|
|
33230
|
+
var end = range.endContainer;
|
|
33231
|
+
var isInvalid = false;
|
|
33232
|
+
var isInsideList = range.commonAncestorContainer.nodeName === 'OL' || range.commonAncestorContainer.nodeName === 'UL'
|
|
33233
|
+
|| range.commonAncestorContainer.nodeName === 'LI';
|
|
33234
|
+
if (!isInsideList && end.nodeType === 1 && end.nodeName === 'LI') {
|
|
33235
|
+
end = closest(end, 'ol, ul').previousElementSibling.lastElementChild;
|
|
33236
|
+
}
|
|
33237
|
+
else if (isInsideList && end.nodeType === 1 && range.endOffset === 0) {
|
|
33238
|
+
if (end.previousElementSibling && end.previousElementSibling.lastElementChild) {
|
|
33239
|
+
end = end.previousElementSibling.lastElementChild;
|
|
33240
|
+
}
|
|
33241
|
+
else {
|
|
33242
|
+
end = closest(end.parentElement, 'li');
|
|
33243
|
+
if (end && end.nodeName === 'LI') {
|
|
33244
|
+
end = end.previousElementSibling;
|
|
33245
|
+
}
|
|
33246
|
+
}
|
|
33247
|
+
}
|
|
33248
|
+
else {
|
|
33249
|
+
if (!closest(end, 'li') && end.previousElementSibling && end.previousElementSibling.lastChild &&
|
|
33250
|
+
end.previousElementSibling.textContent.trim().length > 0) {
|
|
33251
|
+
end = end.previousElementSibling.lastChild;
|
|
33252
|
+
}
|
|
33253
|
+
else if (closest(end, 'li') && end.previousElementSibling && end.previousElementSibling.lastChild) {
|
|
33254
|
+
end = closest(end, 'li').parentElement.previousElementSibling.lastChild;
|
|
33255
|
+
}
|
|
33256
|
+
}
|
|
33257
|
+
if (!end || end === this.inputElement) {
|
|
33258
|
+
end = start;
|
|
33259
|
+
isInvalid = true;
|
|
33260
|
+
}
|
|
33261
|
+
while (end.nodeName !== '#text' && !isInvalid) {
|
|
33262
|
+
if (end.lastElementChild) {
|
|
33263
|
+
end = end.lastElementChild;
|
|
33264
|
+
}
|
|
33265
|
+
else {
|
|
33266
|
+
end = end.lastChild;
|
|
33267
|
+
}
|
|
33026
33268
|
}
|
|
33269
|
+
newRange.setStart(start, 0);
|
|
33270
|
+
newRange.setEnd(end, end.textContent.length);
|
|
33271
|
+
this.formatter.editorManager.nodeSelection.setRange(this.contentModule.getDocument(), newRange);
|
|
33027
33272
|
}
|
|
33028
33273
|
}
|
|
33274
|
+
this.notifyMouseUp(e);
|
|
33029
33275
|
};
|
|
33030
33276
|
/**
|
|
33031
33277
|
* @param {Function} module - specifies the module function.
|
|
@@ -33069,7 +33315,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33069
33315
|
var currentLength = _this.inputElement.textContent.length;
|
|
33070
33316
|
var selectionLength = _this.getSelection().length;
|
|
33071
33317
|
var pastedContentLength = (isNullOrUndefined(e) || isNullOrUndefined(e.clipboardData))
|
|
33072
|
-
? 0 : e.clipboardData.getData('text/plain').length;
|
|
33318
|
+
? 0 : e.clipboardData.getData('text/plain').replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
33073
33319
|
var totalLength = (currentLength - selectionLength) + pastedContentLength;
|
|
33074
33320
|
if (_this.editorMode === 'Markdown') {
|
|
33075
33321
|
var args_1 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
|
|
@@ -33501,7 +33747,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33501
33747
|
RichTextEditor.prototype.updatePanelValue = function () {
|
|
33502
33748
|
var value = this.value;
|
|
33503
33749
|
value = (this.enableHtmlEncode && this.value) ? decode(value) : value;
|
|
33504
|
-
var getTextArea = this.element.querySelector('.
|
|
33750
|
+
var getTextArea = this.element.querySelector('.' + CLS_RTE_SOURCE_CODE_TXTAREA);
|
|
33505
33751
|
if (value) {
|
|
33506
33752
|
if (getTextArea && getTextArea.style.display === 'block') {
|
|
33507
33753
|
getTextArea.value = this.value;
|
|
@@ -34132,6 +34378,16 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34132
34378
|
RichTextEditor.prototype.getID = function () {
|
|
34133
34379
|
return (this.originalElement.tagName === 'TEXTAREA' ? this.valueContainer.id : this.element.id);
|
|
34134
34380
|
};
|
|
34381
|
+
/**
|
|
34382
|
+
* @returns {void}
|
|
34383
|
+
* getCssClass method
|
|
34384
|
+
*
|
|
34385
|
+
* @hidden
|
|
34386
|
+
* @deprecated
|
|
34387
|
+
*/
|
|
34388
|
+
RichTextEditor.prototype.getCssClass = function (isSpace) {
|
|
34389
|
+
return (isNullOrUndefined(this.cssClass) ? '' : isSpace ? ' ' + this.cssClass : this.cssClass);
|
|
34390
|
+
};
|
|
34135
34391
|
RichTextEditor.prototype.mouseDownHandler = function (e) {
|
|
34136
34392
|
var touch = (e.touches ? e.changedTouches[0] : e);
|
|
34137
34393
|
addClass([this.element], [CLS_FOCUS]);
|
|
@@ -34243,7 +34499,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34243
34499
|
};
|
|
34244
34500
|
RichTextEditor.prototype.getUpdatedValue = function () {
|
|
34245
34501
|
var value;
|
|
34246
|
-
var getTextArea = this.element.querySelector('.
|
|
34502
|
+
var getTextArea = this.element.querySelector('.' + CLS_RTE_SOURCE_CODE_TXTAREA);
|
|
34247
34503
|
if (this.editorMode === 'HTML') {
|
|
34248
34504
|
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
34249
34505
|
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
@@ -34274,6 +34530,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34274
34530
|
clearTimeout(this.idleInterval);
|
|
34275
34531
|
this.idleInterval = setTimeout(this.updateValueOnIdle.bind(this), 0);
|
|
34276
34532
|
};
|
|
34533
|
+
RichTextEditor.prototype.cleanupResizeElements = function (args) {
|
|
34534
|
+
var value = this.removeResizeElement(args.value);
|
|
34535
|
+
return value;
|
|
34536
|
+
};
|
|
34277
34537
|
RichTextEditor.prototype.removeResizeElement = function (value) {
|
|
34278
34538
|
var valueElementWrapper = document.createElement("div");
|
|
34279
34539
|
valueElementWrapper.innerHTML = value;
|
|
@@ -34495,6 +34755,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34495
34755
|
this.on(contentChanged, this.contentChanged, this);
|
|
34496
34756
|
this.on(resizeInitialized, this.updateResizeFlag, this);
|
|
34497
34757
|
this.on(updateTbItemsStatus, this.updateStatus, this);
|
|
34758
|
+
this.on(cleanupResizeElements, this.cleanupResizeElements, this);
|
|
34498
34759
|
if (this.readonly && this.enabled) {
|
|
34499
34760
|
return;
|
|
34500
34761
|
}
|
|
@@ -34581,6 +34842,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34581
34842
|
this.off(contentChanged, this.contentChanged);
|
|
34582
34843
|
this.off(resizeInitialized, this.updateResizeFlag);
|
|
34583
34844
|
this.off(updateTbItemsStatus, this.updateStatus);
|
|
34845
|
+
this.off(cleanupResizeElements, this.cleanupResizeElements);
|
|
34584
34846
|
if (this.readonly && this.enabled) {
|
|
34585
34847
|
return;
|
|
34586
34848
|
}
|
|
@@ -34953,5 +35215,5 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34953
35215
|
* Rich Text Editor component exported items
|
|
34954
35216
|
*/
|
|
34955
35217
|
|
|
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,
|
|
35218
|
+
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
35219
|
//# sourceMappingURL=ej2-richtexteditor.es5.js.map
|