@syncfusion/ej2-richtexteditor 20.4.42 → 20.4.44
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 +26 -0
- package/dist/ej2-richtexteditor.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +142 -68
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +142 -68
- 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 +10 -10
- package/src/editor-manager/plugin/inserthtml.js +48 -38
- package/src/editor-manager/plugin/lists.js +6 -1
- package/src/editor-manager/plugin/selection-commands.js +57 -17
- package/src/rich-text-editor/actions/html-editor.js +4 -2
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +2 -2
- package/src/rich-text-editor/base/rich-text-editor.d.ts +2 -2
- package/src/rich-text-editor/base/rich-text-editor.js +4 -4
- package/src/rich-text-editor/renderer/audio-module.js +4 -1
- package/src/rich-text-editor/renderer/image-module.js +8 -1
- package/src/rich-text-editor/renderer/table-module.js +7 -3
- package/src/rich-text-editor/renderer/video-module.js +4 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.4.
|
|
3
|
+
* version : 20.4.44
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-richtexteditor@20.4.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@20.4.43",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-vqEugl7iKxPWzOs/ki6IYoaHQWRBJz/+yS49WfW/8B+1bhVUMFEGvOflIdU0PawDsVauNFIVvUeLkLE6CpNQCQ==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
27
27
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
28
28
|
],
|
|
29
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.4.
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.4.43.tgz",
|
|
30
|
+
"_shasum": "8b15e4adefba29920017e631b7d96b4ff30d5994",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
},
|
|
39
39
|
"bundleDependencies": false,
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@syncfusion/ej2-base": "~20.4.
|
|
42
|
-
"@syncfusion/ej2-buttons": "~20.4.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~20.4.
|
|
41
|
+
"@syncfusion/ej2-base": "~20.4.44",
|
|
42
|
+
"@syncfusion/ej2-buttons": "~20.4.44",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~20.4.43",
|
|
44
44
|
"@syncfusion/ej2-inputs": "~20.4.42",
|
|
45
|
-
"@syncfusion/ej2-navigations": "~20.4.
|
|
46
|
-
"@syncfusion/ej2-popups": "~20.4.
|
|
45
|
+
"@syncfusion/ej2-navigations": "~20.4.44",
|
|
46
|
+
"@syncfusion/ej2-popups": "~20.4.44",
|
|
47
47
|
"@syncfusion/ej2-splitbuttons": "~20.4.42"
|
|
48
48
|
},
|
|
49
49
|
"deprecated": false,
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
71
71
|
},
|
|
72
72
|
"typings": "index.d.ts",
|
|
73
|
-
"version": "20.4.
|
|
73
|
+
"version": "20.4.44",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -247,52 +247,62 @@ var InsertHtml = /** @class */ (function () {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
250
|
+
var parentElem = range.startContainer;
|
|
251
|
+
while (!isNOU(parentElem) && parentElem.nodeName !== 'PRE' && parentElem !== editNode) {
|
|
252
|
+
parentElem = parentElem.parentElement;
|
|
253
|
+
}
|
|
254
|
+
if (!isNOU(node) && !isNOU(parentElem) && parentElem.nodeName === 'PRE') {
|
|
255
|
+
range.insertNode(node);
|
|
256
|
+
lastSelectionNode = node.lastChild;
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
this.insertTempNode(range, node, nodes, nodeCutter, editNode);
|
|
260
|
+
var isFirstTextNode = true;
|
|
261
|
+
var isPreviousInlineElem = void 0;
|
|
262
|
+
var paraElm = void 0;
|
|
263
|
+
var previousParent = void 0;
|
|
264
|
+
if (!this.contentsDeleted) {
|
|
265
|
+
range.deleteContents();
|
|
262
266
|
}
|
|
263
|
-
|
|
264
|
-
(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
var firstParaElm = createElement('p');
|
|
268
|
-
node.parentElement.insertBefore(firstParaElm, node);
|
|
267
|
+
while (node.firstChild) {
|
|
268
|
+
if (node.firstChild.nodeName === '#text' && node.firstChild.textContent.trim() === '') {
|
|
269
|
+
detach(node.firstChild);
|
|
270
|
+
continue;
|
|
269
271
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
if (!isPreviousInlineElem) {
|
|
277
|
-
paraElm = createElement('p');
|
|
278
|
-
paraElm.appendChild(node.firstChild);
|
|
279
|
-
fragment.appendChild(paraElm);
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
previousParent.appendChild(node.firstChild);
|
|
283
|
-
fragment.appendChild(previousParent);
|
|
272
|
+
if (node.firstChild.nodeName === '#text' && isFirstTextNode ||
|
|
273
|
+
(this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0 && isFirstTextNode)) {
|
|
274
|
+
lastSelectionNode = node.firstChild;
|
|
275
|
+
if (isNOU(node.previousElementSibling)) {
|
|
276
|
+
var firstParaElm = createElement('p');
|
|
277
|
+
node.parentElement.insertBefore(firstParaElm, node);
|
|
284
278
|
}
|
|
285
|
-
|
|
286
|
-
isPreviousInlineElem = true;
|
|
279
|
+
node.previousElementSibling.appendChild(node.firstChild);
|
|
287
280
|
}
|
|
288
281
|
else {
|
|
289
|
-
|
|
290
|
-
|
|
282
|
+
lastSelectionNode = node.firstChild;
|
|
283
|
+
if (node.firstChild.nodeName === '#text' ||
|
|
284
|
+
(this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
|
|
285
|
+
if (!isPreviousInlineElem) {
|
|
286
|
+
paraElm = createElement('p');
|
|
287
|
+
paraElm.appendChild(node.firstChild);
|
|
288
|
+
fragment.appendChild(paraElm);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
previousParent.appendChild(node.firstChild);
|
|
292
|
+
fragment.appendChild(previousParent);
|
|
293
|
+
}
|
|
294
|
+
previousParent = paraElm;
|
|
295
|
+
isPreviousInlineElem = true;
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
fragment.appendChild(node.firstChild);
|
|
299
|
+
isPreviousInlineElem = false;
|
|
300
|
+
}
|
|
301
|
+
isFirstTextNode = false;
|
|
291
302
|
}
|
|
292
|
-
isFirstTextNode = false;
|
|
293
303
|
}
|
|
304
|
+
node.parentNode.replaceChild(fragment, node);
|
|
294
305
|
}
|
|
295
|
-
node.parentNode.replaceChild(fragment, node);
|
|
296
306
|
}
|
|
297
307
|
if (lastSelectionNode.nodeName === '#text') {
|
|
298
308
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
@@ -91,7 +91,7 @@ var Lists = /** @class */ (function () {
|
|
|
91
91
|
range.startContainer.parentElement.closest('LI');
|
|
92
92
|
var endNode = range.endContainer.nodeName === 'LI' ? range.endContainer :
|
|
93
93
|
range.endContainer.parentElement.closest('LI');
|
|
94
|
-
// Checks for Image, Audio , Video Element inside List Element
|
|
94
|
+
// Checks for Image, Audio , Video Element inside List Element
|
|
95
95
|
var hasMediaElem = false;
|
|
96
96
|
if (!isNOU(startNode)) {
|
|
97
97
|
var videoElemList = startNode.querySelectorAll('.e-video-clickelem');
|
|
@@ -721,6 +721,11 @@ var Lists = /** @class */ (function () {
|
|
|
721
721
|
}
|
|
722
722
|
node.parentNode.removeChild(node);
|
|
723
723
|
}
|
|
724
|
+
else if (!isNOU(node.getAttribute('level'))) {
|
|
725
|
+
if (node.tagName === node.previousElementSibling.tagName) {
|
|
726
|
+
node.previousElementSibling.lastChild.append(node);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
724
729
|
}
|
|
725
730
|
};
|
|
726
731
|
Lists.prototype.findUnSelected = function (temp, elements) {
|
|
@@ -95,14 +95,17 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
95
95
|
isSubSup = formatNode === null ? false : true;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
+
else if ((format === 'fontsize' || format === 'fontname' || format === 'fontcolor') && range.startContainer.parentElement === endNode) {
|
|
99
|
+
formatNode = null;
|
|
100
|
+
}
|
|
98
101
|
if (index === 0 && formatNode === null) {
|
|
99
102
|
isFormat = true;
|
|
100
103
|
}
|
|
101
104
|
if (formatNode !== null && (!isFormat || isFontStyle)) {
|
|
102
105
|
nodes[index] = this.removeFormat(nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode);
|
|
103
106
|
}
|
|
104
|
-
else {
|
|
105
|
-
nodes[index] = this.insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value);
|
|
107
|
+
else if (range.startContainer.parentElement !== endNode || (range.commonAncestorContainer === endNode || nodes.length === 1)) {
|
|
108
|
+
nodes[index] = this.insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domNode, endNode);
|
|
106
109
|
}
|
|
107
110
|
domSelection = this.applySelection(nodes, domSelection, nodeCutter, index, isCollapsed);
|
|
108
111
|
}
|
|
@@ -357,10 +360,24 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
357
360
|
}
|
|
358
361
|
return nodes[index];
|
|
359
362
|
};
|
|
360
|
-
SelectionCommands.insertFormat = function (docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value) {
|
|
363
|
+
SelectionCommands.insertFormat = function (docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domNode, endNode) {
|
|
364
|
+
var rootBlockNode;
|
|
361
365
|
if (!isCursor) {
|
|
362
366
|
if ((formatNode === null && isFormat) || isFontStyle) {
|
|
363
367
|
if (nodes[index].nodeName !== 'BR') {
|
|
368
|
+
if (format === 'fontsize' || format === 'fontname' || format === 'fontcolor') {
|
|
369
|
+
var rangeNode = nodes[index];
|
|
370
|
+
while (rangeNode && !domNode.isBlockNode(rangeNode) && rangeNode !== endNode) {
|
|
371
|
+
if (domNode.isBlockNode(rangeNode.parentElement)) {
|
|
372
|
+
rootBlockNode = rangeNode;
|
|
373
|
+
}
|
|
374
|
+
rangeNode = rangeNode.parentElement;
|
|
375
|
+
}
|
|
376
|
+
if (rootBlockNode && rootBlockNode.nodeType !== 3) {
|
|
377
|
+
nodeCutter.SplitNode(range, rootBlockNode, true).cloneNode(true);
|
|
378
|
+
nodeCutter.SplitNode(range, rootBlockNode, false).cloneNode(false);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
364
381
|
nodes[index] = nodeCutter.GetSpliceNode(range, nodes[index]);
|
|
365
382
|
nodes[index].textContent = nodeCutter.TrimLineBreak(nodes[index].textContent);
|
|
366
383
|
}
|
|
@@ -370,24 +387,47 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
370
387
|
}
|
|
371
388
|
else if (!(isFontStyle === true && value === '')) {
|
|
372
389
|
var element = this.GetFormatNode(format, value);
|
|
373
|
-
if (format === 'fontsize' || format === 'fontcolor') {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
parentElement
|
|
378
|
-
|
|
390
|
+
if (format === 'fontsize' || format === 'fontcolor' || format === 'fontname') {
|
|
391
|
+
if (format !== 'fontname') {
|
|
392
|
+
var liElement = nodes[index].parentElement;
|
|
393
|
+
var parentElement = nodes[index].parentElement;
|
|
394
|
+
while (!isNOU(parentElement) && parentElement.tagName.toLowerCase() !== 'li') {
|
|
395
|
+
parentElement = parentElement.parentElement;
|
|
396
|
+
liElement = parentElement;
|
|
397
|
+
}
|
|
398
|
+
if (!isNOU(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
399
|
+
liElement.textContent.trim() === nodes[index].textContent.trim()) {
|
|
400
|
+
if (format === 'fontsize') {
|
|
401
|
+
liElement.style.fontSize = value;
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
liElement.style.color = value;
|
|
405
|
+
liElement.style.textDecoration = 'inherit';
|
|
406
|
+
}
|
|
407
|
+
}
|
|
379
408
|
}
|
|
380
|
-
if (
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
409
|
+
if (rootBlockNode && rootBlockNode.nodeType !== 3) {
|
|
410
|
+
var save = new NodeSelection();
|
|
411
|
+
save.save(range, docElement);
|
|
412
|
+
domNode.setMarker(save);
|
|
413
|
+
var cloneNode = rootBlockNode.cloneNode(true);
|
|
414
|
+
element.appendChild(cloneNode);
|
|
415
|
+
domNode.replaceWith(rootBlockNode, element.outerHTML);
|
|
416
|
+
var currentStartNode = endNode.querySelector('.e-editor-select-start');
|
|
417
|
+
var currrentEndNode = endNode.querySelector('.e-editor-select-end');
|
|
418
|
+
if (index === 0) {
|
|
419
|
+
nodes[index] = currentStartNode ? currentStartNode.lastChild : nodes[index];
|
|
384
420
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
421
|
+
if (range.startContainer.parentElement === endNode) {
|
|
422
|
+
if (nodes.length > 1) {
|
|
423
|
+
nodes[nodes.length - 1] = currrentEndNode ? currrentEndNode.lastChild : nodes[index];
|
|
424
|
+
}
|
|
388
425
|
}
|
|
426
|
+
domNode.saveMarker(save, null);
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
nodes[index] = this.applyStyles(nodes, index, element);
|
|
389
430
|
}
|
|
390
|
-
nodes[index] = this.applyStyles(nodes, index, element);
|
|
391
431
|
if (format === 'fontsize') {
|
|
392
432
|
var bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
|
|
393
433
|
if (!isNOU(bg)) {
|
|
@@ -109,10 +109,12 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
109
109
|
// eslint-disable-next-line
|
|
110
110
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
111
111
|
var pointer;
|
|
112
|
+
var isRootParent = false;
|
|
112
113
|
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
|
|
113
114
|
pointer = range.startOffset;
|
|
114
115
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
115
|
-
range.startContainer.nodeName === '#text' ? range.startContainer.parentElement.
|
|
116
|
+
range.startContainer.nodeName === '#text' ? range.startContainer.parentElement !== this.parent.inputElement ? range.startContainer.parentElement.classList.add('currentStartMark')
|
|
117
|
+
: isRootParent = true : range.startContainer.classList.add('currentStartMark');
|
|
116
118
|
if (range.startContainer.textContent.charCodeAt(0) === 8203) {
|
|
117
119
|
pointer = range.startOffset === 0 ? range.startOffset : range.startOffset - 1;
|
|
118
120
|
range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
|
|
@@ -121,7 +123,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
121
123
|
var previousLength = this.parent.inputElement.innerHTML.length;
|
|
122
124
|
var currentLength = this.parent.inputElement.innerHTML.replace(regEx, '').length;
|
|
123
125
|
var focusNode = range.startContainer;
|
|
124
|
-
if (previousLength > currentLength) {
|
|
126
|
+
if (previousLength > currentLength && !isRootParent) {
|
|
125
127
|
var currentChild = this.parent.inputElement.firstChild;
|
|
126
128
|
while (!isNOU(currentChild) && currentChild.textContent.replace(regEx, '').trim().length > 0) {
|
|
127
129
|
currentChild.innerHTML = currentChild.innerHTML.replace(regEx, '');
|
|
@@ -97,8 +97,8 @@ export interface RichTextEditorModel extends ComponentModel{
|
|
|
97
97
|
* * enable - Set Boolean value to enable, the editors content is placed in an iframe and isolated from the rest of the page.
|
|
98
98
|
* * attributes - Custom style to be used inside the iframe to display content. This style is added to the iframe body.
|
|
99
99
|
* * resources - we can add both styles and scripts to the iframe.
|
|
100
|
-
* 1. styles[] - An array of CSS style files to inject inside the iframe to display content
|
|
101
|
-
* 2. scripts[] - An array of JS script files to inject inside the iframe
|
|
100
|
+
* 1. styles[] - An array of CSS style files to inject inside the iframe to display content.
|
|
101
|
+
* 2. scripts[] - An array of JS script files to inject inside the iframe.
|
|
102
102
|
*
|
|
103
103
|
* {% codeBlock src='rich-text-editor/iframe-settings/index.md' %}{% endcodeBlock %}
|
|
104
104
|
*
|
|
@@ -267,8 +267,8 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
267
267
|
* * enable - Set Boolean value to enable, the editors content is placed in an iframe and isolated from the rest of the page.
|
|
268
268
|
* * attributes - Custom style to be used inside the iframe to display content. This style is added to the iframe body.
|
|
269
269
|
* * resources - we can add both styles and scripts to the iframe.
|
|
270
|
-
* 1. styles[] - An array of CSS style files to inject inside the iframe to display content
|
|
271
|
-
* 2. scripts[] - An array of JS script files to inject inside the iframe
|
|
270
|
+
* 1. styles[] - An array of CSS style files to inject inside the iframe to display content.
|
|
271
|
+
* 2. scripts[] - An array of JS script files to inject inside the iframe.
|
|
272
272
|
*
|
|
273
273
|
* {% codeBlock src='rich-text-editor/iframe-settings/index.md' %}{% endcodeBlock %}
|
|
274
274
|
*
|
|
@@ -992,6 +992,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
992
992
|
if (this.isDestroyed || !this.isRendered) {
|
|
993
993
|
return;
|
|
994
994
|
}
|
|
995
|
+
if (!isNOU(this.timeInterval)) {
|
|
996
|
+
clearInterval(this.timeInterval);
|
|
997
|
+
this.timeInterval = null;
|
|
998
|
+
}
|
|
995
999
|
if (this.element.offsetParent === null) {
|
|
996
1000
|
if (!isNOU(this.toolbarModule)) {
|
|
997
1001
|
this.toolbarModule.destroy();
|
|
@@ -1001,10 +1005,6 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1001
1005
|
}
|
|
1002
1006
|
this.notify(events.destroy, {});
|
|
1003
1007
|
this.destroyDependentModules();
|
|
1004
|
-
if (!isNOU(this.timeInterval)) {
|
|
1005
|
-
clearInterval(this.timeInterval);
|
|
1006
|
-
this.timeInterval = null;
|
|
1007
|
-
}
|
|
1008
1008
|
this.unWireEvents();
|
|
1009
1009
|
if (this.originalElement.tagName === 'TEXTAREA') {
|
|
1010
1010
|
this.element.parentElement.insertBefore(this.valueContainer, this.element);
|
|
@@ -166,7 +166,6 @@ var Audio = /** @class */ (function () {
|
|
|
166
166
|
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) &&
|
|
167
167
|
originalEvent.code !== 'KeyK') {
|
|
168
168
|
range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
169
|
-
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
170
169
|
selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
171
170
|
selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
172
171
|
if (!originalEvent.ctrlKey && originalEvent.key && (originalEvent.key.length === 1 || originalEvent.action === 'enter') &&
|
|
@@ -182,6 +181,8 @@ var Audio = /** @class */ (function () {
|
|
|
182
181
|
}
|
|
183
182
|
if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
|
|
184
183
|
if (selectNodeEle && this.isAudioElem(selectNodeEle[0]) && selectNodeEle.length < 1) {
|
|
184
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
185
|
+
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
185
186
|
originalEvent.preventDefault();
|
|
186
187
|
var event_1 = {
|
|
187
188
|
selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
|
|
@@ -230,6 +231,8 @@ var Audio = /** @class */ (function () {
|
|
|
230
231
|
}
|
|
231
232
|
break;
|
|
232
233
|
case 'insert-audio':
|
|
234
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
235
|
+
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
233
236
|
this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
|
|
234
237
|
originalEvent.preventDefault();
|
|
235
238
|
break;
|
|
@@ -456,6 +456,10 @@ var Image = /** @class */ (function () {
|
|
|
456
456
|
});
|
|
457
457
|
};
|
|
458
458
|
Image.prototype.resizing = function (e) {
|
|
459
|
+
if (!this.parent) {
|
|
460
|
+
this.cancelResizeAction();
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
459
463
|
if (this.imgEle.offsetWidth >= this.parent.getInsertImgMaxWidth()) {
|
|
460
464
|
this.imgEle.style.maxHeight = this.imgEle.offsetHeight + 'px';
|
|
461
465
|
}
|
|
@@ -619,7 +623,6 @@ var Image = /** @class */ (function () {
|
|
|
619
623
|
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) &&
|
|
620
624
|
originalEvent.code !== 'KeyK') {
|
|
621
625
|
range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
622
|
-
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
623
626
|
selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
624
627
|
selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
625
628
|
if (!originalEvent.ctrlKey && originalEvent.key && (originalEvent.key.length === 1 || originalEvent.action === 'enter') &&
|
|
@@ -638,6 +641,8 @@ var Image = /** @class */ (function () {
|
|
|
638
641
|
}
|
|
639
642
|
if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
|
|
640
643
|
if (selectNodeEle && selectNodeEle[0].nodeName === 'IMG' && selectNodeEle.length < 1) {
|
|
644
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
645
|
+
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
641
646
|
originalEvent.preventDefault();
|
|
642
647
|
var event_1 = {
|
|
643
648
|
selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
|
|
@@ -696,6 +701,8 @@ var Image = /** @class */ (function () {
|
|
|
696
701
|
}
|
|
697
702
|
break;
|
|
698
703
|
case 'insert-image':
|
|
704
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
705
|
+
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
699
706
|
this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
|
|
700
707
|
originalEvent.preventDefault();
|
|
701
708
|
break;
|
|
@@ -177,14 +177,15 @@ var Table = /** @class */ (function () {
|
|
|
177
177
|
}
|
|
178
178
|
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule
|
|
179
179
|
&& event.code !== 'KeyK') {
|
|
180
|
+
var selection = void 0;
|
|
180
181
|
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
181
|
-
var selection = this.parent.formatter.editorManager.
|
|
182
|
-
nodeSelection.save(range, this.contentModule.getDocument());
|
|
183
182
|
var ele = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range)[0];
|
|
184
183
|
ele = (ele && ele.tagName !== 'TD' && ele.tagName !== 'TH') ? ele.parentElement : ele;
|
|
185
184
|
if ((event.keyCode === 8 || event.keyCode === 46) ||
|
|
186
185
|
(event.ctrlKey && event.keyCode === 88)) {
|
|
187
186
|
if (ele && ele.tagName === 'TBODY') {
|
|
187
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule)
|
|
188
|
+
selection = this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
|
|
188
189
|
event.preventDefault();
|
|
189
190
|
proxy.removeTable(selection, event, true);
|
|
190
191
|
}
|
|
@@ -198,6 +199,8 @@ var Table = /** @class */ (function () {
|
|
|
198
199
|
ele = !isNullOrUndefined(closestTd) && this.parent.inputElement.contains(closestTd) ? closestTd : ele;
|
|
199
200
|
}
|
|
200
201
|
if (ele && (ele.tagName === 'TD' || ele.tagName === 'TH')) {
|
|
202
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule)
|
|
203
|
+
selection = this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
|
|
201
204
|
switch (event.keyCode) {
|
|
202
205
|
case 9:
|
|
203
206
|
case 37:
|
|
@@ -465,9 +468,10 @@ var Table = /** @class */ (function () {
|
|
|
465
468
|
var range_1 = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
466
469
|
this.parent.formatter.editorManager.nodeSelection.save(range_1, this.contentModule.getDocument());
|
|
467
470
|
this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
|
|
471
|
+
var pageX = (this.parent.iframeSettings.enable) ? window.pageXOffset + this.parent.element.getBoundingClientRect().left + args.clientX : args.pageX;
|
|
468
472
|
var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
|
|
469
473
|
this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
|
|
470
|
-
this.quickToolObj.tableQTBar.showPopup(
|
|
474
|
+
this.quickToolObj.tableQTBar.showPopup(pageX, pageY, target);
|
|
471
475
|
this.parent.formatter.editorManager.nodeSelection.restore();
|
|
472
476
|
}
|
|
473
477
|
else {
|
|
@@ -605,7 +605,6 @@ var Video = /** @class */ (function () {
|
|
|
605
605
|
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) &&
|
|
606
606
|
originalEvent.code !== 'KeyK') {
|
|
607
607
|
range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
608
|
-
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
609
608
|
selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
610
609
|
selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
611
610
|
if (!originalEvent.ctrlKey && originalEvent.key && (originalEvent.key.length === 1 || originalEvent.action === 'enter') &&
|
|
@@ -625,6 +624,8 @@ var Video = /** @class */ (function () {
|
|
|
625
624
|
}
|
|
626
625
|
if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
|
|
627
626
|
if (selectNodeEle && (selectNodeEle[0].nodeName === 'VIDEO' || this.isEmbedVidElem(selectNodeEle[0])) && selectNodeEle.length < 1) {
|
|
627
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
628
|
+
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
628
629
|
originalEvent.preventDefault();
|
|
629
630
|
var event_1 = {
|
|
630
631
|
selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
|
|
@@ -677,6 +678,8 @@ var Video = /** @class */ (function () {
|
|
|
677
678
|
}
|
|
678
679
|
break;
|
|
679
680
|
case 'insert-video':
|
|
681
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
682
|
+
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
680
683
|
this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
|
|
681
684
|
originalEvent.preventDefault();
|
|
682
685
|
break;
|