@syncfusion/ej2-richtexteditor 23.2.7-52849 → 24.1.41-569781
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 +177 -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 +2919 -1147
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +2906 -1133
- 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/inserthtml.d.ts +1 -0
- package/src/editor-manager/plugin/inserthtml.js +67 -7
- package/src/editor-manager/plugin/link.js +4 -1
- package/src/editor-manager/plugin/lists.js +121 -65
- 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 +2 -2
- package/src/editor-manager/plugin/selection-commands.d.ts +1 -0
- package/src/editor-manager/plugin/selection-commands.js +165 -3
- package/src/editor-manager/plugin/table.d.ts +0 -1
- package/src/editor-manager/plugin/table.js +33 -30
- 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 +3 -3
- package/src/rich-text-editor/actions/base-quick-toolbar.js +66 -15
- package/src/rich-text-editor/actions/base-toolbar.js +32 -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.js +25 -4
- package/src/rich-text-editor/actions/emoji-picker.js +15 -6
- package/src/rich-text-editor/actions/enter-key.js +6 -4
- package/src/rich-text-editor/actions/file-manager.js +1 -1
- package/src/rich-text-editor/actions/format-painter.js +1 -1
- package/src/rich-text-editor/actions/full-screen.js +5 -4
- package/src/rich-text-editor/actions/html-editor.d.ts +2 -0
- package/src/rich-text-editor/actions/html-editor.js +127 -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 +7 -0
- package/src/rich-text-editor/actions/quick-toolbar.js +45 -11
- 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 +196 -100
- package/src/rich-text-editor/base/util.d.ts +4 -0
- package/src/rich-text-editor/base/util.js +57 -5
- package/src/rich-text-editor/formatter/formatter.js +15 -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 +13 -0
- 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 +244 -212
- 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 +330 -165
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +4 -6
- package/src/rich-text-editor/renderer/toolbar-renderer.js +105 -106
- package/src/rich-text-editor/renderer/video-module.d.ts +3 -0
- package/src/rich-text-editor/renderer/video-module.js +61 -34
- 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 +345 -99
- package/styles/bootstrap.css +353 -108
- package/styles/bootstrap4.css +337 -95
- package/styles/bootstrap5-dark.css +343 -96
- package/styles/bootstrap5.css +343 -96
- package/styles/fabric-dark.css +331 -89
- package/styles/fabric.css +332 -90
- package/styles/fluent-dark.css +342 -92
- package/styles/fluent.css +342 -92
- package/styles/highcontrast-light.css +331 -89
- package/styles/highcontrast.css +335 -90
- package/styles/material-dark.css +337 -90
- package/styles/material.css +337 -90
- package/styles/material3-dark.css +347 -99
- package/styles/material3.css +347 -99
- package/styles/rich-text-editor/_bds-definition.scss +279 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +14 -10
- package/styles/rich-text-editor/_bootstrap-definition.scss +20 -17
- 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 +9 -5
- 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 +208 -31
- 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 +25 -21
- package/styles/rich-text-editor/_theme.scss +93 -24
- package/styles/rich-text-editor/bootstrap-dark.css +345 -99
- package/styles/rich-text-editor/bootstrap.css +353 -108
- package/styles/rich-text-editor/bootstrap4.css +337 -95
- package/styles/rich-text-editor/bootstrap5-dark.css +343 -96
- package/styles/rich-text-editor/bootstrap5.css +343 -96
- package/styles/rich-text-editor/fabric-dark.css +331 -89
- package/styles/rich-text-editor/fabric.css +332 -90
- package/styles/rich-text-editor/fluent-dark.css +342 -92
- package/styles/rich-text-editor/fluent.css +342 -92
- package/styles/rich-text-editor/highcontrast-light.css +331 -89
- package/styles/rich-text-editor/highcontrast.css +335 -90
- 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 +337 -90
- package/styles/rich-text-editor/material.css +337 -90
- package/styles/rich-text-editor/material3-dark.css +347 -99
- package/styles/rich-text-editor/material3.css +347 -99
- package/styles/rich-text-editor/tailwind-dark.css +386 -116
- package/styles/rich-text-editor/tailwind.css +386 -116
- package/styles/tailwind-dark.css +386 -116
- package/styles/tailwind.css +386 -116
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -41
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -27
- package/src/global.d.ts +0 -1
|
@@ -17,12 +17,12 @@ export declare class ToolbarRenderer implements IRenderer {
|
|
|
17
17
|
* @private
|
|
18
18
|
*/
|
|
19
19
|
parent: IRichTextEditor;
|
|
20
|
-
private popupContainer;
|
|
21
20
|
private currentElement;
|
|
22
21
|
private currentDropdown;
|
|
23
|
-
private popupOverlay;
|
|
24
22
|
private tooltip;
|
|
25
23
|
private l10n;
|
|
24
|
+
private dropdownTooltip;
|
|
25
|
+
private tooltipTargetEle;
|
|
26
26
|
/**
|
|
27
27
|
* Constructor for toolbar renderer module
|
|
28
28
|
*
|
|
@@ -41,7 +41,6 @@ export declare class ToolbarRenderer implements IRenderer {
|
|
|
41
41
|
private tooltipBeforeRender;
|
|
42
42
|
private dropDownOpen;
|
|
43
43
|
private dropDownClose;
|
|
44
|
-
private removePopupContainer;
|
|
45
44
|
/**
|
|
46
45
|
* renderToolbar method
|
|
47
46
|
*
|
|
@@ -60,6 +59,8 @@ export declare class ToolbarRenderer implements IRenderer {
|
|
|
60
59
|
* @deprecated
|
|
61
60
|
*/
|
|
62
61
|
renderDropDownButton(args: IDropDownModel): DropDownButton;
|
|
62
|
+
private mouseOutHandler;
|
|
63
|
+
private closeTooltip;
|
|
63
64
|
/**
|
|
64
65
|
* renderListDropDown method
|
|
65
66
|
*
|
|
@@ -69,8 +70,6 @@ export declare class ToolbarRenderer implements IRenderer {
|
|
|
69
70
|
* @deprecated
|
|
70
71
|
*/
|
|
71
72
|
renderListDropDown(args: IDropDownModel): DropDownButton;
|
|
72
|
-
private onPopupOverlay;
|
|
73
|
-
private setIsModel;
|
|
74
73
|
private paletteSelection;
|
|
75
74
|
/**
|
|
76
75
|
* renderColorPickerDropDown method
|
|
@@ -85,7 +84,6 @@ export declare class ToolbarRenderer implements IRenderer {
|
|
|
85
84
|
*/
|
|
86
85
|
renderColorPickerDropDown(args: IColorPickerModel, item: string, colorPicker: ColorPicker, defaultColor: string): DropDownButton;
|
|
87
86
|
private pickerRefresh;
|
|
88
|
-
private popupModal;
|
|
89
87
|
private setColorPickerContentWidth;
|
|
90
88
|
/**
|
|
91
89
|
* renderColorPicker method
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { addClass, Browser, removeClass,
|
|
2
|
-
import { getInstance, closest, selectAll
|
|
1
|
+
import { addClass, Browser, removeClass, formatUnit, isNullOrUndefined, isNullOrUndefined as isNOU, EventHandler } from '@syncfusion/ej2-base';
|
|
2
|
+
import { getInstance, closest, selectAll } from '@syncfusion/ej2-base';
|
|
3
3
|
import { Toolbar } from '@syncfusion/ej2-navigations';
|
|
4
4
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
5
5
|
import { Popup, Tooltip } from '@syncfusion/ej2-popups';
|
|
@@ -30,21 +30,22 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
30
30
|
}
|
|
31
31
|
ToolbarRenderer.prototype.wireEvent = function () {
|
|
32
32
|
this.parent.on(events.destroy, this.unWireEvent, this);
|
|
33
|
-
this.parent.on(events.
|
|
33
|
+
this.parent.on(events.destroyTooltip, this.destroyTooltip, this);
|
|
34
|
+
this.parent.on(events.closeTooltip, this.closeTooltip, this);
|
|
34
35
|
};
|
|
35
36
|
ToolbarRenderer.prototype.destroyTooltip = function () {
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
38
|
+
this.parent.contentModule.getDocument();
|
|
39
|
+
if (!isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap')) && !isNullOrUndefined(currentDocument.querySelector('[data-tooltip-id]'))) {
|
|
40
|
+
var tooltipTargetEle = currentDocument.querySelector('[data-tooltip-id]');
|
|
38
41
|
var event_1 = new MouseEvent('mouseleave', { bubbles: true, cancelable: true });
|
|
39
42
|
tooltipTargetEle.dispatchEvent(event_1);
|
|
40
43
|
}
|
|
41
44
|
};
|
|
42
45
|
ToolbarRenderer.prototype.unWireEvent = function () {
|
|
43
46
|
this.parent.off(events.destroy, this.unWireEvent);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
this.removePopupContainer();
|
|
47
|
+
this.parent.off(events.destroyTooltip, this.destroyTooltip);
|
|
48
|
+
this.parent.off(events.closeTooltip, this.closeTooltip);
|
|
48
49
|
};
|
|
49
50
|
ToolbarRenderer.prototype.toolbarBeforeCreate = function (e) {
|
|
50
51
|
if (this.mode === 'Extended') {
|
|
@@ -65,7 +66,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
65
66
|
};
|
|
66
67
|
ToolbarRenderer.prototype.dropDownSelected = function (args) {
|
|
67
68
|
this.parent.notify(events.dropDownSelect, args);
|
|
68
|
-
this.
|
|
69
|
+
this.destroyTooltip();
|
|
69
70
|
};
|
|
70
71
|
ToolbarRenderer.prototype.beforeDropDownItemRender = function (args) {
|
|
71
72
|
if (this.parent.readonly || !this.parent.enabled) {
|
|
@@ -93,36 +94,41 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
93
94
|
if (args.element.parentElement.getAttribute('id').indexOf('TableCell') > -1 && !isNOU(args.element.parentElement.querySelector('.e-cell-merge')) &&
|
|
94
95
|
(!isNOU(args.element.parentElement.querySelector('.e-cell-horizontal-split')) || !isNOU(args.element.parentElement.querySelector('.e-cell-vertical-split')))) {
|
|
95
96
|
var listEle = args.element.querySelectorAll('li');
|
|
96
|
-
|
|
97
|
+
var selectedEles_1 = this.parent.inputElement.querySelectorAll('.e-cell-select');
|
|
98
|
+
if (selectedEles_1.length === 1) {
|
|
97
99
|
addClass([listEle[0]], 'e-disabled');
|
|
98
100
|
removeClass([listEle[1], listEle[2]], 'e-disabled');
|
|
99
101
|
}
|
|
100
|
-
else if (
|
|
101
|
-
|
|
102
|
+
else if (selectedEles_1.length > 1) {
|
|
103
|
+
if (!Array.from(selectedEles_1).every(function (element) {
|
|
104
|
+
return element.tagName.toLowerCase() === selectedEles_1[0].tagName.toLowerCase();
|
|
105
|
+
})) {
|
|
106
|
+
addClass([listEle[0]], 'e-disabled');
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
removeClass([listEle[0]], 'e-disabled');
|
|
110
|
+
}
|
|
102
111
|
addClass([listEle[1], listEle[2]], 'e-disabled');
|
|
103
112
|
}
|
|
104
113
|
}
|
|
105
|
-
if (
|
|
106
|
-
this.
|
|
114
|
+
if (this.parent.showTooltip) {
|
|
115
|
+
this.dropdownTooltip = new Tooltip({
|
|
116
|
+
target: '[aria-owns="' + this.parent.getID() + '"].e-rte-elements [title]',
|
|
117
|
+
showTipPointer: true,
|
|
118
|
+
openDelay: 400,
|
|
119
|
+
opensOn: 'Hover',
|
|
120
|
+
beforeRender: this.tooltipBeforeRender.bind(this),
|
|
121
|
+
cssClass: this.parent.getCssClass(),
|
|
122
|
+
windowCollision: true,
|
|
123
|
+
position: 'BottomCenter'
|
|
124
|
+
});
|
|
125
|
+
this.dropdownTooltip.appendTo(args.element);
|
|
107
126
|
}
|
|
108
127
|
this.parent.notify(events.selectionSave, args);
|
|
109
128
|
};
|
|
110
129
|
ToolbarRenderer.prototype.dropDownClose = function (args) {
|
|
111
|
-
this.removePopupContainer();
|
|
112
130
|
this.parent.notify(events.selectionRestore, args);
|
|
113
131
|
};
|
|
114
|
-
ToolbarRenderer.prototype.removePopupContainer = function () {
|
|
115
|
-
if (Browser.isDevice && !isNullOrUndefined(this.popupContainer)) {
|
|
116
|
-
var popupEle = this.popupContainer.querySelector('.e-dropdown-popup.e-tbar-btn.e-control');
|
|
117
|
-
if (popupEle) {
|
|
118
|
-
this.popupContainer.parentNode.insertBefore(popupEle, this.popupContainer.nextSibling);
|
|
119
|
-
popupEle.style.removeProperty('position');
|
|
120
|
-
removeClass([popupEle], 'e-popup-modal');
|
|
121
|
-
}
|
|
122
|
-
detach(this.popupContainer);
|
|
123
|
-
this.popupContainer = undefined;
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
132
|
/**
|
|
127
133
|
* renderToolbar method
|
|
128
134
|
*
|
|
@@ -156,11 +162,11 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
156
162
|
openDelay: 400,
|
|
157
163
|
opensOn: 'Hover',
|
|
158
164
|
beforeRender: this.tooltipBeforeRender.bind(this),
|
|
159
|
-
cssClass: this.parent.
|
|
165
|
+
cssClass: this.parent.getCssClass(),
|
|
160
166
|
windowCollision: true,
|
|
161
167
|
position: 'BottomCenter'
|
|
162
168
|
});
|
|
163
|
-
this.tooltip.appendTo(args.target);
|
|
169
|
+
this.tooltip.appendTo(args.target.parentElement);
|
|
164
170
|
}
|
|
165
171
|
};
|
|
166
172
|
/**
|
|
@@ -216,7 +222,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
216
222
|
}
|
|
217
223
|
//Alignments preselect
|
|
218
224
|
var alignEle = proxy.parent.getRange().startContainer;
|
|
219
|
-
while (alignEle !== proxy.parent.
|
|
225
|
+
while (alignEle !== proxy.parent.inputElement && !isNOU(alignEle.parentElement)) {
|
|
220
226
|
if (alignEle.nodeName === '#text') {
|
|
221
227
|
alignEle = alignEle.parentElement;
|
|
222
228
|
}
|
|
@@ -242,7 +248,8 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
242
248
|
alignEle = alignEle.parentElement;
|
|
243
249
|
}
|
|
244
250
|
//image preselect
|
|
245
|
-
var
|
|
251
|
+
var closestNode = startNode.closest('img');
|
|
252
|
+
var imageEle = closestNode ? closestNode : startNode.querySelector('img');
|
|
246
253
|
if (args.items[0].command === 'Images') {
|
|
247
254
|
if (!isNOU(imageEle)) {
|
|
248
255
|
var index = void 0;
|
|
@@ -261,7 +268,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
261
268
|
}
|
|
262
269
|
}
|
|
263
270
|
//Formats preselect
|
|
264
|
-
if (args.items[0].command === 'Formats') {
|
|
271
|
+
if (args.items[0].command === 'Formats' || args.items[0].command === 'Font') {
|
|
265
272
|
for (var index = 0; index < args.element.childNodes.length; index++) {
|
|
266
273
|
var divNode = _this.parent.createElement('div');
|
|
267
274
|
divNode.innerHTML = dropDown.content.trim();
|
|
@@ -291,6 +298,32 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
291
298
|
popupElement.setAttribute('aria-owns', this.parent.getID());
|
|
292
299
|
return dropDown;
|
|
293
300
|
};
|
|
301
|
+
ToolbarRenderer.prototype.mouseOutHandler = function () {
|
|
302
|
+
if (!isNOU(this.tooltipTargetEle)) {
|
|
303
|
+
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
307
|
+
this.parent.contentModule.getDocument();
|
|
308
|
+
this.tooltipTargetEle = currentDocument.querySelector('[data-title]');
|
|
309
|
+
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
310
|
+
}
|
|
311
|
+
this.tooltipTargetEle.removeAttribute('data-title');
|
|
312
|
+
EventHandler.remove(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler);
|
|
313
|
+
};
|
|
314
|
+
ToolbarRenderer.prototype.closeTooltip = function (args) {
|
|
315
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
316
|
+
this.parent.contentModule.getDocument();
|
|
317
|
+
this.tooltipTargetEle = closest(args.target, '[data-tooltip-id]');
|
|
318
|
+
if (!isNOU(this.tooltipTargetEle) && this.parent.showTooltip && !isNOU(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
319
|
+
this.destroyTooltip();
|
|
320
|
+
if (!this.tooltipTargetEle.closest('.e-rte-quick-popup')) {
|
|
321
|
+
this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
|
|
322
|
+
this.tooltipTargetEle.removeAttribute('title');
|
|
323
|
+
EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
};
|
|
294
327
|
/**
|
|
295
328
|
* renderListDropDown method
|
|
296
329
|
*
|
|
@@ -300,6 +333,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
300
333
|
* @deprecated
|
|
301
334
|
*/
|
|
302
335
|
ToolbarRenderer.prototype.renderListDropDown = function (args) {
|
|
336
|
+
var _this = this;
|
|
303
337
|
// eslint-disable-next-line
|
|
304
338
|
var proxy = this;
|
|
305
339
|
var css = CLS_RTE_ELEMENTS + ' ' + CLS_TB_BTN + ((this.parent.inlineMode) ? (' ' + CLS_INLINE_DROPDOWN) : '');
|
|
@@ -315,6 +349,35 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
315
349
|
enableRtl: this.parent.enableRtl,
|
|
316
350
|
select: this.dropDownSelected.bind(this),
|
|
317
351
|
beforeOpen: function (args) {
|
|
352
|
+
if (proxy.parent.editorMode !== 'Markdown') {
|
|
353
|
+
var startNode = proxy.parent.getRange().startContainer.parentElement;
|
|
354
|
+
var listElem = startNode.closest('LI');
|
|
355
|
+
var currentLiElem = !isNOU(listElem) ? listElem.parentElement : null;
|
|
356
|
+
if (!isNOU(currentLiElem) && (currentLiElem.nodeName === 'OL' || currentLiElem.nodeName === 'UL')) {
|
|
357
|
+
if (currentLiElem.nodeName === 'UL' && args.items[0].subCommand === 'NumberFormatList') {
|
|
358
|
+
addClass([args.element.childNodes[0]], 'e-active');
|
|
359
|
+
}
|
|
360
|
+
else if (currentLiElem.nodeName === 'OL' && args.items[0].subCommand === 'BulletFormatList') {
|
|
361
|
+
addClass([args.element.childNodes[0]], 'e-active');
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
var currentListStyle = currentLiElem.style.listStyleType.split('-').join('').toLocaleLowerCase();
|
|
365
|
+
currentListStyle = currentListStyle === 'decimal' ? 'number' : currentListStyle;
|
|
366
|
+
for (var index = 0; index < args.element.childNodes.length; index++) {
|
|
367
|
+
if (currentListStyle === args.element.childNodes[index].innerHTML.split(' ').join('').toLocaleLowerCase()) {
|
|
368
|
+
addClass([args.element.childNodes[index]], 'e-active');
|
|
369
|
+
}
|
|
370
|
+
else if (currentListStyle === '') {
|
|
371
|
+
addClass([args.element.childNodes[index]], 'e-active');
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
addClass([args.element.childNodes[0]], 'e-active');
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
_this.closeTooltip({ target: args.event.target });
|
|
318
381
|
if (proxy.parent.readonly || !proxy.parent.enabled) {
|
|
319
382
|
args.cancel = true;
|
|
320
383
|
return;
|
|
@@ -354,39 +417,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
354
417
|
};
|
|
355
418
|
return dropDown;
|
|
356
419
|
};
|
|
357
|
-
// eslint-disable-next-line
|
|
358
|
-
ToolbarRenderer.prototype.onPopupOverlay = function (args) {
|
|
359
|
-
if (!isNullOrUndefined(this.popupOverlay)) {
|
|
360
|
-
closest(this.popupOverlay, '.e-popup-container').style.display = 'none';
|
|
361
|
-
this.popupOverlay.style.display = 'none';
|
|
362
|
-
removeClass([this.popupOverlay], 'e-popup-overlay');
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
ToolbarRenderer.prototype.setIsModel = function (element) {
|
|
366
|
-
if (!closest(element, '.e-popup-container')) {
|
|
367
|
-
this.popupContainer = this.parent.createElement('div', {
|
|
368
|
-
className: 'e-rte-modal-popup e-popup-container e-center'
|
|
369
|
-
});
|
|
370
|
-
element.parentNode.insertBefore(this.popupContainer, element);
|
|
371
|
-
this.popupContainer.appendChild(element);
|
|
372
|
-
this.popupContainer.style.zIndex = element.style.zIndex;
|
|
373
|
-
this.popupContainer.style.display = 'flex';
|
|
374
|
-
element.style.position = 'relative';
|
|
375
|
-
addClass([element], 'e-popup-modal');
|
|
376
|
-
this.popupOverlay = this.parent.createElement('div', { className: 'e-popup-overlay' });
|
|
377
|
-
// eslint-disable-next-line
|
|
378
|
-
this.popupOverlay.style.zIndex = (parseInt(element.style.zIndex, null) - 1).toString();
|
|
379
|
-
this.popupOverlay.style.display = 'block';
|
|
380
|
-
this.popupContainer.appendChild(this.popupOverlay);
|
|
381
|
-
EventHandler.add(this.popupOverlay, 'click touchmove', this.onPopupOverlay, this);
|
|
382
|
-
}
|
|
383
|
-
else {
|
|
384
|
-
element.parentElement.style.display = 'flex';
|
|
385
|
-
this.popupOverlay = element.nextElementSibling;
|
|
386
|
-
this.popupOverlay.style.display = 'block';
|
|
387
|
-
addClass([this.popupOverlay], 'e-popup-overlay');
|
|
388
|
-
}
|
|
389
|
-
};
|
|
390
420
|
ToolbarRenderer.prototype.paletteSelection = function (dropDownArgs, currentElement) {
|
|
391
421
|
var ele = dropDownArgs.element.querySelector('.e-control.e-colorpicker');
|
|
392
422
|
var colorbox = [].slice.call(selectAll('.e-tile', ele.parentElement));
|
|
@@ -415,7 +445,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
415
445
|
var proxy = this;
|
|
416
446
|
var css = CLS_RTE_ELEMENTS + ' ' + CLS_TB_BTN + ((this.parent.inlineMode) ? (' ' + CLS_INLINE_DROPDOWN) : '');
|
|
417
447
|
css += (' ' + ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_DROPDOWN : CLS_FONT_COLOR_DROPDOWN));
|
|
418
|
-
css +=
|
|
448
|
+
css += this.parent.getCssClass(true);
|
|
419
449
|
var content = proxy.parent.createElement('span', { className: CLS_COLOR_CONTENT });
|
|
420
450
|
var inlineEle = proxy.parent.createElement('span', { className: args.cssClass });
|
|
421
451
|
var range;
|
|
@@ -427,8 +457,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
427
457
|
target: colorPicker.element.parentElement, cssClass: css,
|
|
428
458
|
enablePersistence: this.parent.enablePersistence, enableRtl: this.parent.enableRtl,
|
|
429
459
|
beforeOpen: function (dropDownArgs) {
|
|
430
|
-
colorPicker.inline = true;
|
|
431
|
-
colorPicker.dataBind();
|
|
432
460
|
if (proxy.parent.readonly || !proxy.parent.enabled) {
|
|
433
461
|
dropDownArgs.cancel = true;
|
|
434
462
|
return;
|
|
@@ -487,9 +515,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
487
515
|
if (focusEle) {
|
|
488
516
|
focusEle.focus();
|
|
489
517
|
}
|
|
490
|
-
if (Browser.isDevice) {
|
|
491
|
-
_this.popupModal(dropDownArgs.element.parentElement);
|
|
492
|
-
}
|
|
493
518
|
_this.pickerRefresh(dropDownArgs);
|
|
494
519
|
},
|
|
495
520
|
beforeClose: function (dropDownArgs) {
|
|
@@ -517,22 +542,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
517
542
|
},
|
|
518
543
|
close: function (dropDownArgs) {
|
|
519
544
|
proxy.parent.notify(events.selectionRestore, {});
|
|
520
|
-
var dropElement = closest(dropDownArgs.element.parentElement, '.e-popup-container');
|
|
521
|
-
if (dropElement) {
|
|
522
|
-
dropElement.style.display = 'none';
|
|
523
|
-
dropElement.lastElementChild.style.display = 'none';
|
|
524
|
-
removeClass([dropElement.lastElementChild], 'e-popup-overlay');
|
|
525
|
-
}
|
|
526
|
-
if (Browser.isDevice && !isNullOrUndefined(dropElement)) {
|
|
527
|
-
var popupEle = dropElement.querySelector('.e-dropdown-popup.e-tbar-btn.e-control');
|
|
528
|
-
if (popupEle) {
|
|
529
|
-
dropElement.parentNode.insertBefore(popupEle, dropElement.nextSibling);
|
|
530
|
-
popupEle.style.removeProperty('position');
|
|
531
|
-
removeClass([popupEle], 'e-popup-modal');
|
|
532
|
-
}
|
|
533
|
-
detach(dropElement);
|
|
534
|
-
proxy.popupContainer = undefined;
|
|
535
|
-
}
|
|
536
545
|
}
|
|
537
546
|
});
|
|
538
547
|
dropDown.isStringTemplate = true;
|
|
@@ -560,16 +569,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
560
569
|
popupElem.style.width = (popupElem.offsetWidth - 5).toString() + 'px';
|
|
561
570
|
}
|
|
562
571
|
};
|
|
563
|
-
ToolbarRenderer.prototype.popupModal = function (element) {
|
|
564
|
-
var popupInst = getInstance(element, Popup);
|
|
565
|
-
popupInst.relateTo = document.body;
|
|
566
|
-
popupInst.position = { X: 0, Y: 0 };
|
|
567
|
-
popupInst.targetType = 'container';
|
|
568
|
-
popupInst.collision = { X: 'fit', Y: 'fit' };
|
|
569
|
-
popupInst.offsetY = 4;
|
|
570
|
-
popupInst.dataBind();
|
|
571
|
-
this.setIsModel(element);
|
|
572
|
-
};
|
|
573
572
|
ToolbarRenderer.prototype.setColorPickerContentWidth = function (colorPicker) {
|
|
574
573
|
var colorPickerContent = colorPicker.element.nextSibling;
|
|
575
574
|
if (colorPickerContent.style.width === '0px') {
|
|
@@ -596,19 +595,23 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
596
595
|
var colorPicker = new ColorPicker({
|
|
597
596
|
enablePersistence: this.parent.enablePersistence,
|
|
598
597
|
enableRtl: this.parent.enableRtl,
|
|
599
|
-
inline:
|
|
600
|
-
value:
|
|
598
|
+
inline: true,
|
|
599
|
+
value: null,
|
|
600
|
+
cssClass: ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass + ' ' + 'e-rte-picker-init',
|
|
601
601
|
created: function () {
|
|
602
602
|
var value = (item === 'backgroundcolor') ? proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
|
|
603
|
-
colorPicker.
|
|
603
|
+
colorPicker.cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
|
|
604
|
+
colorPicker.value = value;
|
|
604
605
|
},
|
|
605
606
|
mode: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.mode : proxy.parent.fontColor.mode),
|
|
606
607
|
modeSwitcher: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.modeSwitcher : proxy.parent.fontColor.modeSwitcher),
|
|
608
|
+
presetColors: (item === 'backgroundcolor') ? this.parent.backgroundColor.colorCode : this.parent.fontColor.colorCode,
|
|
609
|
+
columns: (item === 'backgroundcolor') ? this.parent.backgroundColor.columns : this.parent.fontColor.columns,
|
|
607
610
|
beforeTileRender: function (args) {
|
|
608
611
|
args.element.classList.add(CLS_COLOR_PALETTE);
|
|
609
612
|
args.element.classList.add(CLS_CUSTOM_TILE);
|
|
610
613
|
if (!isNullOrUndefined(_this.parent.cssClass)) {
|
|
611
|
-
var allClassName = _this.parent.
|
|
614
|
+
var allClassName = _this.parent.getCssClass().split(' ');
|
|
612
615
|
for (var i = 0; i < allClassName.length; i++) {
|
|
613
616
|
if (allClassName[i].trim() !== '') {
|
|
614
617
|
args.element.classList.add(allClassName[i]);
|
|
@@ -648,10 +651,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
648
651
|
}
|
|
649
652
|
});
|
|
650
653
|
colorPicker.isStringTemplate = true;
|
|
651
|
-
colorPicker.columns = (item === 'backgroundcolor') ? this.parent.backgroundColor.columns : this.parent.fontColor.columns;
|
|
652
|
-
colorPicker.presetColors = (item === 'backgroundcolor') ? this.parent.backgroundColor.colorCode :
|
|
653
|
-
this.parent.fontColor.colorCode;
|
|
654
|
-
colorPicker.cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
|
|
655
654
|
colorPicker.createElement = this.parent.createElement;
|
|
656
655
|
colorPicker.appendTo(document.getElementById(args.target));
|
|
657
656
|
return colorPicker;
|
|
@@ -23,6 +23,7 @@ export declare class Video {
|
|
|
23
23
|
private isAllowedTypes;
|
|
24
24
|
private pageX;
|
|
25
25
|
private pageY;
|
|
26
|
+
private mouseX;
|
|
26
27
|
private dialogRenderObj;
|
|
27
28
|
private deletedVid;
|
|
28
29
|
private changedWidthValue;
|
|
@@ -51,6 +52,7 @@ export declare class Video {
|
|
|
51
52
|
private vidResizePos;
|
|
52
53
|
private calcPos;
|
|
53
54
|
private setAspectRatio;
|
|
55
|
+
private updateVidEleWidth;
|
|
54
56
|
private pixToPerc;
|
|
55
57
|
private vidDupMouseMove;
|
|
56
58
|
private resizing;
|
|
@@ -59,6 +61,7 @@ export declare class Video {
|
|
|
59
61
|
private resizeBtnInit;
|
|
60
62
|
private onToolbarAction;
|
|
61
63
|
private onKeyDown;
|
|
64
|
+
private handleSelectAll;
|
|
62
65
|
private openDialog;
|
|
63
66
|
private showDialog;
|
|
64
67
|
private closeDialog;
|
|
@@ -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;
|
|
@@ -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');
|
|
@@ -1158,6 +1173,15 @@ var Video = /** @class */ (function () {
|
|
|
1158
1173
|
}
|
|
1159
1174
|
}
|
|
1160
1175
|
});
|
|
1176
|
+
if (e.selectNode && ((e.selectNode[0] && e.selectNode[0].nodeType !== 3 &&
|
|
1177
|
+
e.selectNode[0].nodeName !== 'BR' &&
|
|
1178
|
+
(e.selectNode[0].classList &&
|
|
1179
|
+
e.selectNode[0].classList.contains(classes.CLS_VID_CLICK_ELEM))) ||
|
|
1180
|
+
e.selectNode[0].nodeName === 'IFRAME' || 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.src.match(regex) ? sourceElement.src : '';
|
|
1184
|
+
}
|
|
1161
1185
|
var embedUrlBtn = new RadioButton({
|
|
1162
1186
|
label: this.i10n.getConstant('embeddedCode'),
|
|
1163
1187
|
checked: true,
|
|
@@ -1167,7 +1191,6 @@ var Video = /** @class */ (function () {
|
|
|
1167
1191
|
},
|
|
1168
1192
|
change: function () {
|
|
1169
1193
|
urlContent.innerHTML = '';
|
|
1170
|
-
_this.inputUrl.value = '';
|
|
1171
1194
|
urlContent.appendChild(_this.embedInputUrl);
|
|
1172
1195
|
}
|
|
1173
1196
|
});
|
|
@@ -1177,7 +1200,6 @@ var Video = /** @class */ (function () {
|
|
|
1177
1200
|
name: 'URL',
|
|
1178
1201
|
change: function () {
|
|
1179
1202
|
urlContent.innerHTML = '';
|
|
1180
|
-
_this.embedInputUrl.value = '';
|
|
1181
1203
|
urlContent.appendChild(_this.inputUrl);
|
|
1182
1204
|
}
|
|
1183
1205
|
});
|
|
@@ -1307,8 +1329,12 @@ var Video = /** @class */ (function () {
|
|
|
1307
1329
|
_this.parent.trigger(events.fileRemoving, e, function (e) {
|
|
1308
1330
|
proxy.isVideoUploaded = false;
|
|
1309
1331
|
_this.dialogObj.getButtons(0).element.disabled = true;
|
|
1310
|
-
|
|
1311
|
-
|
|
1332
|
+
if (proxy.inputUrl.getAttribute('disabled')) {
|
|
1333
|
+
proxy.inputUrl.removeAttribute('disabled');
|
|
1334
|
+
}
|
|
1335
|
+
if (proxy.embedInputUrl.getAttribute('disabled')) {
|
|
1336
|
+
proxy.embedInputUrl.removeAttribute('disabled');
|
|
1337
|
+
}
|
|
1312
1338
|
if (proxy.uploadUrl) {
|
|
1313
1339
|
proxy.uploadUrl.url = '';
|
|
1314
1340
|
}
|
|
@@ -1369,10 +1395,11 @@ var Video = /** @class */ (function () {
|
|
|
1369
1395
|
this.selection = proxy.parent.formatter.editorManager.nodeSelection.save(range, proxy.contentModule.getDocument());
|
|
1370
1396
|
this.selectParent = proxy.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
1371
1397
|
}
|
|
1372
|
-
var
|
|
1398
|
+
var webUrlBtn = document.getElementById('webURL');
|
|
1399
|
+
var name_1 = webUrlBtn.checked ? url.split('/')[url.split('/').length - 1] : embedUrl;
|
|
1373
1400
|
var value = {
|
|
1374
1401
|
cssClass: (proxy.parent.insertVideoSettings.layoutOption === 'Inline' ? classes.CLS_VIDEOINLINE : classes.CLS_VIDEOBREAK),
|
|
1375
|
-
url: url, selection: this.selection, fileName: name_1, isEmbedUrl:
|
|
1402
|
+
url: url, selection: this.selection, fileName: name_1, isEmbedUrl: !webUrlBtn.checked,
|
|
1376
1403
|
selectParent: this.selectParent, width: {
|
|
1377
1404
|
width: proxy.parent.insertVideoSettings.width, minWidth: proxy.parent.insertVideoSettings.minWidth,
|
|
1378
1405
|
maxWidth: proxy.parent.getInsertImgMaxWidth()
|