@syncfusion/ej2-image-editor 26.2.10 → 27.1.48
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/README.md +1 -1
- package/dist/ej2-image-editor.umd.min.js +2 -2
- package/dist/ej2-image-editor.umd.min.js.map +1 -1
- package/dist/es6/ej2-image-editor.es2015.js +3207 -732
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +3286 -797
- package/dist/es6/ej2-image-editor.es5.js.map +1 -1
- package/dist/global/ej2-image-editor.min.js +2 -2
- package/dist/global/ej2-image-editor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +14 -13
- package/src/image-editor/action/crop.d.ts +0 -1
- package/src/image-editor/action/crop.js +8 -19
- package/src/image-editor/action/draw.d.ts +4 -0
- package/src/image-editor/action/draw.js +377 -45
- package/src/image-editor/action/export.js +21 -13
- package/src/image-editor/action/filter.d.ts +13 -0
- package/src/image-editor/action/filter.js +272 -1
- package/src/image-editor/action/freehand-draw.d.ts +1 -0
- package/src/image-editor/action/freehand-draw.js +44 -23
- package/src/image-editor/action/selection.d.ts +6 -0
- package/src/image-editor/action/selection.js +382 -97
- package/src/image-editor/action/shape.d.ts +5 -0
- package/src/image-editor/action/shape.js +287 -141
- package/src/image-editor/action/transform.js +56 -82
- package/src/image-editor/action/undo-redo.d.ts +2 -0
- package/src/image-editor/action/undo-redo.js +100 -1
- package/src/image-editor/base/enum.d.ts +11 -0
- package/src/image-editor/base/enum.js +12 -0
- package/src/image-editor/base/image-editor-model.d.ts +13 -1
- package/src/image-editor/base/image-editor.d.ts +142 -20
- package/src/image-editor/base/image-editor.js +816 -149
- package/src/image-editor/base/interface.d.ts +140 -1
- package/src/image-editor/renderer/toolbar.d.ts +8 -0
- package/src/image-editor/renderer/toolbar.js +873 -191
- package/styles/bootstrap-dark-lite.css +746 -0
- package/styles/bootstrap-dark-lite.scss +13 -0
- package/styles/bootstrap-dark.css +150 -105
- package/styles/bootstrap-dark.scss +1 -0
- package/styles/bootstrap-lite.css +747 -0
- package/styles/bootstrap-lite.scss +13 -0
- package/styles/bootstrap.css +151 -106
- package/styles/bootstrap.scss +1 -0
- package/styles/bootstrap4-lite.css +747 -0
- package/styles/bootstrap4-lite.scss +13 -0
- package/styles/bootstrap4.css +150 -105
- package/styles/bootstrap4.scss +1 -0
- package/styles/bootstrap5-dark-lite.css +757 -0
- package/styles/bootstrap5-dark-lite.scss +13 -0
- package/styles/bootstrap5-dark.css +152 -113
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5-lite.css +757 -0
- package/styles/bootstrap5-lite.scss +13 -0
- package/styles/bootstrap5.3-lite.css +760 -0
- package/styles/bootstrap5.3-lite.scss +13 -0
- package/styles/bootstrap5.3.css +867 -0
- package/styles/bootstrap5.3.scss +14 -0
- package/styles/bootstrap5.css +152 -113
- package/styles/bootstrap5.scss +1 -0
- package/styles/fabric-dark-lite.css +749 -0
- package/styles/fabric-dark-lite.scss +13 -0
- package/styles/fabric-dark.css +150 -105
- package/styles/fabric-dark.scss +1 -0
- package/styles/fabric-lite.css +751 -0
- package/styles/fabric-lite.scss +13 -0
- package/styles/fabric.css +151 -106
- package/styles/fabric.scss +1 -0
- package/styles/fluent-dark-lite.css +758 -0
- package/styles/fluent-dark-lite.scss +13 -0
- package/styles/fluent-dark.css +150 -111
- package/styles/fluent-dark.scss +1 -0
- package/styles/fluent-lite.css +758 -0
- package/styles/fluent-lite.scss +13 -0
- package/styles/fluent.css +150 -111
- package/styles/fluent.scss +1 -0
- package/styles/fluent2-lite.css +791 -0
- package/styles/fluent2-lite.scss +13 -0
- package/styles/fluent2.css +173 -117
- package/styles/fluent2.scss +1 -0
- package/styles/highcontrast-light-lite.css +748 -0
- package/styles/highcontrast-light-lite.scss +13 -0
- package/styles/highcontrast-light.css +149 -104
- package/styles/highcontrast-light.scss +1 -0
- package/styles/highcontrast-lite.css +753 -0
- package/styles/highcontrast-lite.scss +13 -0
- package/styles/highcontrast.css +150 -104
- package/styles/highcontrast.scss +1 -0
- package/styles/image-editor/_bds-definition.scss +3 -1
- package/styles/image-editor/_bigger.scss +216 -0
- package/styles/image-editor/_bootstrap-dark-definition.scss +3 -1
- package/styles/image-editor/_bootstrap-definition.scss +3 -1
- package/styles/image-editor/_bootstrap4-definition.scss +3 -1
- package/styles/image-editor/_bootstrap5-definition.scss +3 -1
- package/styles/image-editor/_bootstrap5.3-definition.scss +3 -1
- package/styles/image-editor/_fabric-dark-definition.scss +3 -1
- package/styles/image-editor/_fabric-definition.scss +3 -1
- package/styles/image-editor/_fluent-definition.scss +3 -1
- package/styles/image-editor/_fluent2-definition.scss +4 -2
- package/styles/image-editor/_fusionnew-definition.scss +3 -1
- package/styles/image-editor/_highcontrast-definition.scss +3 -1
- package/styles/image-editor/_highcontrast-light-definition.scss +3 -1
- package/styles/image-editor/_layout.scss +75 -212
- package/styles/image-editor/_material-dark-definition.scss +3 -1
- package/styles/image-editor/_material-definition.scss +3 -1
- package/styles/image-editor/_material3-definition.scss +5 -3
- package/styles/image-editor/_tailwind-definition.scss +5 -3
- package/styles/image-editor/_theme.scss +48 -11
- package/styles/image-editor/bootstrap-dark.css +150 -105
- package/styles/image-editor/bootstrap-dark.scss +1 -0
- package/styles/image-editor/bootstrap.css +151 -106
- package/styles/image-editor/bootstrap.scss +1 -0
- package/styles/image-editor/bootstrap4.css +150 -105
- package/styles/image-editor/bootstrap4.scss +1 -0
- package/styles/image-editor/bootstrap5-dark.css +152 -113
- package/styles/image-editor/bootstrap5-dark.scss +1 -0
- package/styles/image-editor/bootstrap5.3.css +867 -0
- package/styles/image-editor/bootstrap5.3.scss +14 -0
- package/styles/image-editor/bootstrap5.css +152 -113
- package/styles/image-editor/bootstrap5.scss +1 -0
- package/styles/image-editor/fabric-dark.css +150 -105
- package/styles/image-editor/fabric-dark.scss +1 -0
- package/styles/image-editor/fabric.css +151 -106
- package/styles/image-editor/fabric.scss +1 -0
- package/styles/image-editor/fluent-dark.css +150 -111
- package/styles/image-editor/fluent-dark.scss +1 -0
- package/styles/image-editor/fluent.css +150 -111
- package/styles/image-editor/fluent.scss +1 -0
- package/styles/image-editor/fluent2.css +173 -117
- package/styles/image-editor/fluent2.scss +1 -0
- package/styles/image-editor/highcontrast-light.css +149 -104
- package/styles/image-editor/highcontrast-light.scss +1 -0
- package/styles/image-editor/highcontrast.css +150 -104
- package/styles/image-editor/highcontrast.scss +1 -0
- package/styles/image-editor/icons/_bds.scss +10 -1
- package/styles/image-editor/icons/_bootstrap-dark.scss +10 -1
- package/styles/image-editor/icons/_bootstrap.scss +10 -1
- package/styles/image-editor/icons/_bootstrap4.scss +10 -1
- package/styles/image-editor/icons/_bootstrap5.3.scss +10 -1
- package/styles/image-editor/icons/_bootstrap5.scss +10 -1
- package/styles/image-editor/icons/_fabric-dark.scss +10 -1
- package/styles/image-editor/icons/_fabric.scss +10 -1
- package/styles/image-editor/icons/_fluent.scss +10 -1
- package/styles/image-editor/icons/_fluent2.scss +10 -1
- package/styles/image-editor/icons/_fusionnew.scss +10 -1
- package/styles/image-editor/icons/_highcontrast-light.scss +10 -1
- package/styles/image-editor/icons/_highcontrast.scss +10 -1
- package/styles/image-editor/icons/_material-dark.scss +10 -1
- package/styles/image-editor/icons/_material.scss +10 -1
- package/styles/image-editor/icons/_material3.scss +10 -1
- package/styles/image-editor/icons/_tailwind.scss +10 -1
- package/styles/image-editor/material-dark.css +153 -108
- package/styles/image-editor/material-dark.scss +1 -0
- package/styles/image-editor/material.css +159 -114
- package/styles/image-editor/material.scss +1 -0
- package/styles/image-editor/material3-dark.css +171 -123
- package/styles/image-editor/material3-dark.scss +1 -0
- package/styles/image-editor/material3.css +171 -123
- package/styles/image-editor/material3.scss +1 -0
- package/styles/image-editor/tailwind-dark.css +154 -116
- package/styles/image-editor/tailwind-dark.scss +1 -0
- package/styles/image-editor/tailwind.css +154 -116
- package/styles/image-editor/tailwind.scss +1 -0
- package/styles/material-dark-lite.css +767 -0
- package/styles/material-dark-lite.scss +13 -0
- package/styles/material-dark.css +153 -108
- package/styles/material-dark.scss +1 -0
- package/styles/material-lite.css +769 -0
- package/styles/material-lite.scss +13 -0
- package/styles/material.css +159 -114
- package/styles/material.scss +1 -0
- package/styles/material3-dark-lite.css +799 -0
- package/styles/material3-dark-lite.scss +13 -0
- package/styles/material3-dark.css +171 -123
- package/styles/material3-dark.scss +1 -0
- package/styles/material3-lite.css +801 -0
- package/styles/material3-lite.scss +13 -0
- package/styles/material3.css +171 -123
- package/styles/material3.scss +1 -0
- package/styles/tailwind-dark-lite.css +751 -0
- package/styles/tailwind-dark-lite.scss +13 -0
- package/styles/tailwind-dark.css +154 -116
- package/styles/tailwind-dark.scss +1 -0
- package/styles/tailwind-lite.css +751 -0
- package/styles/tailwind-lite.scss +13 -0
- package/styles/tailwind.css +154 -116
- package/styles/tailwind.scss +1 -0
- package/hotfix/26.1.35_Vol2.txt +0 -1
|
@@ -195,7 +195,13 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
195
195
|
SendBackward: 'Send Backward',
|
|
196
196
|
SendToBack: 'Send to Back',
|
|
197
197
|
BringToFront: 'Bring to Front',
|
|
198
|
-
ZOrder: 'Z-Order'
|
|
198
|
+
ZOrder: 'Z-Order',
|
|
199
|
+
Redact: 'Redact',
|
|
200
|
+
Pixelate: 'Pixelate',
|
|
201
|
+
BorderRadius: 'Border Radius',
|
|
202
|
+
TextOutlineColor: 'Outline Color',
|
|
203
|
+
TextOutlineWidth: 'Outline Width',
|
|
204
|
+
PixelSize: 'Pixel Size'
|
|
199
205
|
};
|
|
200
206
|
this.l10n = new L10n('image-editor', this.defaultLocale, this.parent.locale);
|
|
201
207
|
};
|
|
@@ -319,9 +325,6 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
319
325
|
case 'getFrameToolbar':
|
|
320
326
|
args.value['obj']['bool'] = this.isFrameToolbar;
|
|
321
327
|
break;
|
|
322
|
-
case 'callFrameToolbar':
|
|
323
|
-
this.callFrameToolbar();
|
|
324
|
-
break;
|
|
325
328
|
case 'resizeClick':
|
|
326
329
|
this.resizeClick();
|
|
327
330
|
break;
|
|
@@ -340,6 +343,18 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
340
343
|
case 'setInitialSize':
|
|
341
344
|
this.initialSize = Number(args.value['value']);
|
|
342
345
|
break;
|
|
346
|
+
case 'widthPress':
|
|
347
|
+
this.widthPress(args.value['e']);
|
|
348
|
+
break;
|
|
349
|
+
case 'heightPress':
|
|
350
|
+
this.heightPress(args.value['e']);
|
|
351
|
+
break;
|
|
352
|
+
case 'widthAspectRatio':
|
|
353
|
+
this.widthAspectRatio(args.value['e']);
|
|
354
|
+
break;
|
|
355
|
+
case 'heightAspectRatio':
|
|
356
|
+
this.heightAspectRatio(args.value['e']);
|
|
357
|
+
break;
|
|
343
358
|
}
|
|
344
359
|
};
|
|
345
360
|
ToolbarModule.prototype.updatePrivateVariables = function () {
|
|
@@ -515,17 +530,17 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
515
530
|
toolbarObj.appendTo('#' + id + '_quickAccessToolbar');
|
|
516
531
|
}
|
|
517
532
|
};
|
|
518
|
-
ToolbarModule.prototype.initMainToolbar = function (isApplyOption, isDevice, isOkBtn, isResize, isFrame, isMainToolbar) {
|
|
533
|
+
ToolbarModule.prototype.initMainToolbar = function (isApplyOption, isDevice, isOkBtn, isResize, isFrame, isMainToolbar, isRedact) {
|
|
519
534
|
var _this = this;
|
|
520
535
|
var parent = this.parent;
|
|
521
536
|
var id = parent.element.id;
|
|
522
537
|
if (this.isToolbar()) {
|
|
523
538
|
var leftItem = this.getLeftToolbarItem(isOkBtn, isResize);
|
|
524
|
-
var rightItem = this.getRightToolbarItem(isOkBtn, isMainToolbar);
|
|
525
|
-
var mainItem = this.getMainToolbarItem(isApplyOption, isFrame);
|
|
539
|
+
var rightItem = this.getRightToolbarItem(isOkBtn, isMainToolbar, isRedact);
|
|
540
|
+
var mainItem = this.getMainToolbarItem(isApplyOption, isFrame, isRedact);
|
|
526
541
|
var zoomItem = this.getZoomToolbarItem();
|
|
527
542
|
if (isDevice) {
|
|
528
|
-
if (isFrame) {
|
|
543
|
+
if (isFrame || isRedact) {
|
|
529
544
|
this.defToolbarItems = mainItem;
|
|
530
545
|
}
|
|
531
546
|
else {
|
|
@@ -551,7 +566,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
551
566
|
parent.trigger('toolbarCreated', { toolbarType: 'main' });
|
|
552
567
|
}
|
|
553
568
|
});
|
|
554
|
-
if (isDevice && isFrame) {
|
|
569
|
+
if ((isDevice && isFrame) || (isDevice && isRedact)) {
|
|
555
570
|
toolbarObj.appendTo('#' + id + '_bottomToolbar');
|
|
556
571
|
}
|
|
557
572
|
else {
|
|
@@ -633,11 +648,11 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
633
648
|
}
|
|
634
649
|
return toolbarItems;
|
|
635
650
|
};
|
|
636
|
-
ToolbarModule.prototype.getRightToolbarItem = function (isOkBtn, isMainToolbar) {
|
|
651
|
+
ToolbarModule.prototype.getRightToolbarItem = function (isOkBtn, isMainToolbar, isRedact) {
|
|
637
652
|
var parent = this.parent;
|
|
638
653
|
var id = parent.element.id;
|
|
639
654
|
var toolbarItems = [];
|
|
640
|
-
if (isOkBtn) {
|
|
655
|
+
if (isOkBtn || isRedact) {
|
|
641
656
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
642
657
|
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
643
658
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
@@ -659,7 +674,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
659
674
|
}
|
|
660
675
|
return toolbarItems;
|
|
661
676
|
};
|
|
662
|
-
ToolbarModule.prototype.getMainToolbarItem = function (isApplyOption, isFrame) {
|
|
677
|
+
ToolbarModule.prototype.getMainToolbarItem = function (isApplyOption, isFrame, isRedact) {
|
|
663
678
|
var parent = this.parent;
|
|
664
679
|
var id = parent.element.id;
|
|
665
680
|
var toolbarItems = [];
|
|
@@ -689,6 +704,16 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
689
704
|
tooltipText: this.l10n.getConstant('Hook'), align: 'Center' });
|
|
690
705
|
}
|
|
691
706
|
}
|
|
707
|
+
else if (isRedact) {
|
|
708
|
+
toolbarItems.push({ id: id + '_redactBlur', prefixIcon: 'e-icons e-tint', cssClass: 'top-icon e-opacity',
|
|
709
|
+
tooltipText: this.l10n.getConstant('Blur'), align: 'Center' });
|
|
710
|
+
toolbarItems.push({ id: id + '_pixelate', prefixIcon: 'e-icons e-opacity', cssClass: 'top-icon e-opacity',
|
|
711
|
+
tooltipText: this.l10n.getConstant('Pixelate'), align: 'Center' });
|
|
712
|
+
toolbarItems.push({ id: id + '_duplicate', prefixIcon: 'e-icons e-order', cssClass: 'top-icon e-order',
|
|
713
|
+
tooltipText: this.l10n.getConstant('Duplicate'), align: 'Center' });
|
|
714
|
+
toolbarItems.push({ id: id + '_remove', prefixIcon: 'e-icons e-trash', cssClass: 'top-icon e-trash',
|
|
715
|
+
tooltipText: this.l10n.getConstant('Remove'), align: 'Center' });
|
|
716
|
+
}
|
|
692
717
|
else {
|
|
693
718
|
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Crop') > -1)) {
|
|
694
719
|
toolbarItems.push({ id: id + '_cropTransform', prefixIcon: 'e-icons e-crop', cssClass: 'top-icon e-crop',
|
|
@@ -714,6 +739,10 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
714
739
|
toolbarItems.push({ id: id + '_resize', prefixIcon: 'e-icons e-resize', cssClass: 'top-icon e-resize',
|
|
715
740
|
tooltipText: this.l10n.getConstant('Resize'), align: 'Center' });
|
|
716
741
|
}
|
|
742
|
+
if (isNullOrUndefined(parent.toolbar) || (!isNullOrUndefined(parent.toolbar) && parent.toolbar.indexOf('Redact') > -1)) {
|
|
743
|
+
toolbarItems.push({ id: id + '_redact', prefixIcon: 'e-icons e-redact', cssClass: 'top-icon e-opacity',
|
|
744
|
+
tooltipText: this.l10n.getConstant('Redact'), align: 'Center' });
|
|
745
|
+
}
|
|
717
746
|
}
|
|
718
747
|
var tempToolbarItems = this.processToolbar('center');
|
|
719
748
|
for (var i = 0, len = tempToolbarItems.length; i < len; i++) {
|
|
@@ -1108,10 +1137,17 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1108
1137
|
}
|
|
1109
1138
|
var frame = document.querySelector('#' + id + '_frame');
|
|
1110
1139
|
if (frame && ((parent.currSelectionPoint && parent.currSelectionPoint.shape === 'crop-circle') || parent.isCircleCrop)) {
|
|
1111
|
-
frame.classList.add('e-
|
|
1140
|
+
frame.classList.add('e-overlay');
|
|
1112
1141
|
}
|
|
1113
1142
|
else if (frame) {
|
|
1114
|
-
frame.classList.remove('e-
|
|
1143
|
+
frame.classList.remove('e-overlay');
|
|
1144
|
+
}
|
|
1145
|
+
var ratio = document.querySelector('#' + id + '_aspectratio');
|
|
1146
|
+
if (ratio && ((parent.currSelectionPoint && parent.currSelectionPoint.shape === 'crop-circle') || parent.isCircleCrop)) {
|
|
1147
|
+
ratio.classList.add('e-overlay');
|
|
1148
|
+
}
|
|
1149
|
+
else if (ratio) {
|
|
1150
|
+
ratio.classList.remove('e-overlay');
|
|
1115
1151
|
}
|
|
1116
1152
|
};
|
|
1117
1153
|
ToolbarModule.prototype.createLeftToolbarControls = function () {
|
|
@@ -1126,6 +1162,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1126
1162
|
var uploadBtnElem = uploadDiv.getElementsByTagName('button')[0];
|
|
1127
1163
|
uploadBtnElem.className = 'e-tbar-btn e-tbtn-txt top-icon';
|
|
1128
1164
|
uploadBtnElem.innerHTML = '';
|
|
1165
|
+
uploadBtnElem.title = this.l10n.getConstant('Browse');
|
|
1129
1166
|
uploadBtnElem.appendChild(parent.createElement('span', {
|
|
1130
1167
|
className: 'e-btn-icon e-icons e-upload-icon e-icon-left'
|
|
1131
1168
|
}));
|
|
@@ -1193,46 +1230,13 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1193
1230
|
}
|
|
1194
1231
|
var obj = { freehandDrawSelectedId: null };
|
|
1195
1232
|
parent.notify('freehand-draw', { prop: 'getFreehandDrawSelectedId', onPropertyChange: false, value: { obj: obj } });
|
|
1196
|
-
var
|
|
1197
|
-
|
|
1198
|
-
var editTextElement = document.querySelector('#' + id + '_editText');
|
|
1199
|
-
var zOrderElement = document.querySelector('#' + id + '_zOrderBtn');
|
|
1200
|
-
if ((parent.activeObj.activePoint.width === 0 && parent.activeObj.activePoint.height === 0) &&
|
|
1201
|
-
(isNullOrUndefined(parent.activeObj.pointColl) || (parent.activeObj.pointColl
|
|
1202
|
-
&& parent.activeObj.pointColl.length === 0)) &&
|
|
1203
|
-
isNullOrUndefined(obj['freehandDrawSelectedId'])) {
|
|
1204
|
-
if (duplicateElement) {
|
|
1205
|
-
duplicateElement.classList.add('e-disabled');
|
|
1206
|
-
}
|
|
1207
|
-
if (removeElement) {
|
|
1208
|
-
removeElement.classList.add('e-disabled');
|
|
1209
|
-
}
|
|
1210
|
-
if (editTextElement) {
|
|
1211
|
-
editTextElement.classList.add('e-disabled');
|
|
1212
|
-
}
|
|
1213
|
-
if (zOrderElement) {
|
|
1214
|
-
zOrderElement.classList.add('e-disabled');
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
else {
|
|
1218
|
-
if (duplicateElement) {
|
|
1219
|
-
duplicateElement.classList.remove('e-disabled');
|
|
1220
|
-
}
|
|
1221
|
-
if (removeElement) {
|
|
1222
|
-
removeElement.classList.remove('e-disabled');
|
|
1223
|
-
}
|
|
1224
|
-
if (editTextElement) {
|
|
1225
|
-
editTextElement.classList.remove('e-disabled');
|
|
1226
|
-
}
|
|
1227
|
-
if (zOrderElement) {
|
|
1228
|
-
zOrderElement.classList.remove('e-disabled');
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1233
|
+
var toolbarId = Browser.isDevice ? '#' + id + '_bottomToolbar ' + '#' + id : '#' + id;
|
|
1234
|
+
this.enableDisableCloneBtn(toolbarId, obj);
|
|
1231
1235
|
var iconCss = isContextualToolbar ? this.getCurrentShapeIcon(parent.activeObj.shape) : 'e-annotation';
|
|
1232
1236
|
var drpDownBtn = new DropDownButton({ items: items, iconCss: 'e-icons ' + iconCss,
|
|
1233
1237
|
cssClass: 'e-image-popup',
|
|
1234
1238
|
open: function (args) {
|
|
1235
|
-
if (parent.currObjType.isFiltered) {
|
|
1239
|
+
if (parent.currObjType.isFiltered || parent.currObjType.isRedact) {
|
|
1236
1240
|
parent.okBtn();
|
|
1237
1241
|
parent.element.querySelector('#' + id + '_annotationBtn').click();
|
|
1238
1242
|
}
|
|
@@ -1273,11 +1277,16 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1273
1277
|
var prevObj = { shapeSettingsObj: {} };
|
|
1274
1278
|
var shapeSettings;
|
|
1275
1279
|
var shapeChangingArgs;
|
|
1280
|
+
var shapes = ['ellipse', 'rectangle', 'text', 'image'];
|
|
1281
|
+
var allowOutofBound;
|
|
1276
1282
|
drpDownBtn.iconCss = 'e-icons ' + _this.getCurrentShapeIcon(args.item.id);
|
|
1277
1283
|
parent.notify('draw', { prop: 'updateTempObjColl' });
|
|
1278
1284
|
parent.notify('draw', { prop: 'updateTempPointColl' });
|
|
1285
|
+
var penStrokeWidthObj = { penStrokeWidth: 2 };
|
|
1279
1286
|
switch (args.item.id) {
|
|
1280
1287
|
case 'pen':
|
|
1288
|
+
parent.notify('freehand-draw', { prop: 'getPenStrokeWidth', onPropertyChange: false, value: { obj: penStrokeWidthObj } });
|
|
1289
|
+
parent.notify('draw', { prop: 'setTempStrokeWidth', value: { strokeWidth: penStrokeWidthObj['penStrokeWidth'] } });
|
|
1281
1290
|
parent.drawingShape = null;
|
|
1282
1291
|
parent.notify('draw', { prop: 'setTempFreehandCounter', value: { tempFreehandCounter: parent.freehandCounter } });
|
|
1283
1292
|
parent.notify('draw', { prop: 'setTempCurrentFreehandDrawIndex', value: { tempCurrentFreehandDrawIndex: obj['currentFreehandDrawIndex'] } });
|
|
@@ -1285,6 +1294,8 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1285
1294
|
parent.freeHandDraw(true);
|
|
1286
1295
|
parent.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: prevObj } });
|
|
1287
1296
|
shapeSettings = prevObj['shapeSettingsObj'];
|
|
1297
|
+
parent.notify('freehand-draw', { prop: 'getPenStrokeWidth', onPropertyChange: false, value: { obj: penStrokeWidthObj } });
|
|
1298
|
+
shapeSettings.strokeWidth = penStrokeWidthObj['penStrokeWidth'];
|
|
1288
1299
|
shapeSettings.type = ShapeType.FreehandDraw;
|
|
1289
1300
|
shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
|
|
1290
1301
|
currentShapeSettings: shapeSettings };
|
|
@@ -1317,9 +1328,11 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1317
1328
|
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
1318
1329
|
parent.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: prevObj } });
|
|
1319
1330
|
shapeSettings = prevObj['shapeSettingsObj'];
|
|
1331
|
+
allowOutofBound = shapes.indexOf(_this.parent.activeObj.shape) !== -1 ? false : true;
|
|
1320
1332
|
shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
|
|
1321
|
-
currentShapeSettings: shapeSettings };
|
|
1333
|
+
currentShapeSettings: shapeSettings, allowShapeOverflow: allowOutofBound };
|
|
1322
1334
|
parent.trigger('shapeChanging', shapeChangingArgs);
|
|
1335
|
+
parent.editCompleteArgs = shapeChangingArgs;
|
|
1323
1336
|
parent.notify('shape', { prop: 'updateShapeChangeEventArgs', value: { shapeSettings: shapeChangingArgs.currentShapeSettings } });
|
|
1324
1337
|
break;
|
|
1325
1338
|
}
|
|
@@ -1335,6 +1348,50 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1335
1348
|
// Render initialized DropDownButton.
|
|
1336
1349
|
drpDownBtn.appendTo('#' + id + '_annotationBtn');
|
|
1337
1350
|
};
|
|
1351
|
+
ToolbarModule.prototype.enableDisableCloneBtn = function (toolbarId, obj) {
|
|
1352
|
+
var parent = this.parent;
|
|
1353
|
+
var isDummyTextClick = false;
|
|
1354
|
+
if (parent.activeObj.shape && parent.activeObj.shape === 'text' &&
|
|
1355
|
+
parent.activeObj.textSettings.fontSize === 11 && Math.floor(parent.activeObj.activePoint.width) === 55 &&
|
|
1356
|
+
Math.floor(parent.activeObj.activePoint.height) === 11) {
|
|
1357
|
+
isDummyTextClick = true;
|
|
1358
|
+
}
|
|
1359
|
+
var duplicateElement = document.querySelector(toolbarId + '_duplicate');
|
|
1360
|
+
var removeElement = document.querySelector(toolbarId + '_remove');
|
|
1361
|
+
var editTextElement = document.querySelector(toolbarId + '_editText');
|
|
1362
|
+
var zOrderElement = document.querySelector(toolbarId + '_zOrderBtn');
|
|
1363
|
+
if (isDummyTextClick || (parent.activeObj.activePoint.width === 0 && parent.activeObj.activePoint.height === 0) &&
|
|
1364
|
+
(isNullOrUndefined(parent.activeObj.pointColl) || (parent.activeObj.pointColl
|
|
1365
|
+
&& parent.activeObj.pointColl.length === 0)) &&
|
|
1366
|
+
isNullOrUndefined(obj['freehandDrawSelectedId'])) {
|
|
1367
|
+
if (duplicateElement) {
|
|
1368
|
+
duplicateElement.classList.add('e-overlay');
|
|
1369
|
+
}
|
|
1370
|
+
if (removeElement) {
|
|
1371
|
+
removeElement.classList.add('e-overlay');
|
|
1372
|
+
}
|
|
1373
|
+
if (editTextElement) {
|
|
1374
|
+
editTextElement.classList.add('e-overlay');
|
|
1375
|
+
}
|
|
1376
|
+
if (zOrderElement) {
|
|
1377
|
+
zOrderElement.classList.add('e-overlay');
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
else {
|
|
1381
|
+
if (duplicateElement) {
|
|
1382
|
+
duplicateElement.classList.remove('e-overlay');
|
|
1383
|
+
}
|
|
1384
|
+
if (removeElement) {
|
|
1385
|
+
removeElement.classList.remove('e-overlay');
|
|
1386
|
+
}
|
|
1387
|
+
if (editTextElement) {
|
|
1388
|
+
editTextElement.classList.remove('e-overlay');
|
|
1389
|
+
}
|
|
1390
|
+
if (zOrderElement) {
|
|
1391
|
+
zOrderElement.classList.remove('e-overlay');
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1338
1395
|
ToolbarModule.prototype.renderStraightenSlider = function () {
|
|
1339
1396
|
var parent = this.parent;
|
|
1340
1397
|
var id = parent.element.id;
|
|
@@ -1683,13 +1740,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1683
1740
|
if (args.item.id !== 'jpeg') {
|
|
1684
1741
|
qualityContainer.style.display = 'none';
|
|
1685
1742
|
imageNameLabel.style.display = 'block';
|
|
1686
|
-
|
|
1687
|
-
var megabytes = _this.initialSize / 1048576;
|
|
1688
|
-
imageNameLabel.innerHTML = _this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
|
|
1689
|
-
}
|
|
1690
|
-
else {
|
|
1691
|
-
imageNameLabel.innerHTML = _this.l10n.getConstant('ImageSize') + ': ' + _this.initialSize.toFixed(2) + ' KB';
|
|
1692
|
-
}
|
|
1743
|
+
_this.updateImageSize(1, obj['canvas'], _this.fileType);
|
|
1693
1744
|
if (slider) {
|
|
1694
1745
|
if (_this.isSlider) {
|
|
1695
1746
|
getComponent(slider, 'slider').destroy();
|
|
@@ -1703,7 +1754,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1703
1754
|
removeClass([qualityBtnGrp], 'e-hide');
|
|
1704
1755
|
slider.style.display = 'none';
|
|
1705
1756
|
imageNameLabel.style.display = 'block';
|
|
1706
|
-
_this.updateImageSize(isNullOrUndefined(_this.currentQuality) ? 1 : _this.currentQuality, obj['canvas']);
|
|
1757
|
+
_this.updateImageSize(isNullOrUndefined(_this.currentQuality) ? 1 : _this.currentQuality, obj['canvas'], _this.fileType);
|
|
1707
1758
|
document.getElementById(id + '_' + _this.imageQuality).checked = true;
|
|
1708
1759
|
}
|
|
1709
1760
|
}
|
|
@@ -1719,10 +1770,10 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1719
1770
|
if (Browser.isDevice) {
|
|
1720
1771
|
document.getElementById(id + '_dialogImgContent').style.display = 'none';
|
|
1721
1772
|
document.getElementById(id + '_dialogRightContent').style.width = '100%';
|
|
1722
|
-
this.updateImageSize(1, obj['canvas']);
|
|
1773
|
+
this.updateImageSize(1, obj['canvas'], this.fileType);
|
|
1723
1774
|
}
|
|
1724
1775
|
else {
|
|
1725
|
-
this.updateImageSize(1, obj['canvas']);
|
|
1776
|
+
this.updateImageSize(1, obj['canvas'], this.fileType);
|
|
1726
1777
|
}
|
|
1727
1778
|
}
|
|
1728
1779
|
document.getElementById(id + '_' + this.imageQuality).checked = true;
|
|
@@ -1759,14 +1810,14 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1759
1810
|
type: 'MinRange',
|
|
1760
1811
|
width: Browser.isDevice ? '80%' : '190px',
|
|
1761
1812
|
created: function () {
|
|
1762
|
-
_this.updateImageSize(_this.currentQuality, obj['canvas']);
|
|
1813
|
+
_this.updateImageSize(_this.currentQuality, obj['canvas'], 'jpeg');
|
|
1763
1814
|
qualitySliderValueSpan.innerHTML = (Math.round(_this.currentQuality * 100)).toString();
|
|
1764
1815
|
},
|
|
1765
1816
|
changed: function (args) {
|
|
1766
1817
|
_this.currentQuality = args.value;
|
|
1767
1818
|
qualitySliderValueSpan.innerHTML = (Math.round(_this.currentQuality * 100)).toString();
|
|
1768
1819
|
parent.notify('export', { prop: 'setImageQuality', value: { value: args.value } });
|
|
1769
|
-
_this.updateImageSize(args.value, obj['canvas']);
|
|
1820
|
+
_this.updateImageSize(args.value, obj['canvas'], 'jpeg');
|
|
1770
1821
|
}
|
|
1771
1822
|
});
|
|
1772
1823
|
sliderObj.appendTo('#' + id + '_qualitySlider');
|
|
@@ -1786,10 +1837,10 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1786
1837
|
event.target.previousElementSibling.checked = true;
|
|
1787
1838
|
this.currentQuality = compressionValues[target.textContent];
|
|
1788
1839
|
this.imageQuality = target.textContent.toLowerCase();
|
|
1789
|
-
this.updateImageSize(compressionValues[target.textContent], obj['canvas']);
|
|
1840
|
+
this.updateImageSize(compressionValues[target.textContent], obj['canvas'], 'jpeg');
|
|
1790
1841
|
}
|
|
1791
1842
|
};
|
|
1792
|
-
ToolbarModule.prototype.updateImageSize = function (quality, tempCanvas) {
|
|
1843
|
+
ToolbarModule.prototype.updateImageSize = function (quality, tempCanvas, fileType) {
|
|
1793
1844
|
var fileSize;
|
|
1794
1845
|
var parent = this.parent;
|
|
1795
1846
|
var id = parent.element.id;
|
|
@@ -1803,32 +1854,49 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1803
1854
|
else {
|
|
1804
1855
|
imageNameLabel = document.getElementById(id + '_imageNameLabel');
|
|
1805
1856
|
}
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1857
|
+
if (fileType.toLowerCase() === 'jpeg') {
|
|
1858
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
1859
|
+
tempCanvas.toBlob((function (blob) {
|
|
1860
|
+
fileSize = Math.floor(blob.size / 1024);
|
|
1861
|
+
if (fileSize > 1000) {
|
|
1862
|
+
var megabytes = fileSize / 1024;
|
|
1863
|
+
imageNameLabel.innerHTML = 'Image size: ' + megabytes.toFixed(2) + ' MB';
|
|
1864
|
+
fileSize = +megabytes.toFixed(2);
|
|
1865
|
+
}
|
|
1866
|
+
else {
|
|
1867
|
+
imageNameLabel.innerHTML = 'Image size: ' + fileSize.toFixed(2) + ' KB';
|
|
1868
|
+
fileSize = +fileSize.toFixed(2);
|
|
1869
|
+
}
|
|
1870
|
+
if (Browser.isDevice) {
|
|
1871
|
+
canvas.style.display = 'none';
|
|
1872
|
+
}
|
|
1873
|
+
else {
|
|
1874
|
+
var compressedImage_1 = new Image();
|
|
1875
|
+
compressedImage_1.src = URL.createObjectURL(blob);
|
|
1876
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
1877
|
+
compressedImage_1.onload = function () {
|
|
1878
|
+
ctx.drawImage(compressedImage_1, 0, 0);
|
|
1879
|
+
URL.revokeObjectURL(compressedImage_1.src);
|
|
1880
|
+
};
|
|
1881
|
+
}
|
|
1882
|
+
this.fileSize = fileSize;
|
|
1883
|
+
}).bind(this), 'image/jpeg', quality);
|
|
1884
|
+
}
|
|
1885
|
+
else {
|
|
1818
1886
|
if (Browser.isDevice) {
|
|
1819
1887
|
canvas.style.display = 'none';
|
|
1820
1888
|
}
|
|
1821
1889
|
else {
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1890
|
+
ctx.drawImage(tempCanvas, 0, 0);
|
|
1891
|
+
if (this.initialSize > 1000) {
|
|
1892
|
+
var megabytes = this.initialSize / 1048576;
|
|
1893
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
|
|
1894
|
+
}
|
|
1895
|
+
else {
|
|
1896
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + this.initialSize.toFixed(2) + ' KB';
|
|
1897
|
+
}
|
|
1829
1898
|
}
|
|
1830
|
-
|
|
1831
|
-
}).bind(this), 'image/jpeg', quality);
|
|
1899
|
+
}
|
|
1832
1900
|
};
|
|
1833
1901
|
ToolbarModule.prototype.download = function () {
|
|
1834
1902
|
var parent = this.parent;
|
|
@@ -1908,15 +1976,19 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1908
1976
|
template: '<button id="' + id + '_borderColorBtn"></button>' });
|
|
1909
1977
|
}
|
|
1910
1978
|
if (items.indexOf('strokeWidth') > -1) {
|
|
1911
|
-
toolbarItems.push({ id: id + '_strokeWidth', cssClass: 'top-icon e-size', tooltipText: '
|
|
1979
|
+
toolbarItems.push({ id: id + '_strokeWidth', cssClass: 'top-icon e-size', tooltipText: this.l10n.getConstant('StrokeWidth'), align: 'Center',
|
|
1912
1980
|
type: 'Input', template: '<button id="' + id + '_borderWidthBtn"></button>' });
|
|
1913
1981
|
}
|
|
1914
1982
|
if (items.indexOf('start') > -1) {
|
|
1915
|
-
toolbarItems.push({ id: id + '_start', cssClass: 'top-icon e-size', tooltipText: 'Start', align: 'Center',
|
|
1983
|
+
toolbarItems.push({ id: id + '_start', cssClass: 'top-icon e-size', tooltipText: this.l10n.getConstant('Start'), align: 'Center',
|
|
1916
1984
|
type: 'Input', template: '<button id="' + id + '_startBtn"></button>' });
|
|
1917
1985
|
}
|
|
1986
|
+
if (items.indexOf('borderRadius') > -1) {
|
|
1987
|
+
toolbarItems.push({ id: id + '_rectangleRadius', cssClass: 'top-icon e-size', tooltipText: this.l10n.getConstant('BorderRadius'), align: 'Center',
|
|
1988
|
+
type: 'Input', template: '<button id="' + id + '_rectangleRadiusBtn"></button>' });
|
|
1989
|
+
}
|
|
1918
1990
|
if (items.indexOf('end') > -1) {
|
|
1919
|
-
toolbarItems.push({ id: id + '_end', cssClass: 'top-icon e-size', tooltipText: 'End', align: 'Center',
|
|
1991
|
+
toolbarItems.push({ id: id + '_end', cssClass: 'top-icon e-size', tooltipText: this.l10n.getConstant('End'), align: 'Center',
|
|
1920
1992
|
type: 'Input', template: '<button id="' + id + '_endBtn"></button>' });
|
|
1921
1993
|
}
|
|
1922
1994
|
if (items.indexOf('flip') > -1) {
|
|
@@ -2104,6 +2176,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2104
2176
|
clicked: this.defToolbarClicked.bind(this),
|
|
2105
2177
|
created: function () {
|
|
2106
2178
|
_this.renderAnnotationBtn(true);
|
|
2179
|
+
_this.createRectangleRadius(items);
|
|
2107
2180
|
_this.createShapeColor(items);
|
|
2108
2181
|
_this.createShapeBtn(items);
|
|
2109
2182
|
_this.createZOrderBtn(items);
|
|
@@ -2144,6 +2217,62 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2144
2217
|
}
|
|
2145
2218
|
this.enableDisableTbrBtn();
|
|
2146
2219
|
};
|
|
2220
|
+
ToolbarModule.prototype.createRectangleRadius = function (items) {
|
|
2221
|
+
var _this = this;
|
|
2222
|
+
var parent = this.parent;
|
|
2223
|
+
var id = parent.element.id;
|
|
2224
|
+
if (items.indexOf('borderRadius') > -1) {
|
|
2225
|
+
var strokeWidthItems = [
|
|
2226
|
+
{ id: '1', text: this.l10n.getConstant('0') },
|
|
2227
|
+
{ id: '2', text: this.l10n.getConstant('20') },
|
|
2228
|
+
{ id: '3', text: this.l10n.getConstant('40') },
|
|
2229
|
+
{ id: '4', text: this.l10n.getConstant('60') },
|
|
2230
|
+
{ id: '5', text: this.l10n.getConstant('80') },
|
|
2231
|
+
{ id: '6', text: this.l10n.getConstant('100') }
|
|
2232
|
+
];
|
|
2233
|
+
var strokeWidthBtn = document.getElementById(id + '_rectangleRadiusBtn');
|
|
2234
|
+
var spanElem_2 = document.createElement('span');
|
|
2235
|
+
spanElem_2.innerHTML = this.l10n.getConstant(parent.frameObj.radius.toString());
|
|
2236
|
+
spanElem_2.className = 'e-shape-rectangle-radius';
|
|
2237
|
+
strokeWidthBtn.appendChild(spanElem_2);
|
|
2238
|
+
// Initialize the DropDownButton component.
|
|
2239
|
+
var drpDownBtn_2 = new DropDownButton({ items: strokeWidthItems,
|
|
2240
|
+
open: function (args) {
|
|
2241
|
+
if (Browser.isDevice) {
|
|
2242
|
+
var parentElem = args.element.parentElement;
|
|
2243
|
+
parentElem.style.top = drpDownBtn_2.element.getBoundingClientRect().top -
|
|
2244
|
+
parentElem.offsetHeight + 'px';
|
|
2245
|
+
}
|
|
2246
|
+
var activeBtn = drpDownBtn_2.element.childNodes[0].textContent;
|
|
2247
|
+
if (activeBtn !== '') {
|
|
2248
|
+
args.element.querySelector('[aria-label = ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
|
|
2249
|
+
}
|
|
2250
|
+
},
|
|
2251
|
+
select: function (args) {
|
|
2252
|
+
_this.triggerTbarClickEvent(args);
|
|
2253
|
+
spanElem_2.textContent = args.item.text;
|
|
2254
|
+
parent.updateStrokeWidth(args.item.id, 'radius');
|
|
2255
|
+
if (Browser.isDevice) {
|
|
2256
|
+
if (document.getElementById(id + '_bottomToolbar')) {
|
|
2257
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2258
|
+
var toolbar_7 = getComponent(id + '_bottomToolbar', 'toolbar');
|
|
2259
|
+
toolbar_7.refreshOverflow();
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
else {
|
|
2263
|
+
if (document.getElementById(id + '_toolbar')) {
|
|
2264
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2265
|
+
var toolbar_8 = getComponent(id + '_toolbar', 'toolbar');
|
|
2266
|
+
toolbar_8.refreshOverflow();
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
|
|
2270
|
+
}
|
|
2271
|
+
});
|
|
2272
|
+
// Render initialized DropDownButton.
|
|
2273
|
+
drpDownBtn_2.appendTo('#' + id + '_rectangleRadiusBtn');
|
|
2274
|
+
}
|
|
2275
|
+
};
|
|
2147
2276
|
ToolbarModule.prototype.beforeModeSwitch = function (args, inst) {
|
|
2148
2277
|
this.popupLeft = args.element.offsetParent.style.left;
|
|
2149
2278
|
if (args.mode === 'Picker') {
|
|
@@ -2217,7 +2346,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2217
2346
|
if (Browser.isDevice) {
|
|
2218
2347
|
parenElem.style.top = fillDDB_1.element.getBoundingClientRect().top -
|
|
2219
2348
|
parenElem.offsetHeight + 'px';
|
|
2220
|
-
|
|
2349
|
+
if (window.innerWidth <= 520) {
|
|
2350
|
+
parenElem.style.left = parent.element.offsetLeft + 'px';
|
|
2351
|
+
}
|
|
2221
2352
|
}
|
|
2222
2353
|
},
|
|
2223
2354
|
target: '.e-shape-fill-color',
|
|
@@ -2263,7 +2394,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2263
2394
|
if (Browser.isDevice) {
|
|
2264
2395
|
parenElem.style.top = strokeDDB_1.element.getBoundingClientRect().top -
|
|
2265
2396
|
parenElem.offsetHeight + 'px';
|
|
2266
|
-
|
|
2397
|
+
if (window.innerWidth <= 520) {
|
|
2398
|
+
parenElem.style.left = parent.element.offsetLeft + 'px';
|
|
2399
|
+
}
|
|
2267
2400
|
}
|
|
2268
2401
|
},
|
|
2269
2402
|
target: '.e-shape-stroke-color',
|
|
@@ -2298,45 +2431,45 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2298
2431
|
];
|
|
2299
2432
|
}
|
|
2300
2433
|
var strokeWidthBtn = document.getElementById(id + '_borderWidthBtn');
|
|
2301
|
-
var
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
strokeWidthBtn.appendChild(
|
|
2434
|
+
var spanElem_3 = document.createElement('span');
|
|
2435
|
+
spanElem_3.innerHTML = this.l10n.getConstant('XSmall');
|
|
2436
|
+
spanElem_3.className = 'e-shape-stroke-width';
|
|
2437
|
+
strokeWidthBtn.appendChild(spanElem_3);
|
|
2305
2438
|
// Initialize the DropDownButton component.
|
|
2306
|
-
var
|
|
2439
|
+
var drpDownBtn_3 = new DropDownButton({ items: strokeWidthItems,
|
|
2307
2440
|
open: function (args) {
|
|
2308
2441
|
if (Browser.isDevice) {
|
|
2309
|
-
args.element.parentElement.style.top =
|
|
2442
|
+
args.element.parentElement.style.top = drpDownBtn_3.element.getBoundingClientRect().top -
|
|
2310
2443
|
args.element.parentElement.offsetHeight + 'px';
|
|
2311
2444
|
}
|
|
2312
|
-
var activeBtn =
|
|
2445
|
+
var activeBtn = spanElem_3.innerHTML;
|
|
2313
2446
|
if (activeBtn !== '') {
|
|
2314
2447
|
args.element.querySelector('[aria-label = ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
|
|
2315
2448
|
}
|
|
2316
2449
|
},
|
|
2317
2450
|
select: function (args) {
|
|
2318
2451
|
_this.triggerTbarClickEvent(args);
|
|
2319
|
-
|
|
2320
|
-
parent.updateStrokeWidth(args.item.id);
|
|
2452
|
+
spanElem_3.textContent = args.item.text;
|
|
2453
|
+
parent.updateStrokeWidth(args.item.id, 'width', parent.activeObj.shape);
|
|
2321
2454
|
if (Browser.isDevice) {
|
|
2322
2455
|
if (document.getElementById(id + '_bottomToolbar')) {
|
|
2323
2456
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2324
|
-
var
|
|
2325
|
-
|
|
2457
|
+
var toolbar_9 = getComponent(id + '_bottomToolbar', 'toolbar');
|
|
2458
|
+
toolbar_9.refreshOverflow();
|
|
2326
2459
|
}
|
|
2327
2460
|
}
|
|
2328
2461
|
else {
|
|
2329
2462
|
if (document.getElementById(id + '_toolbar')) {
|
|
2330
2463
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2331
|
-
var
|
|
2332
|
-
|
|
2464
|
+
var toolbar_10 = getComponent(id + '_toolbar', 'toolbar');
|
|
2465
|
+
toolbar_10.refreshOverflow();
|
|
2333
2466
|
}
|
|
2334
2467
|
}
|
|
2335
2468
|
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
|
|
2336
2469
|
}
|
|
2337
2470
|
});
|
|
2338
2471
|
// Render initialized DropDownButton.
|
|
2339
|
-
|
|
2472
|
+
drpDownBtn_3.appendTo('#' + id + '_borderWidthBtn');
|
|
2340
2473
|
}
|
|
2341
2474
|
};
|
|
2342
2475
|
ToolbarModule.prototype.createZOrderBtn = function (items) {
|
|
@@ -2351,7 +2484,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2351
2484
|
{ text: this.l10n.getConstant('SendToBack'), id: 'sendToBack', iconCss: 'e-icons e-send-to-back' }
|
|
2352
2485
|
];
|
|
2353
2486
|
// Initialize the DropDownButton component.
|
|
2354
|
-
var
|
|
2487
|
+
var drpDownBtn_4 = new DropDownButton({ items: zOrderItems, iconCss: 'e-icons e-layers',
|
|
2355
2488
|
beforeOpen: function (args) {
|
|
2356
2489
|
if (document.getElementById(parent.element.id + '_zOrderBtn').classList.contains('e-disabled')) {
|
|
2357
2490
|
args.cancel = true;
|
|
@@ -2386,7 +2519,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2386
2519
|
},
|
|
2387
2520
|
open: function (args) {
|
|
2388
2521
|
if (Browser.isDevice) {
|
|
2389
|
-
args.element.parentElement.style.top =
|
|
2522
|
+
args.element.parentElement.style.top = drpDownBtn_4.element.getBoundingClientRect().top -
|
|
2390
2523
|
args.element.parentElement.offsetHeight + 'px';
|
|
2391
2524
|
}
|
|
2392
2525
|
},
|
|
@@ -2399,15 +2532,15 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2399
2532
|
if (Browser.isDevice) {
|
|
2400
2533
|
if (document.getElementById(id + '_bottomToolbar')) {
|
|
2401
2534
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2402
|
-
var
|
|
2403
|
-
|
|
2535
|
+
var toolbar_11 = getComponent(id + '_bottomToolbar', 'toolbar');
|
|
2536
|
+
toolbar_11.refreshOverflow();
|
|
2404
2537
|
}
|
|
2405
2538
|
}
|
|
2406
2539
|
else {
|
|
2407
2540
|
if (document.getElementById(id + '_toolbar')) {
|
|
2408
2541
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2409
|
-
var
|
|
2410
|
-
|
|
2542
|
+
var toolbar_12 = getComponent(id + '_toolbar', 'toolbar');
|
|
2543
|
+
toolbar_12.refreshOverflow();
|
|
2411
2544
|
}
|
|
2412
2545
|
}
|
|
2413
2546
|
if (shapeId.indexOf('shape') > -1) {
|
|
@@ -2419,7 +2552,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2419
2552
|
}
|
|
2420
2553
|
});
|
|
2421
2554
|
// Render initialized DropDownButton.
|
|
2422
|
-
|
|
2555
|
+
drpDownBtn_4.appendTo('#' + id + '_zOrderBtn');
|
|
2423
2556
|
}
|
|
2424
2557
|
};
|
|
2425
2558
|
ToolbarModule.prototype.createStartBtn = function () {
|
|
@@ -2539,6 +2672,17 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2539
2672
|
tooltipText: this.l10n.getConstant('FontColor'), align: 'Center',
|
|
2540
2673
|
type: 'Input', template: '<button id="' + id + '_fontColorBtn"></button>' });
|
|
2541
2674
|
}
|
|
2675
|
+
if (items.indexOf('strokeColor') > -1) {
|
|
2676
|
+
toolbarItems.push({ cssClass: 'top-icon e-stroke-text-font-color', id: id + '_stroke_text_color',
|
|
2677
|
+
tooltipText: this.l10n.getConstant('TextOutlineColor'), align: 'Center',
|
|
2678
|
+
type: 'Input', template: '<button id="' + id + '_strokeTextColorBtn"></button>' });
|
|
2679
|
+
}
|
|
2680
|
+
if (items.indexOf('fillColor') > -1) {
|
|
2681
|
+
toolbarItems.push({ cssClass: 'top-icon e-text-background-color', id: id + '_text_backgroundcolor',
|
|
2682
|
+
tooltipText: this.l10n.getConstant('FillColor'), align: 'Center',
|
|
2683
|
+
type: 'Input', template: '<button id="' + id + '_bgColorBtn"></button>'
|
|
2684
|
+
});
|
|
2685
|
+
}
|
|
2542
2686
|
if (items.indexOf('bold') > -1) {
|
|
2543
2687
|
toolbarItems.push({ id: id + '_bold', prefixIcon: 'e-icons e-bold', cssClass: 'top-icon e-bold',
|
|
2544
2688
|
tooltipText: this.l10n.getConstant('Bold'), align: 'Center' });
|
|
@@ -2547,6 +2691,10 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2547
2691
|
toolbarItems.push({ id: id + '_italic', prefixIcon: 'e-icons e-italic', cssClass: 'top-icon e-italic',
|
|
2548
2692
|
tooltipText: this.l10n.getConstant('Italic'), align: 'Center' });
|
|
2549
2693
|
}
|
|
2694
|
+
if (items.indexOf('strokeWidth') > -1) {
|
|
2695
|
+
toolbarItems.push({ id: id + '_strokeWidth', cssClass: 'top-icon e-size', tooltipText: this.l10n.getConstant('TextOutlineWidth'), align: 'Center',
|
|
2696
|
+
type: 'Input', template: '<button id="' + id + '_borderWidthBtn"></button>' });
|
|
2697
|
+
}
|
|
2550
2698
|
if (items.indexOf('transparency') > -1) {
|
|
2551
2699
|
toolbarItems.push({ id: id + '_transparency', prefixIcon: 'e-opacity',
|
|
2552
2700
|
tooltipText: this.l10n.getConstant('Opacity'), align: 'Center' });
|
|
@@ -2628,6 +2776,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2628
2776
|
created: function () {
|
|
2629
2777
|
_this.renderAnnotationBtn(true);
|
|
2630
2778
|
_this.createTextColor(items);
|
|
2779
|
+
_this.createStrokeTextColor(items);
|
|
2780
|
+
_this.createShapeBtn(items);
|
|
2781
|
+
_this.createBackgroundColor(items);
|
|
2631
2782
|
_this.createTextBtn(items);
|
|
2632
2783
|
_this.createZOrderBtn(items);
|
|
2633
2784
|
_this.wireZoomBtnEvents();
|
|
@@ -2675,7 +2826,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2675
2826
|
},
|
|
2676
2827
|
presetColors: this.presetColors,
|
|
2677
2828
|
change: function (args) {
|
|
2678
|
-
parent.updateFontColor(args.value);
|
|
2829
|
+
parent.updateFontColor(args.value, 'Text');
|
|
2679
2830
|
strokeDDB_2.element.children[0].style.backgroundColor = args.currentValue.rgba;
|
|
2680
2831
|
strokeDDB_2.toggle();
|
|
2681
2832
|
if (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) {
|
|
@@ -2698,7 +2849,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2698
2849
|
if (Browser.isDevice) {
|
|
2699
2850
|
parenElem.style.top = strokeDDB_2.element.getBoundingClientRect().top -
|
|
2700
2851
|
parenElem.offsetHeight + 'px';
|
|
2701
|
-
|
|
2852
|
+
if (window.innerWidth <= 520) {
|
|
2853
|
+
parenElem.style.left = parent.element.offsetLeft + 'px';
|
|
2854
|
+
}
|
|
2702
2855
|
}
|
|
2703
2856
|
},
|
|
2704
2857
|
target: '.e-text-fontt-color',
|
|
@@ -2711,23 +2864,179 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2711
2864
|
= '#fff';
|
|
2712
2865
|
}
|
|
2713
2866
|
};
|
|
2867
|
+
ToolbarModule.prototype.createBackgroundColor = function (items) {
|
|
2868
|
+
var _this = this;
|
|
2869
|
+
var parent = this.parent;
|
|
2870
|
+
var id = parent.element.id;
|
|
2871
|
+
if (items.indexOf('fillColor') > -1 && parent.element.querySelector('.e-template.e-text-background-color')) {
|
|
2872
|
+
parent.element.querySelector('.e-template.e-text-background-color').appendChild(parent.createElement('input', {
|
|
2873
|
+
id: id + '_text_bgColor'
|
|
2874
|
+
}));
|
|
2875
|
+
var backgroundColor_1 = new ColorPicker({
|
|
2876
|
+
modeSwitcher: true, noColor: true, value: '', inline: true,
|
|
2877
|
+
showButtons: false, mode: 'Palette', cssClass: 'e-text-fontt-color',
|
|
2878
|
+
beforeModeSwitch: function (args) {
|
|
2879
|
+
_this.popupLeft = args.element.offsetParent.style.left;
|
|
2880
|
+
_this.beforeModeSwitch(args, backgroundColor_1);
|
|
2881
|
+
},
|
|
2882
|
+
presetColors: {
|
|
2883
|
+
'custom': ['', '#f44336', '#e91e63', '#9c27b0', '#673ab7', '#2196f3',
|
|
2884
|
+
'#03a9f4', '#00bcd4', '#009688', '#ffeb3b', '#ffffff', '#ffebee', '#fce4ec', '#f3e5f5', '#ede7f6', '#e3f2fd',
|
|
2885
|
+
'#e1f5fe', '#e0f7fa', '#e0f2f1', '#fffde7', '#f2f2f2', '#ffcdd2', '#f8bbd0', '#e1bee7', '#d1c4e9', '#bbdefb',
|
|
2886
|
+
'#b3e5fc', '#b2ebf2', '#b2dfdb', '#fff9c4', '#e6e6e6', '#ef9a9a', '#f48fb1', '#ce93d8', '#b39ddb', '#90caf9',
|
|
2887
|
+
'#81d4fa', '#80deea', '#80cbc4', '#fff59d', '#cccccc', '#e57373', '#f06292', '#ba68c8', '#9575cd', '#64b5f6',
|
|
2888
|
+
'#4fc3f7', '#4dd0e1', '#4db6ac', '#fff176', '#b3b3b3', '#ef5350', '#ec407a', '#ab47bc', '#7e57c2', '#42a5f5',
|
|
2889
|
+
'#29b6f6', '#26c6da', '#26a69a', '#ffee58', '#999999', '#e53935', '#d81b60', '#8e24aa', '#5e35b1', '#1e88e5',
|
|
2890
|
+
'#039be5', '#00acc1', '#00897b', '#fdd835', '#808080', '#d32f2f', '#c2185b', '#7b1fa2', '#512da8', '#1976d2',
|
|
2891
|
+
'#0288d1', '#0097a7', '#00796b', '#fbc02d', '#666666', '#c62828', '#ad1457', '#6a1b9a', '#4527a0', '#1565c0',
|
|
2892
|
+
'#0277bd', '#00838f', '#00695c', '#f9a825', '#4d4d4d', '#b71c1c', '#880e4f', '#4a148c', '#311b92', '#0d47a1',
|
|
2893
|
+
'#01579b', '#006064', '#004d40', '#f57f17']
|
|
2894
|
+
},
|
|
2895
|
+
beforeTileRender: function (args) {
|
|
2896
|
+
if (args.value === '') {
|
|
2897
|
+
args.element.classList.add('e-nocolor-item');
|
|
2898
|
+
}
|
|
2899
|
+
},
|
|
2900
|
+
change: function (args) {
|
|
2901
|
+
parent.updateFontColor(args.value, 'Background');
|
|
2902
|
+
if (args.currentValue.rgba === '') {
|
|
2903
|
+
strokeDDB_3.element.children[0].classList.add('e-nocolor-item');
|
|
2904
|
+
}
|
|
2905
|
+
else {
|
|
2906
|
+
strokeDDB_3.element.children[0].classList.remove('e-nocolor-item');
|
|
2907
|
+
strokeDDB_3.element.children[0].style.backgroundColor = args.currentValue.rgba;
|
|
2908
|
+
}
|
|
2909
|
+
strokeDDB_3.toggle();
|
|
2910
|
+
if (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) {
|
|
2911
|
+
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
|
|
2912
|
+
}
|
|
2913
|
+
},
|
|
2914
|
+
onModeSwitch: function (args) {
|
|
2915
|
+
if (Browser.isDevice) {
|
|
2916
|
+
args.element.parentElement.parentElement.style.left = _this.popupLeft;
|
|
2917
|
+
args.element.parentElement.parentElement.style.top = (strokeDDB_3.element.getBoundingClientRect().top - args.element.parentElement.parentElement.offsetHeight) + 'px';
|
|
2918
|
+
}
|
|
2919
|
+
},
|
|
2920
|
+
beforeClose: function () {
|
|
2921
|
+
strokeDDB_3.toggle();
|
|
2922
|
+
}
|
|
2923
|
+
}, '#' + id + '_text_bgColor');
|
|
2924
|
+
var strokeDDB_3 = new DropDownButton({
|
|
2925
|
+
open: function (args) {
|
|
2926
|
+
var parenElem = args.element.parentElement;
|
|
2927
|
+
if (Browser.isDevice) {
|
|
2928
|
+
parenElem.style.top = strokeDDB_3.element.getBoundingClientRect().top -
|
|
2929
|
+
parenElem.offsetHeight + 'px';
|
|
2930
|
+
if (window.innerWidth <= 520) {
|
|
2931
|
+
parenElem.style.left = parent.element.offsetLeft + 'px';
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
},
|
|
2935
|
+
target: '.e-text-fontt-color',
|
|
2936
|
+
iconCss: 'e-dropdownbtn-preview',
|
|
2937
|
+
cssClass: 'e-ie-ddb-popup'
|
|
2938
|
+
}, '#' + id + '_bgColorBtn');
|
|
2939
|
+
backgroundColor_1.inline = true;
|
|
2940
|
+
backgroundColor_1.value = backgroundColor_1.getValue(backgroundColor_1.value, 'rgba');
|
|
2941
|
+
parent.element.querySelector('.e-text-background-color.e-template .e-dropdownbtn-preview').style.background
|
|
2942
|
+
= '#fff';
|
|
2943
|
+
}
|
|
2944
|
+
};
|
|
2945
|
+
ToolbarModule.prototype.createStrokeTextColor = function (items) {
|
|
2946
|
+
var _this = this;
|
|
2947
|
+
var parent = this.parent;
|
|
2948
|
+
var id = parent.element.id;
|
|
2949
|
+
if (items.indexOf('strokeColor') > -1 && parent.element.querySelector('.e-template.e-stroke-text-font-color')) {
|
|
2950
|
+
parent.element.querySelector('.e-template.e-stroke-text-font-color').appendChild(parent.createElement('input', {
|
|
2951
|
+
id: id + '_stroke_text'
|
|
2952
|
+
}));
|
|
2953
|
+
var fontColor_2 = new ColorPicker({
|
|
2954
|
+
modeSwitcher: true, noColor: true, value: '', inline: true,
|
|
2955
|
+
showButtons: false, mode: 'Palette', cssClass: 'e-text-fontt-color',
|
|
2956
|
+
beforeModeSwitch: function (args) {
|
|
2957
|
+
_this.popupLeft = args.element.offsetParent.style.left;
|
|
2958
|
+
_this.beforeModeSwitch(args, fontColor_2);
|
|
2959
|
+
},
|
|
2960
|
+
presetColors: {
|
|
2961
|
+
'custom': ['', '#f44336', '#e91e63', '#9c27b0', '#673ab7', '#2196f3',
|
|
2962
|
+
'#03a9f4', '#00bcd4', '#009688', '#ffeb3b', '#ffffff', '#ffebee', '#fce4ec', '#f3e5f5', '#ede7f6', '#e3f2fd',
|
|
2963
|
+
'#e1f5fe', '#e0f7fa', '#e0f2f1', '#fffde7', '#f2f2f2', '#ffcdd2', '#f8bbd0', '#e1bee7', '#d1c4e9', '#bbdefb',
|
|
2964
|
+
'#b3e5fc', '#b2ebf2', '#b2dfdb', '#fff9c4', '#e6e6e6', '#ef9a9a', '#f48fb1', '#ce93d8', '#b39ddb', '#90caf9',
|
|
2965
|
+
'#81d4fa', '#80deea', '#80cbc4', '#fff59d', '#cccccc', '#e57373', '#f06292', '#ba68c8', '#9575cd', '#64b5f6',
|
|
2966
|
+
'#4fc3f7', '#4dd0e1', '#4db6ac', '#fff176', '#b3b3b3', '#ef5350', '#ec407a', '#ab47bc', '#7e57c2', '#42a5f5',
|
|
2967
|
+
'#29b6f6', '#26c6da', '#26a69a', '#ffee58', '#999999', '#e53935', '#d81b60', '#8e24aa', '#5e35b1', '#1e88e5',
|
|
2968
|
+
'#039be5', '#00acc1', '#00897b', '#fdd835', '#808080', '#d32f2f', '#c2185b', '#7b1fa2', '#512da8', '#1976d2',
|
|
2969
|
+
'#0288d1', '#0097a7', '#00796b', '#fbc02d', '#666666', '#c62828', '#ad1457', '#6a1b9a', '#4527a0', '#1565c0',
|
|
2970
|
+
'#0277bd', '#00838f', '#00695c', '#f9a825', '#4d4d4d', '#b71c1c', '#880e4f', '#4a148c', '#311b92', '#0d47a1',
|
|
2971
|
+
'#01579b', '#006064', '#004d40', '#f57f17']
|
|
2972
|
+
},
|
|
2973
|
+
beforeTileRender: function (args) {
|
|
2974
|
+
if (args.value === '') {
|
|
2975
|
+
args.element.classList.add('e-nocolor-item');
|
|
2976
|
+
}
|
|
2977
|
+
},
|
|
2978
|
+
change: function (args) {
|
|
2979
|
+
parent.updateStrokeTextColor(args.value);
|
|
2980
|
+
if (args.currentValue.rgba === '') {
|
|
2981
|
+
strokeDDB_4.element.children[0].classList.add('e-nocolor-item');
|
|
2982
|
+
}
|
|
2983
|
+
else {
|
|
2984
|
+
strokeDDB_4.element.children[0].classList.remove('e-nocolor-item');
|
|
2985
|
+
strokeDDB_4.element.children[0].style.backgroundColor = args.currentValue.rgba;
|
|
2986
|
+
}
|
|
2987
|
+
strokeDDB_4.toggle();
|
|
2988
|
+
if (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) {
|
|
2989
|
+
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
|
|
2990
|
+
}
|
|
2991
|
+
},
|
|
2992
|
+
onModeSwitch: function (args) {
|
|
2993
|
+
if (Browser.isDevice) {
|
|
2994
|
+
args.element.parentElement.parentElement.style.left = _this.popupLeft;
|
|
2995
|
+
args.element.parentElement.parentElement.style.top = (strokeDDB_4.element.getBoundingClientRect().top - args.element.parentElement.parentElement.offsetHeight) + 'px';
|
|
2996
|
+
}
|
|
2997
|
+
},
|
|
2998
|
+
beforeClose: function () {
|
|
2999
|
+
strokeDDB_4.toggle();
|
|
3000
|
+
}
|
|
3001
|
+
}, '#' + id + '_stroke_text');
|
|
3002
|
+
var strokeDDB_4 = new DropDownButton({
|
|
3003
|
+
open: function (args) {
|
|
3004
|
+
var parenElem = args.element.parentElement;
|
|
3005
|
+
if (Browser.isDevice) {
|
|
3006
|
+
parenElem.style.top = strokeDDB_4.element.getBoundingClientRect().top -
|
|
3007
|
+
parenElem.offsetHeight + 'px';
|
|
3008
|
+
if (window.innerWidth <= 520) {
|
|
3009
|
+
parenElem.style.left = parent.element.offsetLeft + 'px';
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3012
|
+
},
|
|
3013
|
+
target: '.e-text-fontt-color',
|
|
3014
|
+
iconCss: 'e-dropdownbtn-preview',
|
|
3015
|
+
cssClass: 'e-ie-ddb-popup'
|
|
3016
|
+
}, '#' + id + '_strokeTextColorBtn');
|
|
3017
|
+
fontColor_2.inline = true;
|
|
3018
|
+
fontColor_2.value = fontColor_2.getValue(fontColor_2.value, 'rgba');
|
|
3019
|
+
parent.element.querySelector('.e-stroke-text-font-color.e-template .e-dropdownbtn-preview').style.background
|
|
3020
|
+
= '#fff';
|
|
3021
|
+
}
|
|
3022
|
+
};
|
|
2714
3023
|
ToolbarModule.prototype.createTextBtn = function (items) {
|
|
2715
3024
|
var _this = this;
|
|
2716
3025
|
var parent = this.parent;
|
|
2717
3026
|
var id = parent.element.id;
|
|
2718
3027
|
if (items.indexOf('fontFamily') > -1) {
|
|
2719
3028
|
var fontNameBtn = document.getElementById(id + '_fontFamilyBtn');
|
|
2720
|
-
var
|
|
3029
|
+
var spanElem_4 = document.createElement('span');
|
|
2721
3030
|
if (Browser.isDevice) {
|
|
2722
|
-
|
|
2723
|
-
|
|
3031
|
+
spanElem_4.innerHTML = 'ABC';
|
|
3032
|
+
spanElem_4.setAttribute('style', 'font-family: ' + parent.fontFamily.default.toLowerCase() + '\'');
|
|
2724
3033
|
}
|
|
2725
3034
|
else {
|
|
2726
|
-
|
|
3035
|
+
spanElem_4.innerHTML = parent.fontFamily.default;
|
|
2727
3036
|
}
|
|
2728
|
-
|
|
3037
|
+
spanElem_4.className = 'e-text-font-family';
|
|
2729
3038
|
if (fontNameBtn) {
|
|
2730
|
-
fontNameBtn.appendChild(
|
|
3039
|
+
fontNameBtn.appendChild(spanElem_4);
|
|
2731
3040
|
}
|
|
2732
3041
|
var fontFamilyBtn_1 = new DropDownButton({ items: this.getFontFamilyItems(),
|
|
2733
3042
|
cssClass: 'e-font-family',
|
|
@@ -2754,12 +3063,16 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2754
3063
|
},
|
|
2755
3064
|
select: function (args) {
|
|
2756
3065
|
_this.triggerTbarClickEvent(args);
|
|
2757
|
-
|
|
3066
|
+
spanElem_4.textContent = args.item.text;
|
|
2758
3067
|
if (Browser.isDevice) {
|
|
2759
|
-
|
|
3068
|
+
spanElem_4.setAttribute('style', 'font-family:' + args.item.id);
|
|
2760
3069
|
}
|
|
2761
3070
|
parent.updateFontFamily(args.item.id);
|
|
2762
3071
|
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
|
|
3072
|
+
var toolbar = document.getElementById(parent.element.id + '_toolbar');
|
|
3073
|
+
if (toolbar && toolbar.classList.contains('e-control')) {
|
|
3074
|
+
getComponent(toolbar, 'toolbar').refreshOverflow();
|
|
3075
|
+
}
|
|
2763
3076
|
}
|
|
2764
3077
|
});
|
|
2765
3078
|
fontFamilyBtn_1.appendTo('#' + id + '_fontFamilyBtn');
|
|
@@ -2814,9 +3127,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2814
3127
|
toolbarElement.innerHTML = '';
|
|
2815
3128
|
}
|
|
2816
3129
|
if (toolbarElement && (this.defToolbarItems.length > 0 || parent.toolbar && parent.toolbar.length > 0 && parent.toolbar.indexOf('Open') === -1)) {
|
|
2817
|
-
var
|
|
2818
|
-
if (!isNullOrUndefined(
|
|
2819
|
-
|
|
3130
|
+
var toolbar_13 = getComponent(toolbarElement, 'toolbar');
|
|
3131
|
+
if (!isNullOrUndefined(toolbar_13)) {
|
|
3132
|
+
toolbar_13.destroy();
|
|
2820
3133
|
document.getElementById(parent.element.id + '_toolbar').innerHTML = '';
|
|
2821
3134
|
}
|
|
2822
3135
|
}
|
|
@@ -2868,6 +3181,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2868
3181
|
else if (parent.activeObj.shape === 'image') {
|
|
2869
3182
|
args.toolbarItems = ['flip', 'z-order', 'duplicate', 'remove', 'transparency'];
|
|
2870
3183
|
}
|
|
3184
|
+
else if (parent.activeObj.shape === 'rectangle') {
|
|
3185
|
+
args.toolbarItems = ['fillColor', 'strokeColor', 'strokeWidth', 'borderRadius', 'z-order', 'duplicate', 'remove'];
|
|
3186
|
+
}
|
|
2871
3187
|
else {
|
|
2872
3188
|
args.toolbarItems = ['fillColor', 'strokeColor', 'strokeWidth', 'z-order', 'duplicate', 'remove'];
|
|
2873
3189
|
}
|
|
@@ -2886,7 +3202,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2886
3202
|
if (Browser.isDevice) {
|
|
2887
3203
|
this.initMainToolbar(false, true, true);
|
|
2888
3204
|
}
|
|
2889
|
-
args.toolbarItems = ['fontFamily', 'fontSize', 'fontColor', 'bold', 'italic', 'z-order', 'duplicate', 'remove', 'text'];
|
|
3205
|
+
args.toolbarItems = ['fontFamily', 'fontSize', 'fontColor', 'fillColor', 'strokeColor', 'strokeWidth', 'bold', 'italic', 'z-order', 'duplicate', 'remove', 'text'];
|
|
2890
3206
|
this.initTextToolbarItem(args.toolbarItems);
|
|
2891
3207
|
break;
|
|
2892
3208
|
case 'pen':
|
|
@@ -2943,6 +3259,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2943
3259
|
if (Browser.isDevice && this.isToolbar()) {
|
|
2944
3260
|
this.updateContextualToolbar('color', 'straighten', true);
|
|
2945
3261
|
}
|
|
3262
|
+
if (parent.isMaskImage) {
|
|
3263
|
+
this.refreshToolbar('main');
|
|
3264
|
+
}
|
|
2946
3265
|
break;
|
|
2947
3266
|
case 'frame':
|
|
2948
3267
|
this.isFrameToolbar = true;
|
|
@@ -2963,11 +3282,59 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2963
3282
|
}
|
|
2964
3283
|
parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: true } });
|
|
2965
3284
|
break;
|
|
3285
|
+
case 'redact':
|
|
3286
|
+
if (Browser.isDevice) {
|
|
3287
|
+
this.initMainToolbar(false, true, true);
|
|
3288
|
+
this.initMainToolbar(false, true, true, null, null, null, true);
|
|
3289
|
+
}
|
|
3290
|
+
else {
|
|
3291
|
+
this.initMainToolbar(isApplyBtn, Browser.isDevice, null, null, null, null, true);
|
|
3292
|
+
}
|
|
3293
|
+
this.enableDisableTbrBtn();
|
|
3294
|
+
if (parent.activeObj.redactType === 'blur') {
|
|
3295
|
+
var redactBlurElement = parent.element.querySelector('#' + id + '_' + 'redactBlur');
|
|
3296
|
+
if (redactBlurElement) {
|
|
3297
|
+
redactBlurElement.classList.add('e-selected-btn');
|
|
3298
|
+
}
|
|
3299
|
+
}
|
|
3300
|
+
else {
|
|
3301
|
+
var pixelateElement = parent.element.querySelector('#' + id + '_' + 'pixelate');
|
|
3302
|
+
if (pixelateElement) {
|
|
3303
|
+
pixelateElement.classList.add('e-selected-btn');
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
3306
|
+
this.redactSlider(parent.activeObj.redactType);
|
|
3307
|
+
break;
|
|
2966
3308
|
}
|
|
2967
3309
|
this.refreshDropDownBtn(isCropping);
|
|
2968
3310
|
this.updateKBDNavigation(type);
|
|
2969
3311
|
this.currToolbar = type;
|
|
2970
3312
|
};
|
|
3313
|
+
ToolbarModule.prototype.updateRedactObj = function () {
|
|
3314
|
+
var parent = this.parent;
|
|
3315
|
+
var objColl = extend([], parent.objColl, [], true);
|
|
3316
|
+
parent.objColl = [];
|
|
3317
|
+
var activeObj = extend({}, parent.activeObj, {}, true);
|
|
3318
|
+
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
3319
|
+
parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: true } });
|
|
3320
|
+
parent.objColl = objColl;
|
|
3321
|
+
for (var i = 0; i < parent.objColl.length; i++) {
|
|
3322
|
+
var obj = parent.objColl[i];
|
|
3323
|
+
if (obj.shape === 'redact') {
|
|
3324
|
+
obj.redactImage = parent.createElement('canvas');
|
|
3325
|
+
obj.redactImage.width = obj.activePoint.width;
|
|
3326
|
+
obj.redactImage.height = obj.activePoint.height;
|
|
3327
|
+
obj.redactImage.getContext('2d').drawImage(parent.lowerCanvas, obj.activePoint.startX, obj.activePoint.startY, obj.activePoint.width, obj.activePoint.height, 0, 0, obj.redactImage.width, obj.redactImage.height);
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
parent.isCropTab = false;
|
|
3331
|
+
parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: true } });
|
|
3332
|
+
parent.isCropTab = true;
|
|
3333
|
+
if (activeObj) {
|
|
3334
|
+
parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: activeObj,
|
|
3335
|
+
isCropRatio: null, points: null, isPreventDrag: true } });
|
|
3336
|
+
}
|
|
3337
|
+
};
|
|
2971
3338
|
ToolbarModule.prototype.updateKBDNavigation = function (type) {
|
|
2972
3339
|
var parent = this.parent;
|
|
2973
3340
|
var id = parent.element.id;
|
|
@@ -2994,6 +3361,12 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2994
3361
|
if (type === 'resize' && tempElem) {
|
|
2995
3362
|
tbarInitialBtn_1 = tempElem;
|
|
2996
3363
|
}
|
|
3364
|
+
if (type === 'filter') {
|
|
3365
|
+
var defaultFilter_1 = document.querySelector('#' + id + '_defaultCanvas');
|
|
3366
|
+
if (defaultFilter_1) {
|
|
3367
|
+
setTimeout(function () { return defaultFilter_1.focus(); }, 50);
|
|
3368
|
+
}
|
|
3369
|
+
}
|
|
2997
3370
|
if (tbarInitialBtn_1) {
|
|
2998
3371
|
if (type === 'main') {
|
|
2999
3372
|
setTimeout(function () { return tbarInitialBtn_1.focus(); }, 50);
|
|
@@ -3010,7 +3383,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3010
3383
|
if (isNullOrUndefined(isTransform)) {
|
|
3011
3384
|
parent.notify('draw', { prop: 'setTempStraightenZoomDeg' });
|
|
3012
3385
|
parent.tempStraighten = parent.transform.straighten;
|
|
3013
|
-
if (parent.currObjType.isFiltered) {
|
|
3386
|
+
if (parent.currObjType.isFiltered || parent.currObjType.isRedact) {
|
|
3014
3387
|
parent.okBtn();
|
|
3015
3388
|
}
|
|
3016
3389
|
parent.isStraightening = true;
|
|
@@ -3274,18 +3647,20 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3274
3647
|
change: function (args) {
|
|
3275
3648
|
parent.updatePenStrokeColor(args.currentValue.hex);
|
|
3276
3649
|
_this.selFhdColor = args.currentValue.hex;
|
|
3277
|
-
|
|
3278
|
-
|
|
3650
|
+
strokeDDB_5.element.children[0].style.backgroundColor = args.currentValue.rgba;
|
|
3651
|
+
strokeDDB_5.toggle();
|
|
3279
3652
|
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', value: { isPenDraw: true } });
|
|
3280
3653
|
}
|
|
3281
3654
|
}, '#' + id + '_pen_stroke');
|
|
3282
|
-
var
|
|
3655
|
+
var strokeDDB_5 = new DropDownButton({
|
|
3283
3656
|
open: function (args) {
|
|
3284
3657
|
var parentElem = args.element.parentElement;
|
|
3285
3658
|
if (Browser.isDevice) {
|
|
3286
|
-
parentElem.style.top =
|
|
3659
|
+
parentElem.style.top = strokeDDB_5.element.getBoundingClientRect().top -
|
|
3287
3660
|
parentElem.offsetHeight + 'px';
|
|
3288
|
-
|
|
3661
|
+
if (window.innerWidth <= 520) {
|
|
3662
|
+
parentElem.style.left = parent.element.offsetLeft + 'px';
|
|
3663
|
+
}
|
|
3289
3664
|
}
|
|
3290
3665
|
},
|
|
3291
3666
|
target: '.e-pen-color',
|
|
@@ -3325,56 +3700,59 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3325
3700
|
];
|
|
3326
3701
|
if (items.indexOf('strokeWidth') > -1) {
|
|
3327
3702
|
var strokeWidthBtn = document.getElementById(id + '_penStrokeWidth');
|
|
3328
|
-
var
|
|
3703
|
+
var spanElem_5 = document.createElement('span');
|
|
3329
3704
|
var indexObj = { freehandSelectedIndex: null };
|
|
3330
3705
|
parent.notify('freehand-draw', { prop: 'getFreehandSelectedIndex', onPropertyChange: false, value: { obj: indexObj } });
|
|
3331
3706
|
if (!isNullOrUndefined(indexObj['freehandSelectedIndex']) && indexObj['freehandSelectedIndex'] > -1) {
|
|
3332
|
-
|
|
3707
|
+
spanElem_5.innerHTML = this.getPenStroke(parent.pointColl[indexObj['freehandSelectedIndex']].strokeWidth);
|
|
3333
3708
|
}
|
|
3334
3709
|
else {
|
|
3335
3710
|
var obj = { penStrokeWidth: 2 };
|
|
3336
3711
|
parent.notify('freehand-draw', { prop: 'getPenStrokeWidth', onPropertyChange: false, value: { obj: obj } });
|
|
3337
3712
|
if (obj['penStrokeWidth']) {
|
|
3338
|
-
|
|
3713
|
+
spanElem_5.innerHTML = this.getPenStroke(obj['penStrokeWidth']);
|
|
3339
3714
|
}
|
|
3340
3715
|
else {
|
|
3341
|
-
|
|
3716
|
+
spanElem_5.innerHTML = this.l10n.getConstant('Small');
|
|
3342
3717
|
}
|
|
3343
3718
|
}
|
|
3344
|
-
|
|
3345
|
-
strokeWidthBtn.appendChild(
|
|
3346
|
-
var
|
|
3719
|
+
spanElem_5.className = 'e-pen-stroke-width';
|
|
3720
|
+
strokeWidthBtn.appendChild(spanElem_5);
|
|
3721
|
+
var drpDownBtn_5 = new DropDownButton({ items: strokeWidthItems,
|
|
3347
3722
|
open: function (args) {
|
|
3348
3723
|
if (Browser.isDevice) {
|
|
3349
|
-
args.element.parentElement.style.top =
|
|
3724
|
+
args.element.parentElement.style.top = drpDownBtn_5.element.getBoundingClientRect().top -
|
|
3350
3725
|
args.element.parentElement.offsetHeight + 'px';
|
|
3351
3726
|
}
|
|
3352
|
-
var activeBtn =
|
|
3727
|
+
var activeBtn = spanElem_5.innerHTML;
|
|
3353
3728
|
args.element.querySelector('[aria-label = ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
|
|
3354
3729
|
},
|
|
3355
3730
|
select: function (args) {
|
|
3356
3731
|
_this.triggerTbarClickEvent(args);
|
|
3357
|
-
|
|
3732
|
+
spanElem_5.textContent = args.item.text;
|
|
3358
3733
|
parent.updatePenStrokeWidth(args.item.id);
|
|
3359
3734
|
if (Browser.isDevice) {
|
|
3360
3735
|
if (document.getElementById(id + '_bottomToolbar')) {
|
|
3361
3736
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
3362
|
-
var
|
|
3363
|
-
|
|
3737
|
+
var toolbar_14 = getComponent(id + '_bottomToolbar', 'toolbar');
|
|
3738
|
+
toolbar_14.refreshOverflow();
|
|
3364
3739
|
}
|
|
3365
3740
|
}
|
|
3366
3741
|
else {
|
|
3367
3742
|
if (document.getElementById(id + '_toolbar')) {
|
|
3368
3743
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
3369
|
-
var
|
|
3370
|
-
|
|
3744
|
+
var toolbar_15 = getComponent(id + '_toolbar', 'toolbar');
|
|
3745
|
+
toolbar_15.refreshOverflow();
|
|
3371
3746
|
}
|
|
3372
3747
|
}
|
|
3748
|
+
var widthObj = { penStrokeWidth: null };
|
|
3749
|
+
parent.notify('freehand-draw', { prop: 'getPenStrokeWidth', onPropertyChange: false, value: { obj: widthObj } });
|
|
3373
3750
|
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', value: { isPenDraw: true } });
|
|
3751
|
+
parent.notify('freehand-draw', { prop: 'setPenStrokeWidth', onPropertyChange: false, value: { value: widthObj['penStrokeWidth'] } });
|
|
3374
3752
|
}
|
|
3375
3753
|
});
|
|
3376
3754
|
// Render initialized DropDownButton.
|
|
3377
|
-
|
|
3755
|
+
drpDownBtn_5.appendTo('#' + id + '_penStrokeWidth');
|
|
3378
3756
|
}
|
|
3379
3757
|
};
|
|
3380
3758
|
ToolbarModule.prototype.getPenStroke = function (value) {
|
|
@@ -3554,7 +3932,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3554
3932
|
var parentElem = args.element.parentElement;
|
|
3555
3933
|
parentElem.style.top = fillDDB.element.getBoundingClientRect().top -
|
|
3556
3934
|
parentElem.offsetHeight + 'px';
|
|
3557
|
-
|
|
3935
|
+
if (window.innerWidth <= 520) {
|
|
3936
|
+
parentElem.style.left = parent.element.offsetLeft + 'px';
|
|
3937
|
+
}
|
|
3558
3938
|
}
|
|
3559
3939
|
},
|
|
3560
3940
|
target: '.e-frame-gradient-fill-color',
|
|
@@ -3623,7 +4003,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3623
4003
|
var parentElem = args.element.parentElement;
|
|
3624
4004
|
parentElem.style.top = fillDDB.element.getBoundingClientRect().top -
|
|
3625
4005
|
parentElem.offsetHeight + 'px';
|
|
3626
|
-
|
|
4006
|
+
if (window.innerWidth <= 520) {
|
|
4007
|
+
parentElem.style.left = parent.element.offsetLeft + 'px';
|
|
4008
|
+
}
|
|
3627
4009
|
}
|
|
3628
4010
|
},
|
|
3629
4011
|
target: '.e-frame-fill-color',
|
|
@@ -3695,15 +4077,15 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3695
4077
|
if (Browser.isDevice) {
|
|
3696
4078
|
if (document.getElementById(id + '_bottomToolbar')) {
|
|
3697
4079
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
3698
|
-
var
|
|
3699
|
-
|
|
4080
|
+
var toolbar_16 = getComponent(id + '_bottomToolbar', 'toolbar');
|
|
4081
|
+
toolbar_16.refreshOverflow();
|
|
3700
4082
|
}
|
|
3701
4083
|
}
|
|
3702
4084
|
else {
|
|
3703
4085
|
if (document.getElementById(id + '_toolbar')) {
|
|
3704
4086
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
3705
|
-
var
|
|
3706
|
-
|
|
4087
|
+
var toolbar_17 = getComponent(id + '_toolbar', 'toolbar');
|
|
4088
|
+
toolbar_17.refreshOverflow();
|
|
3707
4089
|
}
|
|
3708
4090
|
}
|
|
3709
4091
|
}
|
|
@@ -3773,15 +4155,15 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3773
4155
|
if (Browser.isDevice) {
|
|
3774
4156
|
if (document.getElementById(id + '_bottomToolbar')) {
|
|
3775
4157
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
3776
|
-
var
|
|
3777
|
-
|
|
4158
|
+
var toolbar_18 = getComponent(id + '_bottomToolbar', 'toolbar');
|
|
4159
|
+
toolbar_18.refreshOverflow();
|
|
3778
4160
|
}
|
|
3779
4161
|
}
|
|
3780
4162
|
else {
|
|
3781
4163
|
if (document.getElementById(id + '_toolbar')) {
|
|
3782
4164
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
3783
|
-
var
|
|
3784
|
-
|
|
4165
|
+
var toolbar_19 = getComponent(id + '_toolbar', 'toolbar');
|
|
4166
|
+
toolbar_19.refreshOverflow();
|
|
3785
4167
|
}
|
|
3786
4168
|
}
|
|
3787
4169
|
}
|
|
@@ -3851,15 +4233,15 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3851
4233
|
if (Browser.isDevice) {
|
|
3852
4234
|
if (document.getElementById(id + '_bottomToolbar')) {
|
|
3853
4235
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
3854
|
-
var
|
|
3855
|
-
|
|
4236
|
+
var toolbar_20 = getComponent(id + '_bottomToolbar', 'toolbar');
|
|
4237
|
+
toolbar_20.refreshOverflow();
|
|
3856
4238
|
}
|
|
3857
4239
|
}
|
|
3858
4240
|
else {
|
|
3859
4241
|
if (document.getElementById(id + '_toolbar')) {
|
|
3860
4242
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
3861
|
-
var
|
|
3862
|
-
|
|
4243
|
+
var toolbar_21 = getComponent(id + '_toolbar', 'toolbar');
|
|
4244
|
+
toolbar_21.refreshOverflow();
|
|
3863
4245
|
}
|
|
3864
4246
|
}
|
|
3865
4247
|
}
|
|
@@ -3931,15 +4313,15 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3931
4313
|
if (Browser.isDevice) {
|
|
3932
4314
|
if (document.getElementById(id + '_bottomToolbar')) {
|
|
3933
4315
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
3934
|
-
var
|
|
3935
|
-
|
|
4316
|
+
var toolbar_22 = getComponent(id + '_bottomToolbar', 'toolbar');
|
|
4317
|
+
toolbar_22.refreshOverflow();
|
|
3936
4318
|
}
|
|
3937
4319
|
}
|
|
3938
4320
|
else {
|
|
3939
4321
|
if (document.getElementById(id + '_toolbar')) {
|
|
3940
4322
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
3941
|
-
var
|
|
3942
|
-
|
|
4323
|
+
var toolbar_23 = getComponent(id + '_toolbar', 'toolbar');
|
|
4324
|
+
toolbar_23.refreshOverflow();
|
|
3943
4325
|
}
|
|
3944
4326
|
}
|
|
3945
4327
|
}
|
|
@@ -4008,15 +4390,15 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4008
4390
|
if (Browser.isDevice) {
|
|
4009
4391
|
if (document.getElementById(id + '_bottomToolbar')) {
|
|
4010
4392
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4011
|
-
var
|
|
4012
|
-
|
|
4393
|
+
var toolbar_24 = getComponent(id + '_bottomToolbar', 'toolbar');
|
|
4394
|
+
toolbar_24.refreshOverflow();
|
|
4013
4395
|
}
|
|
4014
4396
|
}
|
|
4015
4397
|
else {
|
|
4016
4398
|
if (document.getElementById(id + '_toolbar')) {
|
|
4017
4399
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4018
|
-
var
|
|
4019
|
-
|
|
4400
|
+
var toolbar_25 = getComponent(id + '_toolbar', 'toolbar');
|
|
4401
|
+
toolbar_25.refreshOverflow();
|
|
4020
4402
|
}
|
|
4021
4403
|
}
|
|
4022
4404
|
}
|
|
@@ -4083,15 +4465,15 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4083
4465
|
if (Browser.isDevice) {
|
|
4084
4466
|
if (document.getElementById(id + '_bottomToolbar')) {
|
|
4085
4467
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4086
|
-
var
|
|
4087
|
-
|
|
4468
|
+
var toolbar_26 = getComponent(id + '_bottomToolbar', 'toolbar');
|
|
4469
|
+
toolbar_26.refreshOverflow();
|
|
4088
4470
|
}
|
|
4089
4471
|
}
|
|
4090
4472
|
else {
|
|
4091
4473
|
if (document.getElementById(id + '_toolbar')) {
|
|
4092
4474
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4093
|
-
var
|
|
4094
|
-
|
|
4475
|
+
var toolbar_27 = getComponent(id + '_toolbar', 'toolbar');
|
|
4476
|
+
toolbar_27.refreshOverflow();
|
|
4095
4477
|
}
|
|
4096
4478
|
}
|
|
4097
4479
|
}
|
|
@@ -4170,6 +4552,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4170
4552
|
filter.style.height = '100px';
|
|
4171
4553
|
parent.notify('filter', { prop: 'updateAdj', value: { type: type, value: null, isPreview: true, ctx: ctx } });
|
|
4172
4554
|
ctx.drawImage(this.inMemoryCanvas, 0, 0, 300, 150);
|
|
4555
|
+
if (parent.isSafari) {
|
|
4556
|
+
parent.notify('filter', { prop: 'apply-filter', onPropertyChange: false, value: { context: ctx } });
|
|
4557
|
+
}
|
|
4173
4558
|
}
|
|
4174
4559
|
};
|
|
4175
4560
|
ToolbarModule.prototype.getQuickAccessToolbarItem = function (isPenEdit) {
|
|
@@ -4181,7 +4566,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4181
4566
|
if (parent.activeObj.shape === 'image') {
|
|
4182
4567
|
toolbarItems.push('Flip');
|
|
4183
4568
|
}
|
|
4184
|
-
|
|
4569
|
+
if (parent.activeObj.shape !== 'redact') {
|
|
4570
|
+
toolbarItems.push('BringToFront');
|
|
4571
|
+
}
|
|
4185
4572
|
toolbarItems.push('Clone');
|
|
4186
4573
|
toolbarItems.push('Delete');
|
|
4187
4574
|
if (parent.activeObj.shape === 'text') {
|
|
@@ -4254,16 +4641,19 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4254
4641
|
toolbarObj.appendTo('#' + id + '_quickAccessToolbar');
|
|
4255
4642
|
}
|
|
4256
4643
|
var height = this.toolbarHeight && this.toolbarHeight !== 0 ? this.toolbarHeight : qtArea.clientHeight;
|
|
4644
|
+
var wrapperElement = parent.element.querySelector('#' + id + '_headWrapper');
|
|
4257
4645
|
if (isNullOrUndefined(isPenEdit) && (parent.activeObj.activePoint.width !== 0 ||
|
|
4258
4646
|
parent.activeObj.activePoint.height !== 0 ||
|
|
4259
4647
|
(parent.activeObj.shape && parent.activeObj.shape === 'path' && parent.activeObj.pointColl.length > 0))) {
|
|
4260
4648
|
var orderObj = { order: null };
|
|
4261
4649
|
parent.notify('shape', { prop: 'getHighestOrder', onPropertyChange: false, value: { obj: orderObj } });
|
|
4262
|
-
if (parent.activeObj.order > orderObj['order']) {
|
|
4263
|
-
document.getElementById(parent.element.id + '_bringToFront').classList.add('e-
|
|
4650
|
+
if (parent.activeObj.order > orderObj['order'] && document.getElementById(parent.element.id + '_bringToFront')) {
|
|
4651
|
+
document.getElementById(parent.element.id + '_bringToFront').classList.add('e-overlay');
|
|
4264
4652
|
}
|
|
4265
4653
|
else {
|
|
4266
|
-
document.getElementById(parent.element.id + '_bringToFront')
|
|
4654
|
+
if (document.getElementById(parent.element.id + '_bringToFront')) {
|
|
4655
|
+
document.getElementById(parent.element.id + '_bringToFront').classList.remove('e-overlay');
|
|
4656
|
+
}
|
|
4267
4657
|
}
|
|
4268
4658
|
qtArea.style.width = 'auto';
|
|
4269
4659
|
parent.activeObj.activePoint.width = Math.abs(parent.activeObj.activePoint.width);
|
|
@@ -4293,10 +4683,19 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4293
4683
|
var diff = (x + (width / 2)) - (parseFloat(qtArea.style.left) + (qtArea.clientWidth / 2));
|
|
4294
4684
|
qtArea.style.left = parseFloat(qtArea.style.left) + diff + 'px';
|
|
4295
4685
|
}
|
|
4686
|
+
if (wrapperElement) {
|
|
4687
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4688
|
+
height = wrapperElement.offsetHeight + height;
|
|
4689
|
+
}
|
|
4296
4690
|
if (y - (height + (height / 1.5)) < parent.img.destTop) {
|
|
4297
4691
|
qtArea.style.top = parent.img.destTop + 'px';
|
|
4692
|
+
if (wrapperElement) {
|
|
4693
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4694
|
+
qtArea.style.top = (parent.img.destTop < 0 ? 0 : parent.img.destTop) + wrapperElement.offsetHeight + 'px';
|
|
4695
|
+
}
|
|
4298
4696
|
}
|
|
4299
4697
|
else {
|
|
4698
|
+
height = this.toolbarHeight;
|
|
4300
4699
|
qtArea.style.top = y - (height + (height / 1.5)) + 'px';
|
|
4301
4700
|
}
|
|
4302
4701
|
}
|
|
@@ -4306,11 +4705,13 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4306
4705
|
var orderObj = { order: null };
|
|
4307
4706
|
parent.notify('shape', { prop: 'getHighestOrder', onPropertyChange: false, value: { obj: orderObj } });
|
|
4308
4707
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4309
|
-
if (parent.getObjFromId(parent.pointColl[indexObj['freehandSelectedIndex']].id).order >= orderObj['order']) {
|
|
4310
|
-
document.getElementById(parent.element.id + '_bringToFront').classList.add('e-
|
|
4708
|
+
if (parent.getObjFromId(parent.pointColl[indexObj['freehandSelectedIndex']].id).order >= orderObj['order'] && document.getElementById(parent.element.id + '_bringToFront')) {
|
|
4709
|
+
document.getElementById(parent.element.id + '_bringToFront').classList.add('e-overlay');
|
|
4311
4710
|
}
|
|
4312
4711
|
else {
|
|
4313
|
-
document.getElementById(parent.element.id + '_bringToFront')
|
|
4712
|
+
if (document.getElementById(parent.element.id + '_bringToFront')) {
|
|
4713
|
+
document.getElementById(parent.element.id + '_bringToFront').classList.remove('e-overlay');
|
|
4714
|
+
}
|
|
4314
4715
|
}
|
|
4315
4716
|
var obj = { activePoint: null };
|
|
4316
4717
|
parent.notify('freehand-draw', { prop: 'getSqPtFD',
|
|
@@ -4430,7 +4831,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4430
4831
|
var orderObj = { order: null };
|
|
4431
4832
|
switch (type) {
|
|
4432
4833
|
case 'duplicate':
|
|
4433
|
-
if (!parent.element.querySelector('#' + id + '_duplicate').classList.contains('e-
|
|
4834
|
+
if (!parent.element.querySelector('#' + id + '_duplicate').classList.contains('e-overlay')) {
|
|
4434
4835
|
this.refreshSlider();
|
|
4435
4836
|
if (!pathObject['isNewPath'] && JSON.stringify(object['tempObj']) === JSON.stringify(parent.activeObj)) {
|
|
4436
4837
|
isPreventUndoRedo = true;
|
|
@@ -4439,14 +4840,14 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4439
4840
|
}
|
|
4440
4841
|
break;
|
|
4441
4842
|
case 'remove':
|
|
4442
|
-
if (!parent.element.querySelector('#' + id + '_remove').classList.contains('e-
|
|
4843
|
+
if (!parent.element.querySelector('#' + id + '_remove').classList.contains('e-overlay')) {
|
|
4443
4844
|
parent.noPushUndo = false;
|
|
4444
4845
|
this.refreshSlider();
|
|
4445
4846
|
parent.notify('selection', { prop: 'deleteItem', onPropertyChange: false });
|
|
4446
4847
|
}
|
|
4447
4848
|
break;
|
|
4448
4849
|
case 'edittext':
|
|
4449
|
-
if (!parent.element.querySelector('#' + id + '_editText').classList.contains('e-
|
|
4850
|
+
if (!parent.element.querySelector('#' + id + '_editText').classList.contains('e-overlay')) {
|
|
4450
4851
|
this.editText();
|
|
4451
4852
|
}
|
|
4452
4853
|
break;
|
|
@@ -4475,7 +4876,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4475
4876
|
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
|
|
4476
4877
|
break;
|
|
4477
4878
|
case 'bringtofront':
|
|
4478
|
-
if (!parent.element.querySelector('#' + id + '_bringToFront').classList.contains('e-
|
|
4879
|
+
if (!parent.element.querySelector('#' + id + '_bringToFront').classList.contains('e-overlay')) {
|
|
4479
4880
|
parent.notify('freehand-draw', { prop: 'getFreehandSelectedIndex', onPropertyChange: false, value: { obj: indexObj } });
|
|
4480
4881
|
shapeId = indexObj['freehandSelectedIndex'] !== null ? parent.pointColl[indexObj['freehandSelectedIndex']].id :
|
|
4481
4882
|
parent.activeObj.currIndex;
|
|
@@ -4494,10 +4895,10 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4494
4895
|
isDisabled = order > orderObj['order'] ? true : false;
|
|
4495
4896
|
}
|
|
4496
4897
|
if (isDisabled) {
|
|
4497
|
-
document.getElementById(parent.element.id + '_bringToFront').classList.add('e-
|
|
4898
|
+
document.getElementById(parent.element.id + '_bringToFront').classList.add('e-overlay');
|
|
4498
4899
|
}
|
|
4499
4900
|
else {
|
|
4500
|
-
document.getElementById(parent.element.id + '_bringToFront').classList.remove('e-
|
|
4901
|
+
document.getElementById(parent.element.id + '_bringToFront').classList.remove('e-overlay');
|
|
4501
4902
|
}
|
|
4502
4903
|
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
|
|
4503
4904
|
}
|
|
@@ -4652,7 +5053,21 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4652
5053
|
parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj,
|
|
4653
5054
|
isCropRatio: null, points: null, isPreventDrag: true } });
|
|
4654
5055
|
parent.notify('undo-redo', { prop: 'updateUrObj', onPropertyChange: false, value: { objColl: objColl } });
|
|
5056
|
+
parent.notify('shape', { prop: 'applyActObj', onPropertyChange: false, value: { isMouseDown: true } });
|
|
5057
|
+
parent.noPushUndo = false;
|
|
5058
|
+
parent.notify('undo-redo', { prop: 'updateCurrUrc', value: { type: 'ok' } });
|
|
5059
|
+
parent.noPushUndo = true;
|
|
5060
|
+
parent.notify('selection', { prop: 'redrawShape', onPropertyChange: false,
|
|
5061
|
+
value: { obj: parent.objColl[parent.objColl.length - 1] } });
|
|
5062
|
+
var id = parent.element.id;
|
|
5063
|
+
var toolbarId = Browser.isDevice ? '#' + id + '_bottomToolbar ' + '#' + id : '#' + id;
|
|
5064
|
+
var object = { freehandDrawSelectedId: null };
|
|
5065
|
+
parent.notify('freehand-draw', { prop: 'getFreehandDrawSelectedId', onPropertyChange: false, value: { obj: object } });
|
|
5066
|
+
this.enableDisableCloneBtn(toolbarId, object);
|
|
4655
5067
|
this.renderQAT();
|
|
5068
|
+
if (parent.activeObj.shape && parent.activeObj.shape === 'redact') {
|
|
5069
|
+
this.redactSlider(parent.activeObj.redactType);
|
|
5070
|
+
}
|
|
4656
5071
|
};
|
|
4657
5072
|
ToolbarModule.prototype.defToolbarClicked = function (args) {
|
|
4658
5073
|
var parent = this.parent;
|
|
@@ -4710,6 +5125,8 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4710
5125
|
var isCropSelection = false;
|
|
4711
5126
|
var panBtn;
|
|
4712
5127
|
var splitWords;
|
|
5128
|
+
var actionType;
|
|
5129
|
+
var actionArgs;
|
|
4713
5130
|
if (parent.activeObj.shape !== undefined) {
|
|
4714
5131
|
splitWords = parent.activeObj.shape.split('-');
|
|
4715
5132
|
}
|
|
@@ -4723,6 +5140,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4723
5140
|
switch (type) {
|
|
4724
5141
|
case 'pan':
|
|
4725
5142
|
parent.currObjType.isCustomCrop = parent.currObjType.isFiltered = false;
|
|
5143
|
+
parent.currObjType.isRedact = false;
|
|
4726
5144
|
if (parent.currObjType.isUndoAction) {
|
|
4727
5145
|
parent.notify('undo-redo', { prop: 'refreshUrc', value: { bool: null } });
|
|
4728
5146
|
}
|
|
@@ -4758,9 +5176,18 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4758
5176
|
this.refreshToolbar('main');
|
|
4759
5177
|
break;
|
|
4760
5178
|
case 'cancel':
|
|
5179
|
+
if (parent.currObjType.isRedact) {
|
|
5180
|
+
parent.currObjType.isRedact = false;
|
|
5181
|
+
}
|
|
5182
|
+
if (this.isFrameToolbar && parent.element.querySelector('.e-contextual-toolbar-wrapper') && !parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.contains('e-hide')) {
|
|
5183
|
+
parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
|
|
5184
|
+
}
|
|
4761
5185
|
parent.notify('draw', { prop: 'performCancel', value: { isContextualToolbar: isContextualToolbar, isFinalCancel: true } });
|
|
4762
5186
|
break;
|
|
4763
5187
|
case 'ok':
|
|
5188
|
+
if (Browser.isDevice && this.isFrameToolbar && parent.element.querySelector('.e-contextual-toolbar-wrapper') && !parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.contains('e-hide')) {
|
|
5189
|
+
parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
|
|
5190
|
+
}
|
|
4764
5191
|
parent.okBtn(null, true);
|
|
4765
5192
|
parent.drawingShape = null;
|
|
4766
5193
|
this.refreshDropDownBtn(false);
|
|
@@ -4834,14 +5261,14 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4834
5261
|
this.refreshToolbar('resize');
|
|
4835
5262
|
break;
|
|
4836
5263
|
case 'resize':
|
|
4837
|
-
if (parent.currObjType.isFiltered) {
|
|
5264
|
+
if (parent.currObjType.isFiltered || parent.currObjType.isRedact) {
|
|
4838
5265
|
parent.okBtn();
|
|
4839
5266
|
}
|
|
4840
5267
|
this.resizeClick();
|
|
4841
5268
|
break;
|
|
4842
5269
|
case 'adjustment':
|
|
4843
5270
|
if (!isDisabledAdjustment) {
|
|
4844
|
-
if (parent.currObjType.isFiltered) {
|
|
5271
|
+
if (parent.currObjType.isFiltered || parent.currObjType.isRedact) {
|
|
4845
5272
|
parent.okBtn();
|
|
4846
5273
|
}
|
|
4847
5274
|
this.refreshToolbar('adjustment');
|
|
@@ -4949,6 +5376,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4949
5376
|
case 'horizontalflip':
|
|
4950
5377
|
case 'verticalflip':
|
|
4951
5378
|
parent.transformSelect(type);
|
|
5379
|
+
this.updateRedactObj();
|
|
4952
5380
|
if (type === 'rotateleft' || type === 'rotateright') {
|
|
4953
5381
|
parent.notify('draw', { prop: 'resetStraightenDestPoints' });
|
|
4954
5382
|
parent.notify('draw', { prop: 'setDestForStraighten' });
|
|
@@ -4957,6 +5385,10 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4957
5385
|
if (Browser.isDevice) {
|
|
4958
5386
|
this.updateContextualToolbar('color', 'straighten');
|
|
4959
5387
|
}
|
|
5388
|
+
actionType = type === 'rotateleft' || type === 'rotateright' ?
|
|
5389
|
+
'rotate' : 'flip';
|
|
5390
|
+
actionArgs = { action: actionType, actionEventArgs: parent.editCompleteArgs };
|
|
5391
|
+
parent.triggerEditCompleteEvent(actionArgs);
|
|
4960
5392
|
break;
|
|
4961
5393
|
case 'save':
|
|
4962
5394
|
parent.noPushUndo = false;
|
|
@@ -4996,9 +5428,98 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
4996
5428
|
parent.isFrameBtnClick = true;
|
|
4997
5429
|
parent.curFrameObjEvent = { previousFrameSetting: parent.tempFrameObj, currentFrameSetting: parent.frameObj };
|
|
4998
5430
|
break;
|
|
5431
|
+
case 'redact':
|
|
5432
|
+
parent.currObjType.isRedact = true;
|
|
5433
|
+
parent.drawingShape = 'redact';
|
|
5434
|
+
if (isNullOrUndefined(parent.activeObj.redactBlur)) {
|
|
5435
|
+
parent.activeObj.redactBlur = 20;
|
|
5436
|
+
}
|
|
5437
|
+
if (isNullOrUndefined(parent.activeObj.redactPixelate)) {
|
|
5438
|
+
parent.activeObj.redactPixelate = 20;
|
|
5439
|
+
}
|
|
5440
|
+
parent.notify('selection', { prop: 'annotate', value: { shape: 'redact' } });
|
|
5441
|
+
this.refreshToolbar('redact');
|
|
5442
|
+
this.redactSlider(parent.activeObj.redactType);
|
|
5443
|
+
break;
|
|
5444
|
+
case 'pixelate':
|
|
5445
|
+
parent.currObjType.isRedact = true;
|
|
5446
|
+
parent.drawingShape = 'redact';
|
|
5447
|
+
parent.notify('selection', { prop: 'annotate', value: { shape: 'redact' } });
|
|
5448
|
+
if (parent.activeObj.redactType === 'blur') {
|
|
5449
|
+
this.updateRedactType('pixelate');
|
|
5450
|
+
}
|
|
5451
|
+
parent.notify('shape', { prop: 'setRedactType', onPropertyChange: false,
|
|
5452
|
+
value: { redactType: 'pixelate' } });
|
|
5453
|
+
if (parent.activeObj.redactType === 'pixelate') {
|
|
5454
|
+
var pixelateBtn = parent.element.querySelector('#' + id + '_' + 'pixelate');
|
|
5455
|
+
var redactBlurBtn = parent.element.querySelector('#' + id + '_' + 'redactBlur');
|
|
5456
|
+
if (pixelateBtn) {
|
|
5457
|
+
pixelateBtn.classList.add('e-selected-btn');
|
|
5458
|
+
}
|
|
5459
|
+
if (redactBlurBtn && redactBlurBtn.classList.contains('e-selected-btn')) {
|
|
5460
|
+
redactBlurBtn.classList.remove('e-selected-btn');
|
|
5461
|
+
}
|
|
5462
|
+
}
|
|
5463
|
+
else {
|
|
5464
|
+
var redactBlurBtn = parent.element.querySelector('#' + id + '_' + 'redactBlur');
|
|
5465
|
+
if (redactBlurBtn) {
|
|
5466
|
+
redactBlurBtn.classList.add('e-selected-btn');
|
|
5467
|
+
}
|
|
5468
|
+
}
|
|
5469
|
+
this.redactSlider(parent.activeObj.redactType);
|
|
5470
|
+
if (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) {
|
|
5471
|
+
parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
|
|
5472
|
+
value: { operation: 'shapeTransform', previousObj: null, previousObjColl: null,
|
|
5473
|
+
previousPointColl: null, previousSelPointColl: null,
|
|
5474
|
+
previousCropObj: null, previousText: null,
|
|
5475
|
+
currentText: null, previousFilter: null, isCircleCrop: null } });
|
|
5476
|
+
}
|
|
5477
|
+
break;
|
|
5478
|
+
case 'redactblur':
|
|
5479
|
+
parent.currObjType.isRedact = true;
|
|
5480
|
+
parent.drawingShape = 'redact';
|
|
5481
|
+
parent.notify('selection', { prop: 'annotate', value: { shape: 'redact' } });
|
|
5482
|
+
parent.notify('shape', { prop: 'setRedactType', onPropertyChange: false,
|
|
5483
|
+
value: { redactType: 'blur' } });
|
|
5484
|
+
if (parent.activeObj.redactType === 'pixelate') {
|
|
5485
|
+
this.updateRedactType('blur');
|
|
5486
|
+
}
|
|
5487
|
+
parent.notify('shape', { prop: 'setRedactType', onPropertyChange: false, value: { redactType: 'blur' } });
|
|
5488
|
+
if (parent.activeObj.redactType === 'blur') {
|
|
5489
|
+
var redactBlurBtn = parent.element.querySelector('#' + id + '_' + 'redactBlur');
|
|
5490
|
+
var pixelateBtn = parent.element.querySelector('#' + id + '_' + 'pixelate');
|
|
5491
|
+
if (redactBlurBtn) {
|
|
5492
|
+
redactBlurBtn.classList.add('e-selected-btn');
|
|
5493
|
+
}
|
|
5494
|
+
if (pixelateBtn && pixelateBtn.classList.contains('e-selected-btn')) {
|
|
5495
|
+
pixelateBtn.classList.remove('e-selected-btn');
|
|
5496
|
+
}
|
|
5497
|
+
}
|
|
5498
|
+
else {
|
|
5499
|
+
var pixelateBtn = parent.element.querySelector('#' + id + '_' + 'pixelate');
|
|
5500
|
+
if (pixelateBtn) {
|
|
5501
|
+
pixelateBtn.classList.add('e-selected-btn');
|
|
5502
|
+
}
|
|
5503
|
+
}
|
|
5504
|
+
this.redactSlider(parent.activeObj.redactType);
|
|
5505
|
+
if (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) {
|
|
5506
|
+
parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
|
|
5507
|
+
value: { operation: 'shapeTransform', previousObj: null, previousObjColl: null,
|
|
5508
|
+
previousPointColl: null, previousSelPointColl: null,
|
|
5509
|
+
previousCropObj: null, previousText: null,
|
|
5510
|
+
currentText: null, previousFilter: null, isCircleCrop: null } });
|
|
5511
|
+
}
|
|
5512
|
+
break;
|
|
4999
5513
|
}
|
|
5000
5514
|
}
|
|
5001
5515
|
};
|
|
5516
|
+
ToolbarModule.prototype.updateRedactType = function (value) {
|
|
5517
|
+
var parent = this.parent;
|
|
5518
|
+
parent.activeObj.redactType = value;
|
|
5519
|
+
parent.notify('shape', { prop: 'setRedactType', value: { type: value } });
|
|
5520
|
+
this.parent.objColl.push(parent.activeObj);
|
|
5521
|
+
parent.notify('selection', { prop: 'redrawShape', value: { obj: parent.objColl[parent.objColl.length - 1] } });
|
|
5522
|
+
};
|
|
5002
5523
|
ToolbarModule.prototype.frameToolbarClick = function () {
|
|
5003
5524
|
var parent = this.parent;
|
|
5004
5525
|
var id = parent.element.id;
|
|
@@ -5007,10 +5528,10 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5007
5528
|
var frameObj;
|
|
5008
5529
|
var tempFrameObj;
|
|
5009
5530
|
parent.notify('draw', { prop: 'updateCropSelection', onPropertyChange: false });
|
|
5010
|
-
if (parent.currObjType.isFiltered) {
|
|
5531
|
+
if (parent.currObjType.isFiltered || parent.currObjType.isRedact) {
|
|
5011
5532
|
parent.okBtn();
|
|
5012
5533
|
}
|
|
5013
|
-
if (frame && !frame.classList.contains('e-
|
|
5534
|
+
if (frame && !frame.classList.contains('e-overlay')) {
|
|
5014
5535
|
zoom = parent.transform.zoomFactor;
|
|
5015
5536
|
parent.frameDestPoints = extend({}, parent.img, {}, true);
|
|
5016
5537
|
if (isNullOrUndefined(parent.cxtTbarHeight)) {
|
|
@@ -5089,6 +5610,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5089
5610
|
var type = args.item.id.replace(parent.element.id, '').split('_')[1];
|
|
5090
5611
|
var imageFiltering = { filter: parent.toPascalCase(type), cancel: false };
|
|
5091
5612
|
parent.trigger('imageFiltering', imageFiltering);
|
|
5613
|
+
parent.editCompleteArgs = imageFiltering;
|
|
5092
5614
|
if (imageFiltering.cancel) {
|
|
5093
5615
|
return;
|
|
5094
5616
|
}
|
|
@@ -5148,6 +5670,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5148
5670
|
parent_1.isZoomBtnClick = true;
|
|
5149
5671
|
this.applyPreviewFilter();
|
|
5150
5672
|
parent_1.currObjType.isFiltered = false;
|
|
5673
|
+
parent_1.currObjType.isRedact = false;
|
|
5151
5674
|
if (parent_1.togglePen) {
|
|
5152
5675
|
parent_1.currObjType.isZoomed = true;
|
|
5153
5676
|
parent_1.freeHandDraw(false);
|
|
@@ -5166,6 +5689,12 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5166
5689
|
parent_1.notify('draw', { prop: 'resetStraightenDestPoints' });
|
|
5167
5690
|
parent_1.notify('draw', { prop: 'setDestForStraighten' });
|
|
5168
5691
|
}
|
|
5692
|
+
var actionArgs = { action: 'zoom-in',
|
|
5693
|
+
actionEventArgs: parent_1.editCompleteArgs };
|
|
5694
|
+
parent_1.triggerEditCompleteEvent(actionArgs);
|
|
5695
|
+
if (Browser.isDevice) {
|
|
5696
|
+
zoomIn.focus();
|
|
5697
|
+
}
|
|
5169
5698
|
}
|
|
5170
5699
|
}
|
|
5171
5700
|
};
|
|
@@ -5206,6 +5735,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5206
5735
|
parent_2.isZoomBtnClick = true;
|
|
5207
5736
|
this.applyPreviewFilter();
|
|
5208
5737
|
parent_2.currObjType.isFiltered = false;
|
|
5738
|
+
parent_2.currObjType.isRedact = false;
|
|
5209
5739
|
if (parent_2.togglePen) {
|
|
5210
5740
|
parent_2.currObjType.isZoomed = true;
|
|
5211
5741
|
parent_2.freeHandDraw(false);
|
|
@@ -5224,6 +5754,12 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5224
5754
|
parent_2.notify('draw', { prop: 'resetStraightenDestPoints' });
|
|
5225
5755
|
parent_2.notify('draw', { prop: 'setDestForStraighten' });
|
|
5226
5756
|
}
|
|
5757
|
+
var actionArgs = { action: 'zoom-out',
|
|
5758
|
+
actionEventArgs: parent_2.editCompleteArgs };
|
|
5759
|
+
parent_2.triggerEditCompleteEvent(actionArgs);
|
|
5760
|
+
if (Browser.isDevice) {
|
|
5761
|
+
zoomOut.focus();
|
|
5762
|
+
}
|
|
5227
5763
|
}
|
|
5228
5764
|
}
|
|
5229
5765
|
};
|
|
@@ -5560,8 +6096,11 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5560
6096
|
var selFillElem = parent.element.querySelector('.e-fill.e-template .e-dropdownbtn-preview');
|
|
5561
6097
|
var selStrokeElem = parent.element.querySelector('.e-stroke.e-template .e-dropdownbtn-preview');
|
|
5562
6098
|
var selTextStrokeElem = parent.element.querySelector('.e-text-font-color.e-template .e-dropdownbtn-preview');
|
|
6099
|
+
var selStrokeTextColorElem = parent.element.querySelector('.e-stroke-text-font-color.e-template .e-dropdownbtn-preview');
|
|
6100
|
+
var selTextBGElem = parent.element.querySelector('.e-text-background-color.e-template .e-dropdownbtn-preview');
|
|
5563
6101
|
var selPenStrokeElem = parent.element.querySelector('.e-pen-stroke-color.e-template .e-dropdownbtn-preview');
|
|
5564
6102
|
var strokeWidthElem = parent.element.querySelector('.e-shape-stroke-width');
|
|
6103
|
+
var rectangleRadiusElem = parent.element.querySelector('.e-shape-rectangle-radius');
|
|
5565
6104
|
var fontFamilyElem = parent.element.querySelector('.e-text-font-family');
|
|
5566
6105
|
var fontSizeElem = parent.element.querySelector('.e-text-font-size');
|
|
5567
6106
|
var boldBtn = parent.element.querySelector('#' + id + '_bold');
|
|
@@ -5570,6 +6109,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5570
6109
|
if (isNullOrUndefined(parent.activeObj.strokeSettings.strokeWidth)) {
|
|
5571
6110
|
parent.activeObj.strokeSettings.strokeWidth = 2;
|
|
5572
6111
|
}
|
|
6112
|
+
if (isNullOrUndefined(parent.activeObj.strokeSettings.outlineWidth)) {
|
|
6113
|
+
parent.activeObj.strokeSettings.outlineWidth = 2;
|
|
6114
|
+
}
|
|
5573
6115
|
if (selFillElem) {
|
|
5574
6116
|
var value = parent.activeObj.strokeSettings.fillColor;
|
|
5575
6117
|
if (parent.activeObj.strokeSettings.fillColor === '') {
|
|
@@ -5597,6 +6139,32 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5597
6139
|
getComponent(id + '_text_font', 'colorpicker').value = value;
|
|
5598
6140
|
}
|
|
5599
6141
|
}
|
|
6142
|
+
if (selStrokeTextColorElem) {
|
|
6143
|
+
var value = parent.activeObj.strokeSettings.outlineColor;
|
|
6144
|
+
if (!/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$|^[a-zA-Z]+$/.test(parent.activeObj.strokeSettings.outlineColor)) {
|
|
6145
|
+
selStrokeTextColorElem.classList.add('e-nocolor-item');
|
|
6146
|
+
}
|
|
6147
|
+
else {
|
|
6148
|
+
selStrokeTextColorElem.classList.remove('e-nocolor-item');
|
|
6149
|
+
selStrokeTextColorElem.style.background = value;
|
|
6150
|
+
}
|
|
6151
|
+
if (document.querySelector('#' + id + '_stroke_text')) {
|
|
6152
|
+
getComponent(id + '_stroke_text', 'colorpicker').value = value;
|
|
6153
|
+
}
|
|
6154
|
+
}
|
|
6155
|
+
if (selTextBGElem) {
|
|
6156
|
+
var value = parent.activeObj.strokeSettings.fillColor;
|
|
6157
|
+
if (parent.activeObj.strokeSettings.fillColor === '' || parent.activeObj.strokeSettings.fillColor === 'transparent') {
|
|
6158
|
+
selTextBGElem.classList.add('e-nocolor-item');
|
|
6159
|
+
}
|
|
6160
|
+
else {
|
|
6161
|
+
selTextBGElem.classList.remove('e-nocolor-item');
|
|
6162
|
+
selTextBGElem.style.background = value;
|
|
6163
|
+
}
|
|
6164
|
+
if (document.querySelector('#' + id + '_text_bgColor')) {
|
|
6165
|
+
getComponent(id + '_text_bgColor', 'colorpicker').value = value;
|
|
6166
|
+
}
|
|
6167
|
+
}
|
|
5600
6168
|
if (selPenStrokeElem) {
|
|
5601
6169
|
var value = parent.activeObj.strokeSettings.strokeColor;
|
|
5602
6170
|
selPenStrokeElem.style.background = value;
|
|
@@ -5639,9 +6207,14 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5639
6207
|
}
|
|
5640
6208
|
}
|
|
5641
6209
|
if (strokeWidthElem) {
|
|
5642
|
-
var
|
|
6210
|
+
var width = parent.activeObj.shape === 'text' ? parent.activeObj.strokeSettings.outlineWidth : parent.activeObj.strokeSettings.strokeWidth;
|
|
6211
|
+
var strokeWidth = Math.round(width).toString();
|
|
5643
6212
|
strokeWidthElem.textContent = this.getStrokeWidth(strokeWidth);
|
|
5644
6213
|
}
|
|
6214
|
+
if (rectangleRadiusElem) {
|
|
6215
|
+
var rectRadius = Math.round((parent.activeObj.strokeSettings.radius)).toString();
|
|
6216
|
+
rectangleRadiusElem.textContent = this.getRectRadius(rectRadius);
|
|
6217
|
+
}
|
|
5645
6218
|
}
|
|
5646
6219
|
}
|
|
5647
6220
|
};
|
|
@@ -5670,6 +6243,31 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5670
6243
|
}
|
|
5671
6244
|
return strokeWidth;
|
|
5672
6245
|
};
|
|
6246
|
+
ToolbarModule.prototype.getRectRadius = function (text) {
|
|
6247
|
+
var rectRadius;
|
|
6248
|
+
var currentWidth = parseInt(text, 10) / 2;
|
|
6249
|
+
switch (currentWidth) {
|
|
6250
|
+
case 0:
|
|
6251
|
+
rectRadius = this.l10n.getConstant('0');
|
|
6252
|
+
break;
|
|
6253
|
+
case 1:
|
|
6254
|
+
rectRadius = this.l10n.getConstant('20');
|
|
6255
|
+
break;
|
|
6256
|
+
case 2:
|
|
6257
|
+
rectRadius = this.l10n.getConstant('40');
|
|
6258
|
+
break;
|
|
6259
|
+
case 3:
|
|
6260
|
+
rectRadius = this.l10n.getConstant('60');
|
|
6261
|
+
break;
|
|
6262
|
+
case 4:
|
|
6263
|
+
rectRadius = this.l10n.getConstant('80');
|
|
6264
|
+
break;
|
|
6265
|
+
case 5:
|
|
6266
|
+
rectRadius = this.l10n.getConstant('100');
|
|
6267
|
+
break;
|
|
6268
|
+
}
|
|
6269
|
+
return rectRadius;
|
|
6270
|
+
};
|
|
5673
6271
|
ToolbarModule.prototype.cancelPan = function () {
|
|
5674
6272
|
var parent = this.parent;
|
|
5675
6273
|
parent.notify('shape', { prop: 'applyActObj', onPropertyChange: false, value: { isMouseDown: true } });
|
|
@@ -5796,6 +6394,90 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
5796
6394
|
ToolbarModule.prototype.getModuleName = function () {
|
|
5797
6395
|
return 'toolbar-module';
|
|
5798
6396
|
};
|
|
6397
|
+
ToolbarModule.prototype.redactSlider = function (type) {
|
|
6398
|
+
var parent = this.parent;
|
|
6399
|
+
var id = parent.element.id;
|
|
6400
|
+
var toolbarArea = parent.element.querySelector('#' + id + '_toolbarArea');
|
|
6401
|
+
var contextualToolbarArea = parent.element.querySelector('#' + id + '_contextualToolbarArea');
|
|
6402
|
+
if (!contextualToolbarArea) {
|
|
6403
|
+
return;
|
|
6404
|
+
}
|
|
6405
|
+
contextualToolbarArea.classList.remove('e-hide');
|
|
6406
|
+
contextualToolbarArea.style.left = toolbarArea.offsetLeft + 'px';
|
|
6407
|
+
var canvasWrapper = document.querySelector('#' + id + '_contextualToolbarArea');
|
|
6408
|
+
var hdrWrapper = document.querySelector('#' + id + '_headWrapper');
|
|
6409
|
+
var labelWrapper = document.querySelector('#' + id + '_labelWrapper');
|
|
6410
|
+
var ctxTbar = document.querySelector('#' + id + '_contextualToolbar');
|
|
6411
|
+
if (hdrWrapper) {
|
|
6412
|
+
hdrWrapper.remove();
|
|
6413
|
+
labelWrapper.remove();
|
|
6414
|
+
}
|
|
6415
|
+
if (ctxTbar) {
|
|
6416
|
+
ctxTbar.remove();
|
|
6417
|
+
this.createContextualToolbar();
|
|
6418
|
+
}
|
|
6419
|
+
hdrWrapper = canvasWrapper.appendChild(parent.createElement('div', {
|
|
6420
|
+
id: id + '_headWrapper',
|
|
6421
|
+
styles: 'position: relative'
|
|
6422
|
+
}));
|
|
6423
|
+
labelWrapper = hdrWrapper.appendChild(parent.createElement('label', {
|
|
6424
|
+
id: id + '_labelWrapper',
|
|
6425
|
+
className: 'e-ie-finetune-slider-label',
|
|
6426
|
+
styles: Browser.isDevice ? ('position: absolute; top: 31%; left: calc(50% - 160px); font-size: 15px; text-transform: capitalize; font-weight: 400;')
|
|
6427
|
+
: 'position: absolute; top: 25%; left: calc(50% - 226px); font-size: 15px; text-transform: capitalize; font-weight: 400;'
|
|
6428
|
+
}));
|
|
6429
|
+
var text = type === 'blur' ? this.l10n.getConstant('Blur') : this.l10n.getConstant('PixelSize');
|
|
6430
|
+
labelWrapper.textContent = text;
|
|
6431
|
+
var sliderWrapper = hdrWrapper.appendChild(parent.createElement('div', {
|
|
6432
|
+
id: id + '_sliderWrapper',
|
|
6433
|
+
className: 'e-ie-finetune-slider-wrap',
|
|
6434
|
+
styles: 'position: absolute'
|
|
6435
|
+
}));
|
|
6436
|
+
hdrWrapper.appendChild(parent.createElement('label', {
|
|
6437
|
+
id: id + '_redactSpan',
|
|
6438
|
+
className: 'e-ie-redact-value-span',
|
|
6439
|
+
styles: Browser.isDevice ? ('position: absolute; top: 30%; margin-left: 20px; font-size: 15px; text-transform: capitalize; font-weight: 400;') :
|
|
6440
|
+
'position: absolute; top: 30%; left: calc(50% + 190px); font-size: 15px; text-transform: capitalize; font-weight: 400;'
|
|
6441
|
+
}));
|
|
6442
|
+
sliderWrapper.parentElement.classList.add('e-finetune-slider');
|
|
6443
|
+
var value = parent.activeObj.redactType === 'blur' ? parent.activeObj.redactBlur :
|
|
6444
|
+
parent.activeObj.redactPixelate;
|
|
6445
|
+
var redactSlider = new Slider({
|
|
6446
|
+
tooltip: { placement: 'Before', isVisible: true, showOn: 'Focus' },
|
|
6447
|
+
min: 10, max: 100, step: 1, value: value,
|
|
6448
|
+
type: 'MinRange',
|
|
6449
|
+
width: Browser.isDevice ? '130px' : '300px',
|
|
6450
|
+
created: function () {
|
|
6451
|
+
parent.element.querySelector('.e-ie-redact-value-span').innerText = value.toString();
|
|
6452
|
+
},
|
|
6453
|
+
change: function (args) {
|
|
6454
|
+
parent.element.querySelector('.e-ie-redact-value-span').innerText = args.value.toString();
|
|
6455
|
+
if (parent.activeObj.redactType === 'blur') {
|
|
6456
|
+
parent.activeObj.redactBlur = parent.tempRedactBlur = args.value;
|
|
6457
|
+
}
|
|
6458
|
+
else if (parent.activeObj.redactType === 'pixelate') {
|
|
6459
|
+
parent.activeObj.redactPixelate = parent.tempRedactPixel = args.value;
|
|
6460
|
+
}
|
|
6461
|
+
parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj, isCropRatio: null,
|
|
6462
|
+
points: null, isPreventDrag: true, saveContext: null, isPreventSelection: true } });
|
|
6463
|
+
},
|
|
6464
|
+
changed: function () {
|
|
6465
|
+
setTimeout(function () {
|
|
6466
|
+
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
|
|
6467
|
+
}, 50);
|
|
6468
|
+
}
|
|
6469
|
+
});
|
|
6470
|
+
redactSlider.appendTo('#' + id + '_sliderWrapper');
|
|
6471
|
+
if (Browser.isDevice) {
|
|
6472
|
+
var cHt = contextualToolbarArea.offsetHeight + 1;
|
|
6473
|
+
var cusWrapper = parent.element.querySelector('#' + id + '_customizeWrapper');
|
|
6474
|
+
if (this.isFrameToolbar && cusWrapper) {
|
|
6475
|
+
cHt = cusWrapper.offsetHeight + 2;
|
|
6476
|
+
}
|
|
6477
|
+
var ht = parent.element.querySelector('#' + id + '_canvasWrapper').offsetHeight;
|
|
6478
|
+
contextualToolbarArea.style.top = this.toolbarHeight + 1 + ht - cHt + 'px';
|
|
6479
|
+
}
|
|
6480
|
+
};
|
|
5799
6481
|
return ToolbarModule;
|
|
5800
6482
|
}());
|
|
5801
6483
|
export { ToolbarModule };
|