@syncfusion/ej2-richtexteditor 24.1.41-569421 → 24.1.41-581025
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -176
- package/dist/ej2-richtexteditor.umd.min.js +1 -1
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +7822 -9502
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +5674 -7355
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/package.json +12 -12
- package/src/common/config.d.ts +0 -7
- package/src/common/config.js +0 -11
- package/src/common/constant.d.ts +0 -6
- package/src/common/constant.js +0 -6
- package/src/common/interface.d.ts +0 -12
- package/src/common/types.d.ts +0 -6
- package/src/common/util.d.ts +0 -6
- package/src/common/util.js +20 -61
- package/src/editor-manager/base/constant.d.ts +0 -6
- package/src/editor-manager/base/constant.js +0 -6
- package/src/editor-manager/base/editor-manager.d.ts +0 -5
- package/src/editor-manager/base/editor-manager.js +0 -59
- package/src/editor-manager/base/interface.d.ts +0 -8
- package/src/editor-manager/plugin/dom-node.d.ts +1 -5
- package/src/editor-manager/plugin/dom-node.js +15 -169
- package/src/editor-manager/plugin/format-painter-actions.d.ts +0 -1
- package/src/editor-manager/plugin/format-painter-actions.js +1 -19
- package/src/editor-manager/plugin/formats.d.ts +0 -1
- package/src/editor-manager/plugin/formats.js +3 -38
- package/src/editor-manager/plugin/image.js +16 -12
- package/src/editor-manager/plugin/indents.js +1 -1
- package/src/editor-manager/plugin/inserthtml.d.ts +0 -1
- package/src/editor-manager/plugin/inserthtml.js +18 -78
- package/src/editor-manager/plugin/link.js +3 -8
- package/src/editor-manager/plugin/lists.js +70 -159
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +0 -3
- package/src/editor-manager/plugin/ms-word-clean-up.js +85 -212
- package/src/editor-manager/plugin/nodecutter.js +2 -5
- package/src/editor-manager/plugin/selection-commands.d.ts +0 -2
- package/src/editor-manager/plugin/selection-commands.js +4 -209
- package/src/editor-manager/plugin/table.d.ts +1 -4
- package/src/editor-manager/plugin/table.js +49 -95
- package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +10 -20
- package/src/editor-manager/plugin/undo.d.ts +0 -1
- package/src/editor-manager/plugin/undo.js +1 -21
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +3 -4
- package/src/rich-text-editor/actions/base-quick-toolbar.js +10 -43
- package/src/rich-text-editor/actions/base-toolbar.js +34 -33
- package/src/rich-text-editor/actions/color-picker.d.ts +0 -1
- package/src/rich-text-editor/actions/color-picker.js +0 -10
- package/src/rich-text-editor/actions/count.js +1 -1
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +0 -1
- package/src/rich-text-editor/actions/dropdown-buttons.js +4 -8
- package/src/rich-text-editor/actions/emoji-picker.js +4 -4
- package/src/rich-text-editor/actions/enter-key.js +4 -8
- package/src/rich-text-editor/actions/format-painter.js +1 -4
- package/src/rich-text-editor/actions/full-screen.js +2 -3
- package/src/rich-text-editor/actions/html-editor.d.ts +2 -2
- package/src/rich-text-editor/actions/html-editor.js +42 -123
- package/src/rich-text-editor/actions/keyboard.js +1 -3
- package/src/rich-text-editor/actions/markdown-editor.js +1 -3
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +0 -3
- package/src/rich-text-editor/actions/paste-clean-up.js +14 -85
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +0 -8
- package/src/rich-text-editor/actions/quick-toolbar.js +9 -37
- package/src/rich-text-editor/actions/resize.js +1 -2
- package/src/rich-text-editor/actions/toolbar-action.js +1 -1
- package/src/rich-text-editor/actions/toolbar.d.ts +3 -2
- package/src/rich-text-editor/actions/toolbar.js +87 -18
- package/src/rich-text-editor/base/classes.d.ts +5 -0
- package/src/rich-text-editor/base/classes.js +5 -0
- package/src/rich-text-editor/base/constant.d.ts +0 -40
- package/src/rich-text-editor/base/constant.js +0 -209
- package/src/rich-text-editor/base/interface.d.ts +3 -37
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +3 -3
- package/src/rich-text-editor/base/rich-text-editor.d.ts +4 -7
- package/src/rich-text-editor/base/rich-text-editor.js +132 -156
- package/src/rich-text-editor/base/util.js +2 -11
- package/src/rich-text-editor/formatter/formatter.js +4 -16
- package/src/rich-text-editor/models/default-locale.js +26 -30
- package/src/rich-text-editor/models/items.js +2 -2
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.js +1 -1
- package/src/rich-text-editor/renderer/audio-module.d.ts +0 -1
- package/src/rich-text-editor/renderer/audio-module.js +4 -22
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +0 -2
- package/src/rich-text-editor/renderer/dialog-renderer.js +1 -12
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -2
- package/src/rich-text-editor/renderer/image-module.d.ts +1 -9
- package/src/rich-text-editor/renderer/image-module.js +168 -203
- package/src/rich-text-editor/renderer/link-module.js +1 -10
- package/src/rich-text-editor/renderer/table-module.d.ts +1 -8
- package/src/rich-text-editor/renderer/table-module.js +139 -301
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -3
- package/src/rich-text-editor/renderer/toolbar-renderer.js +9 -94
- package/src/rich-text-editor/renderer/video-module.d.ts +0 -3
- package/src/rich-text-editor/renderer/video-module.js +41 -82
- package/src/rich-text-editor/renderer/view-source.d.ts +0 -1
- package/src/rich-text-editor/renderer/view-source.js +4 -12
- package/src/selection/selection.js +0 -3
- package/styles/bootstrap-dark.css +53 -161
- package/styles/bootstrap.css +61 -162
- package/styles/bootstrap4.css +46 -146
- package/styles/bootstrap5-dark.css +46 -151
- package/styles/bootstrap5.css +46 -151
- package/styles/fabric-dark.css +40 -140
- package/styles/fabric.css +41 -141
- package/styles/fluent-dark.css +47 -165
- package/styles/fluent.css +47 -165
- package/styles/highcontrast-light.css +40 -140
- package/styles/highcontrast.css +41 -144
- package/styles/material-dark.css +41 -145
- package/styles/material.css +41 -145
- package/styles/material3-dark.css +50 -156
- package/styles/material3.css +50 -156
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +13 -17
- package/styles/rich-text-editor/_bootstrap-definition.scss +19 -22
- package/styles/rich-text-editor/_bootstrap4-definition.scss +7 -11
- package/styles/rich-text-editor/_bootstrap5-definition.scss +3 -7
- package/styles/rich-text-editor/_fabric-dark-definition.scss +2 -6
- package/styles/rich-text-editor/_fabric-definition.scss +3 -7
- package/styles/rich-text-editor/_fluent-definition.scss +9 -13
- package/styles/rich-text-editor/_fusionnew-definition.scss +3 -7
- package/styles/rich-text-editor/_highcontrast-definition.scss +3 -7
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +2 -6
- package/styles/rich-text-editor/_layout.scss +31 -133
- package/styles/rich-text-editor/_material-dark-definition.scss +2 -6
- package/styles/rich-text-editor/_material-definition.scss +2 -6
- package/styles/rich-text-editor/_material3-definition.scss +12 -16
- package/styles/rich-text-editor/_tailwind-definition.scss +19 -23
- package/styles/rich-text-editor/_theme.scss +23 -112
- package/styles/rich-text-editor/bootstrap-dark.css +53 -161
- package/styles/rich-text-editor/bootstrap.css +61 -162
- package/styles/rich-text-editor/bootstrap4.css +46 -146
- package/styles/rich-text-editor/bootstrap5-dark.css +46 -151
- package/styles/rich-text-editor/bootstrap5.css +46 -151
- package/styles/rich-text-editor/fabric-dark.css +40 -140
- package/styles/rich-text-editor/fabric.css +41 -141
- package/styles/rich-text-editor/fluent-dark.css +47 -165
- package/styles/rich-text-editor/fluent.css +47 -165
- package/styles/rich-text-editor/highcontrast-light.css +40 -140
- package/styles/rich-text-editor/highcontrast.css +41 -144
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap4.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap5.scss +2 -2
- package/styles/rich-text-editor/icons/_fabric-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_fabric.scss +2 -2
- package/styles/rich-text-editor/icons/_fluent.scss +2 -2
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +2 -2
- package/styles/rich-text-editor/icons/_highcontrast.scss +2 -2
- package/styles/rich-text-editor/icons/_material-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_material.scss +2 -2
- package/styles/rich-text-editor/icons/_material3.scss +2 -2
- package/styles/rich-text-editor/icons/_tailwind.scss +2 -2
- package/styles/rich-text-editor/material-dark.css +41 -145
- package/styles/rich-text-editor/material.css +41 -145
- package/styles/rich-text-editor/material3-dark.css +50 -156
- package/styles/rich-text-editor/material3.css +50 -156
- package/styles/rich-text-editor/tailwind-dark.css +63 -191
- package/styles/rich-text-editor/tailwind.css +63 -191
- package/styles/tailwind-dark.css +63 -191
- package/styles/tailwind.css +63 -191
- package/.eslintrc.json +0 -260
- package/src/global.d.ts +0 -1
- package/styles/rich-text-editor/_bds-definition.scss +0 -279
- package/styles/rich-text-editor/icons/_bds.scss +0 -348
|
@@ -21,7 +21,6 @@ export declare class ToolbarRenderer implements IRenderer {
|
|
|
21
21
|
private currentDropdown;
|
|
22
22
|
private tooltip;
|
|
23
23
|
private l10n;
|
|
24
|
-
private tooltipTargetEle;
|
|
25
24
|
/**
|
|
26
25
|
* Constructor for toolbar renderer module
|
|
27
26
|
*
|
|
@@ -58,8 +57,6 @@ export declare class ToolbarRenderer implements IRenderer {
|
|
|
58
57
|
* @deprecated
|
|
59
58
|
*/
|
|
60
59
|
renderDropDownButton(args: IDropDownModel): DropDownButton;
|
|
61
|
-
private mouseOutHandler;
|
|
62
|
-
private closeTooltip;
|
|
63
60
|
/**
|
|
64
61
|
* renderListDropDown method
|
|
65
62
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addClass, Browser, removeClass, formatUnit, isNullOrUndefined, isNullOrUndefined as isNOU
|
|
1
|
+
import { addClass, Browser, removeClass, formatUnit, isNullOrUndefined, isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
|
|
2
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';
|
|
@@ -8,7 +8,6 @@ import * as events from '../base/constant';
|
|
|
8
8
|
import { CLS_TOOLBAR, CLS_DROPDOWN_BTN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_INLINE_DROPDOWN, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_BULLETFORMATLIST_TB_BTN, CLS_NUMBERFORMATLIST_TB_BTN, CLS_LIST_PRIMARY_CONTENT } from '../base/classes';
|
|
9
9
|
import { ColorPicker } from '@syncfusion/ej2-inputs';
|
|
10
10
|
import { hasClass } from '../base/util';
|
|
11
|
-
import { ToolbarStatus } from '../../editor-manager/plugin/toolbar-status';
|
|
12
11
|
/**
|
|
13
12
|
* `Toolbar renderer` module is used to render toolbar in RichTextEditor.
|
|
14
13
|
*
|
|
@@ -32,7 +31,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
32
31
|
ToolbarRenderer.prototype.wireEvent = function () {
|
|
33
32
|
this.parent.on(events.destroy, this.unWireEvent, this);
|
|
34
33
|
this.parent.on(events.destroyTooltip, this.destroyTooltip, this);
|
|
35
|
-
this.parent.on(events.closeTooltip, this.closeTooltip, this);
|
|
36
34
|
};
|
|
37
35
|
ToolbarRenderer.prototype.destroyTooltip = function () {
|
|
38
36
|
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
@@ -45,8 +43,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
45
43
|
};
|
|
46
44
|
ToolbarRenderer.prototype.unWireEvent = function () {
|
|
47
45
|
this.parent.off(events.destroy, this.unWireEvent);
|
|
48
|
-
this.parent.off(events.destroyTooltip, this.destroyTooltip);
|
|
49
|
-
this.parent.off(events.closeTooltip, this.closeTooltip);
|
|
50
46
|
};
|
|
51
47
|
ToolbarRenderer.prototype.toolbarBeforeCreate = function (e) {
|
|
52
48
|
if (this.mode === 'Extended') {
|
|
@@ -66,8 +62,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
66
62
|
}
|
|
67
63
|
};
|
|
68
64
|
ToolbarRenderer.prototype.dropDownSelected = function (args) {
|
|
69
|
-
this.parent.notify(events.dropDownSelect,
|
|
70
|
-
this.destroyTooltip();
|
|
65
|
+
this.parent.notify(events.dropDownSelect, args);
|
|
71
66
|
};
|
|
72
67
|
ToolbarRenderer.prototype.beforeDropDownItemRender = function (args) {
|
|
73
68
|
if (this.parent.readonly || !this.parent.enabled) {
|
|
@@ -90,28 +85,17 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
90
85
|
break;
|
|
91
86
|
}
|
|
92
87
|
}
|
|
93
|
-
if (args.target.querySelector('.e-active')) {
|
|
94
|
-
args.cancel = true;
|
|
95
|
-
}
|
|
96
88
|
};
|
|
97
89
|
ToolbarRenderer.prototype.dropDownOpen = function (args) {
|
|
98
90
|
if (args.element.parentElement.getAttribute('id').indexOf('TableCell') > -1 && !isNOU(args.element.parentElement.querySelector('.e-cell-merge')) &&
|
|
99
91
|
(!isNOU(args.element.parentElement.querySelector('.e-cell-horizontal-split')) || !isNOU(args.element.parentElement.querySelector('.e-cell-vertical-split')))) {
|
|
100
92
|
var listEle = args.element.querySelectorAll('li');
|
|
101
|
-
|
|
102
|
-
if (selectedEles_1.length === 1) {
|
|
93
|
+
if (this.parent.inputElement.querySelectorAll('.e-cell-select').length === 1) {
|
|
103
94
|
addClass([listEle[0]], 'e-disabled');
|
|
104
95
|
removeClass([listEle[1], listEle[2]], 'e-disabled');
|
|
105
96
|
}
|
|
106
|
-
else if (
|
|
107
|
-
|
|
108
|
-
return element.tagName.toLowerCase() === selectedEles_1[0].tagName.toLowerCase();
|
|
109
|
-
})) {
|
|
110
|
-
addClass([listEle[0]], 'e-disabled');
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
removeClass([listEle[0]], 'e-disabled');
|
|
114
|
-
}
|
|
97
|
+
else if (this.parent.inputElement.querySelectorAll('.e-cell-select').length > 1) {
|
|
98
|
+
removeClass([listEle[0]], 'e-disabled');
|
|
115
99
|
addClass([listEle[1], listEle[2]], 'e-disabled');
|
|
116
100
|
}
|
|
117
101
|
}
|
|
@@ -157,7 +141,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
157
141
|
windowCollision: true,
|
|
158
142
|
position: 'BottomCenter'
|
|
159
143
|
});
|
|
160
|
-
this.tooltip.appendTo(args.target
|
|
144
|
+
this.tooltip.appendTo(args.target);
|
|
161
145
|
}
|
|
162
146
|
};
|
|
163
147
|
/**
|
|
@@ -259,23 +243,12 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
259
243
|
}
|
|
260
244
|
}
|
|
261
245
|
//Formats preselect
|
|
262
|
-
if (args.items[0].command === 'Formats'
|
|
263
|
-
var fontName_1 = [];
|
|
264
|
-
var formats_1 = [];
|
|
265
|
-
_this.parent.format.types.forEach(function (item) {
|
|
266
|
-
formats_1.push(item.value.toLocaleLowerCase());
|
|
267
|
-
});
|
|
268
|
-
_this.parent.fontFamily.items.forEach(function (item) {
|
|
269
|
-
fontName_1.push(item.value);
|
|
270
|
-
});
|
|
271
|
-
var toolbarStatus = ToolbarStatus.get(_this.parent.contentModule.getDocument(), _this.parent.contentModule.getEditPanel(), formats_1, null, fontName_1);
|
|
246
|
+
if (args.items[0].command === 'Formats') {
|
|
272
247
|
for (var index = 0; index < args.element.childNodes.length; index++) {
|
|
273
248
|
var divNode = _this.parent.createElement('div');
|
|
274
249
|
divNode.innerHTML = dropDown.content.trim();
|
|
275
|
-
if (
|
|
276
|
-
&& args.element.childNodes[index].textContent.trim() === divNode.textContent.trim())
|
|
277
|
-
((args.items[0].command === 'Formats' && !isNOU(toolbarStatus.formats) && _this.parent.format.types[index].value.toLowerCase() === toolbarStatus.formats.toLowerCase() && args.element.childNodes[index].classList.contains(_this.parent.format.types[index].cssClass))
|
|
278
|
-
|| (args.items[0].command === 'Font' && !isNOU(toolbarStatus.fontname) && _this.parent.fontFamily.items[index].value.toLowerCase() === toolbarStatus.fontname.toLowerCase() && args.element.childNodes[index].classList.contains(_this.parent.fontFamily.items[index].cssClass)))) {
|
|
250
|
+
if (divNode.textContent.trim() !== ''
|
|
251
|
+
&& args.element.childNodes[index].textContent.trim() === divNode.textContent.trim()) {
|
|
279
252
|
if (!args.element.childNodes[index].classList.contains('e-active')) {
|
|
280
253
|
addClass([args.element.childNodes[index]], 'e-active');
|
|
281
254
|
}
|
|
@@ -300,32 +273,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
300
273
|
popupElement.setAttribute('aria-owns', this.parent.getID());
|
|
301
274
|
return dropDown;
|
|
302
275
|
};
|
|
303
|
-
ToolbarRenderer.prototype.mouseOutHandler = function () {
|
|
304
|
-
if (!isNOU(this.tooltipTargetEle)) {
|
|
305
|
-
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
309
|
-
this.parent.contentModule.getDocument();
|
|
310
|
-
this.tooltipTargetEle = currentDocument.querySelector('[data-title]');
|
|
311
|
-
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
312
|
-
}
|
|
313
|
-
this.tooltipTargetEle.removeAttribute('data-title');
|
|
314
|
-
EventHandler.remove(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler);
|
|
315
|
-
};
|
|
316
|
-
ToolbarRenderer.prototype.closeTooltip = function (args) {
|
|
317
|
-
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
318
|
-
this.parent.contentModule.getDocument();
|
|
319
|
-
this.tooltipTargetEle = closest(args.target, '[data-tooltip-id]');
|
|
320
|
-
if (!isNOU(this.tooltipTargetEle) && this.parent.showTooltip && !isNOU(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
321
|
-
this.destroyTooltip();
|
|
322
|
-
if (!this.tooltipTargetEle.closest('.e-rte-quick-popup')) {
|
|
323
|
-
this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
|
|
324
|
-
this.tooltipTargetEle.removeAttribute('title');
|
|
325
|
-
EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
};
|
|
329
276
|
/**
|
|
330
277
|
* renderListDropDown method
|
|
331
278
|
*
|
|
@@ -335,7 +282,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
335
282
|
* @deprecated
|
|
336
283
|
*/
|
|
337
284
|
ToolbarRenderer.prototype.renderListDropDown = function (args) {
|
|
338
|
-
var _this = this;
|
|
339
285
|
// eslint-disable-next-line
|
|
340
286
|
var proxy = this;
|
|
341
287
|
var css = CLS_RTE_ELEMENTS + ' ' + CLS_TB_BTN + ((this.parent.inlineMode) ? (' ' + CLS_INLINE_DROPDOWN) : '');
|
|
@@ -351,37 +297,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
351
297
|
enableRtl: this.parent.enableRtl,
|
|
352
298
|
select: this.dropDownSelected.bind(this),
|
|
353
299
|
beforeOpen: function (args) {
|
|
354
|
-
if (proxy.parent.editorMode !== 'Markdown') {
|
|
355
|
-
var startNode = proxy.parent.getRange().startContainer.parentElement;
|
|
356
|
-
var listElem = startNode.closest('LI');
|
|
357
|
-
var currentLiElem = !isNOU(listElem) ? listElem.parentElement : null;
|
|
358
|
-
if (!isNOU(currentLiElem) && (currentLiElem.nodeName === 'OL' || currentLiElem.nodeName === 'UL')) {
|
|
359
|
-
if (currentLiElem.nodeName === 'UL' && args.items[0].subCommand === 'NumberFormatList') {
|
|
360
|
-
addClass([args.element.childNodes[0]], 'e-active');
|
|
361
|
-
}
|
|
362
|
-
else if (currentLiElem.nodeName === 'OL' && args.items[0].subCommand === 'BulletFormatList') {
|
|
363
|
-
addClass([args.element.childNodes[0]], 'e-active');
|
|
364
|
-
}
|
|
365
|
-
else {
|
|
366
|
-
var currentListStyle = currentLiElem.style.listStyleType.split('-').join('').toLocaleLowerCase();
|
|
367
|
-
currentListStyle = currentListStyle === 'decimal' ? 'number' : currentListStyle;
|
|
368
|
-
for (var index = 0; index < args.element.childNodes.length; index++) {
|
|
369
|
-
if (currentListStyle === args.element.childNodes[index].innerHTML.split(' ').join('').toLocaleLowerCase()) {
|
|
370
|
-
addClass([args.element.childNodes[index]], 'e-active');
|
|
371
|
-
break;
|
|
372
|
-
}
|
|
373
|
-
else if (currentListStyle === '' && args.element.childNodes[index].innerHTML !== 'None') {
|
|
374
|
-
addClass([args.element.childNodes[index]], 'e-active');
|
|
375
|
-
break;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
381
|
-
addClass([args.element.childNodes[0]], 'e-active');
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
_this.closeTooltip({ target: args.event.target });
|
|
385
300
|
if (proxy.parent.readonly || !proxy.parent.enabled) {
|
|
386
301
|
args.cancel = true;
|
|
387
302
|
return;
|
|
@@ -23,7 +23,6 @@ export declare class Video {
|
|
|
23
23
|
private isAllowedTypes;
|
|
24
24
|
private pageX;
|
|
25
25
|
private pageY;
|
|
26
|
-
private mouseX;
|
|
27
26
|
private dialogRenderObj;
|
|
28
27
|
private deletedVid;
|
|
29
28
|
private changedWidthValue;
|
|
@@ -52,7 +51,6 @@ export declare class Video {
|
|
|
52
51
|
private vidResizePos;
|
|
53
52
|
private calcPos;
|
|
54
53
|
private setAspectRatio;
|
|
55
|
-
private updateVidEleWidth;
|
|
56
54
|
private pixToPerc;
|
|
57
55
|
private vidDupMouseMove;
|
|
58
56
|
private resizing;
|
|
@@ -61,7 +59,6 @@ export declare class Video {
|
|
|
61
59
|
private resizeBtnInit;
|
|
62
60
|
private onToolbarAction;
|
|
63
61
|
private onKeyDown;
|
|
64
|
-
private handleSelectAll;
|
|
65
62
|
private openDialog;
|
|
66
63
|
private showDialog;
|
|
67
64
|
private closeDialog;
|
|
@@ -13,7 +13,6 @@ var Video = /** @class */ (function () {
|
|
|
13
13
|
this.isAllowedTypes = true;
|
|
14
14
|
this.pageX = null;
|
|
15
15
|
this.pageY = null;
|
|
16
|
-
this.mouseX = null;
|
|
17
16
|
this.deletedVid = [];
|
|
18
17
|
this.parent = parent;
|
|
19
18
|
this.rteID = parent.element.id;
|
|
@@ -144,7 +143,7 @@ var Video = /** @class */ (function () {
|
|
|
144
143
|
var dialogContent = this.vidsizeInput(e);
|
|
145
144
|
var selectObj_1 = { args: e.args, selfVideo: this, selection: e.selection, selectNode: e.selectNode };
|
|
146
145
|
this.dialogObj.setProperties({
|
|
147
|
-
width: '290px', header: vidSizeHeader, content: dialogContent,
|
|
146
|
+
height: 'inherit', width: '290px', header: vidSizeHeader, content: dialogContent,
|
|
148
147
|
buttons: [{
|
|
149
148
|
// eslint-disable-next-line
|
|
150
149
|
click: function (e) {
|
|
@@ -413,50 +412,62 @@ var Video = /** @class */ (function () {
|
|
|
413
412
|
if (isNullOrUndefined(vidEleStyle)) {
|
|
414
413
|
return;
|
|
415
414
|
}
|
|
416
|
-
|
|
415
|
+
// eslint-disable-next-line
|
|
417
416
|
var width = vidEleStyle.width !== '' ? vidEleStyle.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(vidEleStyle.width) :
|
|
418
417
|
parseInt(vidEleStyle.width, 10) : vid.style.width !== '' ? vid.style.width : vid.width;
|
|
419
418
|
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 */
|
|
423
419
|
if (width > height) {
|
|
424
420
|
vid.style.minWidth = this.parent.insertVideoSettings.minWidth === 0 ? '200px' : formatUnit(this.parent.insertVideoSettings.minWidth);
|
|
425
421
|
vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '90px' : formatUnit(this.parent.insertVideoSettings.minHeight);
|
|
426
422
|
if (this.parent.insertVideoSettings.resizeByPercent) {
|
|
427
|
-
|
|
423
|
+
if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
|
|
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');
|
|
428
432
|
}
|
|
429
433
|
else if ((vid.style.width === '' && vid.style.height !== '') || (vidEleStyle.width === '' && vidEleStyle.height !== '')) {
|
|
430
434
|
vid.style.height = expectedY + 'px';
|
|
431
435
|
}
|
|
432
436
|
else if ((vid.style.width !== '' && vid.style.height === '') || (vidEleStyle.width !== '' && vidEleStyle.height === '')) {
|
|
433
|
-
var currentWidth = ((width / height * expectedY) +
|
|
434
|
-
width / height) <
|
|
437
|
+
var currentWidth = ((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY) +
|
|
438
|
+
parseInt(width.toString(), 10) / parseInt(height.toString(), 10)) <
|
|
435
439
|
(this.parent.inputElement.getBoundingClientRect().right - 32) ?
|
|
436
|
-
((width / height * expectedY) +
|
|
437
|
-
width / height) :
|
|
440
|
+
((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY) +
|
|
441
|
+
parseInt(width.toString(), 10) / parseInt(height.toString(), 10)) :
|
|
438
442
|
(this.parent.inputElement.getBoundingClientRect().right - 32);
|
|
439
443
|
vid.style.width = currentWidth.toString() + 'px';
|
|
440
444
|
}
|
|
441
445
|
else if (vid.style.width !== '' || vidEleStyle.width !== '') {
|
|
442
|
-
var currentWidth = (width / height * expectedY) <
|
|
446
|
+
var currentWidth = (parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY) <
|
|
443
447
|
(this.parent.inputElement.getBoundingClientRect().right - 32) ?
|
|
444
|
-
(width / height * expectedY) :
|
|
448
|
+
(parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY) :
|
|
445
449
|
(this.parent.inputElement.getBoundingClientRect().right - 32);
|
|
446
450
|
vid.style.width = currentWidth + 'px';
|
|
447
451
|
vid.style.height = expectedY + 'px';
|
|
448
452
|
}
|
|
449
453
|
else {
|
|
450
|
-
vid.setAttribute('width', (parseInt(((width / height * expectedY) + width / height).toString(), 10)).toString());
|
|
454
|
+
vid.setAttribute('width', (parseInt(((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY) + parseInt(width.toString(), 10) / parseInt(height.toString(), 10)).toString(), 10)).toString());
|
|
451
455
|
}
|
|
452
456
|
}
|
|
453
457
|
else if (height > width) {
|
|
454
458
|
if (this.parent.insertVideoSettings.resizeByPercent) {
|
|
455
|
-
|
|
459
|
+
if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
|
|
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');
|
|
456
467
|
}
|
|
457
468
|
else if (vid.style.width !== '' || vidEleStyle.width !== '') {
|
|
458
469
|
vid.style.width = expectedX + 'px';
|
|
459
|
-
vid.style.height = (height / width * expectedX) + 'px';
|
|
470
|
+
vid.style.height = (parseInt(height.toString(), 10) / parseInt(width.toString(), 10) * expectedX) + 'px';
|
|
460
471
|
}
|
|
461
472
|
else {
|
|
462
473
|
vid.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - vid.getBoundingClientRect().left).toString() : expectedX.toString());
|
|
@@ -474,23 +485,6 @@ var Video = /** @class */ (function () {
|
|
|
474
485
|
}
|
|
475
486
|
}
|
|
476
487
|
};
|
|
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
|
-
};
|
|
494
488
|
Video.prototype.pixToPerc = function (expected, parentEle) {
|
|
495
489
|
return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
|
|
496
490
|
};
|
|
@@ -516,6 +510,7 @@ var Video = /** @class */ (function () {
|
|
|
516
510
|
_this.setAspectRatio(_this.videoEle, parseInt(width, 10), parseInt(height, 10), args);
|
|
517
511
|
_this.resizeVidDupPos(_this.videoEle);
|
|
518
512
|
_this.vidResizePos(_this.videoEle, _this.vidResizeDiv);
|
|
513
|
+
_this.parent.setContentHeight('', false);
|
|
519
514
|
}
|
|
520
515
|
});
|
|
521
516
|
};
|
|
@@ -531,7 +526,6 @@ var Video = /** @class */ (function () {
|
|
|
531
526
|
var height = parseInt(this.vidDupPos.height, 10) + mouseY;
|
|
532
527
|
this.pageX = pageX;
|
|
533
528
|
this.pageY = pageY;
|
|
534
|
-
this.mouseX = mouseX;
|
|
535
529
|
if (this.resizeBtnStat.botRight) {
|
|
536
530
|
this.vidDupMouseMove(width + 'px', height + 'px', e);
|
|
537
531
|
}
|
|
@@ -698,14 +692,6 @@ var Video = /** @class */ (function () {
|
|
|
698
692
|
originalEvent.preventDefault();
|
|
699
693
|
break;
|
|
700
694
|
}
|
|
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);
|
|
709
695
|
};
|
|
710
696
|
Video.prototype.openDialog = function (isInternal, event, selection, ele, parentEle) {
|
|
711
697
|
var range;
|
|
@@ -817,7 +803,7 @@ var Video = /** @class */ (function () {
|
|
|
817
803
|
this.parent.formatter.saveData();
|
|
818
804
|
}
|
|
819
805
|
e.selection.restore();
|
|
820
|
-
this.parent.formatter.process(this.parent, e.args, e.args
|
|
806
|
+
this.parent.formatter.process(this.parent, e.args, e.args, {
|
|
821
807
|
selectNode: e.selectNode,
|
|
822
808
|
subCommand: e.args.item.subCommand
|
|
823
809
|
});
|
|
@@ -883,7 +869,6 @@ var Video = /** @class */ (function () {
|
|
|
883
869
|
if (e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight) {
|
|
884
870
|
}
|
|
885
871
|
else {
|
|
886
|
-
this.parent.notify(events.documentClickClosedBy, { closedBy: "outside click" });
|
|
887
872
|
this.dialogObj.hide({ returnValue: true });
|
|
888
873
|
this.parent.isBlur = true;
|
|
889
874
|
dispatchEvent(this.parent.element, 'focusout');
|
|
@@ -907,9 +892,6 @@ var Video = /** @class */ (function () {
|
|
|
907
892
|
this.prevSelectedVidEle.style.outline = '';
|
|
908
893
|
}
|
|
909
894
|
}
|
|
910
|
-
if (this.parent.inlineMode.enable && target && this.dialogObj && !closest(target, '#' + this.dialogObj.element.id)) {
|
|
911
|
-
this.dialogObj.hide();
|
|
912
|
-
}
|
|
913
895
|
};
|
|
914
896
|
Video.prototype.removeResizeEle = function () {
|
|
915
897
|
EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
|
|
@@ -927,7 +909,7 @@ var Video = /** @class */ (function () {
|
|
|
927
909
|
}
|
|
928
910
|
var subCommand = (e.args.item) ?
|
|
929
911
|
e.args.item.subCommand : 'Break';
|
|
930
|
-
this.parent.formatter.process(this.parent, e.args, e.args
|
|
912
|
+
this.parent.formatter.process(this.parent, e.args, e.args, { selectNode: e.selectNode, subCommand: subCommand });
|
|
931
913
|
};
|
|
932
914
|
Video.prototype.inline = function (e) {
|
|
933
915
|
if (e.selectNode[0].nodeName !== 'VIDEO' && !this.isEmbedVidElem(e.selectNode[0])) {
|
|
@@ -935,12 +917,12 @@ var Video = /** @class */ (function () {
|
|
|
935
917
|
}
|
|
936
918
|
var subCommand = (e.args.item) ?
|
|
937
919
|
e.args.item.subCommand : 'Inline';
|
|
938
|
-
this.parent.formatter.process(this.parent, e.args, e.args
|
|
920
|
+
this.parent.formatter.process(this.parent, e.args, e.args, { selectNode: e.selectNode, subCommand: subCommand });
|
|
939
921
|
};
|
|
940
922
|
Video.prototype.alignVideo = function (e, type) {
|
|
941
923
|
var subCommand = (e.args.item) ?
|
|
942
924
|
e.args.item.subCommand : type;
|
|
943
|
-
this.parent.formatter.process(this.parent, e.args, e.args
|
|
925
|
+
this.parent.formatter.process(this.parent, e.args, e.args, { selectNode: e.selectNode, subCommand: subCommand });
|
|
944
926
|
};
|
|
945
927
|
Video.prototype.editAreaClickHandler = function (e) {
|
|
946
928
|
if (this.parent.readonly) {
|
|
@@ -1084,7 +1066,7 @@ var Video = /** @class */ (function () {
|
|
|
1084
1066
|
_this.uploadObj.removing();
|
|
1085
1067
|
}
|
|
1086
1068
|
_this.parent.isBlur = false;
|
|
1087
|
-
if (event &&
|
|
1069
|
+
if (event && event.event.returnValue) {
|
|
1088
1070
|
if (_this.parent.editorMode === 'HTML') {
|
|
1089
1071
|
selection.restore();
|
|
1090
1072
|
}
|
|
@@ -1176,44 +1158,26 @@ var Video = /** @class */ (function () {
|
|
|
1176
1158
|
}
|
|
1177
1159
|
}
|
|
1178
1160
|
});
|
|
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;
|
|
1191
1161
|
var embedUrlBtn = new RadioButton({
|
|
1192
1162
|
label: this.i10n.getConstant('embeddedCode'),
|
|
1193
|
-
checked:
|
|
1163
|
+
checked: true,
|
|
1194
1164
|
name: 'URL',
|
|
1195
1165
|
created: function () {
|
|
1196
|
-
|
|
1197
|
-
urlContent.appendChild(_this.embedInputUrl);
|
|
1198
|
-
}
|
|
1166
|
+
urlContent.appendChild(_this.embedInputUrl);
|
|
1199
1167
|
},
|
|
1200
1168
|
change: function () {
|
|
1201
1169
|
urlContent.innerHTML = '';
|
|
1170
|
+
_this.inputUrl.value = '';
|
|
1202
1171
|
urlContent.appendChild(_this.embedInputUrl);
|
|
1203
1172
|
}
|
|
1204
1173
|
});
|
|
1205
1174
|
embedUrlBtn.appendTo(videoUrl.querySelector('#embedURL'));
|
|
1206
1175
|
var webUrlBtn = new RadioButton({
|
|
1207
1176
|
label: this.i10n.getConstant('webUrl'),
|
|
1208
|
-
checked: isWebUrl,
|
|
1209
1177
|
name: 'URL',
|
|
1210
|
-
created: function () {
|
|
1211
|
-
if (isWebUrl) {
|
|
1212
|
-
urlContent.appendChild(_this.inputUrl);
|
|
1213
|
-
}
|
|
1214
|
-
},
|
|
1215
1178
|
change: function () {
|
|
1216
1179
|
urlContent.innerHTML = '';
|
|
1180
|
+
_this.embedInputUrl.value = '';
|
|
1217
1181
|
urlContent.appendChild(_this.inputUrl);
|
|
1218
1182
|
}
|
|
1219
1183
|
});
|
|
@@ -1343,12 +1307,8 @@ var Video = /** @class */ (function () {
|
|
|
1343
1307
|
_this.parent.trigger(events.fileRemoving, e, function (e) {
|
|
1344
1308
|
proxy.isVideoUploaded = false;
|
|
1345
1309
|
_this.dialogObj.getButtons(0).element.disabled = true;
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
}
|
|
1349
|
-
if (proxy.embedInputUrl.getAttribute('disabled')) {
|
|
1350
|
-
proxy.embedInputUrl.removeAttribute('disabled');
|
|
1351
|
-
}
|
|
1310
|
+
//proxy.inputUrl.removeAttribute('disabled');
|
|
1311
|
+
proxy.embedInputUrl.removeAttribute('disabled');
|
|
1352
1312
|
if (proxy.uploadUrl) {
|
|
1353
1313
|
proxy.uploadUrl.url = '';
|
|
1354
1314
|
}
|
|
@@ -1409,11 +1369,10 @@ var Video = /** @class */ (function () {
|
|
|
1409
1369
|
this.selection = proxy.parent.formatter.editorManager.nodeSelection.save(range, proxy.contentModule.getDocument());
|
|
1410
1370
|
this.selectParent = proxy.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
1411
1371
|
}
|
|
1412
|
-
var
|
|
1413
|
-
var name_1 = webUrlBtn.checked ? url.split('/')[url.split('/').length - 1] : embedUrl;
|
|
1372
|
+
var name_1 = url !== '' ? url.split('/')[url.split('/').length - 1] : embedUrl;
|
|
1414
1373
|
var value = {
|
|
1415
1374
|
cssClass: (proxy.parent.insertVideoSettings.layoutOption === 'Inline' ? classes.CLS_VIDEOINLINE : classes.CLS_VIDEOBREAK),
|
|
1416
|
-
url: url, selection: this.selection, fileName: name_1, isEmbedUrl:
|
|
1375
|
+
url: url, selection: this.selection, fileName: name_1, isEmbedUrl: embedUrl !== '' ? true : false,
|
|
1417
1376
|
selectParent: this.selectParent, width: {
|
|
1418
1377
|
width: proxy.parent.insertVideoSettings.width, minWidth: proxy.parent.insertVideoSettings.minWidth,
|
|
1419
1378
|
maxWidth: proxy.parent.getInsertImgMaxWidth()
|
|
@@ -108,7 +108,6 @@ var ViewSource = /** @class */ (function () {
|
|
|
108
108
|
* @deprecated
|
|
109
109
|
*/
|
|
110
110
|
ViewSource.prototype.sourceCode = function (args) {
|
|
111
|
-
var _this = this;
|
|
112
111
|
this.parent.notify(events.hidePopup, {});
|
|
113
112
|
this.parent.isBlur = false;
|
|
114
113
|
this.parent.trigger(events.actionBegin, { requestType: 'SourceCode', targetItem: 'SourceCode', args: args });
|
|
@@ -135,6 +134,7 @@ var ViewSource = /** @class */ (function () {
|
|
|
135
134
|
rteContent.appendChild(this.previewElement);
|
|
136
135
|
this.parent.element.appendChild(rteContent);
|
|
137
136
|
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';
|
|
@@ -155,23 +155,17 @@ var ViewSource = /** @class */ (function () {
|
|
|
155
155
|
removeClass([this.parent.getToolbar()], [CLS_EXPAND_OPEN]);
|
|
156
156
|
}
|
|
157
157
|
removeClass(tbItems, [CLS_ACTIVE]);
|
|
158
|
-
|
|
159
|
-
this.parent.setContentHeight('SourceCode', isExpand);
|
|
158
|
+
this.parent.setContentHeight('sourceCode', true);
|
|
160
159
|
this.wireEvent(this.previewElement);
|
|
161
160
|
this.unWireBaseKeyDown();
|
|
162
161
|
this.previewElement.focus();
|
|
163
162
|
this.parent.updateValue();
|
|
164
163
|
if (!isNullOrUndefined(this.parent.placeholder) && !this.parent.iframeSettings.enable) {
|
|
165
164
|
var placeHolderWrapper = this.parent.element.querySelector('.rte-placeholder.e-rte-placeholder');
|
|
166
|
-
|
|
167
|
-
placeHolderWrapper.style.display = 'none';
|
|
168
|
-
}
|
|
165
|
+
placeHolderWrapper.style.display = 'none';
|
|
169
166
|
}
|
|
170
167
|
this.parent.trigger(events.actionComplete, { requestType: 'SourceCode', targetItem: 'SourceCode', args: args });
|
|
171
168
|
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
|
-
}
|
|
175
169
|
};
|
|
176
170
|
/**
|
|
177
171
|
* updateSourceCode method
|
|
@@ -221,8 +215,7 @@ var ViewSource = /** @class */ (function () {
|
|
|
221
215
|
if (this.parent.getToolbar()) {
|
|
222
216
|
removeClass([this.parent.getToolbar()], [CLS_EXPAND_OPEN]);
|
|
223
217
|
}
|
|
224
|
-
|
|
225
|
-
this.parent.setContentHeight('Preview', isExpand);
|
|
218
|
+
this.parent.setContentHeight('preview', true);
|
|
226
219
|
this.unWireEvent();
|
|
227
220
|
this.wireBaseKeyDown();
|
|
228
221
|
this.contentModule.getEditPanel().focus();
|
|
@@ -234,7 +227,6 @@ var ViewSource = /** @class */ (function () {
|
|
|
234
227
|
this.parent.trigger(events.actionComplete, { requestType: 'Preview', targetItem: 'Preview', args: args });
|
|
235
228
|
this.parent.formatter.enableUndo(this.parent);
|
|
236
229
|
this.parent.addAudioVideoWrapper();
|
|
237
|
-
clearTimeout(this.codeViewTimeInterval);
|
|
238
230
|
this.parent.invokeChangeEvent();
|
|
239
231
|
this.parent.notify(events.tableclass, {});
|
|
240
232
|
};
|
|
@@ -90,9 +90,6 @@ 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
|
-
}
|
|
96
93
|
if (nodeCollection.indexOf(startNode.firstChild) === -1 && startNode.firstChild && !this.isChildNode(nodeCollection, startNode)) {
|
|
97
94
|
return startNode.firstChild;
|
|
98
95
|
}
|