@syncfusion/ej2-richtexteditor 19.2.62 → 19.3.43
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 +1 -1
- package/CHANGELOG.md +21 -9
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +858 -245
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +864 -243
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/common/types.d.ts +8 -0
- package/src/editor-manager/base/editor-manager.d.ts +1 -1
- package/src/editor-manager/base/editor-manager.js +6 -6
- package/src/editor-manager/base/interface.d.ts +7 -1
- package/src/editor-manager/plugin/clearformat-exec.js +2 -2
- package/src/editor-manager/plugin/clearformat.d.ts +3 -1
- package/src/editor-manager/plugin/clearformat.js +19 -9
- package/src/editor-manager/plugin/dom-node.js +2 -2
- package/src/editor-manager/plugin/formats.d.ts +1 -0
- package/src/editor-manager/plugin/formats.js +87 -7
- package/src/editor-manager/plugin/image.js +55 -47
- package/src/editor-manager/plugin/inserthtml.js +10 -2
- package/src/editor-manager/plugin/isformatted.js +2 -1
- package/src/editor-manager/plugin/lists.d.ts +1 -0
- package/src/editor-manager/plugin/lists.js +87 -8
- package/src/editor-manager/plugin/nodecutter.d.ts +1 -0
- package/src/editor-manager/plugin/nodecutter.js +1 -0
- package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
- package/src/editor-manager/plugin/selection-commands.js +14 -6
- package/src/editor-manager/plugin/selection-exec.js +2 -2
- package/src/editor-manager/plugin/table.js +19 -9
- package/src/rich-text-editor/actions/base-quick-toolbar.js +3 -4
- package/src/rich-text-editor/actions/enter-key.d.ts +18 -0
- package/src/rich-text-editor/actions/enter-key.js +290 -0
- package/src/rich-text-editor/actions/html-editor.js +30 -20
- package/src/rich-text-editor/actions/paste-clean-up.js +5 -5
- package/src/rich-text-editor/actions/resize.js +4 -4
- package/src/rich-text-editor/base/constant.d.ts +5 -0
- package/src/rich-text-editor/base/constant.js +5 -0
- package/src/rich-text-editor/base/interface.d.ts +15 -3
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +27 -1
- package/src/rich-text-editor/base/rich-text-editor.d.ts +34 -5
- package/src/rich-text-editor/base/rich-text-editor.js +58 -56
- package/src/rich-text-editor/base/util.d.ts +7 -1
- package/src/rich-text-editor/base/util.js +45 -11
- package/src/rich-text-editor/formatter/formatter.js +9 -7
- package/src/rich-text-editor/models/items.js +3 -3
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +2 -2
- package/src/rich-text-editor/renderer/image-module.d.ts +6 -0
- package/src/rich-text-editor/renderer/image-module.js +70 -26
- package/src/rich-text-editor/renderer/link-module.js +4 -3
- package/src/rich-text-editor/renderer/popup-renderer.js +1 -2
- package/src/rich-text-editor/renderer/render.js +10 -2
- package/src/rich-text-editor/renderer/table-module.js +13 -5
- package/src/rich-text-editor/renderer/view-source.js +21 -3
- package/styles/bootstrap-dark.css +25 -12
- package/styles/bootstrap.css +25 -12
- package/styles/bootstrap4.css +21 -13
- package/styles/bootstrap5-dark.css +3058 -0
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5.css +3058 -0
- package/styles/bootstrap5.scss +1 -0
- package/styles/fabric-dark.css +20 -12
- package/styles/fabric.css +20 -12
- package/styles/highcontrast-light.css +20 -12
- package/styles/highcontrast.css +19 -18
- package/styles/material-dark.css +22 -14
- package/styles/material.css +19 -11
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +1 -1
- package/styles/rich-text-editor/_bootstrap-definition.scss +1 -1
- package/styles/rich-text-editor/_bootstrap4-definition.scss +2 -2
- package/styles/rich-text-editor/_bootstrap5-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_bootstrap5-definition.scss +168 -0
- package/styles/rich-text-editor/_fabric-dark-definition.scss +1 -1
- package/styles/rich-text-editor/_fabric-definition.scss +1 -1
- package/styles/rich-text-editor/_highcontrast-definition.scss +2 -2
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +1 -1
- package/styles/rich-text-editor/_layout.scss +64 -7
- package/styles/rich-text-editor/_tailwind-dark-definition.scss +1 -165
- package/styles/rich-text-editor/_tailwind-definition.scss +74 -72
- package/styles/rich-text-editor/_theme.scss +103 -3
- package/styles/rich-text-editor/bootstrap-dark.css +25 -12
- package/styles/rich-text-editor/bootstrap.css +25 -12
- package/styles/rich-text-editor/bootstrap4.css +21 -13
- package/styles/rich-text-editor/bootstrap5-dark.css +3058 -0
- package/styles/rich-text-editor/bootstrap5-dark.scss +4 -0
- package/styles/rich-text-editor/bootstrap5.css +3058 -0
- package/styles/rich-text-editor/bootstrap5.scss +4 -0
- package/styles/rich-text-editor/fabric-dark.css +20 -12
- package/styles/rich-text-editor/fabric.css +20 -12
- package/styles/rich-text-editor/highcontrast-light.css +20 -12
- package/styles/rich-text-editor/highcontrast.css +19 -18
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap4.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap5-dark.scss +1 -0
- package/styles/rich-text-editor/icons/_bootstrap5.scss +303 -0
- package/styles/rich-text-editor/icons/_fabric-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_fabric.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast.scss +1 -1
- package/styles/rich-text-editor/icons/_material-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_material.scss +1 -1
- package/styles/rich-text-editor/icons/_tailwind-dark.scss +1 -304
- package/styles/rich-text-editor/icons/_tailwind.scss +2 -2
- package/styles/rich-text-editor/material-dark.css +22 -14
- package/styles/rich-text-editor/material.css +19 -11
- package/styles/rich-text-editor/tailwind-dark.css +51 -20
- package/styles/rich-text-editor/tailwind.css +49 -18
- package/styles/tailwind-dark.css +51 -20
- package/styles/tailwind.css +49 -18
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Ajax, Base, Browser, ChildProperty, Complex, Component, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Observer, Property, SanitizeHtmlHelper, Touch, addClass, append, attributes, closest, compile, createElement, debounce, detach, extend, formatUnit, getEnumValue, getInstance, getUniqueID,
|
|
1
|
+
import { Ajax, Base, Browser, ChildProperty, Complex, Component, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Observer, Property, SanitizeHtmlHelper, Touch, addClass, append, attributes, closest, compile, createElement, debounce, detach, extend, formatUnit, getEnumValue, getInstance, getUniqueID, isNullOrUndefined, prepend, print, removeClass, select, selectAll, setStyleAttribute } from '@syncfusion/ej2-base';
|
|
2
2
|
import { Toolbar } from '@syncfusion/ej2-navigations';
|
|
3
3
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
4
4
|
import { Dialog, Popup, getScrollableParent, isCollide } from '@syncfusion/ej2-popups';
|
|
5
|
-
import { ColorPicker, NumericTextBox, Uploader } from '@syncfusion/ej2-inputs';
|
|
5
|
+
import { ColorPicker, NumericTextBox, TextBox, Uploader } from '@syncfusion/ej2-inputs';
|
|
6
6
|
import { Button, CheckBox, RadioButton } from '@syncfusion/ej2-buttons';
|
|
7
7
|
import { AjaxSettings, ContextMenu, ContextMenuSettings, DetailsView, DetailsViewSettings, FileManager, NavigationPane, NavigationPaneSettings, SearchSettings, Toolbar as Toolbar$1, ToolbarSettings, UploadSettings } from '@syncfusion/ej2-filemanager';
|
|
8
8
|
|
|
@@ -449,6 +449,11 @@ const readOnlyMode = 'readOnlyMode';
|
|
|
449
449
|
* @deprecated
|
|
450
450
|
*/
|
|
451
451
|
const pasteClean = 'pasteClean';
|
|
452
|
+
/**
|
|
453
|
+
* @hidden
|
|
454
|
+
* @deprecated
|
|
455
|
+
*/
|
|
456
|
+
const enterHandler = 'enterHandler';
|
|
452
457
|
/**
|
|
453
458
|
* @hidden
|
|
454
459
|
* @deprecated
|
|
@@ -1351,14 +1356,14 @@ let tools = {
|
|
|
1351
1356
|
'numberformatlist': {
|
|
1352
1357
|
'id': 'NumberFormatList',
|
|
1353
1358
|
'icon': 'e-order-list',
|
|
1354
|
-
'tooltip': '
|
|
1359
|
+
'tooltip': 'Number Format List',
|
|
1355
1360
|
'command': 'NumberFormatList',
|
|
1356
1361
|
'subCommand': 'NumberFormatList'
|
|
1357
1362
|
},
|
|
1358
1363
|
'bulletformatlist': {
|
|
1359
1364
|
'id': 'BulletFormatList',
|
|
1360
1365
|
'icon': 'e-unorder-list',
|
|
1361
|
-
'tooltip': '
|
|
1366
|
+
'tooltip': 'Bullet Format List',
|
|
1362
1367
|
'command': 'BulletFormatList',
|
|
1363
1368
|
'subCommand': 'BulletFormatList'
|
|
1364
1369
|
},
|
|
@@ -1532,7 +1537,7 @@ let tools = {
|
|
|
1532
1537
|
},
|
|
1533
1538
|
'dimension': {
|
|
1534
1539
|
'id': 'Dimension',
|
|
1535
|
-
'icon': 'e-dimension',
|
|
1540
|
+
'icon': 'e-img-dimension',
|
|
1536
1541
|
'tooltip': 'Change Size',
|
|
1537
1542
|
'command': 'Images',
|
|
1538
1543
|
'subCommand': 'Dimension'
|
|
@@ -2490,11 +2495,19 @@ function toObjectLowerCase(obj) {
|
|
|
2490
2495
|
function getEditValue(value, rteObj) {
|
|
2491
2496
|
let val;
|
|
2492
2497
|
if (value !== null && value !== '') {
|
|
2493
|
-
val = rteObj.enableHtmlEncode ? updateTextNode(decode(value)) : updateTextNode(value);
|
|
2498
|
+
val = rteObj.enableHtmlEncode ? updateTextNode(decode(value), rteObj) : updateTextNode(value, rteObj);
|
|
2494
2499
|
rteObj.setProperties({ value: val }, true);
|
|
2495
2500
|
}
|
|
2496
2501
|
else {
|
|
2497
|
-
|
|
2502
|
+
if (rteObj.enterKey === 'DIV') {
|
|
2503
|
+
val = rteObj.enableHtmlEncode ? '<div><br/></div>' : '<div><br/></div>';
|
|
2504
|
+
}
|
|
2505
|
+
else if (rteObj.enterKey === 'BR') {
|
|
2506
|
+
val = rteObj.enableHtmlEncode ? '<br/>' : '<br/>';
|
|
2507
|
+
}
|
|
2508
|
+
else {
|
|
2509
|
+
val = rteObj.enableHtmlEncode ? '<p><br/></p>' : '<p><br/></p>';
|
|
2510
|
+
}
|
|
2498
2511
|
}
|
|
2499
2512
|
return val;
|
|
2500
2513
|
}
|
|
@@ -2503,7 +2516,7 @@ function getEditValue(value, rteObj) {
|
|
|
2503
2516
|
* @returns {string} - returns the string
|
|
2504
2517
|
* @hidden
|
|
2505
2518
|
*/
|
|
2506
|
-
function updateTextNode(value) {
|
|
2519
|
+
function updateTextNode(value, rteObj) {
|
|
2507
2520
|
const tempNode = document.createElement('div');
|
|
2508
2521
|
const resultElm = document.createElement('div');
|
|
2509
2522
|
const childNodes = tempNode.childNodes;
|
|
@@ -2512,20 +2525,25 @@ function updateTextNode(value) {
|
|
|
2512
2525
|
if (childNodes.length > 0) {
|
|
2513
2526
|
let isPreviousInlineElem;
|
|
2514
2527
|
let previousParent;
|
|
2515
|
-
let
|
|
2528
|
+
let insertElem;
|
|
2516
2529
|
while (tempNode.firstChild) {
|
|
2517
|
-
if ((tempNode.firstChild.nodeName === '#text' &&
|
|
2530
|
+
if (rteObj.enterKey !== 'BR' && ((tempNode.firstChild.nodeName === '#text' &&
|
|
2518
2531
|
(tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
|
|
2519
|
-
inlineNode.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0) {
|
|
2532
|
+
inlineNode.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
|
|
2520
2533
|
if (!isPreviousInlineElem) {
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2534
|
+
if (rteObj.enterKey === 'DIV') {
|
|
2535
|
+
insertElem = createElement('div');
|
|
2536
|
+
}
|
|
2537
|
+
else {
|
|
2538
|
+
insertElem = createElement('p');
|
|
2539
|
+
}
|
|
2540
|
+
resultElm.appendChild(insertElem);
|
|
2541
|
+
insertElem.appendChild(tempNode.firstChild);
|
|
2524
2542
|
}
|
|
2525
2543
|
else {
|
|
2526
2544
|
previousParent.appendChild(tempNode.firstChild);
|
|
2527
2545
|
}
|
|
2528
|
-
previousParent =
|
|
2546
|
+
previousParent = insertElem;
|
|
2529
2547
|
isPreviousInlineElem = true;
|
|
2530
2548
|
}
|
|
2531
2549
|
else if (tempNode.firstChild.nodeName === '#text' && (tempNode.firstChild.textContent === '\n' ||
|
|
@@ -2550,13 +2568,34 @@ function updateTextNode(value) {
|
|
|
2550
2568
|
}
|
|
2551
2569
|
return resultElm.innerHTML;
|
|
2552
2570
|
}
|
|
2571
|
+
/**
|
|
2572
|
+
* @param {IRichTextEditor} rteObj - specifies the rte object
|
|
2573
|
+
* @returns {string} - returns the value based on enter configuration.
|
|
2574
|
+
* @hidden
|
|
2575
|
+
*/
|
|
2576
|
+
function getDefaultValue(rteObj) {
|
|
2577
|
+
let currentVal;
|
|
2578
|
+
if (rteObj.enterKey === 'DIV') {
|
|
2579
|
+
currentVal = rteObj.enableHtmlEncode ? '<div><br/></div>' : '<div><br/></div>';
|
|
2580
|
+
}
|
|
2581
|
+
else if (rteObj.enterKey === 'BR') {
|
|
2582
|
+
currentVal = rteObj.enableHtmlEncode ? '<br/>' : '<br/>';
|
|
2583
|
+
}
|
|
2584
|
+
else {
|
|
2585
|
+
currentVal = rteObj.enableHtmlEncode ? '<p><br/></p>' : '<p><br/></p>';
|
|
2586
|
+
}
|
|
2587
|
+
return currentVal;
|
|
2588
|
+
}
|
|
2553
2589
|
/**
|
|
2554
2590
|
* @param {string} value - specifies the value
|
|
2555
2591
|
* @returns {boolean} - returns the boolean value
|
|
2556
2592
|
* @hidden
|
|
2557
2593
|
*/
|
|
2558
2594
|
function isEditableValueEmpty(value) {
|
|
2559
|
-
return (value === '<p><br></p>' || value === '<p><br></p>'
|
|
2595
|
+
return (value === '<p><br></p>' || value === '<p><br></p>'
|
|
2596
|
+
|| value === '<div><br></div>' || value === '<div><br></div>'
|
|
2597
|
+
|| value === '<br>' || value === '<br>'
|
|
2598
|
+
|| value === '') ? true : false;
|
|
2560
2599
|
}
|
|
2561
2600
|
/**
|
|
2562
2601
|
* @param {string} value - specifies the string value
|
|
@@ -5244,8 +5283,7 @@ class BaseQuickToolbar {
|
|
|
5244
5283
|
* @deprecated
|
|
5245
5284
|
*/
|
|
5246
5285
|
showPopup(x, y, target) {
|
|
5247
|
-
const eventArgs =
|
|
5248
|
-
{ popup: this.popupObj, cancel: false, targetElement: target };
|
|
5286
|
+
const eventArgs = { popup: this.popupObj, cancel: false, targetElement: target };
|
|
5249
5287
|
this.parent.trigger(beforeQuickToolbarOpen, eventArgs, (beforeQuickToolbarArgs) => {
|
|
5250
5288
|
if (!beforeQuickToolbarArgs.cancel) {
|
|
5251
5289
|
let editPanelTop;
|
|
@@ -5372,7 +5410,7 @@ class BaseQuickToolbar {
|
|
|
5372
5410
|
this.colorPickerObj.destroyColorPicker();
|
|
5373
5411
|
removeClass([this.element], [CLS_POP]);
|
|
5374
5412
|
detach(element);
|
|
5375
|
-
const args =
|
|
5413
|
+
const args = this.popupObj;
|
|
5376
5414
|
this.parent.trigger(quickToolbarClose, args);
|
|
5377
5415
|
}
|
|
5378
5416
|
}
|
|
@@ -5480,7 +5518,7 @@ class PopupRenderer {
|
|
|
5480
5518
|
this.parent = parent;
|
|
5481
5519
|
}
|
|
5482
5520
|
quickToolbarOpen() {
|
|
5483
|
-
const args =
|
|
5521
|
+
const args = this.popupObj;
|
|
5484
5522
|
this.parent.trigger(quickToolbarOpen, args);
|
|
5485
5523
|
}
|
|
5486
5524
|
/**
|
|
@@ -6756,10 +6794,6 @@ class Formatter {
|
|
|
6756
6794
|
itemCollection: value
|
|
6757
6795
|
};
|
|
6758
6796
|
extend(args, args, items, true);
|
|
6759
|
-
if (isBlazor()) {
|
|
6760
|
-
delete args.item;
|
|
6761
|
-
delete args.itemCollection;
|
|
6762
|
-
}
|
|
6763
6797
|
self.trigger(actionBegin, args, (actionBeginArgs) => {
|
|
6764
6798
|
if (actionBeginArgs.cancel) {
|
|
6765
6799
|
if (action === 'paste' || action === 'cut' || action === 'copy') {
|
|
@@ -6771,10 +6805,16 @@ class Formatter {
|
|
|
6771
6805
|
const isTableModule = isNullOrUndefined(self.tableModule) ? true : self.tableModule ?
|
|
6772
6806
|
self.tableModule.ensureInsideTableList : false;
|
|
6773
6807
|
if ((event.which === 9 && isTableModule) || event.which !== 9) {
|
|
6808
|
+
if (event.which === 13 && self.editorMode === 'HTML') {
|
|
6809
|
+
value = {
|
|
6810
|
+
'enterAction': self.enterKey
|
|
6811
|
+
};
|
|
6812
|
+
}
|
|
6774
6813
|
this.editorManager.observer.notify((event.type === 'keydown' ? KEY_DOWN : KEY_UP), {
|
|
6775
6814
|
event: event,
|
|
6776
6815
|
callBack: this.onSuccess.bind(this, self),
|
|
6777
|
-
value: value
|
|
6816
|
+
value: value,
|
|
6817
|
+
enterAction: self.enterKey
|
|
6778
6818
|
});
|
|
6779
6819
|
}
|
|
6780
6820
|
}
|
|
@@ -6802,7 +6842,7 @@ class Formatter {
|
|
|
6802
6842
|
else {
|
|
6803
6843
|
this.editorManager.observer.notify(checkUndo, { subCommand: actionBeginArgs.item.subCommand });
|
|
6804
6844
|
this.editorManager.execCommand(actionBeginArgs.item.command, actionBeginArgs.item.subCommand, event, this.onSuccess.bind(this, self), actionBeginArgs.item.value, actionBeginArgs.item.subCommand === 'Pre' && args.name === 'dropDownSelect' ?
|
|
6805
|
-
{ name: args.name } : value, ('#' + self.getID() + ' iframe'));
|
|
6845
|
+
{ name: args.name } : value, ('#' + self.getID() + ' iframe'), self.enterKey);
|
|
6806
6846
|
}
|
|
6807
6847
|
}
|
|
6808
6848
|
});
|
|
@@ -10164,8 +10204,8 @@ class DOMNode {
|
|
|
10164
10204
|
this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
|
|
10165
10205
|
}
|
|
10166
10206
|
else if (start.tagName === 'BR') {
|
|
10167
|
-
this.replaceWith(start, this.marker(
|
|
10168
|
-
const markerStart = range.startContainer.querySelector('.' +
|
|
10207
|
+
this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
|
|
10208
|
+
const markerStart = range.startContainer.querySelector('.' + className);
|
|
10169
10209
|
markerStart.appendChild(start);
|
|
10170
10210
|
}
|
|
10171
10211
|
else {
|
|
@@ -10406,7 +10446,7 @@ class Lists {
|
|
|
10406
10446
|
const olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
|
|
10407
10447
|
if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
|
|
10408
10448
|
for (let i = 0; i < olListStartRegex.length; i++) {
|
|
10409
|
-
if (olListStartRegex[i].test(range.startContainer.textContent.slice(0, range.startOffset).trim())) {
|
|
10449
|
+
if (olListStartRegex[i].test(range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim())) {
|
|
10410
10450
|
return true;
|
|
10411
10451
|
}
|
|
10412
10452
|
}
|
|
@@ -10434,8 +10474,8 @@ class Lists {
|
|
|
10434
10474
|
this.applyListsHandler({ subCommand: 'OL', callBack: e.callBack });
|
|
10435
10475
|
e.event.preventDefault();
|
|
10436
10476
|
}
|
|
10437
|
-
else if (range.startContainer.textContent.slice(0, range.startOffset).trim() === '*' ||
|
|
10438
|
-
range.startContainer.textContent.slice(0, range.startOffset).trim() === '-') {
|
|
10477
|
+
else if (range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '*' ||
|
|
10478
|
+
range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '-') {
|
|
10439
10479
|
range.startContainer.textContent = range.startContainer.textContent.slice(range.startOffset, range.startContainer.textContent.length);
|
|
10440
10480
|
this.applyListsHandler({ subCommand: 'UL', callBack: e.callBack });
|
|
10441
10481
|
e.event.preventDefault();
|
|
@@ -10456,15 +10496,24 @@ class Lists {
|
|
|
10456
10496
|
const startNodeParent = startNode.parentElement;
|
|
10457
10497
|
if (isNullOrUndefined(startNodeParent.parentElement.closest('UL')) && isNullOrUndefined(startNodeParent.parentElement.closest('OL'))) {
|
|
10458
10498
|
if (!isNullOrUndefined(startNode.nextElementSibling)) {
|
|
10459
|
-
//startNode.classList.add('innerNode');
|
|
10460
10499
|
const nearBlockNode = this.parent.domNode.blockParentNode(startNode);
|
|
10461
10500
|
this.parent.nodeCutter.GetSpliceNode(range, nearBlockNode);
|
|
10462
10501
|
}
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10502
|
+
let insertTag;
|
|
10503
|
+
if (e.enterAction === 'DIV') {
|
|
10504
|
+
insertTag = createElement('div');
|
|
10505
|
+
insertTag.innerHTML = '<br>';
|
|
10506
|
+
}
|
|
10507
|
+
else if (e.enterAction === 'P') {
|
|
10508
|
+
insertTag = createElement('p');
|
|
10509
|
+
insertTag.innerHTML = '<br>';
|
|
10510
|
+
}
|
|
10511
|
+
else {
|
|
10512
|
+
insertTag = createElement('br');
|
|
10513
|
+
}
|
|
10514
|
+
this.parent.domNode.insertAfter(insertTag, startNodeParent);
|
|
10466
10515
|
e.event.preventDefault();
|
|
10467
|
-
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,
|
|
10516
|
+
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, insertTag, 0);
|
|
10468
10517
|
if (startNodeParent.textContent === '') {
|
|
10469
10518
|
detach(startNodeParent);
|
|
10470
10519
|
}
|
|
@@ -10760,7 +10809,67 @@ class Lists {
|
|
|
10760
10809
|
this.currentAction = e.subCommand;
|
|
10761
10810
|
this.currentAction = e.subCommand = this.currentAction === 'NumberFormatList' ? 'OL' : this.currentAction === 'BulletFormatList' ? 'UL' : this.currentAction;
|
|
10762
10811
|
this.domNode.setMarker(this.saveSelection);
|
|
10763
|
-
|
|
10812
|
+
let listsNodes = this.domNode.blockNodes();
|
|
10813
|
+
if (e.enterAction === 'BR') {
|
|
10814
|
+
this.setSelectionBRConfig();
|
|
10815
|
+
const allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
|
|
10816
|
+
const selectedNodes = this.parent.nodeSelection.getSelectionNodes(allSelectedNode);
|
|
10817
|
+
const currentFormatNodes = [];
|
|
10818
|
+
if (selectedNodes.length === 0) {
|
|
10819
|
+
selectedNodes.push(listsNodes[0]);
|
|
10820
|
+
}
|
|
10821
|
+
for (let i = 0; i < selectedNodes.length; i++) {
|
|
10822
|
+
let currentNode = selectedNodes[i];
|
|
10823
|
+
let previousCurrentNode;
|
|
10824
|
+
while (!this.parent.domNode.isBlockNode(currentNode) && currentNode !== this.parent.editableElement) {
|
|
10825
|
+
previousCurrentNode = currentNode;
|
|
10826
|
+
currentNode = currentNode.parentElement;
|
|
10827
|
+
}
|
|
10828
|
+
if (this.parent.domNode.isBlockNode(currentNode) && currentNode === this.parent.editableElement) {
|
|
10829
|
+
currentFormatNodes.push(previousCurrentNode);
|
|
10830
|
+
}
|
|
10831
|
+
}
|
|
10832
|
+
for (let i = 0; i < currentFormatNodes.length; i++) {
|
|
10833
|
+
if (!this.parent.domNode.isBlockNode(currentFormatNodes[i])) {
|
|
10834
|
+
let currentNode = currentFormatNodes[i];
|
|
10835
|
+
let previousNode = currentNode;
|
|
10836
|
+
while (currentNode === this.parent.editableElement) {
|
|
10837
|
+
previousNode = currentNode;
|
|
10838
|
+
currentNode = currentNode.parentElement;
|
|
10839
|
+
}
|
|
10840
|
+
let tempElem;
|
|
10841
|
+
if (this.parent.domNode.isBlockNode(previousNode.parentElement) &&
|
|
10842
|
+
previousNode.parentElement === this.parent.editableElement) {
|
|
10843
|
+
tempElem = createElement('p');
|
|
10844
|
+
previousNode.parentElement.insertBefore(tempElem, previousNode);
|
|
10845
|
+
tempElem.appendChild(previousNode);
|
|
10846
|
+
}
|
|
10847
|
+
else {
|
|
10848
|
+
tempElem = previousNode;
|
|
10849
|
+
}
|
|
10850
|
+
let preNode = tempElem.previousSibling;
|
|
10851
|
+
while (!isNullOrUndefined(preNode) && preNode.nodeName !== 'BR' &&
|
|
10852
|
+
!this.parent.domNode.isBlockNode(preNode)) {
|
|
10853
|
+
tempElem.firstChild.parentElement.insertBefore(preNode, tempElem.firstChild);
|
|
10854
|
+
preNode = tempElem.previousSibling;
|
|
10855
|
+
}
|
|
10856
|
+
if (!isNullOrUndefined(preNode) && preNode.nodeName === 'BR') {
|
|
10857
|
+
detach(preNode);
|
|
10858
|
+
}
|
|
10859
|
+
let postNode = tempElem.nextSibling;
|
|
10860
|
+
while (!isNullOrUndefined(postNode) && postNode.nodeName !== 'BR' &&
|
|
10861
|
+
!this.parent.domNode.isBlockNode(postNode)) {
|
|
10862
|
+
tempElem.appendChild(postNode);
|
|
10863
|
+
postNode = tempElem.nextSibling;
|
|
10864
|
+
}
|
|
10865
|
+
if (!isNullOrUndefined(postNode) && postNode.nodeName === 'BR') {
|
|
10866
|
+
detach(postNode);
|
|
10867
|
+
}
|
|
10868
|
+
}
|
|
10869
|
+
}
|
|
10870
|
+
this.setSelectionBRConfig();
|
|
10871
|
+
listsNodes = this.parent.domNode.blockNodes();
|
|
10872
|
+
}
|
|
10764
10873
|
for (let i = 0; i < listsNodes.length; i++) {
|
|
10765
10874
|
if (listsNodes[i].tagName === 'TABLE' && !range.collapsed) {
|
|
10766
10875
|
listsNodes.splice(i, 1);
|
|
@@ -10781,6 +10890,16 @@ class Lists {
|
|
|
10781
10890
|
});
|
|
10782
10891
|
}
|
|
10783
10892
|
}
|
|
10893
|
+
setSelectionBRConfig() {
|
|
10894
|
+
const startElem = this.parent.editableElement.querySelector('.' + markerClassName.startSelection);
|
|
10895
|
+
const endElem = this.parent.editableElement.querySelector('.' + markerClassName.endSelection);
|
|
10896
|
+
if (isNullOrUndefined(endElem)) {
|
|
10897
|
+
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, startElem, 0);
|
|
10898
|
+
}
|
|
10899
|
+
else {
|
|
10900
|
+
this.parent.nodeSelection.setSelectionText(this.parent.currentDocument, startElem, endElem, 0, 0);
|
|
10901
|
+
}
|
|
10902
|
+
}
|
|
10784
10903
|
applyLists(elements, type, selector, item) {
|
|
10785
10904
|
if (this.isRevert(elements, type) && isNullOrUndefined(item)) {
|
|
10786
10905
|
this.revertList(elements);
|
|
@@ -11121,6 +11240,7 @@ class InsertMethods {
|
|
|
11121
11240
|
*/
|
|
11122
11241
|
class NodeCutter {
|
|
11123
11242
|
constructor() {
|
|
11243
|
+
this.enterAction = 'P';
|
|
11124
11244
|
this.position = -1;
|
|
11125
11245
|
this.nodeSelection = new NodeSelection();
|
|
11126
11246
|
}
|
|
@@ -11353,7 +11473,7 @@ class Formats {
|
|
|
11353
11473
|
if (e.event.which === 13 && range.startContainer === endCon && endCon.nodeType !== 3) {
|
|
11354
11474
|
const pTag = createElement('p');
|
|
11355
11475
|
pTag.innerHTML = '<br>';
|
|
11356
|
-
if (lastChild && lastChild.nodeName === 'BR' && (lastChild.previousSibling && lastChild.previousSibling.nodeName === 'TABLE')) {
|
|
11476
|
+
if (!isNullOrUndefined(lastChild) && lastChild && lastChild.nodeName === 'BR' && (lastChild.previousSibling && lastChild.previousSibling.nodeName === 'TABLE')) {
|
|
11357
11477
|
endCon.replaceChild(pTag, lastChild);
|
|
11358
11478
|
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, pTag, 0);
|
|
11359
11479
|
}
|
|
@@ -11396,7 +11516,7 @@ class Formats {
|
|
|
11396
11516
|
let startParent = range.startContainer;
|
|
11397
11517
|
if (!isNullOrUndefined(lastEmpty) && !isNullOrUndefined(lastBeforeBr) && isNullOrUndefined(lastEmpty.nextSibling) &&
|
|
11398
11518
|
lastEmpty.nodeName === 'BR' && lastBeforeBr.nodeName === 'BR') {
|
|
11399
|
-
this.paraFocus(range.startContainer);
|
|
11519
|
+
this.paraFocus(range.startContainer, e.enterAction);
|
|
11400
11520
|
}
|
|
11401
11521
|
else if ((startParent.textContent.charCodeAt(0) === 8203 &&
|
|
11402
11522
|
startParent.textContent.length === 1) || startParent.textContent.length === 0) {
|
|
@@ -11439,11 +11559,21 @@ class Formats {
|
|
|
11439
11559
|
range.deleteContents();
|
|
11440
11560
|
}
|
|
11441
11561
|
}
|
|
11442
|
-
paraFocus(referNode) {
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11562
|
+
paraFocus(referNode, enterAction) {
|
|
11563
|
+
let insertTag;
|
|
11564
|
+
if (enterAction === 'DIV') {
|
|
11565
|
+
insertTag = createElement('div');
|
|
11566
|
+
insertTag.innerHTML = '<br>';
|
|
11567
|
+
}
|
|
11568
|
+
else if (enterAction === 'BR') {
|
|
11569
|
+
insertTag = createElement('br');
|
|
11570
|
+
}
|
|
11571
|
+
else {
|
|
11572
|
+
insertTag = createElement('p');
|
|
11573
|
+
insertTag.innerHTML = '<br>';
|
|
11574
|
+
}
|
|
11575
|
+
this.parent.domNode.insertAfter(insertTag, referNode);
|
|
11576
|
+
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, insertTag, 0);
|
|
11447
11577
|
detach(referNode.lastChild);
|
|
11448
11578
|
}
|
|
11449
11579
|
isNotEndCursor(preElem, range) {
|
|
@@ -11524,7 +11654,67 @@ class Formats {
|
|
|
11524
11654
|
}
|
|
11525
11655
|
let save = this.parent.nodeSelection.save(range, this.parent.currentDocument);
|
|
11526
11656
|
this.parent.domNode.setMarker(save);
|
|
11527
|
-
|
|
11657
|
+
let formatsNodes = this.parent.domNode.blockNodes();
|
|
11658
|
+
if (e.enterAction === 'BR') {
|
|
11659
|
+
this.setSelectionBRConfig();
|
|
11660
|
+
const allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
|
|
11661
|
+
const selectedNodes = this.parent.nodeSelection.getSelectionNodes(allSelectedNode);
|
|
11662
|
+
const currentFormatNodes = [];
|
|
11663
|
+
if (selectedNodes.length === 0) {
|
|
11664
|
+
selectedNodes.push(formatsNodes[0]);
|
|
11665
|
+
}
|
|
11666
|
+
for (let i = 0; i < selectedNodes.length; i++) {
|
|
11667
|
+
let currentNode = selectedNodes[i];
|
|
11668
|
+
let previousCurrentNode;
|
|
11669
|
+
while (!this.parent.domNode.isBlockNode(currentNode) && currentNode !== this.parent.editableElement) {
|
|
11670
|
+
previousCurrentNode = currentNode;
|
|
11671
|
+
currentNode = currentNode.parentElement;
|
|
11672
|
+
}
|
|
11673
|
+
if (this.parent.domNode.isBlockNode(currentNode) && currentNode === this.parent.editableElement) {
|
|
11674
|
+
currentFormatNodes.push(previousCurrentNode);
|
|
11675
|
+
}
|
|
11676
|
+
}
|
|
11677
|
+
for (let i = 0; i < currentFormatNodes.length; i++) {
|
|
11678
|
+
if (!this.parent.domNode.isBlockNode(currentFormatNodes[i])) {
|
|
11679
|
+
let currentNode = currentFormatNodes[i];
|
|
11680
|
+
let previousNode = currentNode;
|
|
11681
|
+
while (currentNode === this.parent.editableElement) {
|
|
11682
|
+
previousNode = currentNode;
|
|
11683
|
+
currentNode = currentNode.parentElement;
|
|
11684
|
+
}
|
|
11685
|
+
let tempElem;
|
|
11686
|
+
if (this.parent.domNode.isBlockNode(previousNode.parentElement) &&
|
|
11687
|
+
previousNode.parentElement === this.parent.editableElement) {
|
|
11688
|
+
tempElem = createElement('div');
|
|
11689
|
+
previousNode.parentElement.insertBefore(tempElem, previousNode);
|
|
11690
|
+
tempElem.appendChild(previousNode);
|
|
11691
|
+
}
|
|
11692
|
+
else {
|
|
11693
|
+
tempElem = previousNode;
|
|
11694
|
+
}
|
|
11695
|
+
let preNode = tempElem.previousSibling;
|
|
11696
|
+
while (!isNullOrUndefined(preNode) && preNode.nodeName !== 'BR' &&
|
|
11697
|
+
!this.parent.domNode.isBlockNode(preNode)) {
|
|
11698
|
+
tempElem.firstChild.parentElement.insertBefore(preNode, tempElem.firstChild);
|
|
11699
|
+
preNode = tempElem.previousSibling;
|
|
11700
|
+
}
|
|
11701
|
+
if (!isNullOrUndefined(preNode) && preNode.nodeName === 'BR') {
|
|
11702
|
+
detach(preNode);
|
|
11703
|
+
}
|
|
11704
|
+
let postNode = tempElem.nextSibling;
|
|
11705
|
+
while (!isNullOrUndefined(postNode) && postNode.nodeName !== 'BR' &&
|
|
11706
|
+
!this.parent.domNode.isBlockNode(postNode)) {
|
|
11707
|
+
tempElem.appendChild(postNode);
|
|
11708
|
+
postNode = tempElem.nextSibling;
|
|
11709
|
+
}
|
|
11710
|
+
if (!isNullOrUndefined(postNode) && postNode.nodeName === 'BR') {
|
|
11711
|
+
detach(postNode);
|
|
11712
|
+
}
|
|
11713
|
+
}
|
|
11714
|
+
}
|
|
11715
|
+
this.setSelectionBRConfig();
|
|
11716
|
+
formatsNodes = this.parent.domNode.blockNodes();
|
|
11717
|
+
}
|
|
11528
11718
|
for (let i = 0; i < formatsNodes.length; i++) {
|
|
11529
11719
|
let parentNode;
|
|
11530
11720
|
let replaceHTML;
|
|
@@ -11583,6 +11773,16 @@ class Formats {
|
|
|
11583
11773
|
});
|
|
11584
11774
|
}
|
|
11585
11775
|
}
|
|
11776
|
+
setSelectionBRConfig() {
|
|
11777
|
+
const startElem = this.parent.editableElement.querySelector('.' + markerClassName.startSelection);
|
|
11778
|
+
const endElem = this.parent.editableElement.querySelector('.' + markerClassName.endSelection);
|
|
11779
|
+
if (isNullOrUndefined(endElem)) {
|
|
11780
|
+
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, startElem, 0);
|
|
11781
|
+
}
|
|
11782
|
+
else {
|
|
11783
|
+
this.parent.nodeSelection.setSelectionText(this.parent.currentDocument, startElem, endElem, 0, 0);
|
|
11784
|
+
}
|
|
11785
|
+
}
|
|
11586
11786
|
preFormatMerge() {
|
|
11587
11787
|
const preNodes = this.parent.editableElement.querySelectorAll('PRE');
|
|
11588
11788
|
if (!isNullOrUndefined(preNodes)) {
|
|
@@ -11713,7 +11913,7 @@ class InsertHtml {
|
|
|
11713
11913
|
}
|
|
11714
11914
|
else {
|
|
11715
11915
|
range.deleteContents();
|
|
11716
|
-
if (isCursor && range.startContainer.textContent === '') {
|
|
11916
|
+
if (isCursor && range.startContainer.textContent === '' && range.startContainer.nodeName !== 'BR') {
|
|
11717
11917
|
range.startContainer.innerHTML = '';
|
|
11718
11918
|
}
|
|
11719
11919
|
if (Browser.isIE) {
|
|
@@ -11732,7 +11932,12 @@ class InsertHtml {
|
|
|
11732
11932
|
}
|
|
11733
11933
|
}
|
|
11734
11934
|
else {
|
|
11735
|
-
range.
|
|
11935
|
+
if (range.startContainer.nodeName === 'BR') {
|
|
11936
|
+
range.startContainer.parentElement.insertBefore(node, range.startContainer);
|
|
11937
|
+
}
|
|
11938
|
+
else {
|
|
11939
|
+
range.insertNode(node);
|
|
11940
|
+
}
|
|
11736
11941
|
}
|
|
11737
11942
|
if (node.nodeType !== 3 && node.childNodes.length > 0) {
|
|
11738
11943
|
nodeSelection.setSelectionText(docElement, node, node, 1, 1);
|
|
@@ -11944,6 +12149,9 @@ class InsertHtml {
|
|
|
11944
12149
|
range.setStart(editNode.firstElementChild, editNode.firstElementChild.textContent.length);
|
|
11945
12150
|
range.setEnd(editNode.firstElementChild, editNode.firstElementChild.textContent.length);
|
|
11946
12151
|
}
|
|
12152
|
+
if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
|
|
12153
|
+
blockNode = range.startContainer;
|
|
12154
|
+
}
|
|
11947
12155
|
if (blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH') {
|
|
11948
12156
|
const tempSpan = createElement('span', { className: 'tempSpan' });
|
|
11949
12157
|
range.insertNode(tempSpan);
|
|
@@ -12796,8 +13004,10 @@ class ImageCommand {
|
|
|
12796
13004
|
const selectNode = e.item.selectNode[0];
|
|
12797
13005
|
selectNode.style.height = '';
|
|
12798
13006
|
selectNode.style.width = '';
|
|
12799
|
-
selectNode.width = e.item.width
|
|
12800
|
-
|
|
13007
|
+
e.item.width !== 'auto' ? selectNode.style.width = formatUnit(e.item.width) :
|
|
13008
|
+
selectNode.removeAttribute('width');
|
|
13009
|
+
e.item.height !== 'auto' ? selectNode.style.height = formatUnit(e.item.height) :
|
|
13010
|
+
selectNode.removeAttribute('height');
|
|
12801
13011
|
this.callBack(e);
|
|
12802
13012
|
}
|
|
12803
13013
|
imageCaption(e) {
|
|
@@ -12806,59 +13016,65 @@ class ImageCommand {
|
|
|
12806
13016
|
}
|
|
12807
13017
|
imageJustifyLeft(e) {
|
|
12808
13018
|
const selectNode = e.item.selectNode[0];
|
|
12809
|
-
selectNode
|
|
12810
|
-
|
|
12811
|
-
|
|
12812
|
-
|
|
12813
|
-
|
|
12814
|
-
|
|
12815
|
-
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
|
|
13019
|
+
if (!isNullOrUndefined(selectNode)) {
|
|
13020
|
+
selectNode.removeAttribute('class');
|
|
13021
|
+
addClass([selectNode], 'e-rte-image');
|
|
13022
|
+
if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
|
|
13023
|
+
removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
|
|
13024
|
+
addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
|
|
13025
|
+
}
|
|
13026
|
+
if (selectNode.parentElement.nodeName === 'A') {
|
|
13027
|
+
removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
|
|
13028
|
+
addClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
|
|
13029
|
+
addClass([selectNode], CLASS_IMAGE_LEFT);
|
|
13030
|
+
}
|
|
13031
|
+
else {
|
|
13032
|
+
addClass([selectNode], CLASS_IMAGE_LEFT);
|
|
13033
|
+
}
|
|
13034
|
+
this.callBack(e);
|
|
12822
13035
|
}
|
|
12823
|
-
this.callBack(e);
|
|
12824
13036
|
}
|
|
12825
13037
|
imageJustifyCenter(e) {
|
|
12826
13038
|
const selectNode = e.item.selectNode[0];
|
|
12827
|
-
selectNode
|
|
12828
|
-
|
|
12829
|
-
|
|
12830
|
-
|
|
12831
|
-
|
|
12832
|
-
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
|
|
12838
|
-
|
|
12839
|
-
|
|
12840
|
-
|
|
12841
|
-
|
|
13039
|
+
if (!isNullOrUndefined(selectNode)) {
|
|
13040
|
+
selectNode.removeAttribute('class');
|
|
13041
|
+
addClass([selectNode], 'e-rte-image');
|
|
13042
|
+
if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
|
|
13043
|
+
removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
|
|
13044
|
+
removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
|
|
13045
|
+
addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_CENTER);
|
|
13046
|
+
}
|
|
13047
|
+
if (selectNode.parentElement.nodeName === 'A') {
|
|
13048
|
+
removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
|
|
13049
|
+
removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
|
|
13050
|
+
addClass([selectNode.parentElement], CLASS_IMAGE_CENTER);
|
|
13051
|
+
addClass([selectNode], CLASS_IMAGE_CENTER);
|
|
13052
|
+
}
|
|
13053
|
+
else {
|
|
13054
|
+
addClass([selectNode], CLASS_IMAGE_CENTER);
|
|
13055
|
+
}
|
|
13056
|
+
this.callBack(e);
|
|
12842
13057
|
}
|
|
12843
|
-
this.callBack(e);
|
|
12844
13058
|
}
|
|
12845
13059
|
imageJustifyRight(e) {
|
|
12846
13060
|
const selectNode = e.item.selectNode[0];
|
|
12847
|
-
selectNode
|
|
12848
|
-
|
|
12849
|
-
|
|
12850
|
-
|
|
12851
|
-
|
|
12852
|
-
|
|
12853
|
-
|
|
12854
|
-
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
|
|
13061
|
+
if (!isNullOrUndefined(selectNode)) {
|
|
13062
|
+
selectNode.removeAttribute('class');
|
|
13063
|
+
addClass([selectNode], 'e-rte-image');
|
|
13064
|
+
if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
|
|
13065
|
+
removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
|
|
13066
|
+
addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
|
|
13067
|
+
}
|
|
13068
|
+
if (selectNode.parentElement.nodeName === 'A') {
|
|
13069
|
+
removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
|
|
13070
|
+
addClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
|
|
13071
|
+
addClass([selectNode], CLASS_IMAGE_RIGHT);
|
|
13072
|
+
}
|
|
13073
|
+
else {
|
|
13074
|
+
addClass([selectNode], CLASS_IMAGE_RIGHT);
|
|
13075
|
+
}
|
|
13076
|
+
this.callBack(e);
|
|
12860
13077
|
}
|
|
12861
|
-
this.callBack(e);
|
|
12862
13078
|
}
|
|
12863
13079
|
imageInline(e) {
|
|
12864
13080
|
const selectNode = e.item.selectNode[0];
|
|
@@ -12947,7 +13163,7 @@ class TableCommand {
|
|
|
12947
13163
|
}
|
|
12948
13164
|
const tdWid = parseInt(e.item.width.width, 10) > 100 ?
|
|
12949
13165
|
100 / e.item.columns : parseInt(e.item.width.width, 10) / e.item.columns;
|
|
12950
|
-
for (let i = 0; i < e.item.
|
|
13166
|
+
for (let i = 0; i < e.item.rows; i++) {
|
|
12951
13167
|
const row = createElement('tr');
|
|
12952
13168
|
for (let j = 0; j < e.item.columns; j++) {
|
|
12953
13169
|
const cell = createElement('td');
|
|
@@ -12963,9 +13179,19 @@ class TableCommand {
|
|
|
12963
13179
|
this.removeEmptyNode();
|
|
12964
13180
|
e.item.selection.setSelectionText(this.parent.currentDocument, table.querySelector('td'), table.querySelector('td'), 0, 0);
|
|
12965
13181
|
if (table.nextElementSibling === null) {
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
13182
|
+
let insertElem;
|
|
13183
|
+
if (e.enterAction === 'DIV') {
|
|
13184
|
+
insertElem = createElement('div');
|
|
13185
|
+
insertElem.appendChild(createElement('br'));
|
|
13186
|
+
}
|
|
13187
|
+
else if (e.enterAction === 'BR') {
|
|
13188
|
+
insertElem = createElement('br');
|
|
13189
|
+
}
|
|
13190
|
+
else {
|
|
13191
|
+
insertElem = createElement('p');
|
|
13192
|
+
insertElem.appendChild(createElement('br'));
|
|
13193
|
+
}
|
|
13194
|
+
this.insertAfter(insertElem, table);
|
|
12969
13195
|
}
|
|
12970
13196
|
table.querySelector('td').classList.add('e-cell-select');
|
|
12971
13197
|
if (e.callBack) {
|
|
@@ -13104,16 +13330,16 @@ class TableCommand {
|
|
|
13104
13330
|
const curRow = closest(selectedCell, 'tr');
|
|
13105
13331
|
let curCell;
|
|
13106
13332
|
const allRows = closest((curRow), 'table').rows;
|
|
13107
|
-
const colIndex = Array.prototype.slice.call(curRow.querySelectorAll('th
|
|
13108
|
-
const previousWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll('td,th').length);
|
|
13109
|
-
const currentWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll('td,th').length + 1);
|
|
13333
|
+
const colIndex = Array.prototype.slice.call(curRow.querySelectorAll(':scope > td, :scope > th')).indexOf(selectedCell);
|
|
13334
|
+
const previousWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll(':scope > td, :scope > th').length);
|
|
13335
|
+
const currentWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll(':scope > td, :scope > th').length + 1);
|
|
13110
13336
|
let currentTabElm = closest(curRow, 'table');
|
|
13111
13337
|
let thTdElm = closest(curRow, 'table').querySelectorAll('th,td');
|
|
13112
13338
|
for (let i = 0; i < thTdElm.length; i++) {
|
|
13113
13339
|
thTdElm[i].dataset.oldWidth = (thTdElm[i].offsetWidth / currentTabElm.offsetWidth * 100) + "%";
|
|
13114
13340
|
}
|
|
13115
13341
|
for (let i = 0; i < allRows.length; i++) {
|
|
13116
|
-
curCell = allRows[i].querySelectorAll('th
|
|
13342
|
+
curCell = allRows[i].querySelectorAll(':scope > td, :scope > th')[colIndex];
|
|
13117
13343
|
const colTemplate = curCell.cloneNode(true);
|
|
13118
13344
|
colTemplate.innerHTML = '';
|
|
13119
13345
|
colTemplate.appendChild(createElement('br'));
|
|
@@ -13646,7 +13872,7 @@ class TableCommand {
|
|
|
13646
13872
|
// eslint-disable-next-line
|
|
13647
13873
|
let _this = this;
|
|
13648
13874
|
const colspan = 0;
|
|
13649
|
-
const allRows = _this.curTable.
|
|
13875
|
+
const allRows = _this.curTable.rows;
|
|
13650
13876
|
for (let i = 0; i <= allRows.length - 1; i++) {
|
|
13651
13877
|
const ele = allRows[i];
|
|
13652
13878
|
let index = 0;
|
|
@@ -14042,7 +14268,8 @@ IsFormatted.inlineTags = [
|
|
|
14042
14268
|
'sup',
|
|
14043
14269
|
'tt',
|
|
14044
14270
|
'u',
|
|
14045
|
-
'var'
|
|
14271
|
+
'var',
|
|
14272
|
+
'del'
|
|
14046
14273
|
];
|
|
14047
14274
|
|
|
14048
14275
|
/**
|
|
@@ -14061,7 +14288,8 @@ class SelectionCommands {
|
|
|
14061
14288
|
* @hidden
|
|
14062
14289
|
* @deprecated
|
|
14063
14290
|
*/
|
|
14064
|
-
static applyFormat(docElement, format, endNode, value, selector) {
|
|
14291
|
+
static applyFormat(docElement, format, endNode, enterAction, value, selector) {
|
|
14292
|
+
this.enterAction = enterAction;
|
|
14065
14293
|
const validFormats = ['bold', 'italic', 'underline', 'strikethrough', 'superscript',
|
|
14066
14294
|
'subscript', 'uppercase', 'lowercase', 'fontcolor', 'fontname', 'fontsize', 'backgroundcolor'];
|
|
14067
14295
|
if (validFormats.indexOf(format) > -1) {
|
|
@@ -14137,7 +14365,7 @@ class SelectionCommands {
|
|
|
14137
14365
|
save.restore();
|
|
14138
14366
|
}
|
|
14139
14367
|
if (isSubSup) {
|
|
14140
|
-
this.applyFormat(docElement, format, endNode);
|
|
14368
|
+
this.applyFormat(docElement, format, endNode, enterAction);
|
|
14141
14369
|
}
|
|
14142
14370
|
}
|
|
14143
14371
|
}
|
|
@@ -14157,6 +14385,10 @@ class SelectionCommands {
|
|
|
14157
14385
|
cursorNodes[0].firstElementChild.tagName.toLowerCase() === 'br')) {
|
|
14158
14386
|
cursorNodes[0].innerHTML = '';
|
|
14159
14387
|
}
|
|
14388
|
+
if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' ||
|
|
14389
|
+
cursorNodes[0].nextSibling.nodeName === 'BR')) {
|
|
14390
|
+
detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
|
|
14391
|
+
}
|
|
14160
14392
|
cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
|
|
14161
14393
|
}
|
|
14162
14394
|
return cursorNode;
|
|
@@ -14372,10 +14604,12 @@ class SelectionCommands {
|
|
|
14372
14604
|
return nodes[index];
|
|
14373
14605
|
}
|
|
14374
14606
|
static applyStyles(nodes, index, element) {
|
|
14375
|
-
nodes[index]
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
|
|
14607
|
+
if (!(nodes[index].nodeName === 'BR' && this.enterAction === 'BR')) {
|
|
14608
|
+
nodes[index] = (index === (nodes.length - 1)) || nodes[index].nodeName === 'BR' ?
|
|
14609
|
+
InsertMethods.Wrap(nodes[index], element)
|
|
14610
|
+
: InsertMethods.WrapBefore(nodes[index], element, true);
|
|
14611
|
+
nodes[index] = this.getChildNode(nodes[index], element);
|
|
14612
|
+
}
|
|
14379
14613
|
return nodes[index];
|
|
14380
14614
|
}
|
|
14381
14615
|
static getInsertNode(docElement, range, format, value) {
|
|
@@ -14471,6 +14705,7 @@ class SelectionCommands {
|
|
|
14471
14705
|
}
|
|
14472
14706
|
}
|
|
14473
14707
|
}
|
|
14708
|
+
SelectionCommands.enterAction = 'P';
|
|
14474
14709
|
|
|
14475
14710
|
/**
|
|
14476
14711
|
* Selection EXEC internal component
|
|
@@ -14499,12 +14734,12 @@ class SelectionBasedExec {
|
|
|
14499
14734
|
'subscript', 'uppercase', 'lowercase'];
|
|
14500
14735
|
if (e.event.ctrlKey && validFormats.indexOf(e.event.action) > -1) {
|
|
14501
14736
|
e.event.preventDefault();
|
|
14502
|
-
SelectionCommands.applyFormat(this.parent.currentDocument, e.event.action, this.parent.editableElement);
|
|
14737
|
+
SelectionCommands.applyFormat(this.parent.currentDocument, e.event.action, this.parent.editableElement, e.enterAction);
|
|
14503
14738
|
this.callBack(e, e.event.action);
|
|
14504
14739
|
}
|
|
14505
14740
|
}
|
|
14506
14741
|
applySelection(e) {
|
|
14507
|
-
SelectionCommands.applyFormat(this.parent.currentDocument, e.subCommand.toLocaleLowerCase(), this.parent.editableElement, e.value, e.selector);
|
|
14742
|
+
SelectionCommands.applyFormat(this.parent.currentDocument, e.subCommand.toLocaleLowerCase(), this.parent.editableElement, e.enterAction, e.value, e.selector);
|
|
14508
14743
|
this.callBack(e, e.subCommand);
|
|
14509
14744
|
}
|
|
14510
14745
|
callBack(event, action) {
|
|
@@ -14583,7 +14818,9 @@ class ClearFormat$1 {
|
|
|
14583
14818
|
* @hidden
|
|
14584
14819
|
* @deprecated
|
|
14585
14820
|
*/
|
|
14586
|
-
static clear(docElement, endNode, selector) {
|
|
14821
|
+
static clear(docElement, endNode, enterAction, selector) {
|
|
14822
|
+
this.domNode = new DOMNode(endNode, docElement);
|
|
14823
|
+
this.defaultTag = enterAction === 'P' ? this.defaultTag : 'div';
|
|
14587
14824
|
const nodeSelection = new NodeSelection();
|
|
14588
14825
|
const nodeCutter = new NodeCutter();
|
|
14589
14826
|
let range = nodeSelection.getRange(docElement);
|
|
@@ -14728,12 +14965,12 @@ class ClearFormat$1 {
|
|
|
14728
14965
|
&& this.IGNORE_PARENT_TAGS.indexOf(parentNodes[index1].childNodes[0].nodeName.toLocaleLowerCase()) > -1)
|
|
14729
14966
|
&& !(parentNodes[index1].childNodes.length === 1
|
|
14730
14967
|
&& parentNodes[index1].childNodes[0].nodeName.toLocaleLowerCase() === 'p')) {
|
|
14731
|
-
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(
|
|
14968
|
+
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
|
|
14732
14969
|
}
|
|
14733
14970
|
const childNodes = InsertMethods.unwrap(parentNodes[index1]);
|
|
14734
14971
|
if (childNodes.length === 1
|
|
14735
14972
|
&& childNodes[0].parentNode.nodeName.toLocaleLowerCase() === 'p') {
|
|
14736
|
-
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(
|
|
14973
|
+
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
|
|
14737
14974
|
InsertMethods.unwrap(parentNodes[index1]);
|
|
14738
14975
|
}
|
|
14739
14976
|
for (let index2 = 0; index2 < childNodes.length; index2++) {
|
|
@@ -14751,13 +14988,13 @@ class ClearFormat$1 {
|
|
|
14751
14988
|
}
|
|
14752
14989
|
else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
|
|
14753
14990
|
childNodes[index2].nodeName.toLocaleLowerCase() === 'p') {
|
|
14754
|
-
InsertMethods.Wrap(childNodes[index2], docElement.createElement(
|
|
14991
|
+
InsertMethods.Wrap(childNodes[index2], docElement.createElement(this.defaultTag));
|
|
14755
14992
|
InsertMethods.unwrap(childNodes[index2]);
|
|
14756
14993
|
}
|
|
14757
14994
|
}
|
|
14758
14995
|
}
|
|
14759
14996
|
else {
|
|
14760
|
-
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(
|
|
14997
|
+
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
|
|
14761
14998
|
InsertMethods.unwrap(parentNodes[index1]);
|
|
14762
14999
|
}
|
|
14763
15000
|
}
|
|
@@ -14766,10 +15003,16 @@ class ClearFormat$1 {
|
|
|
14766
15003
|
// eslint-disable-next-line
|
|
14767
15004
|
endNode) {
|
|
14768
15005
|
for (let index = 0; index < textNodes.length; index++) {
|
|
14769
|
-
|
|
14770
|
-
|
|
14771
|
-
|
|
14772
|
-
|
|
15006
|
+
let currentInlineNode = textNodes[index];
|
|
15007
|
+
let currentNode;
|
|
15008
|
+
while (!this.domNode.isBlockNode(currentInlineNode)) {
|
|
15009
|
+
currentNode = currentInlineNode;
|
|
15010
|
+
currentInlineNode = currentInlineNode.parentElement;
|
|
15011
|
+
}
|
|
15012
|
+
if (currentNode &&
|
|
15013
|
+
IsFormatted.inlineTags.indexOf(currentNode.nodeName.toLocaleLowerCase()) > -1) {
|
|
15014
|
+
nodeCutter.GetSpliceNode(range, currentNode);
|
|
15015
|
+
this.removeInlineParent(currentNode);
|
|
14773
15016
|
}
|
|
14774
15017
|
}
|
|
14775
15018
|
}
|
|
@@ -14793,6 +15036,7 @@ ClearFormat$1.BLOCK_TAGS = ['address', 'article', 'aside', 'blockquote',
|
|
|
14793
15036
|
ClearFormat$1.NONVALID_PARENT_TAGS = ['thead', 'tbody', 'ul', 'ol', 'table', 'tfoot', 'tr'];
|
|
14794
15037
|
ClearFormat$1.IGNORE_PARENT_TAGS = ['ul', 'ol', 'table'];
|
|
14795
15038
|
ClearFormat$1.NONVALID_TAGS = ['thead', 'tbody', 'figcaption', 'td', 'tr', 'th', 'tfoot', 'figcaption', 'li'];
|
|
15039
|
+
ClearFormat$1.defaultTag = 'p';
|
|
14796
15040
|
|
|
14797
15041
|
/**
|
|
14798
15042
|
* Clear Format EXEC internal component
|
|
@@ -14820,14 +15064,14 @@ class ClearFormatExec {
|
|
|
14820
15064
|
onKeyDown(e) {
|
|
14821
15065
|
switch (e.event.action) {
|
|
14822
15066
|
case 'clear-format':
|
|
14823
|
-
this.applyClear({ subCommand: 'ClearFormat', callBack: e.callBack });
|
|
15067
|
+
this.applyClear({ subCommand: 'ClearFormat', callBack: e.callBack, enterAction: e.enterAction });
|
|
14824
15068
|
e.event.preventDefault();
|
|
14825
15069
|
break;
|
|
14826
15070
|
}
|
|
14827
15071
|
}
|
|
14828
15072
|
applyClear(e) {
|
|
14829
15073
|
if (e.subCommand === 'ClearFormat') {
|
|
14830
|
-
ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.selector);
|
|
15074
|
+
ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.enterAction, e.selector);
|
|
14831
15075
|
if (e.callBack) {
|
|
14832
15076
|
e.callBack({
|
|
14833
15077
|
requestType: e.subCommand,
|
|
@@ -15803,15 +16047,15 @@ class EditorManager {
|
|
|
15803
16047
|
* @deprecated
|
|
15804
16048
|
*/
|
|
15805
16049
|
/* eslint-enable */
|
|
15806
|
-
execCommand(command, value, event, callBack, text, exeValue, selector) {
|
|
16050
|
+
execCommand(command, value, event, callBack, text, exeValue, selector, enterAction) {
|
|
15807
16051
|
switch (command.toLocaleLowerCase()) {
|
|
15808
16052
|
case 'lists':
|
|
15809
16053
|
this.observer.notify(LIST_TYPE, { subCommand: value, event: event, callBack: callBack,
|
|
15810
|
-
selector: selector, item: exeValue });
|
|
16054
|
+
selector: selector, item: exeValue, enterAction: enterAction });
|
|
15811
16055
|
break;
|
|
15812
16056
|
case 'formats':
|
|
15813
16057
|
this.observer.notify(FORMAT_TYPE, { subCommand: value, event: event, callBack: callBack,
|
|
15814
|
-
selector: selector, exeValue: exeValue
|
|
16058
|
+
selector: selector, exeValue: exeValue, enterAction: enterAction
|
|
15815
16059
|
});
|
|
15816
16060
|
break;
|
|
15817
16061
|
case 'alignments':
|
|
@@ -15840,7 +16084,7 @@ class EditorManager {
|
|
|
15840
16084
|
case 'table':
|
|
15841
16085
|
switch (value.toString().toLocaleLowerCase()) {
|
|
15842
16086
|
case 'createtable':
|
|
15843
|
-
this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack });
|
|
16087
|
+
this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack, enterAction: enterAction });
|
|
15844
16088
|
break;
|
|
15845
16089
|
case 'insertrowbefore':
|
|
15846
16090
|
case 'insertrowafter':
|
|
@@ -15882,7 +16126,7 @@ class EditorManager {
|
|
|
15882
16126
|
case 'style':
|
|
15883
16127
|
case 'effects':
|
|
15884
16128
|
case 'casing':
|
|
15885
|
-
this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector });
|
|
16129
|
+
this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector, enterAction: enterAction });
|
|
15886
16130
|
break;
|
|
15887
16131
|
case 'inserthtml':
|
|
15888
16132
|
this.observer.notify(INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text });
|
|
@@ -15891,7 +16135,7 @@ class EditorManager {
|
|
|
15891
16135
|
this.observer.notify(INSERT_TEXT_TYPE, { subCommand: value, callBack: callBack, value: text });
|
|
15892
16136
|
break;
|
|
15893
16137
|
case 'clear':
|
|
15894
|
-
this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector });
|
|
16138
|
+
this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector, enterAction: enterAction });
|
|
15895
16139
|
break;
|
|
15896
16140
|
case 'actions':
|
|
15897
16141
|
this.observer.notify(ACTION, { subCommand: value, event: event, callBack: callBack, selector: selector });
|
|
@@ -16522,10 +16766,10 @@ class IframeContentRender extends ContentRender {
|
|
|
16522
16766
|
rteContent + '</body></html>';
|
|
16523
16767
|
let iFrameContent = IFRAMEHEADER + iFrameBodyContent;
|
|
16524
16768
|
const iframe = this.parent.createElement('iframe', {
|
|
16525
|
-
innerHTML: iFrameContent,
|
|
16526
16769
|
id: this.parent.getID() + '_rte-view',
|
|
16527
16770
|
className: 'e-rte-content',
|
|
16528
|
-
styles: 'display:block;'
|
|
16771
|
+
styles: 'display:block;',
|
|
16772
|
+
attrs: { 'srcdoc': iFrameContent }
|
|
16529
16773
|
});
|
|
16530
16774
|
this.setPanel(iframe);
|
|
16531
16775
|
rteObj.element.appendChild(iframe);
|
|
@@ -16827,33 +17071,40 @@ class HtmlEditor {
|
|
|
16827
17071
|
}
|
|
16828
17072
|
onKeyDown(e) {
|
|
16829
17073
|
let currentRange;
|
|
17074
|
+
let args = e.args;
|
|
16830
17075
|
if (Browser.info.name === 'chrome') {
|
|
16831
17076
|
currentRange = this.parent.getRange();
|
|
16832
17077
|
this.backSpaceCleanup(e, currentRange);
|
|
16833
17078
|
this.deleteCleanup(e, currentRange);
|
|
16834
17079
|
}
|
|
16835
|
-
if (
|
|
16836
|
-
|
|
16837
|
-
|
|
16838
|
-
|
|
16839
|
-
|
|
16840
|
-
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
this.rangeCollection
|
|
16847
|
-
|
|
16848
|
-
|
|
16849
|
-
|
|
16850
|
-
|
|
17080
|
+
if (args.keyCode === 9 && this.parent.enableTabKey) {
|
|
17081
|
+
if (!isNullOrUndefined(args.target) && isNullOrUndefined(closest(args.target, '.e-rte-toolbar'))) {
|
|
17082
|
+
const range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument());
|
|
17083
|
+
const parentNode = this.nodeSelectionObj.getParentNodeCollection(range);
|
|
17084
|
+
if (!((parentNode[0].nodeName === 'LI' || closest(parentNode[0], 'li') ||
|
|
17085
|
+
closest(parentNode[0], 'table')) && range.startOffset === 0)) {
|
|
17086
|
+
args.preventDefault();
|
|
17087
|
+
if (!args.shiftKey) {
|
|
17088
|
+
InsertHtml.Insert(this.contentRenderer.getDocument(), ' ');
|
|
17089
|
+
this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
|
|
17090
|
+
}
|
|
17091
|
+
else if (this.rangeCollection.length > 0 &&
|
|
17092
|
+
this.rangeCollection[this.rangeCollection.length - 1].startContainer.textContent.length === 4) {
|
|
17093
|
+
const textCont = this.rangeCollection[this.rangeCollection.length - 1].startContainer;
|
|
17094
|
+
this.nodeSelectionObj.setSelectionText(this.contentRenderer.getDocument(), textCont, textCont, 0, textCont.textContent.length);
|
|
17095
|
+
InsertHtml.Insert(this.contentRenderer.getDocument(), document.createTextNode(''));
|
|
17096
|
+
this.rangeCollection.pop();
|
|
17097
|
+
}
|
|
16851
17098
|
}
|
|
16852
17099
|
}
|
|
16853
17100
|
}
|
|
16854
17101
|
if (e.args.action === 'space' ||
|
|
16855
|
-
e.args.action === 'enter'
|
|
17102
|
+
e.args.action === 'enter' ||
|
|
17103
|
+
e.args.keyCode === 13) {
|
|
16856
17104
|
this.spaceLink(e.args);
|
|
17105
|
+
if (this.parent.editorMode === 'HTML' && !((this.parent.shiftEnterKey === 'BR' && e.args.shiftKey))) {
|
|
17106
|
+
this.parent.notify(enterHandler, { args: e.args });
|
|
17107
|
+
}
|
|
16857
17108
|
}
|
|
16858
17109
|
if (e.args.action === 'space') {
|
|
16859
17110
|
const currentRange = this.parent.getRange();
|
|
@@ -16895,10 +17146,11 @@ class HtmlEditor {
|
|
|
16895
17146
|
this.oldRangeElement = null;
|
|
16896
17147
|
this.deleteRangeElement = null;
|
|
16897
17148
|
this.deleteOldRangeElement = null;
|
|
16898
|
-
|
|
17149
|
+
args.preventDefault();
|
|
16899
17150
|
}
|
|
16900
17151
|
}
|
|
16901
17152
|
isOrderedList(editorValue) {
|
|
17153
|
+
editorValue = editorValue.replace(/\u200B/g, '');
|
|
16902
17154
|
const olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
|
|
16903
17155
|
if (!isNullOrUndefined(editorValue)) {
|
|
16904
17156
|
for (let i = 0; i < olListStartRegex.length; i++) {
|
|
@@ -16910,6 +17162,7 @@ class HtmlEditor {
|
|
|
16910
17162
|
return false;
|
|
16911
17163
|
}
|
|
16912
17164
|
isUnOrderedList(editorValue) {
|
|
17165
|
+
editorValue = editorValue.replace(/\u200B/g, '');
|
|
16913
17166
|
const ulListStartRegex = [/^[*]$/, /^[-]$/];
|
|
16914
17167
|
if (!isNullOrUndefined(editorValue)) {
|
|
16915
17168
|
for (let i = 0; i < ulListStartRegex.length; i++) {
|
|
@@ -17095,7 +17348,7 @@ class HtmlEditor {
|
|
|
17095
17348
|
let contentInnerElem = '';
|
|
17096
17349
|
for (let i = 0; i < enterSplitText.length; i++) {
|
|
17097
17350
|
if (enterSplitText[i].trim() === '') {
|
|
17098
|
-
contentInnerElem +=
|
|
17351
|
+
contentInnerElem += getDefaultValue(this.parent);
|
|
17099
17352
|
}
|
|
17100
17353
|
else {
|
|
17101
17354
|
let contentWithSpace = '';
|
|
@@ -17522,7 +17775,7 @@ class PasteCleanup {
|
|
|
17522
17775
|
let contentInnerElem = '';
|
|
17523
17776
|
for (let i = 0; i < enterSplitText.length; i++) {
|
|
17524
17777
|
if (enterSplitText[i].trim() === '') {
|
|
17525
|
-
contentInnerElem +=
|
|
17778
|
+
contentInnerElem += getDefaultValue(this.parent);
|
|
17526
17779
|
}
|
|
17527
17780
|
else {
|
|
17528
17781
|
const contentWithSpace = this.makeSpace(enterSplitText[i]);
|
|
@@ -17853,7 +18106,7 @@ class PasteCleanup {
|
|
|
17853
18106
|
dialog.hide();
|
|
17854
18107
|
this.parent.height = isHeight ? preRTEHeight : this.parent.height;
|
|
17855
18108
|
isHeight = false;
|
|
17856
|
-
const argument =
|
|
18109
|
+
const argument = dialog;
|
|
17857
18110
|
this.dialogRenderObj.close(argument);
|
|
17858
18111
|
dialog.destroy();
|
|
17859
18112
|
this.selectFormatting(value, args, keepChecked, cleanChecked);
|
|
@@ -17871,7 +18124,7 @@ class PasteCleanup {
|
|
|
17871
18124
|
dialog.hide();
|
|
17872
18125
|
this.parent.height = isHeight ? preRTEHeight : this.parent.height;
|
|
17873
18126
|
isHeight = false;
|
|
17874
|
-
const args =
|
|
18127
|
+
const args = dialog;
|
|
17875
18128
|
this.dialogRenderObj.close(args);
|
|
17876
18129
|
dialog.destroy();
|
|
17877
18130
|
}
|
|
@@ -18291,7 +18544,7 @@ class Resize {
|
|
|
18291
18544
|
}
|
|
18292
18545
|
this.wireResizeEvents();
|
|
18293
18546
|
this.parent.notify(resizeInitialized, {});
|
|
18294
|
-
const args =
|
|
18547
|
+
const args = { event: e, requestType: 'editor' };
|
|
18295
18548
|
this.parent.trigger(resizeStart, args, (resizeStartArgs) => {
|
|
18296
18549
|
if (resizeStartArgs.cancel) {
|
|
18297
18550
|
this.unwireResizeEvents();
|
|
@@ -18299,7 +18552,7 @@ class Resize {
|
|
|
18299
18552
|
});
|
|
18300
18553
|
}
|
|
18301
18554
|
performResize(e) {
|
|
18302
|
-
const args =
|
|
18555
|
+
const args = { event: e, requestType: 'editor' };
|
|
18303
18556
|
this.parent.trigger(onResize, args, (resizingArgs) => {
|
|
18304
18557
|
if (resizingArgs.cancel) {
|
|
18305
18558
|
this.unwireResizeEvents();
|
|
@@ -18323,7 +18576,7 @@ class Resize {
|
|
|
18323
18576
|
stopResize(e) {
|
|
18324
18577
|
this.parent.refreshUI();
|
|
18325
18578
|
this.unwireResizeEvents();
|
|
18326
|
-
const args =
|
|
18579
|
+
const args = { event: e, requestType: 'editor' };
|
|
18327
18580
|
this.parent.trigger(resizeStop, args);
|
|
18328
18581
|
}
|
|
18329
18582
|
getEventType(e) {
|
|
@@ -18903,9 +19156,17 @@ class Render {
|
|
|
18903
19156
|
const childNodes = this.parent.contentModule.getEditPanel().childNodes;
|
|
18904
19157
|
if ((childNodes.length === 0) ||
|
|
18905
19158
|
(childNodes.length === 1 && childNodes[0].childNodes.length === 0 && ((childNodes[0].tagName === 'BR') ||
|
|
18906
|
-
(childNodes[0].tagName === 'P' && childNodes[0].textContent === '')))) {
|
|
19159
|
+
((childNodes[0].tagName === 'P' || childNodes[0].tagName === 'DIV') && childNodes[0].textContent === '')))) {
|
|
18907
19160
|
const node = this.parent.contentModule.getEditPanel();
|
|
18908
|
-
|
|
19161
|
+
if (this.parent.enterKey === 'DIV') {
|
|
19162
|
+
node.innerHTML = '<div><br/></div>';
|
|
19163
|
+
}
|
|
19164
|
+
else if (this.parent.enterKey === 'BR') {
|
|
19165
|
+
node.innerHTML = '<br/>';
|
|
19166
|
+
}
|
|
19167
|
+
else {
|
|
19168
|
+
node.innerHTML = '<p><br/></p>';
|
|
19169
|
+
}
|
|
18909
19170
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), node.childNodes[0], 0);
|
|
18910
19171
|
}
|
|
18911
19172
|
break;
|
|
@@ -19200,7 +19461,7 @@ class Link {
|
|
|
19200
19461
|
}
|
|
19201
19462
|
this.dialogObj.destroy();
|
|
19202
19463
|
detach(this.dialogObj.element);
|
|
19203
|
-
const args =
|
|
19464
|
+
const args = this.dialogObj;
|
|
19204
19465
|
this.dialogRenderObj.close(args);
|
|
19205
19466
|
this.dialogObj = null;
|
|
19206
19467
|
}
|
|
@@ -19292,7 +19553,8 @@ class Link {
|
|
|
19292
19553
|
proxy.parent.formatter.saveData();
|
|
19293
19554
|
}
|
|
19294
19555
|
let argsValue;
|
|
19295
|
-
if (this.args
|
|
19556
|
+
if (!isNullOrUndefined(this.args) &&
|
|
19557
|
+
this.args.code === 'KeyK') {
|
|
19296
19558
|
const originalEvent = this.args;
|
|
19297
19559
|
extend(this.args, { item: { command: 'Links', subCommand: 'CreateLink' }, originalEvent: originalEvent }, true);
|
|
19298
19560
|
const argsVal = {
|
|
@@ -19421,6 +19683,7 @@ class Link {
|
|
|
19421
19683
|
class Image {
|
|
19422
19684
|
constructor(parent, serviceLocator) {
|
|
19423
19685
|
this.isImgUploaded = false;
|
|
19686
|
+
this.isAllowedTypes = true;
|
|
19424
19687
|
this.pageX = null;
|
|
19425
19688
|
this.pageY = null;
|
|
19426
19689
|
this.deletedImg = [];
|
|
@@ -19541,7 +19804,7 @@ class Image {
|
|
|
19541
19804
|
if (Browser.isDevice) {
|
|
19542
19805
|
removeClass([e.target.parentElement], 'e-mob-span');
|
|
19543
19806
|
}
|
|
19544
|
-
const args =
|
|
19807
|
+
const args = { event: e, requestType: 'images' };
|
|
19545
19808
|
this.parent.trigger(resizeStop, args);
|
|
19546
19809
|
/* eslint-disable */
|
|
19547
19810
|
let pageX = this.getPointX(e);
|
|
@@ -19594,7 +19857,7 @@ class Image {
|
|
|
19594
19857
|
addClass([this.imgResizeDiv], 'e-mob-span');
|
|
19595
19858
|
}
|
|
19596
19859
|
else {
|
|
19597
|
-
const args =
|
|
19860
|
+
const args = { event: e, requestType: 'images' };
|
|
19598
19861
|
this.parent.trigger(resizeStart, args, (resizeStartArgs) => {
|
|
19599
19862
|
if (resizeStartArgs.cancel) {
|
|
19600
19863
|
this.cancelResizeAction();
|
|
@@ -19729,6 +19992,12 @@ class Image {
|
|
|
19729
19992
|
img.style.height = null;
|
|
19730
19993
|
img.removeAttribute('height');
|
|
19731
19994
|
}
|
|
19995
|
+
else if (img.style.width === '' && img.style.height !== '') {
|
|
19996
|
+
img.style.height = expectedY + 'px';
|
|
19997
|
+
}
|
|
19998
|
+
else if (img.style.width !== '' && img.style.height === '') {
|
|
19999
|
+
img.style.width = ((width / height * expectedY) + width / height).toString() + 'px';
|
|
20000
|
+
}
|
|
19732
20001
|
else if (img.style.width !== '') {
|
|
19733
20002
|
img.style.width = (width / height * expectedY) + 'px';
|
|
19734
20003
|
img.style.height = expectedY + 'px';
|
|
@@ -19776,7 +20045,7 @@ class Image {
|
|
|
19776
20045
|
return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
|
|
19777
20046
|
}
|
|
19778
20047
|
imgDupMouseMove(width, height, e) {
|
|
19779
|
-
const args =
|
|
20048
|
+
const args = { event: e, requestType: 'images' };
|
|
19780
20049
|
this.parent.trigger(onResize, args, (resizingArgs) => {
|
|
19781
20050
|
if (resizingArgs.cancel) {
|
|
19782
20051
|
this.cancelResizeAction();
|
|
@@ -20598,7 +20867,7 @@ class Image {
|
|
|
20598
20867
|
isModal: Browser.isDevice,
|
|
20599
20868
|
buttons: [{
|
|
20600
20869
|
click: this.insertImageUrl.bind(selectObj),
|
|
20601
|
-
buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage', isPrimary: true }
|
|
20870
|
+
buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage', isPrimary: true, disabled: true }
|
|
20602
20871
|
},
|
|
20603
20872
|
{
|
|
20604
20873
|
click: (e) => {
|
|
@@ -20730,6 +20999,16 @@ class Image {
|
|
|
20730
20999
|
className: 'e-input e-img-url',
|
|
20731
21000
|
attrs: { placeholder: placeUrl, spellcheck: 'false' }
|
|
20732
21001
|
});
|
|
21002
|
+
this.inputUrl.addEventListener('input', () => {
|
|
21003
|
+
if (!isNullOrUndefined(this.inputUrl)) {
|
|
21004
|
+
if (this.inputUrl.value.length === 0) {
|
|
21005
|
+
this.dialogObj.getButtons(0).element.disabled = true;
|
|
21006
|
+
}
|
|
21007
|
+
else {
|
|
21008
|
+
this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
21009
|
+
}
|
|
21010
|
+
}
|
|
21011
|
+
});
|
|
20733
21012
|
imgUrl.appendChild(this.inputUrl);
|
|
20734
21013
|
return imgUrl;
|
|
20735
21014
|
}
|
|
@@ -20784,38 +21063,53 @@ class Image {
|
|
|
20784
21063
|
const imgHeight = this.i10n.getConstant('imageHeight');
|
|
20785
21064
|
const imgWidth = this.i10n.getConstant('imageWidth');
|
|
20786
21065
|
const imgSizeWrap = this.parent.createElement('div', { className: 'e-img-sizewrap' });
|
|
20787
|
-
const widthVal = (selectNode.
|
|
20788
|
-
|
|
20789
|
-
|
|
20790
|
-
|
|
21066
|
+
const widthVal = isNullOrUndefined(this.changedWidthValue) && (selectNode.style.width.toString() === 'auto' ||
|
|
21067
|
+
selectNode.style.width !== "") ? selectNode.style.width : !isNullOrUndefined(this.changedWidthValue) ?
|
|
21068
|
+
this.changedWidthValue : (parseInt(selectNode.getClientRects()[0].width.toString())).toString();
|
|
21069
|
+
const heightVal = isNullOrUndefined(this.changedHeightValue) && (selectNode.style.height.toString() === 'auto' ||
|
|
21070
|
+
selectNode.style.height !== "") ? selectNode.style.height : !isNullOrUndefined(this.changedHeightValue) ?
|
|
21071
|
+
this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString())).toString();
|
|
21072
|
+
this.changedWidthValue = null;
|
|
21073
|
+
this.changedHeightValue = null;
|
|
20791
21074
|
const content = '<div class="e-rte-label"><label>' + imgWidth +
|
|
20792
|
-
'</label></div><div class="e-rte-field"><input type="text"
|
|
21075
|
+
'</label></div><div class="e-rte-field"><input type="text" id="imgwidth" class="e-img-width" value=' +
|
|
20793
21076
|
widthVal
|
|
20794
21077
|
+ ' /></div>' +
|
|
20795
21078
|
'<div class="e-rte-label">' + '<label>' + imgHeight + '</label></div><div class="e-rte-field"> ' +
|
|
20796
|
-
'<input type="text"
|
|
21079
|
+
'<input type="text" id="imgheight" class="e-img-height" value=' +
|
|
20797
21080
|
heightVal
|
|
20798
21081
|
+ ' /></div>';
|
|
20799
21082
|
const contentElem = parseHtml(content);
|
|
20800
21083
|
imgSizeWrap.appendChild(contentElem);
|
|
20801
|
-
const widthNum = new
|
|
20802
|
-
|
|
20803
|
-
|
|
20804
|
-
|
|
21084
|
+
const widthNum = new TextBox({
|
|
21085
|
+
value: formatUnit(widthVal),
|
|
21086
|
+
enableRtl: this.parent.enableRtl,
|
|
21087
|
+
input: (e) => {
|
|
21088
|
+
this.inputWidthValue = formatUnit(this.inputValue(e.value));
|
|
21089
|
+
}
|
|
20805
21090
|
});
|
|
20806
|
-
widthNum.isStringTemplate = true;
|
|
20807
21091
|
widthNum.createElement = this.parent.createElement;
|
|
20808
21092
|
widthNum.appendTo(imgSizeWrap.querySelector('#imgwidth'));
|
|
20809
|
-
const heightNum = new
|
|
20810
|
-
|
|
20811
|
-
|
|
20812
|
-
|
|
21093
|
+
const heightNum = new TextBox({
|
|
21094
|
+
value: formatUnit(heightVal),
|
|
21095
|
+
enableRtl: this.parent.enableRtl,
|
|
21096
|
+
input: (e) => {
|
|
21097
|
+
this.inputHeightValue = formatUnit(this.inputValue(e.value));
|
|
21098
|
+
}
|
|
20813
21099
|
});
|
|
20814
|
-
heightNum.isStringTemplate = true;
|
|
20815
21100
|
heightNum.createElement = this.parent.createElement;
|
|
20816
21101
|
heightNum.appendTo(imgSizeWrap.querySelector('#imgheight'));
|
|
20817
21102
|
return imgSizeWrap;
|
|
20818
21103
|
}
|
|
21104
|
+
inputValue(value) {
|
|
21105
|
+
if (value === 'auto' || value.indexOf('%') !== -1 || value.indexOf('px') !== -1
|
|
21106
|
+
|| value.match(/(\d+)/)) {
|
|
21107
|
+
return value;
|
|
21108
|
+
}
|
|
21109
|
+
else {
|
|
21110
|
+
return "auto";
|
|
21111
|
+
}
|
|
21112
|
+
}
|
|
20819
21113
|
insertSize(e) {
|
|
20820
21114
|
e.selection.restore();
|
|
20821
21115
|
const proxy = e.selfImage;
|
|
@@ -20823,8 +21117,10 @@ class Image {
|
|
|
20823
21117
|
proxy.parent.formatter.saveData();
|
|
20824
21118
|
}
|
|
20825
21119
|
const dialogEle = proxy.dialogObj.element;
|
|
20826
|
-
|
|
20827
|
-
|
|
21120
|
+
this.changedWidthValue = this.inputWidthValue;
|
|
21121
|
+
this.changedHeightValue = this.inputHeightValue;
|
|
21122
|
+
const width = dialogEle.querySelector('.e-img-width').value;
|
|
21123
|
+
const height = dialogEle.parentElement.querySelector('.e-img-height').value;
|
|
20828
21124
|
proxy.parent.formatter.process(this.parent, e.args, e.args, {
|
|
20829
21125
|
width: width, height: height, selectNode: e.selectNode,
|
|
20830
21126
|
subCommand: e.args.item.subCommand
|
|
@@ -20933,6 +21229,10 @@ class Image {
|
|
|
20933
21229
|
}
|
|
20934
21230
|
};
|
|
20935
21231
|
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
21232
|
+
if (isNullOrUndefined(proxy.parent.insertImageSettings.saveUrl) && this.isAllowedTypes
|
|
21233
|
+
&& !isNullOrUndefined(this.dialogObj)) {
|
|
21234
|
+
this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
21235
|
+
}
|
|
20936
21236
|
});
|
|
20937
21237
|
reader.readAsDataURL(selectArgs.filesData[0].rawFile);
|
|
20938
21238
|
}
|
|
@@ -20988,6 +21288,9 @@ class Image {
|
|
|
20988
21288
|
};
|
|
20989
21289
|
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
20990
21290
|
}
|
|
21291
|
+
if (e.operation === 'upload' && !isNullOrUndefined(this.dialogObj)) {
|
|
21292
|
+
this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
21293
|
+
}
|
|
20991
21294
|
});
|
|
20992
21295
|
},
|
|
20993
21296
|
failure: (e) => {
|
|
@@ -20997,11 +21300,11 @@ class Image {
|
|
|
20997
21300
|
// eslint-disable-next-line
|
|
20998
21301
|
this.parent.trigger(imageRemoving, e, (e) => {
|
|
20999
21302
|
proxy.isImgUploaded = false;
|
|
21303
|
+
this.dialogObj.getButtons(0).element.disabled = true;
|
|
21000
21304
|
proxy.inputUrl.removeAttribute('disabled');
|
|
21001
21305
|
if (proxy.uploadUrl) {
|
|
21002
21306
|
proxy.uploadUrl.url = '';
|
|
21003
21307
|
}
|
|
21004
|
-
this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
21005
21308
|
});
|
|
21006
21309
|
}
|
|
21007
21310
|
});
|
|
@@ -21014,9 +21317,10 @@ class Image {
|
|
|
21014
21317
|
if (this.uploadObj.allowedExtensions) {
|
|
21015
21318
|
if (this.uploadObj.allowedExtensions.toLocaleLowerCase().indexOf(('.' + e.type).toLocaleLowerCase()) === -1) {
|
|
21016
21319
|
this.dialogObj.getButtons(0).element.setAttribute('disabled', 'disabled');
|
|
21320
|
+
this.isAllowedTypes = false;
|
|
21017
21321
|
}
|
|
21018
21322
|
else {
|
|
21019
|
-
this.
|
|
21323
|
+
this.isAllowedTypes = true;
|
|
21020
21324
|
}
|
|
21021
21325
|
}
|
|
21022
21326
|
}
|
|
@@ -21678,7 +21982,21 @@ class ViewSource {
|
|
|
21678
21982
|
baseToolbar: this.parent.getBaseToolbarObject()
|
|
21679
21983
|
});
|
|
21680
21984
|
const serializeValue = this.parent.serializeValue(editHTML.value);
|
|
21681
|
-
|
|
21985
|
+
let value;
|
|
21986
|
+
if (serializeValue === null || serializeValue === '') {
|
|
21987
|
+
if (this.parent.enterKey === 'DIV') {
|
|
21988
|
+
value = '<div><br/></div>';
|
|
21989
|
+
}
|
|
21990
|
+
else if (this.parent.enterKey === 'BR') {
|
|
21991
|
+
value = '<br/>';
|
|
21992
|
+
}
|
|
21993
|
+
else {
|
|
21994
|
+
value = '<p><br/></p>';
|
|
21995
|
+
}
|
|
21996
|
+
}
|
|
21997
|
+
else {
|
|
21998
|
+
value = serializeValue;
|
|
21999
|
+
}
|
|
21682
22000
|
if (this.parent.iframeSettings.enable) {
|
|
21683
22001
|
editHTML.parentElement.style.display = 'none';
|
|
21684
22002
|
editHTML.style.display = 'none';
|
|
@@ -21710,9 +22028,13 @@ class ViewSource {
|
|
|
21710
22028
|
}
|
|
21711
22029
|
getTextAreaValue() {
|
|
21712
22030
|
return (this.contentModule.getEditPanel().innerHTML === '<p><br></p>') ||
|
|
22031
|
+
(this.contentModule.getEditPanel().innerHTML === '<div><br></div>') ||
|
|
22032
|
+
(this.contentModule.getEditPanel().innerHTML === '<br>') ||
|
|
21713
22033
|
(this.contentModule.getEditPanel().childNodes.length === 1 &&
|
|
21714
|
-
this.contentModule.getEditPanel().childNodes[0].tagName === 'P' &&
|
|
21715
|
-
|
|
22034
|
+
(this.contentModule.getEditPanel().childNodes[0].tagName === 'P' &&
|
|
22035
|
+
this.contentModule.getEditPanel().innerHTML.length === 7) ||
|
|
22036
|
+
(this.contentModule.getEditPanel().childNodes[0].tagName === 'DIV' &&
|
|
22037
|
+
this.contentModule.getEditPanel().innerHTML.length === 11)) ? '' : this.parent.value;
|
|
21716
22038
|
}
|
|
21717
22039
|
/**
|
|
21718
22040
|
* getPanel method
|
|
@@ -21850,6 +22172,7 @@ class Table {
|
|
|
21850
22172
|
break;
|
|
21851
22173
|
case 'Dashed':
|
|
21852
22174
|
case 'Alternate':
|
|
22175
|
+
case 'Custom':
|
|
21853
22176
|
this.tableStyles(args, item.subCommand);
|
|
21854
22177
|
break;
|
|
21855
22178
|
case 'Merge':
|
|
@@ -21973,6 +22296,13 @@ class Table {
|
|
|
21973
22296
|
table.classList.add(CLS_TB_ALT_BOR);
|
|
21974
22297
|
/* eslint-enable */
|
|
21975
22298
|
}
|
|
22299
|
+
if (args.args && args.args.item.cssClass) {
|
|
22300
|
+
const classList = args.args.item.cssClass.split(' ');
|
|
22301
|
+
for (let i = 0; i < classList.length; i++) {
|
|
22302
|
+
(table.classList.contains(classList[i])) ? table.classList.remove(classList[i]) :
|
|
22303
|
+
table.classList.add(classList[i]);
|
|
22304
|
+
}
|
|
22305
|
+
}
|
|
21976
22306
|
this.parent.formatter.saveData();
|
|
21977
22307
|
this.parent.formatter.editorManager.nodeSelection.restore();
|
|
21978
22308
|
}
|
|
@@ -22189,7 +22519,7 @@ class Table {
|
|
|
22189
22519
|
selectionObj.selection = proxy.parent.formatter.editorManager.nodeSelection.save(range, proxy.contentModule.getDocument());
|
|
22190
22520
|
}
|
|
22191
22521
|
const value = {
|
|
22192
|
-
|
|
22522
|
+
rows: row, columns: col, width: {
|
|
22193
22523
|
minWidth: proxy.parent.tableSettings.minWidth,
|
|
22194
22524
|
maxWidth: proxy.parent.tableSettings.maxWidth,
|
|
22195
22525
|
width: proxy.parent.tableSettings.width
|
|
@@ -22387,7 +22717,7 @@ class Table {
|
|
|
22387
22717
|
EventHandler.add(this.helper, Browser.touchStartEvent, this.resizeStart, this);
|
|
22388
22718
|
}
|
|
22389
22719
|
else {
|
|
22390
|
-
const args =
|
|
22720
|
+
const args = { event: e, requestType: 'Table' };
|
|
22391
22721
|
this.parent.trigger(resizeStart, args, (resizeStartArgs) => {
|
|
22392
22722
|
if (resizeStartArgs.cancel) {
|
|
22393
22723
|
this.cancelResizeAction();
|
|
@@ -22463,7 +22793,7 @@ class Table {
|
|
|
22463
22793
|
const mouseY = (this.parent.enableRtl) ? -(pageY - this.pageY) : (pageY - this.pageY);
|
|
22464
22794
|
this.pageX = pageX;
|
|
22465
22795
|
this.pageY = pageY;
|
|
22466
|
-
const args =
|
|
22796
|
+
const args = { event: e, requestType: 'table' };
|
|
22467
22797
|
this.parent.trigger(onResize, args, (resizingArgs) => {
|
|
22468
22798
|
if (resizingArgs.cancel) {
|
|
22469
22799
|
this.cancelResizeAction();
|
|
@@ -22550,7 +22880,7 @@ class Table {
|
|
|
22550
22880
|
this.pageY = null;
|
|
22551
22881
|
this.moveEle = null;
|
|
22552
22882
|
}
|
|
22553
|
-
const args =
|
|
22883
|
+
const args = { event: e, requestType: 'table' };
|
|
22554
22884
|
this.parent.trigger(resizeStop, args);
|
|
22555
22885
|
this.parent.formatter.saveData();
|
|
22556
22886
|
}
|
|
@@ -23531,6 +23861,288 @@ __decorate$4([
|
|
|
23531
23861
|
Property(true)
|
|
23532
23862
|
], InlineMode.prototype, "onSelection", void 0);
|
|
23533
23863
|
|
|
23864
|
+
/**
|
|
23865
|
+
* `EnterKey` module is used to handle enter key press actions.
|
|
23866
|
+
*/
|
|
23867
|
+
class EnterKeyAction {
|
|
23868
|
+
constructor(parent) {
|
|
23869
|
+
this.parent = parent;
|
|
23870
|
+
this.addEventListener();
|
|
23871
|
+
}
|
|
23872
|
+
addEventListener() {
|
|
23873
|
+
this.parent.on(enterHandler, this.enterHandler, this);
|
|
23874
|
+
this.parent.on(destroy, this.destroy, this);
|
|
23875
|
+
}
|
|
23876
|
+
destroy() {
|
|
23877
|
+
this.removeEventListener();
|
|
23878
|
+
}
|
|
23879
|
+
removeEventListener() {
|
|
23880
|
+
this.parent.off(enterHandler, this.enterHandler);
|
|
23881
|
+
this.parent.off(destroy, this.destroy);
|
|
23882
|
+
}
|
|
23883
|
+
getRangeNode() {
|
|
23884
|
+
this.range = this.parent.getRange();
|
|
23885
|
+
this.startNode = this.range.startContainer.nodeName === '#text' ? this.range.startContainer.parentElement :
|
|
23886
|
+
this.range.startContainer;
|
|
23887
|
+
this.endNode = this.range.endContainer.nodeName === '#text' ? this.range.endContainer.parentElement :
|
|
23888
|
+
this.range.endContainer;
|
|
23889
|
+
}
|
|
23890
|
+
enterHandler(e) {
|
|
23891
|
+
this.getRangeNode();
|
|
23892
|
+
if (e.args.which === 13 && e.args.code === 'Enter') {
|
|
23893
|
+
if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) && isNullOrUndefined(this.startNode.closest('TABLE')) &&
|
|
23894
|
+
isNullOrUndefined(this.endNode.closest('TABLE')) && isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
|
|
23895
|
+
const shiftKey = e.args.shiftKey;
|
|
23896
|
+
const actionBeginArgs = {
|
|
23897
|
+
cancel: false,
|
|
23898
|
+
name: actionBegin,
|
|
23899
|
+
requestType: shiftKey ? 'ShiftEnterAction' : 'EnterAction',
|
|
23900
|
+
originalEvent: e.args
|
|
23901
|
+
};
|
|
23902
|
+
this.parent.trigger(actionBegin, actionBeginArgs, (actionBeginArgs) => {
|
|
23903
|
+
if (!actionBeginArgs.cancel) {
|
|
23904
|
+
if (!(this.range.startOffset === this.range.endOffset && this.range.startContainer === this.range.endContainer)) {
|
|
23905
|
+
this.range.deleteContents();
|
|
23906
|
+
if (this.range.startContainer.nodeName === '#text' && this.range.startContainer.textContent.length === 0 &&
|
|
23907
|
+
this.range.startContainer.parentElement !== this.parent.inputElement) {
|
|
23908
|
+
if (this.parent.enterKey === 'BR') {
|
|
23909
|
+
this.range.startContainer.parentElement.innerHTML = '​';
|
|
23910
|
+
}
|
|
23911
|
+
else {
|
|
23912
|
+
this.range.startContainer.parentElement.innerHTML = '<br>';
|
|
23913
|
+
}
|
|
23914
|
+
}
|
|
23915
|
+
else if (this.range.startContainer === this.parent.inputElement && this.range.startContainer.innerHTML === '') {
|
|
23916
|
+
this.range.startContainer.innerHTML = '<br>';
|
|
23917
|
+
const focusElem = this.range.startContainer.childNodes[this.range.startOffset];
|
|
23918
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusElem, 0);
|
|
23919
|
+
}
|
|
23920
|
+
else if (this.parent.inputElement === this.range.startContainer) {
|
|
23921
|
+
const focusElem = this.range.startContainer.childNodes[this.range.startOffset];
|
|
23922
|
+
if (focusElem.nodeName === '#text' && focusElem.textContent.length === 0) {
|
|
23923
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusElem, focusElem.previousSibling.textContent.length);
|
|
23924
|
+
}
|
|
23925
|
+
else {
|
|
23926
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusElem, focusElem.textContent.length >= 0 ? 0 : 1);
|
|
23927
|
+
if (focusElem.previousSibling.textContent.length === 0) {
|
|
23928
|
+
detach(focusElem.previousSibling);
|
|
23929
|
+
}
|
|
23930
|
+
else if (focusElem.textContent.length === 0) {
|
|
23931
|
+
let currentFocusElem = focusElem.previousSibling.lastChild;
|
|
23932
|
+
while (currentFocusElem.nodeName !== '#text') {
|
|
23933
|
+
currentFocusElem = currentFocusElem.lastChild;
|
|
23934
|
+
}
|
|
23935
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), currentFocusElem, currentFocusElem.textContent.length);
|
|
23936
|
+
detach(focusElem);
|
|
23937
|
+
}
|
|
23938
|
+
else if (this.parent.enterKey !== 'BR' &&
|
|
23939
|
+
focusElem.previousSibling.textContent.length !== 0 && focusElem.textContent.length !== 0) {
|
|
23940
|
+
e.args.preventDefault();
|
|
23941
|
+
return;
|
|
23942
|
+
}
|
|
23943
|
+
}
|
|
23944
|
+
this.getRangeNode();
|
|
23945
|
+
}
|
|
23946
|
+
}
|
|
23947
|
+
if (this.range.startContainer === this.range.endContainer && this.range.startOffset === 0 &&
|
|
23948
|
+
this.range.startOffset == this.range.endOffset && this.range.startContainer === this.parent.inputElement) {
|
|
23949
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.range.startContainer.childNodes[this.range.startOffset], this.range.startOffset);
|
|
23950
|
+
this.getRangeNode();
|
|
23951
|
+
}
|
|
23952
|
+
if (this.parent.enterKey === 'P' || this.parent.enterKey === 'DIV' ||
|
|
23953
|
+
(this.parent.shiftEnterKey === 'P' && shiftKey) ||
|
|
23954
|
+
(this.parent.shiftEnterKey === 'DIV' && shiftKey)) {
|
|
23955
|
+
const nearBlockNode = this.parent.formatter.editorManager.domNode.blockParentNode(this.startNode);
|
|
23956
|
+
let isImageNode = false;
|
|
23957
|
+
if (this.range.startOffset === 0 && this.range.endOffset === 0 && !(!isNullOrUndefined(this.range.startContainer.previousSibling) && this.range.startContainer.previousSibling.nodeName === 'IMG')) {
|
|
23958
|
+
let isNearBlockLengthZero;
|
|
23959
|
+
let newElem;
|
|
23960
|
+
if (this.range.startContainer.nodeName === 'IMG') {
|
|
23961
|
+
newElem = this.createInsertElement(shiftKey);
|
|
23962
|
+
isImageNode = true;
|
|
23963
|
+
isNearBlockLengthZero = false;
|
|
23964
|
+
}
|
|
23965
|
+
else {
|
|
23966
|
+
if (nearBlockNode.textContent.length !== 0) {
|
|
23967
|
+
newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
|
|
23968
|
+
isNearBlockLengthZero = false;
|
|
23969
|
+
}
|
|
23970
|
+
else {
|
|
23971
|
+
newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, true).cloneNode(true);
|
|
23972
|
+
isNearBlockLengthZero = true;
|
|
23973
|
+
}
|
|
23974
|
+
}
|
|
23975
|
+
const insertElem = this.createInsertElement(shiftKey);
|
|
23976
|
+
while (newElem.firstChild) {
|
|
23977
|
+
insertElem.appendChild(newElem.firstChild);
|
|
23978
|
+
}
|
|
23979
|
+
nearBlockNode.parentElement.insertBefore(insertElem, nearBlockNode);
|
|
23980
|
+
if (!isNearBlockLengthZero) {
|
|
23981
|
+
let currentFocusElem = insertElem;
|
|
23982
|
+
let finalFocusElem;
|
|
23983
|
+
while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text') {
|
|
23984
|
+
finalFocusElem = currentFocusElem;
|
|
23985
|
+
currentFocusElem = currentFocusElem.lastChild;
|
|
23986
|
+
}
|
|
23987
|
+
finalFocusElem.innerHTML = '<br>';
|
|
23988
|
+
if (!isImageNode) {
|
|
23989
|
+
detach(nearBlockNode);
|
|
23990
|
+
}
|
|
23991
|
+
}
|
|
23992
|
+
}
|
|
23993
|
+
else if (nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
|
|
23994
|
+
if (!isNullOrUndefined(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
|
|
23995
|
+
const newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
|
|
23996
|
+
this.parent.formatter.editorManager.domNode.insertAfter(newElem, nearBlockNode);
|
|
23997
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), newElem, newElem.textContent.length >= 0 ? 0 : 1);
|
|
23998
|
+
}
|
|
23999
|
+
else {
|
|
24000
|
+
const insertElem = this.createInsertElement(shiftKey);
|
|
24001
|
+
insertElem.innerHTML = '<br>';
|
|
24002
|
+
this.parent.formatter.editorManager.domNode.insertAfter(insertElem, nearBlockNode);
|
|
24003
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), insertElem, 0);
|
|
24004
|
+
}
|
|
24005
|
+
}
|
|
24006
|
+
else {
|
|
24007
|
+
const newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, true);
|
|
24008
|
+
if (!isNullOrUndefined(newElem.childNodes[0]) && newElem.childNodes[0].nodeName === '#text' &&
|
|
24009
|
+
newElem.childNodes[0].textContent.length === 0) {
|
|
24010
|
+
detach(newElem.childNodes[0]);
|
|
24011
|
+
}
|
|
24012
|
+
if (newElem.textContent.trim().length === 0) {
|
|
24013
|
+
const brElm = this.parent.createElement('br');
|
|
24014
|
+
this.startNode.appendChild(brElm);
|
|
24015
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.startNode, 0);
|
|
24016
|
+
}
|
|
24017
|
+
if (((this.parent.enterKey === 'P' || this.parent.enterKey === 'DIV') && !shiftKey) || ((this.parent.shiftEnterKey === 'DIV' ||
|
|
24018
|
+
this.parent.shiftEnterKey === 'P') && shiftKey)) {
|
|
24019
|
+
const insertElm = this.createInsertElement(shiftKey);
|
|
24020
|
+
while (newElem.firstChild) {
|
|
24021
|
+
insertElm.appendChild(newElem.firstChild);
|
|
24022
|
+
}
|
|
24023
|
+
this.parent.formatter.editorManager.domNode.insertAfter(insertElm, newElem);
|
|
24024
|
+
detach(newElem);
|
|
24025
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), insertElm, insertElm.textContent.length >= 0 ? 0 : 1);
|
|
24026
|
+
}
|
|
24027
|
+
}
|
|
24028
|
+
e.args.preventDefault();
|
|
24029
|
+
}
|
|
24030
|
+
if (this.parent.enterKey === 'BR' && !shiftKey) {
|
|
24031
|
+
let currentParent;
|
|
24032
|
+
if (!this.parent.formatter.editorManager.domNode.isBlockNode(this.startNode)) {
|
|
24033
|
+
let currentNode = this.startNode;
|
|
24034
|
+
let previousNode = currentNode;
|
|
24035
|
+
while (!this.parent.formatter.editorManager.domNode.isBlockNode(currentNode)) {
|
|
24036
|
+
previousNode = currentNode;
|
|
24037
|
+
currentNode = currentNode.parentElement;
|
|
24038
|
+
}
|
|
24039
|
+
currentParent = currentNode === this.parent.inputElement ?
|
|
24040
|
+
previousNode : currentNode;
|
|
24041
|
+
}
|
|
24042
|
+
else {
|
|
24043
|
+
currentParent = this.startNode;
|
|
24044
|
+
}
|
|
24045
|
+
let isEmptyBrInserted = false;
|
|
24046
|
+
if (currentParent !== this.parent.inputElement &&
|
|
24047
|
+
this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
24048
|
+
this.range.startOffset === this.range.endOffset &&
|
|
24049
|
+
this.range.startOffset === currentParent.textContent.length) {
|
|
24050
|
+
const outerBRElem = this.parent.createElement('br');
|
|
24051
|
+
this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
|
|
24052
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), outerBRElem, 0);
|
|
24053
|
+
}
|
|
24054
|
+
else if (!isNullOrUndefined(currentParent) && currentParent !== this.parent.inputElement && currentParent.nodeName !== 'BR') {
|
|
24055
|
+
if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
|
|
24056
|
+
currentParent.textContent.charCodeAt(0) === 8203)) {
|
|
24057
|
+
const newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, currentParent, true).cloneNode(true);
|
|
24058
|
+
this.parent.formatter.editorManager.domNode.insertAfter(newElem, currentParent);
|
|
24059
|
+
const outerBRElem = this.parent.createElement('br');
|
|
24060
|
+
newElem.parentElement.insertBefore(outerBRElem, newElem);
|
|
24061
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), newElem, 0);
|
|
24062
|
+
}
|
|
24063
|
+
else {
|
|
24064
|
+
let newElem;
|
|
24065
|
+
let focusElem;
|
|
24066
|
+
const outerBRElem = this.parent.createElement('br');
|
|
24067
|
+
if (this.range.startOffset === 0 && this.range.endOffset === 0 &&
|
|
24068
|
+
!isNullOrUndefined(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR') {
|
|
24069
|
+
focusElem = this.range.startContainer;
|
|
24070
|
+
newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, currentParent, false).cloneNode(true);
|
|
24071
|
+
this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
|
|
24072
|
+
this.insertFocusContent();
|
|
24073
|
+
let currentFocusElem = outerBRElem.nextSibling;
|
|
24074
|
+
while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text') {
|
|
24075
|
+
currentFocusElem = currentFocusElem.lastChild;
|
|
24076
|
+
}
|
|
24077
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), currentFocusElem, 0);
|
|
24078
|
+
isEmptyBrInserted = true;
|
|
24079
|
+
}
|
|
24080
|
+
else {
|
|
24081
|
+
newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, currentParent, true);
|
|
24082
|
+
newElem.parentElement.insertBefore(outerBRElem, newElem);
|
|
24083
|
+
this.insertFocusContent();
|
|
24084
|
+
}
|
|
24085
|
+
}
|
|
24086
|
+
}
|
|
24087
|
+
else {
|
|
24088
|
+
const brElm = this.parent.createElement('br');
|
|
24089
|
+
if (this.startNode.nodeName === 'BR' && this.endNode.nodeName === 'BR' && this.range.startOffset === 0 && this.range.startOffset === this.range.endOffset) {
|
|
24090
|
+
this.parent.formatter.editorManager.domNode.insertAfter(brElm, this.startNode);
|
|
24091
|
+
isEmptyBrInserted = true;
|
|
24092
|
+
}
|
|
24093
|
+
else {
|
|
24094
|
+
if (this.startNode === this.parent.inputElement && !isNullOrUndefined(this.range.startContainer.previousSibling) &&
|
|
24095
|
+
this.range.startContainer.previousSibling.nodeName === 'BR' && this.range.startContainer.textContent.length === 0) {
|
|
24096
|
+
isEmptyBrInserted = true;
|
|
24097
|
+
}
|
|
24098
|
+
this.range.insertNode(brElm);
|
|
24099
|
+
}
|
|
24100
|
+
if (isEmptyBrInserted || (!isNullOrUndefined(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNullOrUndefined(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
|
|
24101
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), !isNullOrUndefined(brElm.nextSibling) ? brElm.nextSibling : brElm, 0);
|
|
24102
|
+
isEmptyBrInserted = false;
|
|
24103
|
+
}
|
|
24104
|
+
else {
|
|
24105
|
+
const brElm2 = this.parent.createElement('br');
|
|
24106
|
+
this.range.insertNode(brElm2);
|
|
24107
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), brElm, 0);
|
|
24108
|
+
}
|
|
24109
|
+
}
|
|
24110
|
+
e.args.preventDefault();
|
|
24111
|
+
}
|
|
24112
|
+
if (this.range.startContainer.nodeName === '#text') {
|
|
24113
|
+
this.range.startContainer.parentElement.scrollIntoView(false);
|
|
24114
|
+
}
|
|
24115
|
+
else {
|
|
24116
|
+
this.range.startContainer.scrollIntoView(false);
|
|
24117
|
+
}
|
|
24118
|
+
this.parent.trigger(actionComplete, { requestType: shiftKey ? 'ShiftEnterAction' : 'EnterAction', args: e.args });
|
|
24119
|
+
}
|
|
24120
|
+
});
|
|
24121
|
+
}
|
|
24122
|
+
}
|
|
24123
|
+
}
|
|
24124
|
+
insertFocusContent() {
|
|
24125
|
+
if (this.range.startContainer.textContent.length === 0) {
|
|
24126
|
+
if (this.range.startContainer.nodeName === '#text') {
|
|
24127
|
+
this.range.startContainer.parentElement.innerHTML = '​';
|
|
24128
|
+
}
|
|
24129
|
+
else {
|
|
24130
|
+
this.range.startContainer.innerHTML = '​';
|
|
24131
|
+
}
|
|
24132
|
+
}
|
|
24133
|
+
}
|
|
24134
|
+
createInsertElement(shiftKey) {
|
|
24135
|
+
let insertElem;
|
|
24136
|
+
if ((this.parent.enterKey === 'DIV' && !shiftKey) || (this.parent.shiftEnterKey === 'DIV' && shiftKey)) {
|
|
24137
|
+
insertElem = this.parent.createElement('div');
|
|
24138
|
+
}
|
|
24139
|
+
else if ((this.parent.enterKey === 'P' && !shiftKey) || (this.parent.shiftEnterKey === 'P' && shiftKey)) {
|
|
24140
|
+
insertElem = this.parent.createElement('p');
|
|
24141
|
+
}
|
|
24142
|
+
return insertElem;
|
|
24143
|
+
}
|
|
24144
|
+
}
|
|
24145
|
+
|
|
23534
24146
|
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
23535
24147
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
23536
24148
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -23686,9 +24298,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
23686
24298
|
this.htmlAttributes = { 'tabindex': this.element.getAttribute('tabindex') };
|
|
23687
24299
|
this.element.removeAttribute('tabindex');
|
|
23688
24300
|
}
|
|
23689
|
-
|
|
23690
|
-
this.element.innerHTML = '';
|
|
23691
|
-
}
|
|
24301
|
+
this.element.innerHTML = '';
|
|
23692
24302
|
const invalidAttr = ['class', 'style', 'id', 'ejs-for'];
|
|
23693
24303
|
const htmlAttr = {};
|
|
23694
24304
|
for (let a = 0; a < this.element.attributes.length; a++) {
|
|
@@ -23706,23 +24316,10 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
23706
24316
|
const rteOuterWrapper = this.createElement('div', {
|
|
23707
24317
|
className: this.element.getAttribute('class')
|
|
23708
24318
|
});
|
|
23709
|
-
|
|
23710
|
-
this.element.innerHTML = '';
|
|
23711
|
-
}
|
|
24319
|
+
this.element.innerHTML = '';
|
|
23712
24320
|
this.element.parentElement.insertBefore(rteOuterWrapper, this.element);
|
|
23713
|
-
|
|
23714
|
-
rteOuterWrapper.appendChild(this.element);
|
|
23715
|
-
this.valueContainer = this.createElement('textarea', {
|
|
23716
|
-
id: this.element.id + '-value'
|
|
23717
|
-
});
|
|
23718
|
-
}
|
|
23719
|
-
else {
|
|
23720
|
-
this.valueContainer = this.element;
|
|
23721
|
-
}
|
|
24321
|
+
this.valueContainer = this.element;
|
|
23722
24322
|
removeClass([this.valueContainer], this.element.getAttribute('class').split(' '));
|
|
23723
|
-
if (this.isBlazor()) {
|
|
23724
|
-
addClass([this.element], CLS_RTE_HIDDEN);
|
|
23725
|
-
}
|
|
23726
24323
|
this.element = rteOuterWrapper;
|
|
23727
24324
|
}
|
|
23728
24325
|
else {
|
|
@@ -23939,12 +24536,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
23939
24536
|
}
|
|
23940
24537
|
this.setContentHeight();
|
|
23941
24538
|
if (this.value !== null) {
|
|
23942
|
-
|
|
23943
|
-
this.valueContainer.defaultValue = this.value;
|
|
23944
|
-
}
|
|
23945
|
-
else {
|
|
23946
|
-
this.defaultResetValue = this.value;
|
|
23947
|
-
}
|
|
24539
|
+
this.valueContainer.defaultValue = this.value;
|
|
23948
24540
|
}
|
|
23949
24541
|
// eslint-disable-next-line
|
|
23950
24542
|
(!this.enabled) ? this.unWireEvents() : this.eventInitializer();
|
|
@@ -24047,7 +24639,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
24047
24639
|
this.notify(keyUp, { member: 'keyup', args: e });
|
|
24048
24640
|
if (e.code === 'KeyX' && e.which === 88 && e.keyCode === 88 && e.ctrlKey && (this.inputElement.innerHTML === '' ||
|
|
24049
24641
|
this.inputElement.innerHTML === '<br>')) {
|
|
24050
|
-
this.inputElement.innerHTML = getEditValue(
|
|
24642
|
+
this.inputElement.innerHTML = getEditValue(getDefaultValue(this), this);
|
|
24051
24643
|
}
|
|
24052
24644
|
const allowedKeys = e.which === 32 || e.which === 13 || e.which === 8 || e.which === 46;
|
|
24053
24645
|
if (((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys) || (this.editorMode === 'Markdown'
|
|
@@ -24059,7 +24651,10 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
24059
24651
|
this.notify(toolbarRefresh, { args: e });
|
|
24060
24652
|
}
|
|
24061
24653
|
if (!isNullOrUndefined(this.placeholder)) {
|
|
24062
|
-
this.
|
|
24654
|
+
if (!(e.key === 'Enter' && e.keyCode === 13) && (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
24655
|
+
this.inputElement.innerHTML === '<br>')) {
|
|
24656
|
+
this.setPlaceHolder();
|
|
24657
|
+
}
|
|
24063
24658
|
}
|
|
24064
24659
|
}
|
|
24065
24660
|
/**
|
|
@@ -24287,22 +24882,16 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
24287
24882
|
}
|
|
24288
24883
|
this.unWireEvents();
|
|
24289
24884
|
if (this.originalElement.tagName === 'TEXTAREA') {
|
|
24290
|
-
if (isBlazor()) {
|
|
24291
|
-
detach(this.valueContainer);
|
|
24292
|
-
this.valueContainer = this.element.querySelector('.e-blazor-hidden.e-control.e-richtexteditor');
|
|
24293
|
-
}
|
|
24294
24885
|
this.element.parentElement.insertBefore(this.valueContainer, this.element);
|
|
24295
24886
|
this.valueContainer.id = this.getID();
|
|
24296
24887
|
this.valueContainer.removeAttribute('name');
|
|
24297
24888
|
detach(this.element);
|
|
24298
24889
|
if (this.originalElement.innerHTML.trim() !== '') {
|
|
24299
|
-
|
|
24300
|
-
|
|
24301
|
-
this.setProperties({ value: (!isNullOrUndefined(this.initialValue) ? this.initialValue : null) }, true);
|
|
24302
|
-
}
|
|
24890
|
+
this.valueContainer.value = this.originalElement.innerHTML.trim();
|
|
24891
|
+
this.setProperties({ value: (!isNullOrUndefined(this.initialValue) ? this.initialValue : null) }, true);
|
|
24303
24892
|
}
|
|
24304
24893
|
else {
|
|
24305
|
-
this.valueContainer.value =
|
|
24894
|
+
this.valueContainer.value = this.valueContainer.defaultValue;
|
|
24306
24895
|
}
|
|
24307
24896
|
this.element = this.valueContainer;
|
|
24308
24897
|
for (let i = 0; i < this.originalElement.classList.length; i++) {
|
|
@@ -24378,12 +24967,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
24378
24967
|
* @returns {Element} - specifies the element.
|
|
24379
24968
|
*/
|
|
24380
24969
|
getContent() {
|
|
24381
|
-
|
|
24382
|
-
return this.inputElement;
|
|
24383
|
-
}
|
|
24384
|
-
else {
|
|
24385
|
-
return this.contentModule.getPanel();
|
|
24386
|
-
}
|
|
24970
|
+
return this.contentModule.getPanel();
|
|
24387
24971
|
}
|
|
24388
24972
|
/**
|
|
24389
24973
|
* Returns the text content as string.
|
|
@@ -24454,10 +25038,23 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
24454
25038
|
onPropertyChanged(newProp, oldProp) {
|
|
24455
25039
|
for (const prop of Object.keys(newProp)) {
|
|
24456
25040
|
switch (prop) {
|
|
25041
|
+
case 'enterKey':
|
|
24457
25042
|
case 'value': {
|
|
24458
|
-
|
|
25043
|
+
let nVal;
|
|
25044
|
+
if (prop === 'enterKey') {
|
|
25045
|
+
if (this.value === null || this.value === '<div><br></div>' || this.value === '<p><br></p>' ||
|
|
25046
|
+
this.value === '<br>') {
|
|
25047
|
+
nVal = null;
|
|
25048
|
+
}
|
|
25049
|
+
else {
|
|
25050
|
+
nVal = this.value;
|
|
25051
|
+
}
|
|
25052
|
+
}
|
|
25053
|
+
else {
|
|
25054
|
+
nVal = newProp[prop];
|
|
25055
|
+
}
|
|
24459
25056
|
const val = this.editorMode === 'HTML' ? getEditValue(nVal, this) : nVal;
|
|
24460
|
-
if (!isNullOrUndefined(nVal) && nVal !== '') {
|
|
25057
|
+
if ((!isNullOrUndefined(nVal) && nVal !== '') || prop === 'enterKey') {
|
|
24461
25058
|
this.value = this.serializeValue(((this.enableHtmlEncode) ? this.encode(decode(val)) : val));
|
|
24462
25059
|
}
|
|
24463
25060
|
this.updatePanelValue();
|
|
@@ -24623,7 +25220,18 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
24623
25220
|
getTextArea.value = '';
|
|
24624
25221
|
}
|
|
24625
25222
|
if (this.editorMode === 'HTML') {
|
|
24626
|
-
this.
|
|
25223
|
+
if (this.enterKey === 'DIV') {
|
|
25224
|
+
this.inputElement.innerHTML = '<div><br/></div>';
|
|
25225
|
+
}
|
|
25226
|
+
else if (this.enterKey === 'BR') {
|
|
25227
|
+
this.inputElement.innerHTML = '<br/>';
|
|
25228
|
+
}
|
|
25229
|
+
else {
|
|
25230
|
+
this.inputElement.innerHTML = '<p><br/></p>';
|
|
25231
|
+
if (value === '' && this.formatter && this.inputElement) {
|
|
25232
|
+
this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), this.inputElement.firstElementChild, this.inputElement.firstElementChild.childElementCount);
|
|
25233
|
+
}
|
|
25234
|
+
}
|
|
24627
25235
|
}
|
|
24628
25236
|
else {
|
|
24629
25237
|
this.inputElement.value = '';
|
|
@@ -24671,10 +25279,9 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
24671
25279
|
});
|
|
24672
25280
|
}
|
|
24673
25281
|
this.placeHolderWrapper.innerHTML = this.placeholder;
|
|
24674
|
-
if (this.inputElement.textContent.length === 0 &&
|
|
24675
|
-
|
|
24676
|
-
|
|
24677
|
-
this.inputElement.innerHTML !== '<p><br></p><p><br></p>') {
|
|
25282
|
+
if (this.inputElement.textContent.length === 0 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
25283
|
+
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
|
|
25284
|
+
this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
24678
25285
|
this.placeHolderWrapper.style.display = 'block';
|
|
24679
25286
|
}
|
|
24680
25287
|
else {
|
|
@@ -24835,6 +25442,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
24835
25442
|
const rendererFactory = this.serviceLocator.getService('rendererFactory');
|
|
24836
25443
|
this.contentModule = rendererFactory.getRenderer(RenderType.Content);
|
|
24837
25444
|
this.fullScreenModule = new FullScreen(this);
|
|
25445
|
+
this.enterKeyModule = new EnterKeyAction(this);
|
|
24838
25446
|
this.renderModule.render();
|
|
24839
25447
|
this.inputElement = this.contentModule.getEditPanel();
|
|
24840
25448
|
this.setHeight(this.height);
|
|
@@ -24904,9 +25512,6 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
24904
25512
|
styleEle.rel = 'stylesheet';
|
|
24905
25513
|
return styleEle;
|
|
24906
25514
|
}
|
|
24907
|
-
isBlazor() {
|
|
24908
|
-
return (!isBlazor() ? false : true);
|
|
24909
|
-
}
|
|
24910
25515
|
setValue() {
|
|
24911
25516
|
if (this.valueTemplate) {
|
|
24912
25517
|
if (typeof this.valueTemplate === 'string') {
|
|
@@ -25213,7 +25818,8 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
25213
25818
|
this.isFocusOut = false;
|
|
25214
25819
|
addClass([this.element], [CLS_FOCUS]);
|
|
25215
25820
|
if (this.editorMode === 'HTML') {
|
|
25216
|
-
this.cloneValue = (this.inputElement.innerHTML === '<p><br></p>'
|
|
25821
|
+
this.cloneValue = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
25822
|
+
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
25217
25823
|
this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
|
|
25218
25824
|
}
|
|
25219
25825
|
else {
|
|
@@ -25262,7 +25868,8 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
25262
25868
|
}
|
|
25263
25869
|
const getTextArea = this.element.querySelector('.e-rte-srctextarea');
|
|
25264
25870
|
if (this.editorMode === 'HTML') {
|
|
25265
|
-
value = (this.inputElement.innerHTML === '<p><br></p>'
|
|
25871
|
+
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
25872
|
+
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
25266
25873
|
this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
|
|
25267
25874
|
if (getTextArea && getTextArea.style.display === 'block') {
|
|
25268
25875
|
value = getTextArea.value;
|
|
@@ -25444,7 +26051,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
25444
26051
|
}
|
|
25445
26052
|
resetHandler() {
|
|
25446
26053
|
const defaultValue = this.valueContainer.defaultValue.trim();
|
|
25447
|
-
this.setProperties({ value: defaultValue === '' ? null :
|
|
26054
|
+
this.setProperties({ value: defaultValue === '' ? null : defaultValue });
|
|
25448
26055
|
}
|
|
25449
26056
|
/**
|
|
25450
26057
|
* @returns {void}
|
|
@@ -25660,6 +26267,12 @@ __decorate$1([
|
|
|
25660
26267
|
__decorate$1([
|
|
25661
26268
|
Property(null)
|
|
25662
26269
|
], RichTextEditor.prototype, "value", void 0);
|
|
26270
|
+
__decorate$1([
|
|
26271
|
+
Property('P')
|
|
26272
|
+
], RichTextEditor.prototype, "enterKey", void 0);
|
|
26273
|
+
__decorate$1([
|
|
26274
|
+
Property('BR')
|
|
26275
|
+
], RichTextEditor.prototype, "shiftEnterKey", void 0);
|
|
25663
26276
|
__decorate$1([
|
|
25664
26277
|
Property(30)
|
|
25665
26278
|
], RichTextEditor.prototype, "undoRedoSteps", void 0);
|
|
@@ -25855,5 +26468,5 @@ RichTextEditor = __decorate$1([
|
|
|
25855
26468
|
* Rich Text Editor component exported items
|
|
25856
26469
|
*/
|
|
25857
26470
|
|
|
25858
|
-
export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, imageCaption, imageSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, pasteClean, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, afterImageDelete, drop, xhtmlValidation, beforeImageUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, closeImageDialog, showTableDialog, closeTableDialog, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_IMAGE_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION };
|
|
26471
|
+
export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, imageCaption, imageSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, afterImageDelete, drop, xhtmlValidation, beforeImageUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, closeImageDialog, showTableDialog, closeTableDialog, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_IMAGE_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION };
|
|
25859
26472
|
//# sourceMappingURL=ej2-richtexteditor.es2015.js.map
|