@syncfusion/ej2-richtexteditor 23.2.7-52849 → 24.1.41-569421
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/.eslintrc.json +260 -0
- package/CHANGELOG.md +203 -1
- 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 +9873 -7941
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +9967 -8034
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/package.json +13 -13
- package/src/common/config.d.ts +7 -0
- package/src/common/config.js +12 -1
- package/src/common/constant.d.ts +6 -0
- package/src/common/constant.js +6 -0
- package/src/common/interface.d.ts +12 -0
- package/src/common/types.d.ts +6 -0
- package/src/common/util.d.ts +6 -0
- package/src/common/util.js +61 -20
- package/src/editor-manager/base/constant.d.ts +6 -0
- package/src/editor-manager/base/constant.js +6 -0
- package/src/editor-manager/base/editor-manager.d.ts +5 -0
- package/src/editor-manager/base/editor-manager.js +59 -0
- package/src/editor-manager/base/interface.d.ts +8 -0
- package/src/editor-manager/plugin/audio.js +13 -3
- package/src/editor-manager/plugin/dom-node.d.ts +5 -1
- package/src/editor-manager/plugin/dom-node.js +169 -28
- package/src/editor-manager/plugin/format-painter-actions.d.ts +1 -0
- package/src/editor-manager/plugin/format-painter-actions.js +19 -1
- package/src/editor-manager/plugin/formats.d.ts +1 -0
- package/src/editor-manager/plugin/formats.js +38 -3
- package/src/editor-manager/plugin/image.js +38 -15
- package/src/editor-manager/plugin/indents.js +1 -1
- package/src/editor-manager/plugin/inserthtml.d.ts +1 -0
- package/src/editor-manager/plugin/inserthtml.js +83 -20
- package/src/editor-manager/plugin/link.js +8 -3
- package/src/editor-manager/plugin/lists.js +159 -70
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +3 -0
- package/src/editor-manager/plugin/ms-word-clean-up.js +215 -85
- package/src/editor-manager/plugin/nodecutter.js +5 -2
- package/src/editor-manager/plugin/selection-commands.d.ts +2 -0
- package/src/editor-manager/plugin/selection-commands.js +248 -4
- package/src/editor-manager/plugin/table.d.ts +4 -1
- package/src/editor-manager/plugin/table.js +95 -49
- package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +20 -10
- package/src/editor-manager/plugin/undo.d.ts +1 -0
- package/src/editor-manager/plugin/undo.js +21 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +4 -3
- package/src/rich-text-editor/actions/base-quick-toolbar.js +61 -14
- package/src/rich-text-editor/actions/base-toolbar.js +33 -34
- package/src/rich-text-editor/actions/color-picker.d.ts +1 -0
- package/src/rich-text-editor/actions/color-picker.js +13 -3
- package/src/rich-text-editor/actions/count.js +1 -1
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +1 -0
- package/src/rich-text-editor/actions/dropdown-buttons.js +11 -5
- package/src/rich-text-editor/actions/emoji-picker.js +16 -7
- package/src/rich-text-editor/actions/enter-key.js +10 -5
- package/src/rich-text-editor/actions/file-manager.js +1 -1
- package/src/rich-text-editor/actions/format-painter.js +5 -2
- package/src/rich-text-editor/actions/full-screen.js +5 -4
- package/src/rich-text-editor/actions/html-editor.d.ts +2 -0
- package/src/rich-text-editor/actions/html-editor.js +124 -17
- package/src/rich-text-editor/actions/keyboard.js +3 -1
- package/src/rich-text-editor/actions/markdown-editor.js +3 -1
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +5 -0
- package/src/rich-text-editor/actions/paste-clean-up.js +156 -28
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +8 -0
- package/src/rich-text-editor/actions/quick-toolbar.js +59 -12
- package/src/rich-text-editor/actions/resize.js +2 -1
- package/src/rich-text-editor/actions/toolbar-action.js +1 -1
- package/src/rich-text-editor/actions/toolbar.d.ts +3 -3
- package/src/rich-text-editor/actions/toolbar.js +35 -96
- package/src/rich-text-editor/base/classes.d.ts +5 -5
- package/src/rich-text-editor/base/classes.js +5 -5
- package/src/rich-text-editor/base/constant.d.ts +46 -1
- package/src/rich-text-editor/base/constant.js +215 -1
- package/src/rich-text-editor/base/interface.d.ts +47 -3
- 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 +16 -4
- package/src/rich-text-editor/base/rich-text-editor.js +184 -97
- package/src/rich-text-editor/base/util.js +22 -4
- package/src/rich-text-editor/formatter/formatter.js +16 -4
- package/src/rich-text-editor/models/default-locale.js +31 -25
- package/src/rich-text-editor/models/items.js +3 -3
- 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 +1 -0
- package/src/rich-text-editor/renderer/audio-module.js +22 -4
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +2 -0
- package/src/rich-text-editor/renderer/dialog-renderer.js +22 -2
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +2 -1
- package/src/rich-text-editor/renderer/image-module.d.ts +9 -1
- package/src/rich-text-editor/renderer/image-module.js +248 -213
- package/src/rich-text-editor/renderer/link-module.js +53 -24
- package/src/rich-text-editor/renderer/table-module.d.ts +10 -1
- package/src/rich-text-editor/renderer/table-module.js +343 -168
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +3 -6
- package/src/rich-text-editor/renderer/toolbar-renderer.js +106 -101
- package/src/rich-text-editor/renderer/video-module.d.ts +3 -0
- package/src/rich-text-editor/renderer/video-module.js +82 -41
- package/src/rich-text-editor/renderer/view-source.d.ts +1 -0
- package/src/rich-text-editor/renderer/view-source.js +15 -5
- package/src/selection/selection.js +3 -0
- package/styles/bootstrap-dark.css +353 -103
- package/styles/bootstrap.css +357 -112
- package/styles/bootstrap4.css +338 -96
- package/styles/bootstrap5-dark.css +344 -97
- package/styles/bootstrap5.css +344 -97
- package/styles/fabric-dark.css +332 -90
- package/styles/fabric.css +333 -91
- package/styles/fluent-dark.css +360 -98
- package/styles/fluent.css +360 -98
- package/styles/highcontrast-light.css +332 -90
- package/styles/highcontrast.css +336 -91
- package/styles/material-dark.css +339 -92
- package/styles/material.css +339 -92
- package/styles/material3-dark.css +348 -100
- package/styles/material3.css +348 -100
- package/styles/rich-text-editor/_bds-definition.scss +279 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +17 -13
- package/styles/rich-text-editor/_bootstrap-definition.scss +22 -19
- package/styles/rich-text-editor/_bootstrap4-definition.scss +11 -7
- package/styles/rich-text-editor/_bootstrap5-definition.scss +8 -4
- package/styles/rich-text-editor/_fabric-dark-definition.scss +6 -2
- package/styles/rich-text-editor/_fabric-definition.scss +7 -3
- package/styles/rich-text-editor/_fluent-definition.scss +14 -10
- package/styles/rich-text-editor/_fusionnew-definition.scss +7 -3
- package/styles/rich-text-editor/_highcontrast-definition.scss +7 -3
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +6 -2
- package/styles/rich-text-editor/_layout.scss +211 -34
- package/styles/rich-text-editor/_material-dark-definition.scss +6 -2
- package/styles/rich-text-editor/_material-definition.scss +6 -2
- package/styles/rich-text-editor/_material3-definition.scss +16 -12
- package/styles/rich-text-editor/_tailwind-definition.scss +23 -19
- package/styles/rich-text-editor/_theme.scss +113 -24
- package/styles/rich-text-editor/bootstrap-dark.css +353 -103
- package/styles/rich-text-editor/bootstrap.css +357 -112
- package/styles/rich-text-editor/bootstrap4.css +338 -96
- package/styles/rich-text-editor/bootstrap5-dark.css +344 -97
- package/styles/rich-text-editor/bootstrap5.css +344 -97
- package/styles/rich-text-editor/fabric-dark.css +332 -90
- package/styles/rich-text-editor/fabric.css +333 -91
- package/styles/rich-text-editor/fluent-dark.css +360 -98
- package/styles/rich-text-editor/fluent.css +360 -98
- package/styles/rich-text-editor/highcontrast-light.css +332 -90
- package/styles/rich-text-editor/highcontrast.css +336 -91
- package/styles/rich-text-editor/icons/_bds.scss +348 -0
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +4 -4
- package/styles/rich-text-editor/icons/_bootstrap.scss +4 -4
- package/styles/rich-text-editor/icons/_bootstrap4.scss +4 -4
- package/styles/rich-text-editor/icons/_bootstrap5.scss +4 -4
- package/styles/rich-text-editor/icons/_fabric-dark.scss +4 -4
- package/styles/rich-text-editor/icons/_fabric.scss +4 -4
- package/styles/rich-text-editor/icons/_fluent.scss +4 -4
- package/styles/rich-text-editor/icons/_fusionnew.scss +3 -3
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +4 -4
- package/styles/rich-text-editor/icons/_highcontrast.scss +4 -4
- package/styles/rich-text-editor/icons/_material-dark.scss +4 -4
- package/styles/rich-text-editor/icons/_material.scss +4 -4
- package/styles/rich-text-editor/icons/_material3.scss +4 -4
- package/styles/rich-text-editor/icons/_tailwind.scss +4 -4
- package/styles/rich-text-editor/material-dark.css +339 -92
- package/styles/rich-text-editor/material.css +339 -92
- package/styles/rich-text-editor/material3-dark.css +348 -100
- package/styles/rich-text-editor/material3.css +348 -100
- package/styles/rich-text-editor/tailwind-dark.css +383 -113
- package/styles/rich-text-editor/tailwind.css +383 -113
- package/styles/tailwind-dark.css +383 -113
- package/styles/tailwind.css +383 -113
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -41
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -27
|
@@ -13,6 +13,7 @@ var Video = /** @class */ (function () {
|
|
|
13
13
|
this.isAllowedTypes = true;
|
|
14
14
|
this.pageX = null;
|
|
15
15
|
this.pageY = null;
|
|
16
|
+
this.mouseX = null;
|
|
16
17
|
this.deletedVid = [];
|
|
17
18
|
this.parent = parent;
|
|
18
19
|
this.rteID = parent.element.id;
|
|
@@ -143,7 +144,7 @@ var Video = /** @class */ (function () {
|
|
|
143
144
|
var dialogContent = this.vidsizeInput(e);
|
|
144
145
|
var selectObj_1 = { args: e.args, selfVideo: this, selection: e.selection, selectNode: e.selectNode };
|
|
145
146
|
this.dialogObj.setProperties({
|
|
146
|
-
|
|
147
|
+
width: '290px', header: vidSizeHeader, content: dialogContent,
|
|
147
148
|
buttons: [{
|
|
148
149
|
// eslint-disable-next-line
|
|
149
150
|
click: function (e) {
|
|
@@ -412,62 +413,50 @@ var Video = /** @class */ (function () {
|
|
|
412
413
|
if (isNullOrUndefined(vidEleStyle)) {
|
|
413
414
|
return;
|
|
414
415
|
}
|
|
415
|
-
|
|
416
|
+
/* eslint-disable */
|
|
416
417
|
var width = vidEleStyle.width !== '' ? vidEleStyle.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(vidEleStyle.width) :
|
|
417
418
|
parseInt(vidEleStyle.width, 10) : vid.style.width !== '' ? vid.style.width : vid.width;
|
|
418
419
|
var height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
|
|
420
|
+
width = width.toString().match(/\b\d+(\.\d*)?(%|$)\b/g) ? parseFloat(width.toString()) : parseInt(width.toString(), 10);
|
|
421
|
+
height = height.toString().match(/\b\d+(\.\d*)?(%|$)\b/g) ? parseFloat(height.toString()) : parseInt(height.toString(), 10);
|
|
422
|
+
/* eslint-enable */
|
|
419
423
|
if (width > height) {
|
|
420
424
|
vid.style.minWidth = this.parent.insertVideoSettings.minWidth === 0 ? '200px' : formatUnit(this.parent.insertVideoSettings.minWidth);
|
|
421
425
|
vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '90px' : formatUnit(this.parent.insertVideoSettings.minHeight);
|
|
422
426
|
if (this.parent.insertVideoSettings.resizeByPercent) {
|
|
423
|
-
|
|
424
|
-
var percentageValue = this.pixToPerc((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY), (vid.previousElementSibling || vid.parentElement));
|
|
425
|
-
vid.style.width = Math.min(Math.round((percentageValue / vid.getBoundingClientRect().width) * expectedX * 100) / 100, 100) + '%';
|
|
426
|
-
}
|
|
427
|
-
else {
|
|
428
|
-
vid.style.width = this.pixToPerc(parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY, (vid.previousElementSibling || vid.parentElement)) + '%';
|
|
429
|
-
}
|
|
430
|
-
vid.style.height = null;
|
|
431
|
-
vid.removeAttribute('height');
|
|
427
|
+
this.updateVidEleWidth(vid, width, height, expectedX, expectedY);
|
|
432
428
|
}
|
|
433
429
|
else if ((vid.style.width === '' && vid.style.height !== '') || (vidEleStyle.width === '' && vidEleStyle.height !== '')) {
|
|
434
430
|
vid.style.height = expectedY + 'px';
|
|
435
431
|
}
|
|
436
432
|
else if ((vid.style.width !== '' && vid.style.height === '') || (vidEleStyle.width !== '' && vidEleStyle.height === '')) {
|
|
437
|
-
var currentWidth = ((
|
|
438
|
-
|
|
433
|
+
var currentWidth = ((width / height * expectedY) +
|
|
434
|
+
width / height) <
|
|
439
435
|
(this.parent.inputElement.getBoundingClientRect().right - 32) ?
|
|
440
|
-
((
|
|
441
|
-
|
|
436
|
+
((width / height * expectedY) +
|
|
437
|
+
width / height) :
|
|
442
438
|
(this.parent.inputElement.getBoundingClientRect().right - 32);
|
|
443
439
|
vid.style.width = currentWidth.toString() + 'px';
|
|
444
440
|
}
|
|
445
441
|
else if (vid.style.width !== '' || vidEleStyle.width !== '') {
|
|
446
|
-
var currentWidth = (
|
|
442
|
+
var currentWidth = (width / height * expectedY) <
|
|
447
443
|
(this.parent.inputElement.getBoundingClientRect().right - 32) ?
|
|
448
|
-
(
|
|
444
|
+
(width / height * expectedY) :
|
|
449
445
|
(this.parent.inputElement.getBoundingClientRect().right - 32);
|
|
450
446
|
vid.style.width = currentWidth + 'px';
|
|
451
447
|
vid.style.height = expectedY + 'px';
|
|
452
448
|
}
|
|
453
449
|
else {
|
|
454
|
-
vid.setAttribute('width', (parseInt(((
|
|
450
|
+
vid.setAttribute('width', (parseInt(((width / height * expectedY) + width / height).toString(), 10)).toString());
|
|
455
451
|
}
|
|
456
452
|
}
|
|
457
453
|
else if (height > width) {
|
|
458
454
|
if (this.parent.insertVideoSettings.resizeByPercent) {
|
|
459
|
-
|
|
460
|
-
vid.style.width = Math.min(Math.round((parseInt(width.toString(), 10) / vid.getBoundingClientRect().width) * expectedX * 100) / 100, 100) + '%';
|
|
461
|
-
}
|
|
462
|
-
else {
|
|
463
|
-
vid.style.width = this.pixToPerc((expectedX / parseInt(height.toString(), 10) * expectedY), (vid.previousElementSibling || vid.parentElement)) + '%';
|
|
464
|
-
}
|
|
465
|
-
vid.style.height = null;
|
|
466
|
-
vid.removeAttribute('height');
|
|
455
|
+
this.updateVidEleWidth(vid, width, height, expectedX, expectedY);
|
|
467
456
|
}
|
|
468
457
|
else if (vid.style.width !== '' || vidEleStyle.width !== '') {
|
|
469
458
|
vid.style.width = expectedX + 'px';
|
|
470
|
-
vid.style.height = (
|
|
459
|
+
vid.style.height = (height / width * expectedX) + 'px';
|
|
471
460
|
}
|
|
472
461
|
else {
|
|
473
462
|
vid.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - vid.getBoundingClientRect().left).toString() : expectedX.toString());
|
|
@@ -485,6 +474,23 @@ var Video = /** @class */ (function () {
|
|
|
485
474
|
}
|
|
486
475
|
}
|
|
487
476
|
};
|
|
477
|
+
Video.prototype.updateVidEleWidth = function (vid, width, height, expectedX, expectedY) {
|
|
478
|
+
if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
|
|
479
|
+
var original = vid.offsetWidth + this.mouseX;
|
|
480
|
+
var finalWidthByPerc = (original / vid.offsetWidth) * (parseFloat(vid.style.width).toString() === 'NaN' ? (vid.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) : parseFloat(vid.style.width));
|
|
481
|
+
vid.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
if (width > height) {
|
|
485
|
+
vid.style.width = this.pixToPerc(width / height * expectedY, (vid.previousElementSibling || vid.parentElement)) + '%';
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
vid.style.width = this.pixToPerc((expectedX / height * expectedY), (vid.previousElementSibling || vid.parentElement)) + '%';
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
vid.style.height = null;
|
|
492
|
+
vid.removeAttribute('height');
|
|
493
|
+
};
|
|
488
494
|
Video.prototype.pixToPerc = function (expected, parentEle) {
|
|
489
495
|
return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
|
|
490
496
|
};
|
|
@@ -510,7 +516,6 @@ var Video = /** @class */ (function () {
|
|
|
510
516
|
_this.setAspectRatio(_this.videoEle, parseInt(width, 10), parseInt(height, 10), args);
|
|
511
517
|
_this.resizeVidDupPos(_this.videoEle);
|
|
512
518
|
_this.vidResizePos(_this.videoEle, _this.vidResizeDiv);
|
|
513
|
-
_this.parent.setContentHeight('', false);
|
|
514
519
|
}
|
|
515
520
|
});
|
|
516
521
|
};
|
|
@@ -526,6 +531,7 @@ var Video = /** @class */ (function () {
|
|
|
526
531
|
var height = parseInt(this.vidDupPos.height, 10) + mouseY;
|
|
527
532
|
this.pageX = pageX;
|
|
528
533
|
this.pageY = pageY;
|
|
534
|
+
this.mouseX = mouseX;
|
|
529
535
|
if (this.resizeBtnStat.botRight) {
|
|
530
536
|
this.vidDupMouseMove(width + 'px', height + 'px', e);
|
|
531
537
|
}
|
|
@@ -692,6 +698,14 @@ var Video = /** @class */ (function () {
|
|
|
692
698
|
originalEvent.preventDefault();
|
|
693
699
|
break;
|
|
694
700
|
}
|
|
701
|
+
if (originalEvent.ctrlKey && originalEvent.key === 'a') {
|
|
702
|
+
this.handleSelectAll();
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
Video.prototype.handleSelectAll = function () {
|
|
706
|
+
this.cancelResizeAction();
|
|
707
|
+
var videoFocusNodes = this.parent.inputElement.querySelectorAll('.' + classes.CLS_VID_FOCUS);
|
|
708
|
+
removeClass(videoFocusNodes, classes.CLS_VID_FOCUS);
|
|
695
709
|
};
|
|
696
710
|
Video.prototype.openDialog = function (isInternal, event, selection, ele, parentEle) {
|
|
697
711
|
var range;
|
|
@@ -803,7 +817,7 @@ var Video = /** @class */ (function () {
|
|
|
803
817
|
this.parent.formatter.saveData();
|
|
804
818
|
}
|
|
805
819
|
e.selection.restore();
|
|
806
|
-
this.parent.formatter.process(this.parent, e.args, e.args, {
|
|
820
|
+
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, {
|
|
807
821
|
selectNode: e.selectNode,
|
|
808
822
|
subCommand: e.args.item.subCommand
|
|
809
823
|
});
|
|
@@ -869,6 +883,7 @@ var Video = /** @class */ (function () {
|
|
|
869
883
|
if (e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight) {
|
|
870
884
|
}
|
|
871
885
|
else {
|
|
886
|
+
this.parent.notify(events.documentClickClosedBy, { closedBy: "outside click" });
|
|
872
887
|
this.dialogObj.hide({ returnValue: true });
|
|
873
888
|
this.parent.isBlur = true;
|
|
874
889
|
dispatchEvent(this.parent.element, 'focusout');
|
|
@@ -892,6 +907,9 @@ var Video = /** @class */ (function () {
|
|
|
892
907
|
this.prevSelectedVidEle.style.outline = '';
|
|
893
908
|
}
|
|
894
909
|
}
|
|
910
|
+
if (this.parent.inlineMode.enable && target && this.dialogObj && !closest(target, '#' + this.dialogObj.element.id)) {
|
|
911
|
+
this.dialogObj.hide();
|
|
912
|
+
}
|
|
895
913
|
};
|
|
896
914
|
Video.prototype.removeResizeEle = function () {
|
|
897
915
|
EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
|
|
@@ -909,7 +927,7 @@ var Video = /** @class */ (function () {
|
|
|
909
927
|
}
|
|
910
928
|
var subCommand = (e.args.item) ?
|
|
911
929
|
e.args.item.subCommand : 'Break';
|
|
912
|
-
this.parent.formatter.process(this.parent, e.args, e.args, { selectNode: e.selectNode, subCommand: subCommand });
|
|
930
|
+
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
|
|
913
931
|
};
|
|
914
932
|
Video.prototype.inline = function (e) {
|
|
915
933
|
if (e.selectNode[0].nodeName !== 'VIDEO' && !this.isEmbedVidElem(e.selectNode[0])) {
|
|
@@ -917,12 +935,12 @@ var Video = /** @class */ (function () {
|
|
|
917
935
|
}
|
|
918
936
|
var subCommand = (e.args.item) ?
|
|
919
937
|
e.args.item.subCommand : 'Inline';
|
|
920
|
-
this.parent.formatter.process(this.parent, e.args, e.args, { selectNode: e.selectNode, subCommand: subCommand });
|
|
938
|
+
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
|
|
921
939
|
};
|
|
922
940
|
Video.prototype.alignVideo = function (e, type) {
|
|
923
941
|
var subCommand = (e.args.item) ?
|
|
924
942
|
e.args.item.subCommand : type;
|
|
925
|
-
this.parent.formatter.process(this.parent, e.args, e.args, { selectNode: e.selectNode, subCommand: subCommand });
|
|
943
|
+
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
|
|
926
944
|
};
|
|
927
945
|
Video.prototype.editAreaClickHandler = function (e) {
|
|
928
946
|
if (this.parent.readonly) {
|
|
@@ -1066,7 +1084,7 @@ var Video = /** @class */ (function () {
|
|
|
1066
1084
|
_this.uploadObj.removing();
|
|
1067
1085
|
}
|
|
1068
1086
|
_this.parent.isBlur = false;
|
|
1069
|
-
if (event && event.event.returnValue) {
|
|
1087
|
+
if (event && !isNOU(event.event) && event.event.returnValue) {
|
|
1070
1088
|
if (_this.parent.editorMode === 'HTML') {
|
|
1071
1089
|
selection.restore();
|
|
1072
1090
|
}
|
|
@@ -1158,26 +1176,44 @@ var Video = /** @class */ (function () {
|
|
|
1158
1176
|
}
|
|
1159
1177
|
}
|
|
1160
1178
|
});
|
|
1179
|
+
if (e.selectNode && e.selectNode[0] && (e.selectNode[0].nodeName === 'VIDEO' || this.isEmbedVidElem(e.selectNode[0]))) {
|
|
1180
|
+
if (e.selectNode[0].nodeName === 'VIDEO') {
|
|
1181
|
+
var regex = new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi);
|
|
1182
|
+
var sourceElement = e.selectNode[0].querySelector('source');
|
|
1183
|
+
this.inputUrl.value = sourceElement && sourceElement.src && sourceElement.src.match(regex) ? sourceElement.src : '';
|
|
1184
|
+
}
|
|
1185
|
+
else {
|
|
1186
|
+
this.embedInputUrl.value = e.selectNode[0].nodeName === 'IFRAME' ? e.selectNode[0].outerHTML
|
|
1187
|
+
: e.selectNode[0].querySelector('iframe').outerHTML;
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
var isWebUrl = this.inputUrl.value ? true : false;
|
|
1161
1191
|
var embedUrlBtn = new RadioButton({
|
|
1162
1192
|
label: this.i10n.getConstant('embeddedCode'),
|
|
1163
|
-
checked:
|
|
1193
|
+
checked: !isWebUrl,
|
|
1164
1194
|
name: 'URL',
|
|
1165
1195
|
created: function () {
|
|
1166
|
-
|
|
1196
|
+
if (!isWebUrl) {
|
|
1197
|
+
urlContent.appendChild(_this.embedInputUrl);
|
|
1198
|
+
}
|
|
1167
1199
|
},
|
|
1168
1200
|
change: function () {
|
|
1169
1201
|
urlContent.innerHTML = '';
|
|
1170
|
-
_this.inputUrl.value = '';
|
|
1171
1202
|
urlContent.appendChild(_this.embedInputUrl);
|
|
1172
1203
|
}
|
|
1173
1204
|
});
|
|
1174
1205
|
embedUrlBtn.appendTo(videoUrl.querySelector('#embedURL'));
|
|
1175
1206
|
var webUrlBtn = new RadioButton({
|
|
1176
1207
|
label: this.i10n.getConstant('webUrl'),
|
|
1208
|
+
checked: isWebUrl,
|
|
1177
1209
|
name: 'URL',
|
|
1210
|
+
created: function () {
|
|
1211
|
+
if (isWebUrl) {
|
|
1212
|
+
urlContent.appendChild(_this.inputUrl);
|
|
1213
|
+
}
|
|
1214
|
+
},
|
|
1178
1215
|
change: function () {
|
|
1179
1216
|
urlContent.innerHTML = '';
|
|
1180
|
-
_this.embedInputUrl.value = '';
|
|
1181
1217
|
urlContent.appendChild(_this.inputUrl);
|
|
1182
1218
|
}
|
|
1183
1219
|
});
|
|
@@ -1307,8 +1343,12 @@ var Video = /** @class */ (function () {
|
|
|
1307
1343
|
_this.parent.trigger(events.fileRemoving, e, function (e) {
|
|
1308
1344
|
proxy.isVideoUploaded = false;
|
|
1309
1345
|
_this.dialogObj.getButtons(0).element.disabled = true;
|
|
1310
|
-
|
|
1311
|
-
|
|
1346
|
+
if (proxy.inputUrl.getAttribute('disabled')) {
|
|
1347
|
+
proxy.inputUrl.removeAttribute('disabled');
|
|
1348
|
+
}
|
|
1349
|
+
if (proxy.embedInputUrl.getAttribute('disabled')) {
|
|
1350
|
+
proxy.embedInputUrl.removeAttribute('disabled');
|
|
1351
|
+
}
|
|
1312
1352
|
if (proxy.uploadUrl) {
|
|
1313
1353
|
proxy.uploadUrl.url = '';
|
|
1314
1354
|
}
|
|
@@ -1369,10 +1409,11 @@ var Video = /** @class */ (function () {
|
|
|
1369
1409
|
this.selection = proxy.parent.formatter.editorManager.nodeSelection.save(range, proxy.contentModule.getDocument());
|
|
1370
1410
|
this.selectParent = proxy.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
1371
1411
|
}
|
|
1372
|
-
var
|
|
1412
|
+
var webUrlBtn = document.getElementById('webURL');
|
|
1413
|
+
var name_1 = webUrlBtn.checked ? url.split('/')[url.split('/').length - 1] : embedUrl;
|
|
1373
1414
|
var value = {
|
|
1374
1415
|
cssClass: (proxy.parent.insertVideoSettings.layoutOption === 'Inline' ? classes.CLS_VIDEOINLINE : classes.CLS_VIDEOBREAK),
|
|
1375
|
-
url: url, selection: this.selection, fileName: name_1, isEmbedUrl:
|
|
1416
|
+
url: url, selection: this.selection, fileName: name_1, isEmbedUrl: !webUrlBtn.checked,
|
|
1376
1417
|
selectParent: this.selectParent, width: {
|
|
1377
1418
|
width: proxy.parent.insertVideoSettings.width, minWidth: proxy.parent.insertVideoSettings.minWidth,
|
|
1378
1419
|
maxWidth: proxy.parent.getInsertImgMaxWidth()
|
|
@@ -44,7 +44,7 @@ var ViewSource = /** @class */ (function () {
|
|
|
44
44
|
this.parent.formatter.editorManager.observer.off(CONSTANT.KEY_DOWN_HANDLER, this.onKeyDown);
|
|
45
45
|
};
|
|
46
46
|
ViewSource.prototype.getSourceCode = function () {
|
|
47
|
-
return this.parent.createElement('textarea', { className: CLS_RTE_SOURCE_CODE_TXTAREA +
|
|
47
|
+
return this.parent.createElement('textarea', { className: CLS_RTE_SOURCE_CODE_TXTAREA + this.parent.getCssClass(true) });
|
|
48
48
|
};
|
|
49
49
|
ViewSource.prototype.wireEvent = function (element) {
|
|
50
50
|
this.keyboardModule = new KeyboardEvents(element, {
|
|
@@ -108,6 +108,7 @@ var ViewSource = /** @class */ (function () {
|
|
|
108
108
|
* @deprecated
|
|
109
109
|
*/
|
|
110
110
|
ViewSource.prototype.sourceCode = function (args) {
|
|
111
|
+
var _this = this;
|
|
111
112
|
this.parent.notify(events.hidePopup, {});
|
|
112
113
|
this.parent.isBlur = false;
|
|
113
114
|
this.parent.trigger(events.actionBegin, { requestType: 'SourceCode', targetItem: 'SourceCode', args: args });
|
|
@@ -134,15 +135,16 @@ var ViewSource = /** @class */ (function () {
|
|
|
134
135
|
rteContent.appendChild(this.previewElement);
|
|
135
136
|
this.parent.element.appendChild(rteContent);
|
|
136
137
|
rteContent.style.height = this.contentModule.getPanel().style.height;
|
|
137
|
-
rteContent.style.marginTop = this.contentModule.getPanel().style.marginTop;
|
|
138
138
|
this.getPanel().value = this.getTextAreaValue();
|
|
139
139
|
this.contentModule.getPanel().style.display = 'none';
|
|
140
140
|
rteContent.style.display = 'block';
|
|
141
141
|
this.getPanel().style.display = 'block';
|
|
142
142
|
}
|
|
143
143
|
else {
|
|
144
|
+
var height = this.parent.inputElement.offsetHeight;
|
|
144
145
|
this.contentModule.getPanel().appendChild(this.previewElement);
|
|
145
146
|
this.getPanel().value = this.getTextAreaValue();
|
|
147
|
+
this.previewElement.style.height = height + 'px';
|
|
146
148
|
this.contentModule.getEditPanel().style.display = 'none';
|
|
147
149
|
this.previewElement.style.display = 'block';
|
|
148
150
|
}
|
|
@@ -153,17 +155,23 @@ var ViewSource = /** @class */ (function () {
|
|
|
153
155
|
removeClass([this.parent.getToolbar()], [CLS_EXPAND_OPEN]);
|
|
154
156
|
}
|
|
155
157
|
removeClass(tbItems, [CLS_ACTIVE]);
|
|
156
|
-
this.parent.
|
|
158
|
+
var isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
159
|
+
this.parent.setContentHeight('SourceCode', isExpand);
|
|
157
160
|
this.wireEvent(this.previewElement);
|
|
158
161
|
this.unWireBaseKeyDown();
|
|
159
162
|
this.previewElement.focus();
|
|
160
163
|
this.parent.updateValue();
|
|
161
164
|
if (!isNullOrUndefined(this.parent.placeholder) && !this.parent.iframeSettings.enable) {
|
|
162
165
|
var placeHolderWrapper = this.parent.element.querySelector('.rte-placeholder.e-rte-placeholder');
|
|
163
|
-
placeHolderWrapper
|
|
166
|
+
if (placeHolderWrapper) {
|
|
167
|
+
placeHolderWrapper.style.display = 'none';
|
|
168
|
+
}
|
|
164
169
|
}
|
|
165
170
|
this.parent.trigger(events.actionComplete, { requestType: 'SourceCode', targetItem: 'SourceCode', args: args });
|
|
166
171
|
this.parent.invokeChangeEvent();
|
|
172
|
+
if (!isNullOrUndefined(this.parent.saveInterval) && this.parent.saveInterval > 0 && this.parent.autoSaveOnIdle) {
|
|
173
|
+
this.codeViewTimeInterval = setInterval(function () { _this.parent.notify(events.updateValueOnIdle, {}); }, this.parent.saveInterval);
|
|
174
|
+
}
|
|
167
175
|
};
|
|
168
176
|
/**
|
|
169
177
|
* updateSourceCode method
|
|
@@ -213,7 +221,8 @@ var ViewSource = /** @class */ (function () {
|
|
|
213
221
|
if (this.parent.getToolbar()) {
|
|
214
222
|
removeClass([this.parent.getToolbar()], [CLS_EXPAND_OPEN]);
|
|
215
223
|
}
|
|
216
|
-
this.parent.
|
|
224
|
+
var isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
225
|
+
this.parent.setContentHeight('Preview', isExpand);
|
|
217
226
|
this.unWireEvent();
|
|
218
227
|
this.wireBaseKeyDown();
|
|
219
228
|
this.contentModule.getEditPanel().focus();
|
|
@@ -225,6 +234,7 @@ var ViewSource = /** @class */ (function () {
|
|
|
225
234
|
this.parent.trigger(events.actionComplete, { requestType: 'Preview', targetItem: 'Preview', args: args });
|
|
226
235
|
this.parent.formatter.enableUndo(this.parent);
|
|
227
236
|
this.parent.addAudioVideoWrapper();
|
|
237
|
+
clearTimeout(this.codeViewTimeInterval);
|
|
228
238
|
this.parent.invokeChangeEvent();
|
|
229
239
|
this.parent.notify(events.tableclass, {});
|
|
230
240
|
};
|
|
@@ -90,6 +90,9 @@ var NodeSelection = /** @class */ (function () {
|
|
|
90
90
|
|| this.isChildNode(nodeCollection, startNode))) {
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
|
+
if (startNode.nodeType === 3 && startNode.previousSibling === endNode && endNode.nodeName === 'IMG') {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
93
96
|
if (nodeCollection.indexOf(startNode.firstChild) === -1 && startNode.firstChild && !this.isChildNode(nodeCollection, startNode)) {
|
|
94
97
|
return startNode.firstChild;
|
|
95
98
|
}
|