@syncfusion/ej2-richtexteditor 24.1.41-569421 → 24.1.41-581025
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 +0 -176
- package/dist/ej2-richtexteditor.umd.min.js +1 -1
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +7822 -9502
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +5674 -7355
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/package.json +12 -12
- package/src/common/config.d.ts +0 -7
- package/src/common/config.js +0 -11
- package/src/common/constant.d.ts +0 -6
- package/src/common/constant.js +0 -6
- package/src/common/interface.d.ts +0 -12
- package/src/common/types.d.ts +0 -6
- package/src/common/util.d.ts +0 -6
- package/src/common/util.js +20 -61
- package/src/editor-manager/base/constant.d.ts +0 -6
- package/src/editor-manager/base/constant.js +0 -6
- package/src/editor-manager/base/editor-manager.d.ts +0 -5
- package/src/editor-manager/base/editor-manager.js +0 -59
- package/src/editor-manager/base/interface.d.ts +0 -8
- package/src/editor-manager/plugin/dom-node.d.ts +1 -5
- package/src/editor-manager/plugin/dom-node.js +15 -169
- package/src/editor-manager/plugin/format-painter-actions.d.ts +0 -1
- package/src/editor-manager/plugin/format-painter-actions.js +1 -19
- package/src/editor-manager/plugin/formats.d.ts +0 -1
- package/src/editor-manager/plugin/formats.js +3 -38
- package/src/editor-manager/plugin/image.js +16 -12
- package/src/editor-manager/plugin/indents.js +1 -1
- package/src/editor-manager/plugin/inserthtml.d.ts +0 -1
- package/src/editor-manager/plugin/inserthtml.js +18 -78
- package/src/editor-manager/plugin/link.js +3 -8
- package/src/editor-manager/plugin/lists.js +70 -159
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +0 -3
- package/src/editor-manager/plugin/ms-word-clean-up.js +85 -212
- package/src/editor-manager/plugin/nodecutter.js +2 -5
- package/src/editor-manager/plugin/selection-commands.d.ts +0 -2
- package/src/editor-manager/plugin/selection-commands.js +4 -209
- package/src/editor-manager/plugin/table.d.ts +1 -4
- package/src/editor-manager/plugin/table.js +49 -95
- package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +10 -20
- package/src/editor-manager/plugin/undo.d.ts +0 -1
- package/src/editor-manager/plugin/undo.js +1 -21
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +3 -4
- package/src/rich-text-editor/actions/base-quick-toolbar.js +10 -43
- package/src/rich-text-editor/actions/base-toolbar.js +34 -33
- package/src/rich-text-editor/actions/color-picker.d.ts +0 -1
- package/src/rich-text-editor/actions/color-picker.js +0 -10
- package/src/rich-text-editor/actions/count.js +1 -1
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +0 -1
- package/src/rich-text-editor/actions/dropdown-buttons.js +4 -8
- package/src/rich-text-editor/actions/emoji-picker.js +4 -4
- package/src/rich-text-editor/actions/enter-key.js +4 -8
- package/src/rich-text-editor/actions/format-painter.js +1 -4
- package/src/rich-text-editor/actions/full-screen.js +2 -3
- package/src/rich-text-editor/actions/html-editor.d.ts +2 -2
- package/src/rich-text-editor/actions/html-editor.js +42 -123
- package/src/rich-text-editor/actions/keyboard.js +1 -3
- package/src/rich-text-editor/actions/markdown-editor.js +1 -3
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +0 -3
- package/src/rich-text-editor/actions/paste-clean-up.js +14 -85
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +0 -8
- package/src/rich-text-editor/actions/quick-toolbar.js +9 -37
- package/src/rich-text-editor/actions/resize.js +1 -2
- package/src/rich-text-editor/actions/toolbar-action.js +1 -1
- package/src/rich-text-editor/actions/toolbar.d.ts +3 -2
- package/src/rich-text-editor/actions/toolbar.js +87 -18
- 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 +0 -40
- package/src/rich-text-editor/base/constant.js +0 -209
- package/src/rich-text-editor/base/interface.d.ts +3 -37
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +3 -3
- package/src/rich-text-editor/base/rich-text-editor.d.ts +4 -7
- package/src/rich-text-editor/base/rich-text-editor.js +132 -156
- package/src/rich-text-editor/base/util.js +2 -11
- package/src/rich-text-editor/formatter/formatter.js +4 -16
- package/src/rich-text-editor/models/default-locale.js +26 -30
- package/src/rich-text-editor/models/items.js +2 -2
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.js +1 -1
- package/src/rich-text-editor/renderer/audio-module.d.ts +0 -1
- package/src/rich-text-editor/renderer/audio-module.js +4 -22
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +0 -2
- package/src/rich-text-editor/renderer/dialog-renderer.js +1 -12
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -2
- package/src/rich-text-editor/renderer/image-module.d.ts +1 -9
- package/src/rich-text-editor/renderer/image-module.js +168 -203
- package/src/rich-text-editor/renderer/link-module.js +1 -10
- package/src/rich-text-editor/renderer/table-module.d.ts +1 -8
- package/src/rich-text-editor/renderer/table-module.js +139 -301
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -3
- package/src/rich-text-editor/renderer/toolbar-renderer.js +9 -94
- package/src/rich-text-editor/renderer/video-module.d.ts +0 -3
- package/src/rich-text-editor/renderer/video-module.js +41 -82
- package/src/rich-text-editor/renderer/view-source.d.ts +0 -1
- package/src/rich-text-editor/renderer/view-source.js +4 -12
- package/src/selection/selection.js +0 -3
- package/styles/bootstrap-dark.css +53 -161
- package/styles/bootstrap.css +61 -162
- package/styles/bootstrap4.css +46 -146
- package/styles/bootstrap5-dark.css +46 -151
- package/styles/bootstrap5.css +46 -151
- package/styles/fabric-dark.css +40 -140
- package/styles/fabric.css +41 -141
- package/styles/fluent-dark.css +47 -165
- package/styles/fluent.css +47 -165
- package/styles/highcontrast-light.css +40 -140
- package/styles/highcontrast.css +41 -144
- package/styles/material-dark.css +41 -145
- package/styles/material.css +41 -145
- package/styles/material3-dark.css +50 -156
- package/styles/material3.css +50 -156
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +13 -17
- package/styles/rich-text-editor/_bootstrap-definition.scss +19 -22
- package/styles/rich-text-editor/_bootstrap4-definition.scss +7 -11
- package/styles/rich-text-editor/_bootstrap5-definition.scss +3 -7
- package/styles/rich-text-editor/_fabric-dark-definition.scss +2 -6
- package/styles/rich-text-editor/_fabric-definition.scss +3 -7
- package/styles/rich-text-editor/_fluent-definition.scss +9 -13
- package/styles/rich-text-editor/_fusionnew-definition.scss +3 -7
- package/styles/rich-text-editor/_highcontrast-definition.scss +3 -7
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +2 -6
- package/styles/rich-text-editor/_layout.scss +31 -133
- package/styles/rich-text-editor/_material-dark-definition.scss +2 -6
- package/styles/rich-text-editor/_material-definition.scss +2 -6
- package/styles/rich-text-editor/_material3-definition.scss +12 -16
- package/styles/rich-text-editor/_tailwind-definition.scss +19 -23
- package/styles/rich-text-editor/_theme.scss +23 -112
- package/styles/rich-text-editor/bootstrap-dark.css +53 -161
- package/styles/rich-text-editor/bootstrap.css +61 -162
- package/styles/rich-text-editor/bootstrap4.css +46 -146
- package/styles/rich-text-editor/bootstrap5-dark.css +46 -151
- package/styles/rich-text-editor/bootstrap5.css +46 -151
- package/styles/rich-text-editor/fabric-dark.css +40 -140
- package/styles/rich-text-editor/fabric.css +41 -141
- package/styles/rich-text-editor/fluent-dark.css +47 -165
- package/styles/rich-text-editor/fluent.css +47 -165
- package/styles/rich-text-editor/highcontrast-light.css +40 -140
- package/styles/rich-text-editor/highcontrast.css +41 -144
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap4.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap5.scss +2 -2
- package/styles/rich-text-editor/icons/_fabric-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_fabric.scss +2 -2
- package/styles/rich-text-editor/icons/_fluent.scss +2 -2
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +2 -2
- package/styles/rich-text-editor/icons/_highcontrast.scss +2 -2
- package/styles/rich-text-editor/icons/_material-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_material.scss +2 -2
- package/styles/rich-text-editor/icons/_material3.scss +2 -2
- package/styles/rich-text-editor/icons/_tailwind.scss +2 -2
- package/styles/rich-text-editor/material-dark.css +41 -145
- package/styles/rich-text-editor/material.css +41 -145
- package/styles/rich-text-editor/material3-dark.css +50 -156
- package/styles/rich-text-editor/material3.css +50 -156
- package/styles/rich-text-editor/tailwind-dark.css +63 -191
- package/styles/rich-text-editor/tailwind.css +63 -191
- package/styles/tailwind-dark.css +63 -191
- package/styles/tailwind.css +63 -191
- package/.eslintrc.json +0 -260
- package/src/global.d.ts +0 -1
- package/styles/rich-text-editor/_bds-definition.scss +0 -279
- package/styles/rich-text-editor/icons/_bds.scss +0 -348
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as events from '../base/constant';
|
|
2
|
-
import { isNullOrUndefined, closest, attributes, removeClass, addClass, Browser, detach } from '@syncfusion/ej2-base';
|
|
2
|
+
import { isNullOrUndefined, closest, attributes, removeClass, addClass, Browser, detach, EventHandler } from '@syncfusion/ej2-base';
|
|
3
3
|
import { isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
|
|
4
4
|
import { HTMLFormatter } from '../formatter/html-formatter';
|
|
5
5
|
import { RenderType } from '../base/enum';
|
|
@@ -14,7 +14,6 @@ import { getTextNodesUnder, sanitizeHelper, getDefaultValue } from '../base/util
|
|
|
14
14
|
import { isIDevice } from '../../common/util';
|
|
15
15
|
import { XhtmlValidation } from './xhtml-validation';
|
|
16
16
|
import { ON_BEGIN } from './../../common/constant';
|
|
17
|
-
import * as CONSTANT from '../base/constant';
|
|
18
17
|
/**
|
|
19
18
|
* `HtmlEditor` module is used to HTML editor
|
|
20
19
|
*/
|
|
@@ -71,7 +70,6 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
71
70
|
this.parent.on(events.readOnlyMode, this.updateReadOnly, this);
|
|
72
71
|
this.parent.on(events.paste, this.onPaste, this);
|
|
73
72
|
this.parent.on(events.tableclass, this.isTableClassAdded, this);
|
|
74
|
-
this.parent.on(events.onHandleFontsizeChange, this.onHandleFontsizeChange, this);
|
|
75
73
|
};
|
|
76
74
|
HtmlEditor.prototype.updateReadOnly = function () {
|
|
77
75
|
if (this.parent.readonly) {
|
|
@@ -90,6 +88,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
90
88
|
};
|
|
91
89
|
HtmlEditor.prototype.onSelectionRestore = function (e) {
|
|
92
90
|
this.parent.isBlur = false;
|
|
91
|
+
this.contentRenderer.getEditPanel().focus();
|
|
93
92
|
if (isNullOrUndefined(e.items) || e.items) {
|
|
94
93
|
this.saveSelection.restore();
|
|
95
94
|
}
|
|
@@ -97,91 +96,11 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
97
96
|
HtmlEditor.prototype.isTableClassAdded = function () {
|
|
98
97
|
var tableElement = this.parent.inputElement.querySelectorAll('table');
|
|
99
98
|
for (var i = 0; i < tableElement.length; i++) {
|
|
100
|
-
if (!tableElement[i].classList.contains('e-rte-table')
|
|
99
|
+
if (!tableElement[i].classList.contains('e-rte-table')) {
|
|
101
100
|
tableElement[i].classList.add('e-rte-table');
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
};
|
|
105
|
-
HtmlEditor.prototype.onHandleFontsizeChange = function (e) {
|
|
106
|
-
var keyboardArgs = e.args;
|
|
107
|
-
var args = { name: 'dropDownSelect' };
|
|
108
|
-
args.item = {
|
|
109
|
-
command: 'Font',
|
|
110
|
-
subCommand: 'FontSize'
|
|
111
|
-
};
|
|
112
|
-
var items = this.parent.fontSize.items;
|
|
113
|
-
var activeElem;
|
|
114
|
-
if (this.parent.toolbarModule && this.parent.toolbarModule.dropDownModule &&
|
|
115
|
-
this.parent.toolbarModule.dropDownModule.fontSizeDropDown && !isNOU(this.parent.toolbarModule.dropDownModule.fontSizeDropDown.activeElem[0].textContent) && this.parent.toolbarModule.dropDownModule.fontSizeDropDown.activeElem[0].textContent !== '') {
|
|
116
|
-
activeElem = this.parent.toolbarModule.dropDownModule.fontSizeDropDown.activeElem[0].textContent;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
var fontSizeValue = void 0;
|
|
120
|
-
var selection = this.parent.contentModule.getDocument().getSelection();
|
|
121
|
-
if (selection && selection.focusNode && selection.focusNode.parentElement) {
|
|
122
|
-
fontSizeValue = document.defaultView.getComputedStyle(selection.focusNode.parentElement, null).getPropertyValue('font-size');
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
fontSizeValue = this.parent.fontSize.width;
|
|
126
|
-
}
|
|
127
|
-
fontSizeValue = isNOU(fontSizeValue) ? this.parent.fontSize.width : fontSizeValue;
|
|
128
|
-
var actualTxtFontValues = fontSizeValue.match(/^([\d.]+)(\D+)$/);
|
|
129
|
-
var size_1 = parseInt(actualTxtFontValues[1], 10);
|
|
130
|
-
var unit = actualTxtFontValues[2];
|
|
131
|
-
var defaultFontValues = items[0].value.match(/^([\d.]+)(\D+)$/);
|
|
132
|
-
if (defaultFontValues[2] === unit) {
|
|
133
|
-
var index = items.findIndex(function (_a) {
|
|
134
|
-
var value = _a.value;
|
|
135
|
-
return parseInt(value, 10) >= size_1;
|
|
136
|
-
});
|
|
137
|
-
activeElem = items[index].text;
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
var convertedSize_1 = this.convertFontSize(size_1, unit, defaultFontValues[2]);
|
|
141
|
-
var index = items.findIndex(function (_a) {
|
|
142
|
-
var value = _a.value;
|
|
143
|
-
return parseInt(value, 10) >= convertedSize_1;
|
|
144
|
-
});
|
|
145
|
-
activeElem = items[index].text;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
var fontIndex = items.findIndex(function (size) { return size.text === activeElem; });
|
|
149
|
-
if (keyboardArgs.action === 'increase-fontsize' && fontIndex !== -1) {
|
|
150
|
-
if (fontIndex >= items.length - 1) {
|
|
151
|
-
var fontValues = items[fontIndex].value.match(/^([\d.]+)(\D+)$/);
|
|
152
|
-
if (fontValues) {
|
|
153
|
-
var size = parseInt(fontValues[1], 10);
|
|
154
|
-
var unit = fontValues[2];
|
|
155
|
-
var roundedSize = size % 10 === 0 ? Math.ceil((size + 1) / 10) * 10 : Math.ceil(size / 10) * 10;
|
|
156
|
-
args.item.value = roundedSize.toLocaleString() + unit;
|
|
157
|
-
args.item.text = roundedSize.toLocaleString() + ' ' + unit;
|
|
158
|
-
}
|
|
159
|
-
this.parent.fontSize.items.push(args.item);
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
args.item.value = items[fontIndex + 1].value;
|
|
163
|
-
args.item.text = items[fontIndex + 1].text;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
else if (keyboardArgs.action === 'decrease-fontsize' && fontIndex !== -1 && fontIndex > 0) {
|
|
167
|
-
args.item.value = items[fontIndex - 1].value;
|
|
168
|
-
args.item.text = items[fontIndex - 1].text;
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
if (fontIndex >= 0 && fontIndex < items.length && items[fontIndex]) {
|
|
172
|
-
args.item.value = items[fontIndex].value;
|
|
173
|
-
args.item.text = items[fontIndex].text;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
this.parent.formatter.process(this.parent, args, keyboardArgs);
|
|
177
|
-
};
|
|
178
|
-
HtmlEditor.prototype.convertFontSize = function (value, originalUnit, targetUnit) {
|
|
179
|
-
if (CONSTANT.supportedUnits.indexOf(originalUnit) !== -1 || CONSTANT.supportedUnits.indexOf(targetUnit) !== -1) {
|
|
180
|
-
originalUnit = 'px';
|
|
181
|
-
}
|
|
182
|
-
var convertedValue = value * CONSTANT.conversionFactors[originalUnit][targetUnit];
|
|
183
|
-
return convertedValue;
|
|
184
|
-
};
|
|
185
104
|
HtmlEditor.prototype.onKeyUp = function (e) {
|
|
186
105
|
var args = e.args;
|
|
187
106
|
var restrictKeys = [8, 9, 13, 16, 17, 18, 20, 27, 37, 38, 39, 40, 44, 45, 46, 91,
|
|
@@ -189,12 +108,9 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
189
108
|
var range = this.parent.getRange();
|
|
190
109
|
// eslint-disable-next-line
|
|
191
110
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
192
|
-
var isEmptyNode = range.startContainer === range.endContainer && range.startOffset === range.endOffset &&
|
|
193
|
-
range.startOffset === 1 && range.startContainer.textContent.length === 1 && range.startContainer.textContent.charCodeAt(0) == 8203 &&
|
|
194
|
-
range.startContainer.textContent.replace(regEx, '').length === 0;
|
|
195
111
|
var pointer;
|
|
196
112
|
var isRootParent = false;
|
|
197
|
-
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey
|
|
113
|
+
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
|
|
198
114
|
pointer = range.startOffset;
|
|
199
115
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
200
116
|
range.startContainer.nodeName === '#text' ? range.startContainer.parentElement !== this.parent.inputElement ? range.startContainer.parentElement.classList.add('currentStartMark')
|
|
@@ -306,7 +222,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
306
222
|
e.args.keyCode === 13) {
|
|
307
223
|
this.spaceLink(e.args);
|
|
308
224
|
if (this.parent.editorMode === 'HTML' && !this.parent.readonly) {
|
|
309
|
-
var currentLength = this.parent.getText().trim().replace(/(\r\n|\n|\r
|
|
225
|
+
var currentLength = this.parent.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
310
226
|
var selectionLength = this.parent.getSelection().length;
|
|
311
227
|
var totalLength = (currentLength - selectionLength) + 1;
|
|
312
228
|
if (!(this.parent.maxLength === -1 || totalLength <= this.parent.maxLength) &&
|
|
@@ -317,13 +233,8 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
317
233
|
else {
|
|
318
234
|
this.parent.notify(events.enterHandler, { args: e.args });
|
|
319
235
|
var newRange = this.parent.getRange();
|
|
320
|
-
if (!
|
|
321
|
-
|
|
322
|
-
this.parent.element.querySelector('.e-rte-content').scrollTop += newRange.startContainer.getBoundingClientRect().bottom - this.parent.element.getBoundingClientRect().bottom;
|
|
323
|
-
}
|
|
324
|
-
else if (!isNullOrUndefined(newRange.startContainer) && this.parent.height === 'auto' && newRange.startContainer.nodeName !== '#text'
|
|
325
|
-
&& !this.parent.iframeSettings.enable && window.innerHeight < newRange.startContainer.getBoundingClientRect().top) {
|
|
326
|
-
newRange.startContainer.scrollIntoView({ block: 'end', inline: 'nearest' });
|
|
236
|
+
if (!isNOU(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text') {
|
|
237
|
+
newRange.startContainer.scrollIntoView({ block: "end", inline: "nearest" });
|
|
327
238
|
}
|
|
328
239
|
}
|
|
329
240
|
}
|
|
@@ -405,13 +316,11 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
405
316
|
currentRange.startContainer.previousSibling.nodeName === 'SPAN') {
|
|
406
317
|
isPreviousNotContentEditable = currentRange.startContainer.previousSibling.contentEditable === 'false' ? false : true;
|
|
407
318
|
}
|
|
408
|
-
var checkNode = currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer;
|
|
409
|
-
var isSelectedPositionNotStart = closest(currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer, 'li') ?
|
|
410
|
-
checkNode.nodeName !== 'li' && isNOU(checkNode.previousSibling) : true;
|
|
411
319
|
if (e.args.code === 'Backspace' && e.args.keyCode === 8 && currentRange.startOffset === 0 &&
|
|
412
320
|
currentRange.endOffset === 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.textContent.length > 0 &&
|
|
413
321
|
currentRange.startContainer.parentElement.tagName !== 'TD' && currentRange.startContainer.parentElement.tagName !== 'TH' &&
|
|
414
|
-
isPreviousNotContentEditable
|
|
322
|
+
isPreviousNotContentEditable) {
|
|
323
|
+
var checkNode = currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer;
|
|
415
324
|
if ((!this.parent.formatter.editorManager.domNode.isBlockNode(checkNode) &&
|
|
416
325
|
!isNOU(checkNode.previousSibling) && checkNode.previousSibling.nodeName === 'BR') ||
|
|
417
326
|
(!isNOU(currentRange.startContainer.previousSibling) && currentRange.startContainer.previousSibling.nodeName === 'BR')) {
|
|
@@ -422,9 +331,8 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
422
331
|
var liElement = this.getRangeLiNode(currentRange.startContainer);
|
|
423
332
|
if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
|
|
424
333
|
this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
|
|
425
|
-
liElement.previousElementSibling : liElement.previousElementSibling.
|
|
426
|
-
if (!
|
|
427
|
-
isNOU(liElement.lastElementChild.previousSibling) && liElement.lastChild.nodeName !== "#text") {
|
|
334
|
+
liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
|
|
335
|
+
if (!isNullOrUndefined(liElement.lastElementChild) && liElement.lastElementChild.nodeName !== 'BR') {
|
|
428
336
|
this.rangeElement = liElement.lastElementChild;
|
|
429
337
|
isLiElement = true;
|
|
430
338
|
}
|
|
@@ -434,13 +342,13 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
434
342
|
}
|
|
435
343
|
}
|
|
436
344
|
else if (this.rangeElement === this.parent.inputElement || this.rangeElement.tagName === 'TABLE' ||
|
|
437
|
-
(!
|
|
345
|
+
(!isNullOrUndefined(this.rangeElement.previousElementSibling) && this.rangeElement.previousElementSibling.tagName === 'TABLE')) {
|
|
438
346
|
return;
|
|
439
347
|
}
|
|
440
348
|
else {
|
|
441
349
|
this.oldRangeElement = this.rangeElement.previousElementSibling;
|
|
442
350
|
}
|
|
443
|
-
if (
|
|
351
|
+
if (isNullOrUndefined(this.oldRangeElement)) {
|
|
444
352
|
return;
|
|
445
353
|
}
|
|
446
354
|
else {
|
|
@@ -449,7 +357,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
449
357
|
? this.oldRangeElement.lastElementChild.lastElementChild :
|
|
450
358
|
this.oldRangeElement.lastElementChild;
|
|
451
359
|
}
|
|
452
|
-
var lastNode = this.oldRangeElement.lastChild
|
|
360
|
+
var lastNode = this.oldRangeElement.lastChild;
|
|
453
361
|
while (lastNode.nodeType !== 3 && lastNode.nodeName !== '#text' &&
|
|
454
362
|
lastNode.nodeName !== 'BR') {
|
|
455
363
|
lastNode = lastNode.lastChild;
|
|
@@ -457,17 +365,12 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
457
365
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),
|
|
458
366
|
// eslint-disable-next-line
|
|
459
367
|
lastNode, lastNode.textContent.length);
|
|
460
|
-
if (this.oldRangeElement.
|
|
368
|
+
if (this.oldRangeElement.querySelectorAll('BR').length === 1) {
|
|
461
369
|
detach(this.oldRangeElement.querySelector('BR'));
|
|
462
370
|
}
|
|
463
|
-
if (!
|
|
371
|
+
if (!isNullOrUndefined(this.rangeElement) && this.oldRangeElement !== this.rangeElement) {
|
|
464
372
|
while (this.rangeElement.firstChild) {
|
|
465
|
-
|
|
466
|
-
this.oldRangeElement.parentElement.appendChild(this.rangeElement.childNodes[0]);
|
|
467
|
-
}
|
|
468
|
-
else {
|
|
469
|
-
this.oldRangeElement.appendChild(this.rangeElement.childNodes[0]);
|
|
470
|
-
}
|
|
373
|
+
this.oldRangeElement.appendChild(this.rangeElement.childNodes[0]);
|
|
471
374
|
}
|
|
472
375
|
// eslint-disable-next-line
|
|
473
376
|
!isLiElement ? detach(this.rangeElement) : detach(this.rangeElement.parentElement);
|
|
@@ -481,7 +384,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
481
384
|
var liElement;
|
|
482
385
|
var rootElement;
|
|
483
386
|
if (e.args.code === 'Delete' && e.args.keyCode === 46 &&
|
|
484
|
-
this.parent.contentModule.getText().trim().replace(/(\r\n|\n|\r
|
|
387
|
+
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' &&
|
|
485
388
|
currentRange.startContainer.parentElement.tagName !== 'TH') {
|
|
486
389
|
this.deleteRangeElement = rootElement = this.getRootBlockNode(currentRange.startContainer);
|
|
487
390
|
if (this.deleteRangeElement.tagName === 'OL' || this.deleteRangeElement.tagName === 'UL') {
|
|
@@ -504,11 +407,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
504
407
|
(!isNullOrUndefined(this.deleteRangeElement.nextElementSibling) && this.deleteRangeElement.nextElementSibling.tagName === 'TABLE'))) {
|
|
505
408
|
return;
|
|
506
409
|
}
|
|
507
|
-
|
|
508
|
-
if (this.deleteRangeElement.querySelectorAll('img').length > 0 && this.deleteRangeElement.textContent.trim() === '') {
|
|
509
|
-
isImgWithEmptyBlockNode = true;
|
|
510
|
-
}
|
|
511
|
-
if (this.getCaretIndex(currentRange, this.deleteRangeElement) === this.deleteRangeElement.textContent.length && !isImgWithEmptyBlockNode) {
|
|
410
|
+
if (this.getCaretIndex(currentRange, this.deleteRangeElement) === this.deleteRangeElement.textContent.length) {
|
|
512
411
|
if (!isNullOrUndefined(liElement)) {
|
|
513
412
|
if (isLiElement || !isNullOrUndefined(liElement.nextElementSibling)) {
|
|
514
413
|
this.deleteOldRangeElement = this.getRangeElement(liElement.nextElementSibling);
|
|
@@ -655,7 +554,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
655
554
|
for (var j = 0; j < splitTextContent.length; j++) {
|
|
656
555
|
if (splitTextContent[j].match(httpRegex) || splitTextContent[j].match(wwwRegex)) {
|
|
657
556
|
resultSplitContent += '<a class="e-rte-anchor" href="' + splitTextContent[j] +
|
|
658
|
-
'" title="' + splitTextContent[j] + '"
|
|
557
|
+
'" title="' + splitTextContent[j] + '"target="_blank">' + splitTextContent[j] + ' </a>';
|
|
659
558
|
}
|
|
660
559
|
else {
|
|
661
560
|
resultSplitContent += splitTextContent[j] + ' ';
|
|
@@ -700,6 +599,19 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
700
599
|
}, e, value);
|
|
701
600
|
}
|
|
702
601
|
};
|
|
602
|
+
HtmlEditor.prototype.mouseOutHandler = function () {
|
|
603
|
+
if (!isNOU(this.tooltipTargetEle)) {
|
|
604
|
+
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
608
|
+
this.parent.contentModule.getDocument();
|
|
609
|
+
this.tooltipTargetEle = currentDocument.querySelector('[data-title]');
|
|
610
|
+
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
611
|
+
}
|
|
612
|
+
this.tooltipTargetEle.removeAttribute('data-title');
|
|
613
|
+
EventHandler.remove(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler);
|
|
614
|
+
};
|
|
703
615
|
HtmlEditor.prototype.onToolbarClick = function (args) {
|
|
704
616
|
var _this = this;
|
|
705
617
|
var save;
|
|
@@ -707,8 +619,15 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
707
619
|
var selectParentEle;
|
|
708
620
|
var item = args.item;
|
|
709
621
|
var closestElement = closest(args.originalEvent.target, '.e-rte-quick-popup');
|
|
710
|
-
var
|
|
711
|
-
|
|
622
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
623
|
+
this.parent.contentModule.getDocument();
|
|
624
|
+
this.tooltipTargetEle = closest(args.originalEvent.target, '[data-tooltip-id]');
|
|
625
|
+
if (!isNOU(this.tooltipTargetEle) && this.parent.showTooltip && !isNOU(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
626
|
+
this.parent.notify(events.destroyTooltip, { args: event });
|
|
627
|
+
this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
|
|
628
|
+
this.tooltipTargetEle.removeAttribute('title');
|
|
629
|
+
EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
|
|
630
|
+
}
|
|
712
631
|
if (item.command !== 'FormatPainter') {
|
|
713
632
|
if (closestElement && !closestElement.classList.contains('e-rte-inline-popup') && !closestElement.classList.contains('e-rte-text-popup')) {
|
|
714
633
|
if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
|
|
@@ -74,9 +74,7 @@ var MarkdownEditor = /** @class */ (function () {
|
|
|
74
74
|
MarkdownEditor.prototype.onToolbarClick = function (args) {
|
|
75
75
|
var item = args.item;
|
|
76
76
|
var textArea = this.parent.contentModule.getEditPanel();
|
|
77
|
-
|
|
78
|
-
textArea.focus();
|
|
79
|
-
}
|
|
77
|
+
textArea.focus();
|
|
80
78
|
var startOffset = textArea.selectionStart;
|
|
81
79
|
var endOffset = textArea.selectionEnd;
|
|
82
80
|
var text = textArea.value.substring(startOffset, endOffset);
|
|
@@ -55,7 +55,6 @@ export declare class PasteCleanup {
|
|
|
55
55
|
private updateCss;
|
|
56
56
|
private setCssClass;
|
|
57
57
|
private destroyDialog;
|
|
58
|
-
private docClick;
|
|
59
58
|
private cleanAppleClass;
|
|
60
59
|
private formatting;
|
|
61
60
|
private cropImageHandler;
|
|
@@ -76,8 +75,6 @@ export declare class PasteCleanup {
|
|
|
76
75
|
private deniedTags;
|
|
77
76
|
private deniedAttributes;
|
|
78
77
|
private allowedStyle;
|
|
79
|
-
private findLastElement;
|
|
80
|
-
private processPictureElement;
|
|
81
78
|
/**
|
|
82
79
|
* For internal use only - Get the module name.
|
|
83
80
|
*
|
|
@@ -2,7 +2,7 @@ import * as events from '../base/constant';
|
|
|
2
2
|
import { Popup } from '@syncfusion/ej2-popups';
|
|
3
3
|
import { RadioButton } from '@syncfusion/ej2-buttons';
|
|
4
4
|
import { isNullOrUndefined as isNOU, isNullOrUndefined, detach, extend, addClass, removeClass } from '@syncfusion/ej2-base';
|
|
5
|
-
import { getUniqueID, Browser
|
|
5
|
+
import { getUniqueID, Browser } from '@syncfusion/ej2-base';
|
|
6
6
|
import { CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT } from '../base/classes';
|
|
7
7
|
import { CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT } from '../base/classes';
|
|
8
8
|
import { CLS_RTE_IMAGE, CLS_IMGINLINE, CLS_IMGBREAK } from '../base/classes';
|
|
@@ -46,7 +46,6 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
46
46
|
this.parent.on(events.pasteClean, this.pasteClean, this);
|
|
47
47
|
this.parent.on(events.bindCssClass, this.setCssClass, this);
|
|
48
48
|
this.parent.on(events.destroy, this.destroy, this);
|
|
49
|
-
this.parent.on(events.docClick, this.docClick, this);
|
|
50
49
|
};
|
|
51
50
|
PasteCleanup.prototype.destroy = function () {
|
|
52
51
|
this.removeEventListener();
|
|
@@ -58,7 +57,6 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
58
57
|
this.parent.off(events.pasteClean, this.pasteClean);
|
|
59
58
|
this.parent.off(events.bindCssClass, this.setCssClass);
|
|
60
59
|
this.parent.off(events.destroy, this.destroy);
|
|
61
|
-
this.parent.off(events.docClick, this.docClick);
|
|
62
60
|
};
|
|
63
61
|
PasteCleanup.prototype.pasteClean = function (e) {
|
|
64
62
|
var _this = this;
|
|
@@ -115,8 +113,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
115
113
|
args: e.args,
|
|
116
114
|
text: e.text,
|
|
117
115
|
allowedStylePropertiesArray: this.parent.pasteCleanupSettings.allowedStyleProps,
|
|
118
|
-
callBack: function (a, cropImageData
|
|
119
|
-
args.pasteTableSource = pasteTableSource;
|
|
116
|
+
callBack: function (a, cropImageData) {
|
|
120
117
|
value = a.trim();
|
|
121
118
|
_this.cropImageData = cropImageData;
|
|
122
119
|
}
|
|
@@ -128,19 +125,10 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
128
125
|
this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
|
|
129
126
|
var tempDivElem = this.parent.createElement('div');
|
|
130
127
|
tempDivElem.innerHTML = value;
|
|
131
|
-
var unsupportedImg = tempDivElem.querySelectorAll('.e-rte-image-unsupported');
|
|
132
|
-
for (var index = 0; index < unsupportedImg.length; index++) {
|
|
133
|
-
unsupportedImg[index].setAttribute('alt', this.i10n.getConstant('unsupportedImage'));
|
|
134
|
-
unsupportedImg[index].classList.remove('e-rte-image-unsupported');
|
|
135
|
-
}
|
|
136
|
-
value = tempDivElem.innerHTML;
|
|
137
128
|
var isValueNotEmpty = tempDivElem.textContent !== '' || !isNOU(tempDivElem.querySelector('img')) ||
|
|
138
129
|
!isNOU(tempDivElem.querySelector('table'));
|
|
139
|
-
this.parent.
|
|
140
|
-
value
|
|
141
|
-
callBack: function (currentValue) {
|
|
142
|
-
value = currentValue;
|
|
143
|
-
}
|
|
130
|
+
this.parent.trigger(events.cleanupResizeElements, { value: value }, function (args) {
|
|
131
|
+
value = args.value;
|
|
144
132
|
});
|
|
145
133
|
if (this.parent.pasteCleanupSettings.prompt) {
|
|
146
134
|
if (isValueNotEmpty) {
|
|
@@ -404,7 +392,9 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
404
392
|
popupObj.close();
|
|
405
393
|
}
|
|
406
394
|
this.parent.trigger(events.imageUploadFailed, e);
|
|
407
|
-
uploadObj.
|
|
395
|
+
if (uploadObj && document.body.contains(uploadObj.element)) {
|
|
396
|
+
uploadObj.destroy();
|
|
397
|
+
}
|
|
408
398
|
};
|
|
409
399
|
PasteCleanup.prototype.popupClose = function (popupObj, uploadObj, imgElem, e) {
|
|
410
400
|
var _this = this;
|
|
@@ -419,7 +409,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
419
409
|
});
|
|
420
410
|
popupObj.close();
|
|
421
411
|
imgElem.style.opacity = '1';
|
|
422
|
-
if (
|
|
412
|
+
if (uploadObj && document.body.contains(uploadObj.element)) {
|
|
423
413
|
uploadObj.destroy();
|
|
424
414
|
}
|
|
425
415
|
this.toolbarEnableDisable(false);
|
|
@@ -572,7 +562,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
572
562
|
width: '300px',
|
|
573
563
|
height: '265px',
|
|
574
564
|
cssClass: CLS_RTE_DIALOG_MIN_HEIGHT,
|
|
575
|
-
isModal:
|
|
565
|
+
isModal: true,
|
|
576
566
|
visible: false
|
|
577
567
|
};
|
|
578
568
|
this.dialogObj = this.dialogRenderObj.render(dialogModel);
|
|
@@ -626,22 +616,13 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
626
616
|
this.updateCss(this.keepRadioButton, e);
|
|
627
617
|
};
|
|
628
618
|
PasteCleanup.prototype.destroyDialog = function (rteDialogWrapper) {
|
|
629
|
-
var rteDialogContainer = this.parent.element.querySelector('.e-
|
|
619
|
+
var rteDialogContainer = this.parent.element.querySelector('.e-dlg-container');
|
|
630
620
|
detach(rteDialogContainer);
|
|
631
621
|
var rteDialogWrapperChildLength = rteDialogWrapper.children.length;
|
|
632
622
|
for (var i = 0; i < rteDialogWrapperChildLength; i++) {
|
|
633
623
|
detach(rteDialogWrapper.children[0]);
|
|
634
624
|
}
|
|
635
625
|
};
|
|
636
|
-
PasteCleanup.prototype.docClick = function (e) {
|
|
637
|
-
var target = e.args.target;
|
|
638
|
-
if (target && target.classList && ((this.dialogObj && !closest(target, '[id=' + "'" + this.dialogObj.element.id + "'" + ']')))
|
|
639
|
-
&& (!target.classList.contains('e-toolbar-item'))) {
|
|
640
|
-
if (this.dialogObj) {
|
|
641
|
-
this.dialogObj.hide();
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
};
|
|
645
626
|
PasteCleanup.prototype.cleanAppleClass = function (elem) {
|
|
646
627
|
var appleClassElem = elem.querySelectorAll('br.Apple-interchange-newline');
|
|
647
628
|
for (var i = 0; i < appleClassElem.length; i++) {
|
|
@@ -679,9 +660,6 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
679
660
|
this.setImageProperties(allImg[i]);
|
|
680
661
|
}
|
|
681
662
|
this.addTempClass(clipBoardElem);
|
|
682
|
-
if (clipBoardElem.querySelectorAll('picture').length > 0) {
|
|
683
|
-
this.processPictureElement(clipBoardElem);
|
|
684
|
-
}
|
|
685
663
|
if (clipBoardElem.textContent !== '' || !isNOU(clipBoardElem.querySelector('img')) ||
|
|
686
664
|
!isNOU(clipBoardElem.querySelector('table'))) {
|
|
687
665
|
var tempWrapperElem = this.parent.createElement('div');
|
|
@@ -713,26 +691,11 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
713
691
|
}
|
|
714
692
|
}
|
|
715
693
|
this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
|
|
716
|
-
clipBoardElem.innerHTML =
|
|
717
|
-
clipBoardElem = this.addTableClass(clipBoardElem
|
|
694
|
+
clipBoardElem.innerHTML = value;
|
|
695
|
+
clipBoardElem = this.addTableClass(clipBoardElem);
|
|
718
696
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
719
697
|
extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
720
698
|
_this.parent.formatter.onSuccess(_this.parent, args);
|
|
721
|
-
if (!isNOU(returnArgs.elements) && !isNOU(returnArgs.imgElem) &&
|
|
722
|
-
returnArgs.imgElem.length > 0) {
|
|
723
|
-
var pasteContent = returnArgs.elements;
|
|
724
|
-
var imageContent = returnArgs.imgElem;
|
|
725
|
-
var lastElementChild = _this.findLastElement(pasteContent[pasteContent.length - 1]);
|
|
726
|
-
var isImageAtLast = !isNOU(lastElementChild) ? lastElementChild.nodeName === 'IMG' : false;
|
|
727
|
-
if (isImageAtLast || pasteContent[pasteContent.length - 1] === imageContent[imageContent.length - 1]) {
|
|
728
|
-
_this.parent.notify(events.insertCompleted, {
|
|
729
|
-
args: args.event,
|
|
730
|
-
type: 'Images',
|
|
731
|
-
isNotify: true,
|
|
732
|
-
elements: imageContent[imageContent.length - 1]
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
699
|
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
737
700
|
this.removeTempClass();
|
|
738
701
|
this.parent.notify(events.toolbarRefresh, {});
|
|
@@ -787,16 +750,12 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
787
750
|
}
|
|
788
751
|
}
|
|
789
752
|
};
|
|
790
|
-
PasteCleanup.prototype.addTableClass = function (element
|
|
791
|
-
source = isNOU(source) ? '' : source;
|
|
753
|
+
PasteCleanup.prototype.addTableClass = function (element) {
|
|
792
754
|
var tableElement = element.querySelectorAll('table');
|
|
793
755
|
for (var i = 0; i < tableElement.length; i++) {
|
|
794
|
-
if (!tableElement[i].classList.contains('e-rte-table')
|
|
756
|
+
if (!tableElement[i].classList.contains('e-rte-table')) {
|
|
795
757
|
tableElement[i].classList.add('e-rte-table');
|
|
796
758
|
}
|
|
797
|
-
else if (source && source !== 'html') {
|
|
798
|
-
tableElement[i].classList.add('e-rte-paste-' + source + '-table');
|
|
799
|
-
}
|
|
800
759
|
}
|
|
801
760
|
return element;
|
|
802
761
|
};
|
|
@@ -1131,36 +1090,6 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
1131
1090
|
}
|
|
1132
1091
|
return clipBoardElem;
|
|
1133
1092
|
};
|
|
1134
|
-
PasteCleanup.prototype.findLastElement = function (element) {
|
|
1135
|
-
if (!isNOU(element) && !isNOU(element.lastElementChild)) {
|
|
1136
|
-
var lastChild = element.lastElementChild;
|
|
1137
|
-
while (lastChild && lastChild.lastElementChild) {
|
|
1138
|
-
lastChild = lastChild.lastElementChild;
|
|
1139
|
-
}
|
|
1140
|
-
return lastChild;
|
|
1141
|
-
}
|
|
1142
|
-
return null;
|
|
1143
|
-
};
|
|
1144
|
-
PasteCleanup.prototype.processPictureElement = function (clipBoardElem) {
|
|
1145
|
-
var pictureElems = clipBoardElem.querySelectorAll('picture');
|
|
1146
|
-
for (var i = 0; i < pictureElems.length; i++) {
|
|
1147
|
-
var imgElem = pictureElems[i].querySelector('img');
|
|
1148
|
-
var sourceElems = pictureElems[i].querySelectorAll('source');
|
|
1149
|
-
if (imgElem && imgElem.getAttribute('src')) {
|
|
1150
|
-
var srcValue = imgElem.getAttribute('src');
|
|
1151
|
-
var url = new URL(srcValue);
|
|
1152
|
-
for (var j = 0; j < sourceElems.length; j++) {
|
|
1153
|
-
var srcset = sourceElems[j].getAttribute('srcset');
|
|
1154
|
-
if (srcset) {
|
|
1155
|
-
if (srcset.indexOf('http') === -1) {
|
|
1156
|
-
var fullPath = url.origin + srcset;
|
|
1157
|
-
sourceElems[j].setAttribute('srcset', fullPath);
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
};
|
|
1164
1093
|
/**
|
|
1165
1094
|
* For internal use only - Get the module name.
|
|
1166
1095
|
*
|
|
@@ -72,7 +72,6 @@ export declare class QuickToolbar {
|
|
|
72
72
|
hideQuickToolbars(): void;
|
|
73
73
|
private deBounce;
|
|
74
74
|
private mouseUpHandler;
|
|
75
|
-
private isEmbedVidElem;
|
|
76
75
|
private keyDownHandler;
|
|
77
76
|
private inlineQTBarMouseDownHandler;
|
|
78
77
|
private keyUpHandler;
|
|
@@ -138,11 +137,4 @@ export declare class QuickToolbar {
|
|
|
138
137
|
* @hidden
|
|
139
138
|
*/
|
|
140
139
|
private getModuleName;
|
|
141
|
-
/**
|
|
142
|
-
*
|
|
143
|
-
* @returns {BaseQuickToolbar[]} - specifies the quick toolbar instance.
|
|
144
|
-
* @hidden
|
|
145
|
-
* @private
|
|
146
|
-
*/
|
|
147
|
-
getQuickToolbarInstance(): BaseQuickToolbar[];
|
|
148
140
|
}
|