@syncfusion/ej2-richtexteditor 24.1.41 → 24.1.43-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 +259 -259
- package/CHANGELOG.md +1927 -1775
- package/README.md +76 -76
- package/dist/ej2-richtexteditor.umd.min.js +1 -10
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +2601 -1077
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +2706 -1181
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/helpers/e2e/index.js +3 -3
- package/helpers/e2e/rte-helper.js +13 -13
- package/license +9 -9
- package/package.json +74 -74
- package/src/common/config.d.ts +7 -0
- package/src/common/config.js +11 -0
- package/src/common/constant.d.ts +6 -0
- package/src/common/constant.js +6 -0
- package/src/common/interface.d.ts +19 -7
- 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/classes.d.ts +1 -1
- package/src/editor-manager/base/classes.js +1 -1
- 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 +8 -3
- package/src/editor-manager/base/editor-manager.js +62 -3
- package/src/editor-manager/base/enum.d.ts +2 -2
- package/src/editor-manager/base/interface.d.ts +17 -9
- package/src/editor-manager/base/types.d.ts +1 -1
- package/src/editor-manager/plugin/alignments.d.ts +2 -2
- package/src/editor-manager/plugin/alignments.js +2 -2
- package/src/editor-manager/plugin/audio.d.ts +3 -3
- package/src/editor-manager/plugin/audio.js +3 -3
- package/src/editor-manager/plugin/clearformat-exec.d.ts +2 -2
- package/src/editor-manager/plugin/clearformat-exec.js +2 -2
- package/src/editor-manager/plugin/clearformat.d.ts +1 -1
- package/src/editor-manager/plugin/clearformat.js +1 -1
- package/src/editor-manager/plugin/dom-node.d.ts +39 -35
- package/src/editor-manager/plugin/dom-node.js +203 -49
- package/src/editor-manager/plugin/format-painter-actions.d.ts +2 -1
- package/src/editor-manager/plugin/format-painter-actions.js +20 -2
- package/src/editor-manager/plugin/formats.d.ts +3 -2
- package/src/editor-manager/plugin/formats.js +40 -5
- package/src/editor-manager/plugin/image.d.ts +3 -3
- package/src/editor-manager/plugin/image.js +15 -19
- package/src/editor-manager/plugin/indents.d.ts +2 -2
- package/src/editor-manager/plugin/indents.js +2 -2
- package/src/editor-manager/plugin/insert-methods.d.ts +4 -4
- package/src/editor-manager/plugin/insert-methods.js +4 -4
- package/src/editor-manager/plugin/insert-text.d.ts +2 -2
- package/src/editor-manager/plugin/insert-text.js +2 -2
- package/src/editor-manager/plugin/inserthtml-exec.d.ts +2 -2
- package/src/editor-manager/plugin/inserthtml-exec.js +2 -2
- package/src/editor-manager/plugin/inserthtml.d.ts +3 -2
- package/src/editor-manager/plugin/inserthtml.js +64 -7
- package/src/editor-manager/plugin/isformatted.d.ts +8 -8
- package/src/editor-manager/plugin/isformatted.js +8 -8
- package/src/editor-manager/plugin/link.d.ts +2 -2
- package/src/editor-manager/plugin/link.js +6 -3
- package/src/editor-manager/plugin/lists.d.ts +2 -2
- package/src/editor-manager/plugin/lists.js +123 -67
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +4 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +213 -86
- package/src/editor-manager/plugin/nodecutter.d.ts +6 -6
- package/src/editor-manager/plugin/nodecutter.js +8 -8
- package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
- package/src/editor-manager/plugin/selection-commands.js +127 -4
- package/src/editor-manager/plugin/selection-exec.d.ts +2 -2
- package/src/editor-manager/plugin/selection-exec.js +2 -2
- package/src/editor-manager/plugin/table.d.ts +2 -3
- package/src/editor-manager/plugin/table.js +35 -32
- package/src/editor-manager/plugin/toolbar-status.d.ts +4 -4
- package/src/editor-manager/plugin/toolbar-status.js +22 -12
- package/src/editor-manager/plugin/undo.d.ts +7 -6
- package/src/editor-manager/plugin/undo.js +27 -7
- package/src/editor-manager/plugin/video.d.ts +3 -3
- package/src/editor-manager/plugin/video.js +3 -3
- package/src/markdown-parser/base/interface.d.ts +10 -10
- package/src/markdown-parser/base/markdown-parser.d.ts +3 -3
- package/src/markdown-parser/base/markdown-parser.js +3 -3
- package/src/markdown-parser/base/types.d.ts +1 -1
- package/src/markdown-parser/plugin/clearformat.d.ts +2 -2
- package/src/markdown-parser/plugin/clearformat.js +2 -2
- package/src/markdown-parser/plugin/formats.d.ts +2 -2
- package/src/markdown-parser/plugin/formats.js +2 -2
- package/src/markdown-parser/plugin/insert-text.d.ts +2 -2
- package/src/markdown-parser/plugin/insert-text.js +2 -2
- package/src/markdown-parser/plugin/link.d.ts +2 -2
- package/src/markdown-parser/plugin/link.js +2 -2
- package/src/markdown-parser/plugin/markdown-selection.d.ts +14 -14
- package/src/markdown-parser/plugin/markdown-selection.js +14 -14
- package/src/markdown-parser/plugin/md-selection-formats.d.ts +1 -1
- package/src/markdown-parser/plugin/md-selection-formats.js +1 -1
- package/src/markdown-parser/plugin/table.d.ts +3 -3
- package/src/markdown-parser/plugin/table.js +3 -3
- package/src/markdown-parser/plugin/undo.d.ts +6 -6
- package/src/markdown-parser/plugin/undo.js +6 -6
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +12 -12
- package/src/rich-text-editor/actions/base-quick-toolbar.js +57 -20
- package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
- package/src/rich-text-editor/actions/base-toolbar.js +35 -37
- package/src/rich-text-editor/actions/color-picker.d.ts +3 -2
- package/src/rich-text-editor/actions/color-picker.js +12 -2
- package/src/rich-text-editor/actions/count.d.ts +3 -3
- package/src/rich-text-editor/actions/count.js +4 -4
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
- package/src/rich-text-editor/actions/dropdown-buttons.js +23 -4
- package/src/rich-text-editor/actions/emoji-picker.d.ts +1 -1
- package/src/rich-text-editor/actions/emoji-picker.js +4 -4
- package/src/rich-text-editor/actions/enter-key.js +4 -3
- package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
- package/src/rich-text-editor/actions/full-screen.js +6 -5
- package/src/rich-text-editor/actions/html-editor.d.ts +5 -5
- package/src/rich-text-editor/actions/html-editor.js +129 -45
- package/src/rich-text-editor/actions/keyboard-model.d.ts +16 -16
- package/src/rich-text-editor/actions/keyboard.d.ts +1 -1
- package/src/rich-text-editor/actions/keyboard.js +23 -21
- package/src/rich-text-editor/actions/markdown-editor.d.ts +2 -2
- package/src/rich-text-editor/actions/markdown-editor.js +5 -3
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +4 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +87 -12
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +16 -9
- package/src/rich-text-editor/actions/quick-toolbar.js +33 -18
- 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 +15 -16
- package/src/rich-text-editor/actions/toolbar.js +31 -100
- package/src/rich-text-editor/actions/xhtml-validation.d.ts +1 -1
- package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
- package/src/rich-text-editor/base/classes.d.ts +121 -126
- package/src/rich-text-editor/base/classes.js +121 -126
- package/src/rich-text-editor/base/constant.d.ts +190 -150
- package/src/rich-text-editor/base/constant.js +359 -150
- package/src/rich-text-editor/base/enum.d.ts +1 -1
- package/src/rich-text-editor/base/enum.js +1 -1
- package/src/rich-text-editor/base/interface.d.ts +87 -53
- package/src/rich-text-editor/base/interface.js +1 -1
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +891 -891
- package/src/rich-text-editor/base/rich-text-editor.d.ts +68 -65
- package/src/rich-text-editor/base/rich-text-editor.js +232 -199
- package/src/rich-text-editor/base/util.d.ts +5 -1
- package/src/rich-text-editor/base/util.js +47 -4
- package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
- package/src/rich-text-editor/formatter/formatter.js +23 -12
- package/src/rich-text-editor/formatter/html-formatter.d.ts +2 -2
- package/src/rich-text-editor/formatter/html-formatter.js +15 -15
- package/src/rich-text-editor/formatter/markdown-formatter.d.ts +2 -2
- package/src/rich-text-editor/formatter/markdown-formatter.js +15 -15
- package/src/rich-text-editor/models/default-locale.js +30 -26
- package/src/rich-text-editor/models/iframe-settings-model.d.ts +26 -26
- package/src/rich-text-editor/models/iframe-settings.js +19 -19
- package/src/rich-text-editor/models/inline-mode-model.d.ts +11 -11
- package/src/rich-text-editor/models/inline-mode.js +19 -19
- package/src/rich-text-editor/models/items.js +2 -2
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +760 -760
- package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.js +20 -20
- package/src/rich-text-editor/renderer/audio-module.d.ts +2 -1
- package/src/rich-text-editor/renderer/audio-module.js +14 -1
- package/src/rich-text-editor/renderer/content-renderer.d.ts +6 -6
- package/src/rich-text-editor/renderer/content-renderer.js +6 -6
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +4 -2
- package/src/rich-text-editor/renderer/dialog-renderer.js +14 -3
- package/src/rich-text-editor/renderer/iframe-content-renderer.d.ts +4 -4
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +19 -18
- package/src/rich-text-editor/renderer/image-module.d.ts +10 -2
- package/src/rich-text-editor/renderer/image-module.js +200 -168
- package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/link-module.js +11 -2
- package/src/rich-text-editor/renderer/markdown-renderer.d.ts +6 -6
- package/src/rich-text-editor/renderer/markdown-renderer.js +6 -6
- package/src/rich-text-editor/renderer/popup-renderer.d.ts +5 -5
- package/src/rich-text-editor/renderer/popup-renderer.js +5 -5
- package/src/rich-text-editor/renderer/render.d.ts +2 -2
- package/src/rich-text-editor/renderer/render.js +2 -2
- package/src/rich-text-editor/renderer/table-module.d.ts +9 -2
- package/src/rich-text-editor/renderer/table-module.js +289 -137
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +13 -9
- package/src/rich-text-editor/renderer/toolbar-renderer.js +103 -24
- package/src/rich-text-editor/renderer/video-module.d.ts +4 -1
- package/src/rich-text-editor/renderer/video-module.js +62 -35
- package/src/rich-text-editor/renderer/view-source.d.ts +7 -6
- package/src/rich-text-editor/renderer/view-source.js +18 -10
- package/src/rich-text-editor/services/renderer-factory.d.ts +3 -3
- package/src/rich-text-editor/services/renderer-factory.js +3 -3
- package/src/rich-text-editor/services/service-locator.d.ts +3 -3
- package/src/rich-text-editor/services/service-locator.js +3 -3
- package/src/selection/selection.d.ts +22 -22
- package/src/selection/selection.js +25 -22
- package/styles/_all.scss +1 -1
- package/styles/bootstrap-dark.css +153 -49
- package/styles/bootstrap.css +158 -57
- package/styles/bootstrap4.css +145 -45
- package/styles/bootstrap5-dark.css +150 -45
- package/styles/bootstrap5.css +150 -45
- package/styles/fabric-dark.css +139 -39
- package/styles/fabric.css +140 -40
- package/styles/fluent-dark.css +147 -41
- package/styles/fluent.css +147 -41
- package/styles/highcontrast-light.css +139 -39
- package/styles/highcontrast.css +143 -40
- package/styles/material-dark.css +143 -39
- package/styles/material.css +143 -39
- package/styles/material3-dark.css +155 -49
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +155 -49
- package/styles/material3.scss +1 -1
- package/styles/rich-text-editor/_all.scss +2 -2
- package/styles/rich-text-editor/_bds-definition.scss +279 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +281 -277
- package/styles/rich-text-editor/_bootstrap-definition.scss +337 -334
- package/styles/rich-text-editor/_bootstrap4-definition.scss +464 -460
- package/styles/rich-text-editor/_bootstrap5-definition.scss +266 -262
- package/styles/rich-text-editor/_fabric-dark-definition.scss +263 -259
- package/styles/rich-text-editor/_fabric-definition.scss +261 -257
- package/styles/rich-text-editor/_fluent-definition.scss +267 -263
- package/styles/rich-text-editor/_fusionnew-definition.scss +265 -261
- package/styles/rich-text-editor/_highcontrast-definition.scss +261 -257
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +261 -257
- package/styles/rich-text-editor/_layout.scss +2249 -2147
- package/styles/rich-text-editor/_material-dark-definition.scss +266 -262
- package/styles/rich-text-editor/_material-definition.scss +264 -260
- package/styles/rich-text-editor/_material3-definition.scss +266 -262
- package/styles/rich-text-editor/_tailwind-definition.scss +261 -257
- package/styles/rich-text-editor/_theme.scss +906 -837
- package/styles/rich-text-editor/bootstrap-dark.css +153 -49
- package/styles/rich-text-editor/bootstrap.css +158 -57
- package/styles/rich-text-editor/bootstrap4.css +145 -45
- package/styles/rich-text-editor/bootstrap5-dark.css +150 -45
- package/styles/rich-text-editor/bootstrap5.css +150 -45
- package/styles/rich-text-editor/fabric-dark.css +139 -39
- package/styles/rich-text-editor/fabric.css +140 -40
- package/styles/rich-text-editor/fluent-dark.css +147 -41
- package/styles/rich-text-editor/fluent.css +147 -41
- package/styles/rich-text-editor/highcontrast-light.css +139 -39
- package/styles/rich-text-editor/highcontrast.css +143 -40
- package/styles/rich-text-editor/icons/_bds.scss +348 -0
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap4.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap5.scss +348 -348
- package/styles/rich-text-editor/icons/_fabric-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_fabric.scss +349 -349
- package/styles/rich-text-editor/icons/_fluent.scss +348 -348
- package/styles/rich-text-editor/icons/_fusionnew.scss +348 -348
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +349 -349
- package/styles/rich-text-editor/icons/_highcontrast.scss +349 -349
- package/styles/rich-text-editor/icons/_material-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_material.scss +349 -349
- package/styles/rich-text-editor/icons/_material3.scss +348 -348
- package/styles/rich-text-editor/icons/_tailwind.scss +348 -348
- package/styles/rich-text-editor/material-dark.css +143 -39
- package/styles/rich-text-editor/material.css +143 -39
- package/styles/rich-text-editor/material3-dark.css +155 -49
- package/styles/rich-text-editor/material3-dark.scss +1 -1
- package/styles/rich-text-editor/material3.css +155 -49
- package/styles/rich-text-editor/material3.scss +1 -1
- package/styles/rich-text-editor/tailwind-dark.css +194 -66
- package/styles/rich-text-editor/tailwind.css +194 -66
- package/styles/tailwind-dark.css +194 -66
- package/styles/tailwind.css +194 -66
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -41
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -27
- package/dist/ej2-richtexteditor.min.js +0 -10
- package/dist/global/ej2-richtexteditor.min.js +0 -11
- package/dist/global/ej2-richtexteditor.min.js.map +0 -1
- package/dist/global/index.d.ts +0 -14
- package/tslint.json +0 -111
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addClass, detach, EventHandler,
|
|
1
|
+
import { addClass, detach, EventHandler, select, Ajax, formatUnit } from '@syncfusion/ej2-base';
|
|
2
2
|
import { Browser, closest, removeClass, isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
|
|
3
3
|
import * as events from '../base/constant';
|
|
4
4
|
import * as classes from '../base/classes';
|
|
@@ -8,6 +8,7 @@ import { Button, CheckBox } from '@syncfusion/ej2-buttons';
|
|
|
8
8
|
import { RenderType } from '../base/enum';
|
|
9
9
|
import { dispatchEvent, parseHtml, hasClass, convertToBlob } from '../base/util';
|
|
10
10
|
import { isIDevice } from '../../common/util';
|
|
11
|
+
import { imageResizeFactor } from '../../common/config';
|
|
11
12
|
/**
|
|
12
13
|
* `Image` module is used to handle image actions.
|
|
13
14
|
*/
|
|
@@ -17,7 +18,6 @@ var Image = /** @class */ (function () {
|
|
|
17
18
|
this.isAllowedTypes = true;
|
|
18
19
|
this.pageX = null;
|
|
19
20
|
this.pageY = null;
|
|
20
|
-
this.mouseX = null;
|
|
21
21
|
this.deletedImg = [];
|
|
22
22
|
this.parent = parent;
|
|
23
23
|
this.rteID = parent.element.id;
|
|
@@ -87,7 +87,7 @@ var Image = /** @class */ (function () {
|
|
|
87
87
|
dropElement.removeEventListener('dragstart', this.dragStart.bind(this), true);
|
|
88
88
|
dropElement.removeEventListener('dragenter', this.dragEnter.bind(this), true);
|
|
89
89
|
dropElement.removeEventListener('dragover', this.dragOver.bind(this), true);
|
|
90
|
-
if (!
|
|
90
|
+
if (!isNOU(this.contentModule)) {
|
|
91
91
|
EventHandler.remove(this.contentModule.getEditPanel(), Browser.touchEndEvent, this.imageClick);
|
|
92
92
|
this.parent.formatter.editorManager.observer.off(events.checkUndo, this.undoStack);
|
|
93
93
|
if (this.parent.insertImageSettings.resize) {
|
|
@@ -100,7 +100,7 @@ var Image = /** @class */ (function () {
|
|
|
100
100
|
};
|
|
101
101
|
Image.prototype.updateCss = function (currentObj, e) {
|
|
102
102
|
if (currentObj && e.cssClass) {
|
|
103
|
-
if (
|
|
103
|
+
if (isNOU(e.oldCssClass)) {
|
|
104
104
|
currentObj.setProperties({ cssClass: (currentObj.cssClass + ' ' + e.cssClass).trim() });
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
@@ -111,7 +111,7 @@ var Image = /** @class */ (function () {
|
|
|
111
111
|
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
112
112
|
Image.prototype.setCssClass = function (e) {
|
|
113
113
|
if (this.popupObj && e.cssClass) {
|
|
114
|
-
if (
|
|
114
|
+
if (isNOU(e.oldCssClass)) {
|
|
115
115
|
addClass([this.popupObj.element], e.cssClass);
|
|
116
116
|
}
|
|
117
117
|
else {
|
|
@@ -175,11 +175,6 @@ var Image = /** @class */ (function () {
|
|
|
175
175
|
}
|
|
176
176
|
var args = { event: e, requestType: 'images' };
|
|
177
177
|
this.parent.trigger(events.resizeStop, args);
|
|
178
|
-
/* eslint-disable */
|
|
179
|
-
var pageX = this.getPointX(e);
|
|
180
|
-
var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
|
|
181
|
-
this.parent.element.getBoundingClientRect().top + e.clientY : e.pageY;
|
|
182
|
-
/* eslint-enable */
|
|
183
178
|
this.parent.formatter.editorManager.observer.on(events.checkUndo, this.undoStack, this);
|
|
184
179
|
this.parent.formatter.saveData();
|
|
185
180
|
};
|
|
@@ -210,17 +205,15 @@ var Image = /** @class */ (function () {
|
|
|
210
205
|
if (this.quickToolObj) {
|
|
211
206
|
this.quickToolObj.imageQTBar.hidePopup();
|
|
212
207
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (target.classList.contains('e-rte-botRight')) {
|
|
223
|
-
this.resizeBtnStat.botRight = true;
|
|
208
|
+
var handlers = ['topLeft', 'topRight', 'botLeft', 'botRight'];
|
|
209
|
+
for (var i = 0; i < handlers.length; i++) {
|
|
210
|
+
var handler = handlers[i];
|
|
211
|
+
if (target.classList.contains('e-rte-' + handler)) {
|
|
212
|
+
this.resizeBtnStat[handler] = true;
|
|
213
|
+
this.currentResizeHandler = handler;
|
|
214
|
+
this.aspectRatio = this.findAspectRatio(this.imgEle);
|
|
215
|
+
break; // Exit the loop once a match is found
|
|
216
|
+
}
|
|
224
217
|
}
|
|
225
218
|
if (Browser.isDevice && this.contentModule.getEditPanel().contains(this.imgResizeDiv) &&
|
|
226
219
|
!this.imgResizeDiv.classList.contains('e-mob-span')) {
|
|
@@ -234,6 +227,7 @@ var Image = /** @class */ (function () {
|
|
|
234
227
|
}
|
|
235
228
|
});
|
|
236
229
|
}
|
|
230
|
+
EventHandler.add(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing, this);
|
|
237
231
|
EventHandler.add(this.contentModule.getDocument(), Browser.touchEndEvent, this.resizeEnd, this);
|
|
238
232
|
}
|
|
239
233
|
};
|
|
@@ -285,7 +279,6 @@ var Image = /** @class */ (function () {
|
|
|
285
279
|
this.imgResizePos(e, this.imgResizeDiv);
|
|
286
280
|
this.resizeImgDupPos(e);
|
|
287
281
|
this.contentModule.getEditPanel().appendChild(this.imgResizeDiv);
|
|
288
|
-
EventHandler.add(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing, this);
|
|
289
282
|
};
|
|
290
283
|
Image.prototype.getPointX = function (e) {
|
|
291
284
|
if (e.touches && e.touches.length) {
|
|
@@ -351,89 +344,80 @@ var Image = /** @class */ (function () {
|
|
|
351
344
|
};
|
|
352
345
|
}
|
|
353
346
|
};
|
|
354
|
-
Image.prototype.setAspectRatio = function (img, expectedX, expectedY
|
|
355
|
-
if (
|
|
347
|
+
Image.prototype.setAspectRatio = function (img, expectedX, expectedY) {
|
|
348
|
+
if (isNOU(img.width)) {
|
|
356
349
|
return;
|
|
357
350
|
}
|
|
358
|
-
|
|
359
|
-
var
|
|
360
|
-
|
|
361
|
-
var
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
if (
|
|
365
|
-
if (
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
|
|
351
|
+
var width = img.width;
|
|
352
|
+
var height = img.height;
|
|
353
|
+
var sameHeightWidth = (width === height);
|
|
354
|
+
var factor = this.parent.insertImageSettings.resizeByPercent ? '%' : 'px';
|
|
355
|
+
var emptyStyleDimension = (img.style.width === '' && img.style.height === '');
|
|
356
|
+
if (!sameHeightWidth && !emptyStyleDimension) {
|
|
357
|
+
if (img.style.width !== '' && img.style.height !== '') {
|
|
358
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
359
|
+
this.setImageWidth(img, expectedX, factor);
|
|
360
|
+
this.removeImageHeight(img);
|
|
369
361
|
}
|
|
370
362
|
else {
|
|
371
|
-
|
|
363
|
+
this.setImageWidth(img, expectedX, factor);
|
|
364
|
+
this.setImageHeight(img, expectedY, factor);
|
|
372
365
|
}
|
|
373
|
-
img.style.height = null;
|
|
374
|
-
img.removeAttribute('height');
|
|
375
|
-
}
|
|
376
|
-
else if (img.style.width === '' && img.style.height !== '') {
|
|
377
|
-
img.style.height = expectedY + 'px';
|
|
378
|
-
}
|
|
379
|
-
else if (img.style.width !== '' && img.style.height === '') {
|
|
380
|
-
var currentWidth = ((width / height * expectedY) + width / height) <
|
|
381
|
-
(this.parent.inputElement.getBoundingClientRect().right - 32) ?
|
|
382
|
-
((width / height * expectedY) + width / height) : (this.parent.inputElement.getBoundingClientRect().right - 32);
|
|
383
|
-
img.style.width = currentWidth.toString() + 'px';
|
|
384
|
-
img.style.height = expectedY + 'px';
|
|
385
366
|
}
|
|
386
367
|
else if (img.style.width !== '') {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
img.style.height = expectedY + 'px';
|
|
391
|
-
}
|
|
392
|
-
else {
|
|
393
|
-
if (this.parent.iframeSettings.enable) {
|
|
394
|
-
img.setAttribute('width', (img.width + this.mouseX).toString());
|
|
368
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
369
|
+
this.setImageWidth(img, expectedX, factor);
|
|
370
|
+
this.removeImageHeight(img);
|
|
395
371
|
}
|
|
396
372
|
else {
|
|
397
|
-
|
|
398
|
-
img.setAttribute('width', (currentWidth).toString());
|
|
373
|
+
this.setImageWidth(img, expectedX, factor);
|
|
399
374
|
}
|
|
400
375
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
var original = img.offsetWidth + this.mouseX;
|
|
406
|
-
var finalWidthByPerc = (original / img.offsetWidth) * (parseFloat(img.style.width).toString() === 'NaN' ?
|
|
407
|
-
(img.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) :
|
|
408
|
-
parseFloat(img.style.width));
|
|
409
|
-
img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
|
|
376
|
+
else if (img.style.height !== '') {
|
|
377
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
378
|
+
this.setImageWidth(img, expectedX, factor);
|
|
379
|
+
this.removeImageHeight(img);
|
|
410
380
|
}
|
|
411
381
|
else {
|
|
412
|
-
|
|
382
|
+
this.setImageHeight(img, expectedY, factor);
|
|
413
383
|
}
|
|
414
|
-
img.style.height = null;
|
|
415
|
-
img.removeAttribute('height');
|
|
416
|
-
}
|
|
417
|
-
else if (img.style.width !== '') {
|
|
418
|
-
img.style.width = expectedX + 'px';
|
|
419
|
-
img.style.height = (height / width * expectedX) + 'px';
|
|
420
|
-
}
|
|
421
|
-
else {
|
|
422
|
-
img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
|
|
423
384
|
}
|
|
424
385
|
}
|
|
425
386
|
else {
|
|
387
|
+
this.setImageWidth(img, expectedX, factor);
|
|
426
388
|
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
427
|
-
|
|
428
|
-
img.style.height = null;
|
|
429
|
-
img.removeAttribute('height');
|
|
389
|
+
this.removeImageHeight(img);
|
|
430
390
|
}
|
|
431
391
|
else {
|
|
432
|
-
|
|
433
|
-
img.style.height = ((expectedX >= 15) ? expectedX : 15) + 'px';
|
|
392
|
+
this.setImageHeight(img, expectedY, factor);
|
|
434
393
|
}
|
|
435
394
|
}
|
|
436
395
|
};
|
|
396
|
+
Image.prototype.setImageWidth = function (img, value, suffix) {
|
|
397
|
+
img.style.width = this.getImageDimension(value, img) + suffix;
|
|
398
|
+
if (!this.parent.insertImageSettings.resizeByPercent) {
|
|
399
|
+
img.setAttribute('width', value.toString());
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
Image.prototype.setImageHeight = function (img, value, suffix) {
|
|
403
|
+
img.style.height = this.getImageDimension(value, img) + suffix;
|
|
404
|
+
if (!this.parent.insertImageSettings.resizeByPercent) {
|
|
405
|
+
img.setAttribute('height', value.toString());
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
Image.prototype.removeImageHeight = function (img) {
|
|
409
|
+
img.style.height = '';
|
|
410
|
+
img.removeAttribute('height');
|
|
411
|
+
};
|
|
412
|
+
Image.prototype.getImageDimension = function (value, img) {
|
|
413
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
414
|
+
var rootElem = img.parentElement || img.previousElementSibling;
|
|
415
|
+
return this.pixToPerc(value, rootElem);
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
return value;
|
|
419
|
+
}
|
|
420
|
+
};
|
|
437
421
|
Image.prototype.pixToPerc = function (expected, parentEle) {
|
|
438
422
|
return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
|
|
439
423
|
};
|
|
@@ -456,7 +440,7 @@ var Image = /** @class */ (function () {
|
|
|
456
440
|
return;
|
|
457
441
|
}
|
|
458
442
|
_this.imgEle.parentElement.style.cursor = 'pointer';
|
|
459
|
-
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10)
|
|
443
|
+
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10));
|
|
460
444
|
_this.resizeImgDupPos(_this.imgEle);
|
|
461
445
|
_this.imgResizePos(_this.imgEle, _this.imgResizeDiv);
|
|
462
446
|
}
|
|
@@ -467,35 +451,37 @@ var Image = /** @class */ (function () {
|
|
|
467
451
|
this.cancelResizeAction();
|
|
468
452
|
return;
|
|
469
453
|
}
|
|
470
|
-
if (this.
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
this.
|
|
491
|
-
|
|
492
|
-
else if (this.resizeBtnStat.topRight) {
|
|
493
|
-
this.imgDupMouseMove(width + 'px', height + 'px', e);
|
|
494
|
-
}
|
|
495
|
-
else if (this.resizeBtnStat.topLeft) {
|
|
454
|
+
if (this.resizeBtnStat.botRight || this.resizeBtnStat.botLeft || this.resizeBtnStat.topRight || this.resizeBtnStat.topLeft) {
|
|
455
|
+
var pageX = this.getPointX(e);
|
|
456
|
+
var pageY = this.getPointY(e);
|
|
457
|
+
var resizeFactor = this.getResizeFactor(this.currentResizeHandler);
|
|
458
|
+
var diffX = (pageX - this.pageX);
|
|
459
|
+
var diffY = (pageY - this.pageY);
|
|
460
|
+
var currentWidth = this.imgEle.clientWidth;
|
|
461
|
+
var currentHeight = this.imgEle.clientHeight;
|
|
462
|
+
var width = diffX * resizeFactor[0] + currentWidth;
|
|
463
|
+
var height = diffY * resizeFactor[1] + currentHeight;
|
|
464
|
+
width = (width < 16) ? 16 : width;
|
|
465
|
+
height = (height < 16) ? 16 : height;
|
|
466
|
+
if (Math.abs(diffX) > Math.abs(diffY)) {
|
|
467
|
+
height = Math.round(width / this.aspectRatio);
|
|
468
|
+
width = Math.round(height * this.aspectRatio);
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
width = Math.round(height * this.aspectRatio);
|
|
472
|
+
height = Math.round(width / this.aspectRatio);
|
|
473
|
+
}
|
|
474
|
+
this.pageX = pageX;
|
|
475
|
+
this.pageY = pageY;
|
|
496
476
|
this.imgDupMouseMove(width + 'px', height + 'px', e);
|
|
497
477
|
}
|
|
498
478
|
};
|
|
479
|
+
Image.prototype.getResizeFactor = function (value) {
|
|
480
|
+
return imageResizeFactor[value];
|
|
481
|
+
};
|
|
482
|
+
Image.prototype.findAspectRatio = function (image) {
|
|
483
|
+
return image.clientWidth / image.clientHeight;
|
|
484
|
+
};
|
|
499
485
|
Image.prototype.cancelResizeAction = function () {
|
|
500
486
|
EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
|
|
501
487
|
EventHandler.remove(this.contentModule.getDocument(), Browser.touchEndEvent, this.resizeEnd);
|
|
@@ -505,6 +491,8 @@ var Image = /** @class */ (function () {
|
|
|
505
491
|
this.imgResizeDiv = null;
|
|
506
492
|
this.pageX = null;
|
|
507
493
|
this.pageY = null;
|
|
494
|
+
this.currentResizeHandler = null;
|
|
495
|
+
this.aspectRatio = null;
|
|
508
496
|
}
|
|
509
497
|
};
|
|
510
498
|
Image.prototype.resizeImgDupPos = function (e) {
|
|
@@ -515,6 +503,8 @@ var Image = /** @class */ (function () {
|
|
|
515
503
|
};
|
|
516
504
|
};
|
|
517
505
|
Image.prototype.resizeBtnInit = function () {
|
|
506
|
+
this.aspectRatio = null;
|
|
507
|
+
this.currentResizeHandler = null;
|
|
518
508
|
return this.resizeBtnStat = { botLeft: false, botRight: false, topRight: false, topLeft: false };
|
|
519
509
|
};
|
|
520
510
|
Image.prototype.onToolbarAction = function (args) {
|
|
@@ -587,7 +577,7 @@ var Image = /** @class */ (function () {
|
|
|
587
577
|
});
|
|
588
578
|
if (this.quickToolObj && document.body.contains(this.quickToolObj.imageQTBar.element)) {
|
|
589
579
|
this.quickToolObj.imageQTBar.hidePopup();
|
|
590
|
-
if (!
|
|
580
|
+
if (!isNOU(e.selectParent)) {
|
|
591
581
|
removeClass([e.selectParent[0]], 'e-img-focus');
|
|
592
582
|
}
|
|
593
583
|
}
|
|
@@ -627,7 +617,7 @@ var Image = /** @class */ (function () {
|
|
|
627
617
|
this.checkImageDel(range);
|
|
628
618
|
}
|
|
629
619
|
}
|
|
630
|
-
if (!
|
|
620
|
+
if (!isNOU(this.parent.formatter.editorManager.nodeSelection) &&
|
|
631
621
|
originalEvent.code !== 'KeyK') {
|
|
632
622
|
range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
633
623
|
selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
@@ -644,11 +634,13 @@ var Image = /** @class */ (function () {
|
|
|
644
634
|
}
|
|
645
635
|
}
|
|
646
636
|
if (originalEvent.ctrlKey && (originalEvent.keyCode === 89 || originalEvent.keyCode === 90)) {
|
|
647
|
-
|
|
637
|
+
if (this.parent.editorMode !== 'Markdown') {
|
|
638
|
+
this.undoStack({ subCommand: (originalEvent.keyCode === 90 ? 'undo' : 'redo') });
|
|
639
|
+
}
|
|
648
640
|
}
|
|
649
641
|
if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
|
|
650
642
|
if (selectNodeEle && selectNodeEle[0].nodeName === 'IMG' && selectNodeEle.length < 1) {
|
|
651
|
-
if (!
|
|
643
|
+
if (!isNOU(this.parent.formatter.editorManager.nodeSelection)) {
|
|
652
644
|
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
653
645
|
}
|
|
654
646
|
originalEvent.preventDefault();
|
|
@@ -670,7 +662,7 @@ var Image = /** @class */ (function () {
|
|
|
670
662
|
}
|
|
671
663
|
switch (originalEvent.action) {
|
|
672
664
|
case 'escape':
|
|
673
|
-
if (!
|
|
665
|
+
if (!isNOU(this.dialogObj)) {
|
|
674
666
|
this.dialogObj.close();
|
|
675
667
|
}
|
|
676
668
|
break;
|
|
@@ -718,13 +710,21 @@ var Image = /** @class */ (function () {
|
|
|
718
710
|
}
|
|
719
711
|
break;
|
|
720
712
|
case 'insert-image':
|
|
721
|
-
if (!
|
|
713
|
+
if (!isNOU(this.parent.formatter.editorManager.nodeSelection)) {
|
|
722
714
|
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
723
715
|
}
|
|
724
716
|
this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
|
|
725
717
|
originalEvent.preventDefault();
|
|
726
718
|
break;
|
|
727
719
|
}
|
|
720
|
+
if (originalEvent.ctrlKey && originalEvent.key === 'a') {
|
|
721
|
+
this.handleSelectAll();
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
Image.prototype.handleSelectAll = function () {
|
|
725
|
+
this.cancelResizeAction();
|
|
726
|
+
var imgFocusNodes = this.parent.inputElement.querySelectorAll('.' + classes.CLS_IMG_FOCUS);
|
|
727
|
+
removeClass(imgFocusNodes, classes.CLS_IMG_FOCUS);
|
|
728
728
|
};
|
|
729
729
|
Image.prototype.openDialog = function (isInternal, event, selection, ele, parentEle) {
|
|
730
730
|
var range;
|
|
@@ -868,8 +868,8 @@ var Image = /** @class */ (function () {
|
|
|
868
868
|
};
|
|
869
869
|
Image.prototype.showImageQuickToolbar = function (e) {
|
|
870
870
|
var _this = this;
|
|
871
|
-
if (e.type !== 'Images' ||
|
|
872
|
-
||
|
|
871
|
+
if (e.type !== 'Images' || isNOU(this.parent.quickToolbarModule)
|
|
872
|
+
|| isNOU(this.parent.quickToolbarModule.imageQTBar) || isNOU(e.args)) {
|
|
873
873
|
return;
|
|
874
874
|
}
|
|
875
875
|
this.quickToolObj = this.parent.quickToolbarModule;
|
|
@@ -894,15 +894,17 @@ var Image = /** @class */ (function () {
|
|
|
894
894
|
_this.parent.formatter.editorManager.nodeSelection.Clear(_this.contentModule.getDocument());
|
|
895
895
|
_this.parent.formatter.editorManager.nodeSelection.setSelectionContents(_this.contentModule.getDocument(), target);
|
|
896
896
|
_this.quickToolObj.imageQTBar.showPopup(args.pageX, pageY, target);
|
|
897
|
+
_this.resizeStart(e.args, target);
|
|
897
898
|
}, 400);
|
|
898
899
|
}
|
|
899
900
|
else {
|
|
900
|
-
|
|
901
|
+
var coordinates = target.getBoundingClientRect();
|
|
902
|
+
this.quickToolObj.imageQTBar.showPopup(coordinates.left, coordinates.top, target, 'Image');
|
|
901
903
|
}
|
|
902
904
|
}
|
|
903
905
|
};
|
|
904
906
|
Image.prototype.hideImageQuickToolbar = function () {
|
|
905
|
-
if (!
|
|
907
|
+
if (!isNOU(this.contentModule.getEditPanel().querySelector('.e-img-focus'))) {
|
|
906
908
|
removeClass([this.contentModule.getEditPanel().querySelector('.e-img-focus')], 'e-img-focus');
|
|
907
909
|
if (this.quickToolObj && this.quickToolObj.imageQTBar && document.body.contains(this.quickToolObj.imageQTBar.element)) {
|
|
908
910
|
this.quickToolObj.imageQTBar.hidePopup();
|
|
@@ -917,7 +919,7 @@ var Image = /** @class */ (function () {
|
|
|
917
919
|
var args = e.args;
|
|
918
920
|
var showOnRightClick = this.parent.quickToolbarSettings.showOnRightClick;
|
|
919
921
|
if (args.which === 2 || (showOnRightClick && args.which === 1) || (!showOnRightClick && args.which === 3)) {
|
|
920
|
-
if ((showOnRightClick && args.which === 1) && !
|
|
922
|
+
if ((showOnRightClick && args.which === 1) && !isNOU(args.target) &&
|
|
921
923
|
args.target.tagName === 'IMG') {
|
|
922
924
|
this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
|
|
923
925
|
this.parent.formatter.editorManager.nodeSelection.setSelectionContents(this.contentModule.getDocument(), args.target);
|
|
@@ -977,7 +979,7 @@ var Image = /** @class */ (function () {
|
|
|
977
979
|
return;
|
|
978
980
|
}
|
|
979
981
|
this.imagDialog(e);
|
|
980
|
-
if (!
|
|
982
|
+
if (!isNOU(this.dialogObj)) {
|
|
981
983
|
var linkWrap = this.parent.createElement('div', { className: 'e-img-linkwrap' + this.parent.getCssClass(true) });
|
|
982
984
|
var linkUrl = this.i10n.getConstant('linkurl');
|
|
983
985
|
var content = '<div class="e-rte-field' + this.parent.getCssClass(true) + '">' +
|
|
@@ -1004,7 +1006,7 @@ var Image = /** @class */ (function () {
|
|
|
1004
1006
|
this.checkBoxObj.createElement = this.parent.createElement;
|
|
1005
1007
|
this.checkBoxObj.appendTo(linkTarget);
|
|
1006
1008
|
var target_1 = this.checkBoxObj.checked ? '_blank' : null;
|
|
1007
|
-
var imageLabel = this.checkBoxObj.checked ? this.i10n.getConstant('
|
|
1009
|
+
var imageLabel = this.checkBoxObj.checked ? this.i10n.getConstant('imageLinkAriaLabel') : null;
|
|
1008
1010
|
var linkUpdate = this.i10n.getConstant('dialogUpdate');
|
|
1009
1011
|
var linkargs_1 = {
|
|
1010
1012
|
args: e.args,
|
|
@@ -1012,7 +1014,6 @@ var Image = /** @class */ (function () {
|
|
|
1012
1014
|
selectNode: e.selectNode, selectParent: e.selectParent, link: inputLink, target: target_1, ariaLabel: imageLabel
|
|
1013
1015
|
};
|
|
1014
1016
|
this.dialogObj.setProperties({
|
|
1015
|
-
height: 'inherit',
|
|
1016
1017
|
width: '290px',
|
|
1017
1018
|
header: this.parent.localeObj.getConstant('imageInsertLinkHeader'),
|
|
1018
1019
|
content: linkWrap,
|
|
@@ -1030,7 +1031,7 @@ var Image = /** @class */ (function () {
|
|
|
1030
1031
|
if (!isNOU(this.parent.cssClass)) {
|
|
1031
1032
|
this.dialogObj.setProperties({ cssClass: this.parent.cssClass });
|
|
1032
1033
|
}
|
|
1033
|
-
if (!
|
|
1034
|
+
if (!isNOU(inputDetails)) {
|
|
1034
1035
|
inputLink.value = inputDetails.url;
|
|
1035
1036
|
// eslint-disable-next-line
|
|
1036
1037
|
(inputDetails.target) ? this.checkBoxObj.checked = true : this.checkBoxObj.checked = false;
|
|
@@ -1047,7 +1048,7 @@ var Image = /** @class */ (function () {
|
|
|
1047
1048
|
}
|
|
1048
1049
|
this.imagDialog(e);
|
|
1049
1050
|
var altText = this.i10n.getConstant('altText');
|
|
1050
|
-
if (!
|
|
1051
|
+
if (!isNOU(this.dialogObj)) {
|
|
1051
1052
|
var altWrap = this.parent.createElement('div', { className: 'e-img-altwrap' + this.parent.getCssClass(true) });
|
|
1052
1053
|
var altHeader = this.i10n.getConstant('alternateHeader');
|
|
1053
1054
|
var linkUpdate = this.i10n.getConstant('dialogUpdate');
|
|
@@ -1065,7 +1066,7 @@ var Image = /** @class */ (function () {
|
|
|
1065
1066
|
alt: inputAlt
|
|
1066
1067
|
};
|
|
1067
1068
|
this.dialogObj.setProperties({
|
|
1068
|
-
|
|
1069
|
+
width: '290px', header: altHeader, content: altWrap,
|
|
1069
1070
|
buttons: [{
|
|
1070
1071
|
// eslint-disable-next-line
|
|
1071
1072
|
click: function (e) {
|
|
@@ -1085,7 +1086,7 @@ var Image = /** @class */ (function () {
|
|
|
1085
1086
|
}
|
|
1086
1087
|
};
|
|
1087
1088
|
Image.prototype.insertAlt = function (e) {
|
|
1088
|
-
if (!
|
|
1089
|
+
if (!isNOU(e.alt)) {
|
|
1089
1090
|
e.selection.restore();
|
|
1090
1091
|
if (this.parent.formatter.getUndoRedoStack().length === 0) {
|
|
1091
1092
|
this.parent.formatter.saveData();
|
|
@@ -1124,14 +1125,14 @@ var Image = /** @class */ (function () {
|
|
|
1124
1125
|
}
|
|
1125
1126
|
if (e.selectNode[0].parentElement.nodeName === 'A') {
|
|
1126
1127
|
proxy.parent.formatter.process(proxy.parent, e.args, e.args, {
|
|
1127
|
-
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('
|
|
1128
|
+
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('imageLinkAriaLabel') : null, selectNode: e.selectNode,
|
|
1128
1129
|
subCommand: e.args.item.subCommand
|
|
1129
1130
|
});
|
|
1130
1131
|
proxy.dialogObj.hide({ returnValue: true });
|
|
1131
1132
|
return;
|
|
1132
1133
|
}
|
|
1133
1134
|
proxy.parent.formatter.process(proxy.parent, e.args, e.args, {
|
|
1134
|
-
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('
|
|
1135
|
+
url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('imageLinkAriaLabel') : null, selectNode: e.selectNode,
|
|
1135
1136
|
subCommand: e.args.item.subCommand, selection: e.selection
|
|
1136
1137
|
});
|
|
1137
1138
|
var captionEle = closest(e.selectNode[0], '.e-img-caption');
|
|
@@ -1159,7 +1160,29 @@ var Image = /** @class */ (function () {
|
|
|
1159
1160
|
if (this.parent.formatter.getUndoRedoStack().length === 0) {
|
|
1160
1161
|
this.parent.formatter.saveData();
|
|
1161
1162
|
}
|
|
1162
|
-
e.selection.
|
|
1163
|
+
var restoreStartElement = e.selection.range.startContainer;
|
|
1164
|
+
if (e.selection.range.startContainer.nodeName === 'SPAN' &&
|
|
1165
|
+
restoreStartElement.classList.contains('e-img-wrap') &&
|
|
1166
|
+
restoreStartElement.parentElement.classList.contains('e-img-caption')) {
|
|
1167
|
+
restoreStartElement = restoreStartElement.parentElement;
|
|
1168
|
+
if (!isNOU(restoreStartElement.previousSibling)) {
|
|
1169
|
+
var lastNode = restoreStartElement.previousSibling;
|
|
1170
|
+
while (lastNode.nodeName !== '#text' && lastNode.nodeName !== 'BR') {
|
|
1171
|
+
lastNode = lastNode.lastChild;
|
|
1172
|
+
}
|
|
1173
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), lastNode, lastNode.nodeName !== 'BR' ? lastNode.textContent.length : 0);
|
|
1174
|
+
}
|
|
1175
|
+
else if (!isNOU(restoreStartElement.nextSibling)) {
|
|
1176
|
+
var firstNode = restoreStartElement.nextSibling;
|
|
1177
|
+
while (firstNode.nodeName !== '#text' && firstNode.nodeName !== 'BR') {
|
|
1178
|
+
firstNode = firstNode.firstChild;
|
|
1179
|
+
}
|
|
1180
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), firstNode, 0);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
else {
|
|
1184
|
+
e.selection.restore();
|
|
1185
|
+
}
|
|
1163
1186
|
if (this.contentModule.getEditPanel().querySelector('.e-img-resize')) {
|
|
1164
1187
|
this.removeResizeEle();
|
|
1165
1188
|
}
|
|
@@ -1173,7 +1196,7 @@ var Image = /** @class */ (function () {
|
|
|
1173
1196
|
this.quickToolObj.imageQTBar.hidePopup();
|
|
1174
1197
|
}
|
|
1175
1198
|
this.cancelResizeAction();
|
|
1176
|
-
if (
|
|
1199
|
+
if (isNOU(keyCode)) {
|
|
1177
1200
|
this.parent.trigger(events.afterImageDelete, args);
|
|
1178
1201
|
}
|
|
1179
1202
|
};
|
|
@@ -1227,7 +1250,7 @@ var Image = /** @class */ (function () {
|
|
|
1227
1250
|
addClass([selectNode], 'e-rte-image');
|
|
1228
1251
|
var subCommand = (e.args.item) ?
|
|
1229
1252
|
e.args.item.subCommand : 'Caption';
|
|
1230
|
-
if (!
|
|
1253
|
+
if (!isNOU(closest(selectNode, '.' + classes.CLS_CAPTION))) {
|
|
1231
1254
|
detach(closest(selectNode, '.' + classes.CLS_CAPTION));
|
|
1232
1255
|
if (Browser.isIE) {
|
|
1233
1256
|
this.contentModule.getEditPanel().focus();
|
|
@@ -1286,13 +1309,13 @@ var Image = /** @class */ (function () {
|
|
|
1286
1309
|
return;
|
|
1287
1310
|
}
|
|
1288
1311
|
this.imagDialog(e);
|
|
1289
|
-
if (!
|
|
1312
|
+
if (!isNOU(this.dialogObj)) {
|
|
1290
1313
|
var imgSizeHeader = this.i10n.getConstant('imageSizeHeader');
|
|
1291
1314
|
var linkUpdate = this.i10n.getConstant('dialogUpdate');
|
|
1292
1315
|
var dialogContent = this.imgsizeInput(e);
|
|
1293
1316
|
var selectObj_1 = { args: e.args, selfImage: this, selection: e.selection, selectNode: e.selectNode };
|
|
1294
1317
|
this.dialogObj.setProperties({
|
|
1295
|
-
|
|
1318
|
+
width: '290px', header: imgSizeHeader, content: dialogContent,
|
|
1296
1319
|
buttons: [{
|
|
1297
1320
|
// eslint-disable-next-line
|
|
1298
1321
|
click: function (e) {
|
|
@@ -1361,7 +1384,7 @@ var Image = /** @class */ (function () {
|
|
|
1361
1384
|
isModal: Browser.isDevice,
|
|
1362
1385
|
buttons: [{
|
|
1363
1386
|
click: this.insertImageUrl.bind(selectObj),
|
|
1364
|
-
buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage' + this.parent.getCssClass(true), isPrimary: true, disabled: true }
|
|
1387
|
+
buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage' + this.parent.getCssClass(true), isPrimary: true, disabled: this.parent.editorMode === 'Markdown' ? false : true }
|
|
1365
1388
|
},
|
|
1366
1389
|
{
|
|
1367
1390
|
click: function (e) {
|
|
@@ -1373,7 +1396,7 @@ var Image = /** @class */ (function () {
|
|
|
1373
1396
|
animationSettings: { effect: 'None' },
|
|
1374
1397
|
close: function (event) {
|
|
1375
1398
|
if (_this.isImgUploaded) {
|
|
1376
|
-
_this.uploadObj.
|
|
1399
|
+
_this.uploadObj.remove();
|
|
1377
1400
|
}
|
|
1378
1401
|
_this.parent.isBlur = false;
|
|
1379
1402
|
if (event && event.event.returnValue) {
|
|
@@ -1391,7 +1414,7 @@ var Image = /** @class */ (function () {
|
|
|
1391
1414
|
}
|
|
1392
1415
|
};
|
|
1393
1416
|
var dialogContent = this.parent.createElement('div', { className: 'e-img-content' + this.parent.getCssClass(true) });
|
|
1394
|
-
if ((!
|
|
1417
|
+
if ((!isNOU(this.parent.insertImageSettings.path) && this.parent.editorMode === 'Markdown')
|
|
1395
1418
|
|| this.parent.editorMode === 'HTML') {
|
|
1396
1419
|
dialogContent.appendChild(this.imgUpload(e));
|
|
1397
1420
|
}
|
|
@@ -1415,7 +1438,7 @@ var Image = /** @class */ (function () {
|
|
|
1415
1438
|
this.dialogObj = this.dialogRenderObj.render(dialogModel);
|
|
1416
1439
|
this.dialogObj.createElement = this.parent.createElement;
|
|
1417
1440
|
this.dialogObj.appendTo(imgDialog);
|
|
1418
|
-
if (
|
|
1441
|
+
if (isNOU(this.dialogObj)) {
|
|
1419
1442
|
return;
|
|
1420
1443
|
}
|
|
1421
1444
|
if (e.selectNode && e.selectNode[0].nodeName === 'IMG' && (e.name === 'insertImage')) {
|
|
@@ -1425,7 +1448,7 @@ var Image = /** @class */ (function () {
|
|
|
1425
1448
|
if (this.quickToolObj) {
|
|
1426
1449
|
if (this.quickToolObj.imageQTBar && document.body.contains(this.quickToolObj.imageQTBar.element)) {
|
|
1427
1450
|
this.quickToolObj.imageQTBar.hidePopup();
|
|
1428
|
-
if (!
|
|
1451
|
+
if (!isNOU(e.selectParent)) {
|
|
1429
1452
|
removeClass([e.selectParent[0]], 'e-img-focus');
|
|
1430
1453
|
}
|
|
1431
1454
|
}
|
|
@@ -1441,9 +1464,6 @@ var Image = /** @class */ (function () {
|
|
|
1441
1464
|
Image.prototype.cancelDialog = function (e) {
|
|
1442
1465
|
this.parent.isBlur = false;
|
|
1443
1466
|
this.dialogObj.hide({ returnValue: true });
|
|
1444
|
-
if (this.isImgUploaded) {
|
|
1445
|
-
this.uploadObj.removing();
|
|
1446
|
-
}
|
|
1447
1467
|
};
|
|
1448
1468
|
Image.prototype.onDocumentClick = function (e) {
|
|
1449
1469
|
var target = e.target;
|
|
@@ -1456,7 +1476,7 @@ var Image = /** @class */ (function () {
|
|
|
1456
1476
|
if (target.nodeName !== '#document') {
|
|
1457
1477
|
this.parent.currentTarget = e.target;
|
|
1458
1478
|
}
|
|
1459
|
-
if (!
|
|
1479
|
+
if (!isNOU(this.dialogObj) && ((
|
|
1460
1480
|
// eslint-disable-next-line
|
|
1461
1481
|
!closest(target, '[id=' + "'" + this.dialogObj.element.id + "'" + ']') && this.parent.toolbarSettings.enable && this.parent.getToolbarElement() &&
|
|
1462
1482
|
!this.parent.getToolbarElement().contains(e.target)) ||
|
|
@@ -1467,6 +1487,7 @@ var Image = /** @class */ (function () {
|
|
|
1467
1487
|
if (e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight) {
|
|
1468
1488
|
}
|
|
1469
1489
|
else {
|
|
1490
|
+
this.parent.notify(events.documentClickClosedBy, { closedBy: "outside click" });
|
|
1470
1491
|
this.dialogObj.hide({ returnValue: true });
|
|
1471
1492
|
this.parent.isBlur = true;
|
|
1472
1493
|
dispatchEvent(this.parent.element, 'focusout');
|
|
@@ -1495,7 +1516,6 @@ var Image = /** @class */ (function () {
|
|
|
1495
1516
|
for (var i = 0; i < items.length; i++) {
|
|
1496
1517
|
removeClass([items[i]], 'e-img-focus');
|
|
1497
1518
|
removeClass([items[i]], 'e-resize');
|
|
1498
|
-
items[i].style.maxWidth = '';
|
|
1499
1519
|
}
|
|
1500
1520
|
}
|
|
1501
1521
|
};
|
|
@@ -1509,7 +1529,6 @@ var Image = /** @class */ (function () {
|
|
|
1509
1529
|
this.cancelResizeAction();
|
|
1510
1530
|
}
|
|
1511
1531
|
};
|
|
1512
|
-
// eslint-disable-next-line
|
|
1513
1532
|
Image.prototype.imageUrlPopup = function (e) {
|
|
1514
1533
|
var _this = this;
|
|
1515
1534
|
var imgUrl = this.parent.createElement('div', { className: 'imgUrl' + this.parent.getCssClass(true) });
|
|
@@ -1528,6 +1547,10 @@ var Image = /** @class */ (function () {
|
|
|
1528
1547
|
}
|
|
1529
1548
|
}
|
|
1530
1549
|
});
|
|
1550
|
+
if (e.selectNode && e.selectNode[0].nodeName === 'IMG') {
|
|
1551
|
+
var regex = new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi);
|
|
1552
|
+
this.inputUrl.value = e.selectNode[0].src.match(regex) ? e.selectNode[0].src : '';
|
|
1553
|
+
}
|
|
1531
1554
|
imgUrl.appendChild(this.inputUrl);
|
|
1532
1555
|
return imgUrl;
|
|
1533
1556
|
};
|
|
@@ -1536,10 +1559,13 @@ var Image = /** @class */ (function () {
|
|
|
1536
1559
|
var proxy = this.selfImage;
|
|
1537
1560
|
proxy.isImgUploaded = false;
|
|
1538
1561
|
var url = proxy.inputUrl.value;
|
|
1562
|
+
if (proxy.parent.editorMode === 'Markdown' && url === '') {
|
|
1563
|
+
url = 'http://';
|
|
1564
|
+
}
|
|
1539
1565
|
if (proxy.parent.formatter.getUndoRedoStack().length === 0) {
|
|
1540
1566
|
proxy.parent.formatter.saveData();
|
|
1541
1567
|
}
|
|
1542
|
-
if (!
|
|
1568
|
+
if (!isNOU(proxy.uploadUrl) && proxy.uploadUrl.url !== '') {
|
|
1543
1569
|
proxy.uploadUrl.cssClass = (proxy.parent.insertImageSettings.display === 'inline' ?
|
|
1544
1570
|
classes.CLS_IMGINLINE : classes.CLS_IMGBREAK);
|
|
1545
1571
|
proxy.dialogObj.hide({ returnValue: false });
|
|
@@ -1551,7 +1577,7 @@ var Image = /** @class */ (function () {
|
|
|
1551
1577
|
}
|
|
1552
1578
|
}
|
|
1553
1579
|
else if (url !== '') {
|
|
1554
|
-
if (proxy.parent.editorMode === 'HTML' &&
|
|
1580
|
+
if (proxy.parent.editorMode === 'HTML' && isNOU(closest(
|
|
1555
1581
|
// eslint-disable-next-line
|
|
1556
1582
|
this.selection.range.startContainer.parentNode, '[id=' + "'" + proxy.contentModule.getPanel().id + "'" + ']'))) {
|
|
1557
1583
|
proxy.contentModule.getEditPanel().focus();
|
|
@@ -1560,7 +1586,7 @@ var Image = /** @class */ (function () {
|
|
|
1560
1586
|
this.selectParent = proxy.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
1561
1587
|
}
|
|
1562
1588
|
var regex = /[\w-]+.(jpg|png|jpeg|gif)/g;
|
|
1563
|
-
var matchUrl = (!
|
|
1589
|
+
var matchUrl = (!isNOU(url.match(regex)) && proxy.parent.editorMode === 'HTML') ? url.match(regex)[0] : '';
|
|
1564
1590
|
var value = {
|
|
1565
1591
|
cssClass: (proxy.parent.insertImageSettings.display === 'inline' ? classes.CLS_IMGINLINE : classes.CLS_IMGBREAK),
|
|
1566
1592
|
url: url, selection: this.selection, altText: matchUrl,
|
|
@@ -1583,12 +1609,18 @@ var Image = /** @class */ (function () {
|
|
|
1583
1609
|
var imgHeight = this.i10n.getConstant('imageHeight');
|
|
1584
1610
|
var imgWidth = this.i10n.getConstant('imageWidth');
|
|
1585
1611
|
var imgSizeWrap = this.parent.createElement('div', { className: 'e-img-sizewrap' + this.parent.getCssClass(true) });
|
|
1586
|
-
var widthVal =
|
|
1587
|
-
selectNode.style.width !== '') ? selectNode.style.width : !
|
|
1612
|
+
var widthVal = isNOU(this.changedWidthValue) && (selectNode.style.width.toString() === 'auto' ||
|
|
1613
|
+
selectNode.style.width !== '') ? selectNode.style.width : !isNOU(this.changedWidthValue) ?
|
|
1588
1614
|
this.changedWidthValue : (parseInt(selectNode.getClientRects()[0].width.toString(), 10)).toString();
|
|
1589
|
-
var heightVal =
|
|
1590
|
-
selectNode.style.height !== '') ? selectNode.style.height : !
|
|
1615
|
+
var heightVal = isNOU(this.changedHeightValue) && (selectNode.style.height.toString() === 'auto' ||
|
|
1616
|
+
selectNode.style.height !== '') ? selectNode.style.height : !isNOU(this.changedHeightValue) ?
|
|
1591
1617
|
this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString(), 10)).toString();
|
|
1618
|
+
if (selectNode.style.width === '') {
|
|
1619
|
+
widthVal = 'auto';
|
|
1620
|
+
}
|
|
1621
|
+
if (selectNode.style.height === '') {
|
|
1622
|
+
heightVal = 'auto';
|
|
1623
|
+
}
|
|
1592
1624
|
this.changedWidthValue = null;
|
|
1593
1625
|
this.changedHeightValue = null;
|
|
1594
1626
|
var content = '<div class="e-rte-label' + this.parent.getCssClass(true) + '"><label>' + imgWidth +
|
|
@@ -1652,10 +1684,10 @@ var Image = /** @class */ (function () {
|
|
|
1652
1684
|
};
|
|
1653
1685
|
Image.prototype.insertImage = function (e) {
|
|
1654
1686
|
this.imagDialog(e);
|
|
1655
|
-
if (!
|
|
1687
|
+
if (!isNOU(this.dialogObj)) {
|
|
1656
1688
|
this.dialogObj.element.style.maxHeight = 'inherit';
|
|
1657
1689
|
var dialogContent = this.dialogObj.element.querySelector('.e-img-content');
|
|
1658
|
-
if (((!
|
|
1690
|
+
if (((!isNOU(this.parent.insertImageSettings.path) && this.parent.editorMode === 'Markdown')
|
|
1659
1691
|
|| this.parent.editorMode === 'HTML')) {
|
|
1660
1692
|
document.getElementById(this.rteID + '_insertImage').focus();
|
|
1661
1693
|
}
|
|
@@ -1671,7 +1703,7 @@ var Image = /** @class */ (function () {
|
|
|
1671
1703
|
// eslint-disable-next-line
|
|
1672
1704
|
var proxy = this;
|
|
1673
1705
|
var iframe = proxy.parent.iframeSettings.enable;
|
|
1674
|
-
if (proxy.parent.editorMode === 'HTML' && (!iframe &&
|
|
1706
|
+
if (proxy.parent.editorMode === 'HTML' && (!iframe && isNOU(closest(e.selection.range.startContainer.parentNode, '[id='
|
|
1675
1707
|
// eslint-disable-next-line
|
|
1676
1708
|
+ "'" + this.parent.contentModule.getPanel().id + "'" + ']'))
|
|
1677
1709
|
|| (iframe && !hasClass(e.selection.range.startContainer.parentNode.ownerDocument.querySelector('body'), 'e-lib')))) {
|
|
@@ -1723,8 +1755,8 @@ var Image = /** @class */ (function () {
|
|
|
1723
1755
|
_this.parent.trigger(events.imageSelected, selectArgs, function (selectArgs) {
|
|
1724
1756
|
if (!selectArgs.cancel) {
|
|
1725
1757
|
_this.checkExtension(selectArgs.filesData[0]);
|
|
1726
|
-
altText = selectArgs.filesData[0].name;
|
|
1727
|
-
if (_this.parent.editorMode === 'HTML' &&
|
|
1758
|
+
altText = selectArgs.filesData[0].name.replace(/\.[a-zA-Z0-9]+$/, '');
|
|
1759
|
+
if (_this.parent.editorMode === 'HTML' && isNOU(_this.parent.insertImageSettings.path)) {
|
|
1728
1760
|
var reader_1 = new FileReader();
|
|
1729
1761
|
// eslint-disable-next-line
|
|
1730
1762
|
reader_1.addEventListener('load', function (e) {
|
|
@@ -1743,8 +1775,8 @@ var Image = /** @class */ (function () {
|
|
|
1743
1775
|
}
|
|
1744
1776
|
};
|
|
1745
1777
|
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
1746
|
-
if (
|
|
1747
|
-
&& !
|
|
1778
|
+
if (isNOU(proxy.parent.insertImageSettings.saveUrl) && _this.isAllowedTypes
|
|
1779
|
+
&& !isNOU(_this.dialogObj)) {
|
|
1748
1780
|
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
1749
1781
|
}
|
|
1750
1782
|
});
|
|
@@ -1763,7 +1795,7 @@ var Image = /** @class */ (function () {
|
|
|
1763
1795
|
},
|
|
1764
1796
|
success: function (e) {
|
|
1765
1797
|
_this.parent.trigger(events.imageUploadSuccess, e, function (e) {
|
|
1766
|
-
if (!
|
|
1798
|
+
if (!isNOU(_this.parent.insertImageSettings.path)) {
|
|
1767
1799
|
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
1768
1800
|
// eslint-disable-next-line
|
|
1769
1801
|
var value = { url: url, selection: save };
|
|
@@ -1779,7 +1811,7 @@ var Image = /** @class */ (function () {
|
|
|
1779
1811
|
};
|
|
1780
1812
|
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
1781
1813
|
}
|
|
1782
|
-
if (e.operation === 'upload' && !
|
|
1814
|
+
if (e.operation === 'upload' && !isNOU(_this.dialogObj)) {
|
|
1783
1815
|
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
1784
1816
|
}
|
|
1785
1817
|
});
|
|
@@ -2108,10 +2140,10 @@ var Image = /** @class */ (function () {
|
|
|
2108
2140
|
isUploading = true;
|
|
2109
2141
|
_this.parent.trigger(events.imageUploading, e, function (imageUploadingArgs) {
|
|
2110
2142
|
if (imageUploadingArgs.cancel) {
|
|
2111
|
-
if (!
|
|
2143
|
+
if (!isNOU(imageElement)) {
|
|
2112
2144
|
detach(imageElement);
|
|
2113
2145
|
}
|
|
2114
|
-
if (!
|
|
2146
|
+
if (!isNOU(_this.popupObj.element)) {
|
|
2115
2147
|
detach(_this.popupObj.element);
|
|
2116
2148
|
}
|
|
2117
2149
|
}
|
|
@@ -2208,7 +2240,7 @@ var Image = /** @class */ (function () {
|
|
|
2208
2240
|
imageElement.classList.add(classes.CLS_IMG_FOCUS);
|
|
2209
2241
|
e.element = imageElement;
|
|
2210
2242
|
this.parent.trigger(events.imageUploadSuccess, e, function (e) {
|
|
2211
|
-
if (!
|
|
2243
|
+
if (!isNOU(_this.parent.insertImageSettings.path)) {
|
|
2212
2244
|
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
2213
2245
|
imageElement.src = url;
|
|
2214
2246
|
imageElement.setAttribute('alt', e.file.name);
|
|
@@ -2223,7 +2255,7 @@ var Image = /** @class */ (function () {
|
|
|
2223
2255
|
};
|
|
2224
2256
|
Image.prototype.imagePaste = function (args) {
|
|
2225
2257
|
var _this = this;
|
|
2226
|
-
if (args.text.length === 0 && !
|
|
2258
|
+
if (args.text.length === 0 && !isNOU(args.file)) {
|
|
2227
2259
|
// eslint-disable-next-line
|
|
2228
2260
|
var proxy_1 = this;
|
|
2229
2261
|
var reader_2 = new FileReader();
|
|
@@ -2232,7 +2264,7 @@ var Image = /** @class */ (function () {
|
|
|
2232
2264
|
reader_2.addEventListener('load', function (e) {
|
|
2233
2265
|
var url = {
|
|
2234
2266
|
cssClass: (proxy_1.parent.insertImageSettings.display === 'inline' ? classes.CLS_IMGINLINE : classes.CLS_IMGBREAK),
|
|
2235
|
-
url: _this.parent.insertImageSettings.saveFormat === 'Base64' || !
|
|
2267
|
+
url: _this.parent.insertImageSettings.saveFormat === 'Base64' || !isNOU(args.callBack) ?
|
|
2236
2268
|
reader_2.result : URL.createObjectURL(convertToBlob(reader_2.result)),
|
|
2237
2269
|
width: {
|
|
2238
2270
|
width: proxy_1.parent.insertImageSettings.width, minWidth: proxy_1.parent.insertImageSettings.minWidth,
|
|
@@ -2243,7 +2275,7 @@ var Image = /** @class */ (function () {
|
|
|
2243
2275
|
maxHeight: proxy_1.parent.insertImageSettings.maxHeight
|
|
2244
2276
|
}
|
|
2245
2277
|
};
|
|
2246
|
-
if (!
|
|
2278
|
+
if (!isNOU(args.callBack)) {
|
|
2247
2279
|
args.callBack(url);
|
|
2248
2280
|
return;
|
|
2249
2281
|
}
|
|
@@ -2280,7 +2312,7 @@ var Image = /** @class */ (function () {
|
|
|
2280
2312
|
* @method destroy
|
|
2281
2313
|
* @returns {void}
|
|
2282
2314
|
* @hidden
|
|
2283
|
-
|
|
2315
|
+
* @deprecated
|
|
2284
2316
|
*/
|
|
2285
2317
|
/* eslint-enable */
|
|
2286
2318
|
Image.prototype.destroy = function () {
|