@syncfusion/ej2-image-editor 22.2.8 → 22.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +260 -0
- package/CHANGELOG.md +18 -2
- 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 +118 -53
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +118 -53
- 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 +9 -9
- package/src/image-editor/action/selection.js +20 -14
- package/src/image-editor/action/shape.js +1 -0
- package/src/image-editor/renderer/toolbar.js +97 -39
- package/tslint.json +111 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 22.2.
|
|
3
|
+
* version : 22.2.10
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-image-editor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-image-editor@22.2.
|
|
3
|
+
"_id": "@syncfusion/ej2-image-editor@22.2.9",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-byeXp0fLE66PUgjKarMW4FVTjOpV/zZk4T5T8JRYWDFPi4C9VnWTFGMWC/WJ00MwSfX5ze+eDmbECivdY+t+Sg==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-image-editor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-image-editor",
|
|
24
24
|
"/@syncfusion/ej2-vue-image-editor"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-22.2.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-22.2.9.tgz",
|
|
27
|
+
"_shasum": "8a1070884013eb0d3d27201d843223e9e19a2bfc",
|
|
28
28
|
"_spec": "@syncfusion/ej2-image-editor@*",
|
|
29
29
|
"_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
},
|
|
33
33
|
"bundleDependencies": false,
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@syncfusion/ej2-base": "~22.2.
|
|
36
|
-
"@syncfusion/ej2-buttons": "~22.2.
|
|
37
|
-
"@syncfusion/ej2-inputs": "~22.2.
|
|
35
|
+
"@syncfusion/ej2-base": "~22.2.10",
|
|
36
|
+
"@syncfusion/ej2-buttons": "~22.2.9",
|
|
37
|
+
"@syncfusion/ej2-inputs": "~22.2.9",
|
|
38
38
|
"@syncfusion/ej2-navigations": "~22.2.8",
|
|
39
|
-
"@syncfusion/ej2-popups": "~22.2.
|
|
39
|
+
"@syncfusion/ej2-popups": "~22.2.9",
|
|
40
40
|
"@syncfusion/ej2-splitbuttons": "~22.2.8"
|
|
41
41
|
},
|
|
42
42
|
"deprecated": false,
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/imageeditor"
|
|
68
68
|
},
|
|
69
69
|
"typings": "index.d.ts",
|
|
70
|
-
"version": "22.2.
|
|
70
|
+
"version": "22.2.10",
|
|
71
71
|
"sideEffects": false,
|
|
72
72
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
73
73
|
}
|
|
@@ -3125,8 +3125,10 @@ var Selection = /** @class */ (function () {
|
|
|
3125
3125
|
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
3126
3126
|
}
|
|
3127
3127
|
else if (parent.activeObj.shape === 'text') {
|
|
3128
|
-
parent.
|
|
3129
|
-
|
|
3128
|
+
if (parent.textArea.style.display === 'none') {
|
|
3129
|
+
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
|
|
3130
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
3131
|
+
}
|
|
3130
3132
|
}
|
|
3131
3133
|
else if (this.isFhdEditing) {
|
|
3132
3134
|
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'pen',
|
|
@@ -3143,7 +3145,7 @@ var Selection = /** @class */ (function () {
|
|
|
3143
3145
|
|| (parent.activeObj.shape === 'line' || parent.activeObj.shape === 'arrow' || parent.activeObj.shape === 'path')) {
|
|
3144
3146
|
parent.updateToolbar(parent.element, parent.activeObj.shape);
|
|
3145
3147
|
}
|
|
3146
|
-
else if (parent.activeObj.shape === 'text') {
|
|
3148
|
+
else if (parent.activeObj.shape === 'text' && parent.textArea.style.display === 'none') {
|
|
3147
3149
|
parent.updateToolbar(parent.element, 'text');
|
|
3148
3150
|
}
|
|
3149
3151
|
}
|
|
@@ -3458,23 +3460,24 @@ var Selection = /** @class */ (function () {
|
|
|
3458
3460
|
parent.activeObj = extend({}, activeObj, null, true);
|
|
3459
3461
|
parent.textArea.value = obj.keyHistory;
|
|
3460
3462
|
parent.textArea.style.display = 'block';
|
|
3461
|
-
var strokeColor = obj.strokeSettings.strokeColor.split('(')[0] === 'rgb' ?
|
|
3463
|
+
var strokeColor = obj.strokeSettings && obj.strokeSettings.strokeColor ? obj.strokeSettings.strokeColor.split('(')[0] === 'rgb' ?
|
|
3462
3464
|
this.rgbToHex(parseFloat(obj.strokeSettings.strokeColor.split('(')[1].split(',')[0]), parseFloat(obj.strokeSettings.strokeColor.split('(')[1].split(',')[1]), parseFloat(obj.strokeSettings.strokeColor.split('(')[1].split(',')[2])) :
|
|
3463
|
-
obj.strokeSettings.strokeColor;
|
|
3464
|
-
if (strokeColor === '#ffffff') {
|
|
3465
|
+
obj.strokeSettings.strokeColor : null;
|
|
3466
|
+
if (strokeColor && strokeColor === '#ffffff') {
|
|
3465
3467
|
strokeColor = '#fff';
|
|
3466
3468
|
}
|
|
3467
|
-
if (this.tempActiveObj.strokeSettings.strokeColor
|
|
3469
|
+
if (this.tempActiveObj.strokeSettings && this.tempActiveObj.strokeSettings.strokeColor &&
|
|
3470
|
+
this.tempActiveObj.strokeSettings.strokeColor === '#ffffff') {
|
|
3468
3471
|
this.tempActiveObj.strokeSettings.strokeColor = '#fff';
|
|
3469
3472
|
}
|
|
3470
3473
|
if (obj.keyHistory !== this.tempActiveObj.keyHistory ||
|
|
3471
|
-
strokeColor !== this.tempActiveObj.strokeSettings.strokeColor ||
|
|
3472
|
-
obj.textSettings.fontFamily !== this.tempActiveObj.textSettings.fontFamily ||
|
|
3473
|
-
Math.round(obj.textSettings.fontSize) !== Math.round(this.tempActiveObj.textSettings.fontSize) ||
|
|
3474
|
-
Math.round(obj.textSettings.fontRatio) !== Math.round(this.tempActiveObj.textSettings.fontRatio) ||
|
|
3475
|
-
obj.textSettings.bold !== this.tempActiveObj.textSettings.bold ||
|
|
3476
|
-
obj.textSettings.italic !== this.tempActiveObj.textSettings.italic ||
|
|
3477
|
-
obj.textSettings.underline !== this.tempActiveObj.textSettings.underline) {
|
|
3474
|
+
(strokeColor && (strokeColor !== this.tempActiveObj.strokeSettings.strokeColor)) ||
|
|
3475
|
+
(obj.textSettings && obj.textSettings.fontFamily !== this.tempActiveObj.textSettings.fontFamily) ||
|
|
3476
|
+
(obj.textSettings && Math.round(obj.textSettings.fontSize) !== Math.round(this.tempActiveObj.textSettings.fontSize)) ||
|
|
3477
|
+
(obj.textSettings && Math.round(obj.textSettings.fontRatio) !== Math.round(this.tempActiveObj.textSettings.fontRatio)) ||
|
|
3478
|
+
(obj.textSettings && obj.textSettings.bold !== this.tempActiveObj.textSettings.bold) ||
|
|
3479
|
+
(obj.textSettings && obj.textSettings.italic !== this.tempActiveObj.textSettings.italic) ||
|
|
3480
|
+
(obj.textSettings && obj.textSettings.underline !== this.tempActiveObj.textSettings.underline)) {
|
|
3478
3481
|
isApply = true;
|
|
3479
3482
|
}
|
|
3480
3483
|
if (this.isInitialTextEdited && !isApply) {
|
|
@@ -4222,6 +4225,9 @@ var Selection = /** @class */ (function () {
|
|
|
4222
4225
|
isInside = true;
|
|
4223
4226
|
}
|
|
4224
4227
|
}
|
|
4228
|
+
else if (parent.textArea.style.display === 'block') {
|
|
4229
|
+
isInside = true;
|
|
4230
|
+
}
|
|
4225
4231
|
if (!isInside) {
|
|
4226
4232
|
if (isNullOrUndefined(parent.activeObj.currIndex)) {
|
|
4227
4233
|
parent.activeObj.currIndex = 'shape_' + (parent.objColl.length + 1);
|
|
@@ -606,6 +606,7 @@ var Shape = /** @class */ (function () {
|
|
|
606
606
|
parent.textArea.style.transform = '';
|
|
607
607
|
parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
|
|
608
608
|
}
|
|
609
|
+
this.refreshActiveObj();
|
|
609
610
|
}
|
|
610
611
|
else {
|
|
611
612
|
this.applyActObj(isMouseDown);
|
|
@@ -718,26 +718,36 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
718
718
|
ToolbarModule.prototype.renderAnnotationBtn = function (isContextualToolbar) {
|
|
719
719
|
var _this = this;
|
|
720
720
|
var parent = this.parent;
|
|
721
|
+
var isCustomized = false;
|
|
721
722
|
var items = [];
|
|
722
|
-
|
|
723
|
+
var defItems = ['Ellipse', 'Arrow', 'Line', 'Rectangle', 'Pen', 'Path', 'Text'];
|
|
724
|
+
if (parent.toolbar) {
|
|
725
|
+
for (var i = 0; i < defItems.length; i++) {
|
|
726
|
+
if (parent.toolbar.indexOf(defItems[i]) !== -1) {
|
|
727
|
+
isCustomized = true;
|
|
728
|
+
break;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Pen') > -1)) {
|
|
723
733
|
items.push({ text: this.l10n.getConstant('Pen'), id: 'pen', iconCss: 'e-icons e-free-pen' });
|
|
724
734
|
}
|
|
725
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Line') > -1)) {
|
|
735
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Line') > -1)) {
|
|
726
736
|
items.push({ text: this.l10n.getConstant('Line'), id: 'line', iconCss: 'e-icons e-line' });
|
|
727
737
|
}
|
|
728
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Rectangle') > -1)) {
|
|
738
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Rectangle') > -1)) {
|
|
729
739
|
items.push({ text: this.l10n.getConstant('Rectangle'), id: 'rectangle', iconCss: 'e-icons e-rectangle' });
|
|
730
740
|
}
|
|
731
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Ellipse') > -1)) {
|
|
741
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Ellipse') > -1)) {
|
|
732
742
|
items.push({ text: this.l10n.getConstant('Ellipse'), id: 'ellipse', iconCss: 'e-icons e-circle' });
|
|
733
743
|
}
|
|
734
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Arrow') > -1)) {
|
|
744
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Arrow') > -1)) {
|
|
735
745
|
items.push({ text: this.l10n.getConstant('Arrow'), id: 'arrow', iconCss: 'e-icons e-arrow-right-up' });
|
|
736
746
|
}
|
|
737
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Path') > -1)) {
|
|
747
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Path') > -1)) {
|
|
738
748
|
items.push({ text: this.l10n.getConstant('Path'), id: 'path', iconCss: 'e-icons e-critical-path' });
|
|
739
749
|
}
|
|
740
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Text') > -1)) {
|
|
750
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Text') > -1)) {
|
|
741
751
|
items.push({ text: this.l10n.getConstant('Text'), id: 'text', iconCss: 'e-icons e-add-text' });
|
|
742
752
|
}
|
|
743
753
|
var obj = { freehandDrawSelectedId: null };
|
|
@@ -842,16 +852,26 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
842
852
|
var _this = this;
|
|
843
853
|
var parent = this.parent;
|
|
844
854
|
var items = [];
|
|
845
|
-
|
|
855
|
+
var isCustomized = false;
|
|
856
|
+
var defItems = ['CustomSelection', 'CircleSelection', 'SquareSelection', 'RatioSelection'];
|
|
857
|
+
if (parent.toolbar) {
|
|
858
|
+
for (var i = 0; i < defItems.length; i++) {
|
|
859
|
+
if (parent.toolbar.indexOf(defItems[i]) !== -1) {
|
|
860
|
+
isCustomized = true;
|
|
861
|
+
break;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('CustomSelection') > -1)) {
|
|
846
866
|
items.push({ text: this.l10n.getConstant('Custom'), id: 'custom', iconCss: 'e-icons e-custom' });
|
|
847
867
|
}
|
|
848
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('CircleSelection') > -1)) {
|
|
868
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('CircleSelection') > -1)) {
|
|
849
869
|
items.push({ text: this.l10n.getConstant('Circle'), id: 'circle', iconCss: 'e-icons e-circle' });
|
|
850
870
|
}
|
|
851
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('SquareSelection') > -1)) {
|
|
871
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('SquareSelection') > -1)) {
|
|
852
872
|
items.push({ text: this.l10n.getConstant('Square'), id: 'square', iconCss: 'e-icons e-square' });
|
|
853
873
|
}
|
|
854
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('RatioSelection') > -1)) {
|
|
874
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('RatioSelection') > -1)) {
|
|
855
875
|
items.push({ text: '3:2', id: '3:2', iconCss: 'e-icons e-custom-a' });
|
|
856
876
|
items.push({ text: '4:3', id: '4:3', iconCss: 'e-icons e-custom-b' });
|
|
857
877
|
items.push({ text: '5:4', id: '5:4', iconCss: 'e-icons e-custom-c' });
|
|
@@ -869,8 +889,8 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
869
889
|
shape = parent.currSelectionPoint.shape;
|
|
870
890
|
}
|
|
871
891
|
else {
|
|
872
|
-
iconCss =
|
|
873
|
-
shape =
|
|
892
|
+
iconCss = items[0].iconCss;
|
|
893
|
+
shape = items[0].id;
|
|
874
894
|
}
|
|
875
895
|
var drpDownBtn = new DropDownButton({
|
|
876
896
|
open: function (args) {
|
|
@@ -952,15 +972,29 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
952
972
|
template: '<button id="' + parent.element.id + '_cropBtn"></button>'
|
|
953
973
|
});
|
|
954
974
|
toolbarItems.push({ align: 'Center', type: 'Separator' });
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
975
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
|
|
976
|
+
parent.toolbar.indexOf('RotateLeft') > -1))) {
|
|
977
|
+
toolbarItems.push({ id: parent.element.id + '_rotateLeft', prefixIcon: 'e-icons e-anti-clock-wise',
|
|
978
|
+
tooltipText: this.l10n.getConstant('RotateLeft'), align: 'Center' });
|
|
979
|
+
}
|
|
980
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
|
|
981
|
+
parent.toolbar.indexOf('RotateRight') > -1))) {
|
|
982
|
+
toolbarItems.push({ id: parent.element.id + '_rotateRight', prefixIcon: 'e-icons e-clock-wise',
|
|
983
|
+
tooltipText: this.l10n.getConstant('RotateRight'), align: 'Center' });
|
|
984
|
+
}
|
|
985
|
+
if (toolbarItems.length > 2) {
|
|
986
|
+
toolbarItems.push({ align: 'Center', type: 'Separator' });
|
|
987
|
+
}
|
|
988
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
|
|
989
|
+
parent.toolbar.indexOf('HorizontalFlip') > -1))) {
|
|
990
|
+
toolbarItems.push({ id: parent.element.id + '_horizontalFlip', prefixIcon: 'e-icons e-horizontal-flip',
|
|
991
|
+
tooltipText: this.l10n.getConstant('HorizontalFlip'), align: 'Center' });
|
|
992
|
+
}
|
|
993
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
|
|
994
|
+
parent.toolbar.indexOf('VerticalFlip') > -1))) {
|
|
995
|
+
toolbarItems.push({ id: parent.element.id + '_verticalFlip', prefixIcon: 'e-icons e-vertical-flip',
|
|
996
|
+
tooltipText: this.l10n.getConstant('VerticalFlip'), align: 'Center' });
|
|
997
|
+
}
|
|
964
998
|
if (!Browser.isDevice) {
|
|
965
999
|
toolbarItems.push({ id: parent.element.id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
966
1000
|
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
@@ -1066,7 +1100,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1066
1100
|
toolbar.refreshOverflow();
|
|
1067
1101
|
}
|
|
1068
1102
|
}
|
|
1069
|
-
parent.
|
|
1103
|
+
if (document.getElementById(parent.element.id + '_cropBtn')) {
|
|
1104
|
+
parent.select(document.getElementById(parent.element.id + '_cropBtn').textContent.toLowerCase());
|
|
1105
|
+
}
|
|
1070
1106
|
}
|
|
1071
1107
|
});
|
|
1072
1108
|
if (Browser.isDevice) {
|
|
@@ -1700,31 +1736,41 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1700
1736
|
ToolbarModule.prototype.getAdjustmentToolbarItem = function () {
|
|
1701
1737
|
var toolbarItems = [];
|
|
1702
1738
|
var parent = this.parent;
|
|
1703
|
-
|
|
1739
|
+
var isCustomized = false;
|
|
1740
|
+
var defItems = ['Brightness', 'Contrast', 'Hue', 'Saturation', 'Exposure', 'Opacity', 'Blur'];
|
|
1741
|
+
if (parent.toolbar) {
|
|
1742
|
+
for (var i = 0; i < defItems.length; i++) {
|
|
1743
|
+
if (parent.toolbar.indexOf(defItems[i]) !== -1) {
|
|
1744
|
+
isCustomized = true;
|
|
1745
|
+
break;
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Brightness') > -1)) {
|
|
1704
1750
|
toolbarItems.push({ id: parent.element.id + '_brightness', prefixIcon: 'e-icons e-brightness', cssClass: 'top-icon e-brightness',
|
|
1705
1751
|
tooltipText: this.l10n.getConstant('Brightness'), align: 'Center' });
|
|
1706
1752
|
}
|
|
1707
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Contrast') > -1)) {
|
|
1753
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Contrast') > -1)) {
|
|
1708
1754
|
toolbarItems.push({ id: parent.element.id + '_contrast', prefixIcon: 'e-icons e-contrast', cssClass: 'top-icon e-contrast',
|
|
1709
1755
|
tooltipText: this.l10n.getConstant('Contrast'), align: 'Center' });
|
|
1710
1756
|
}
|
|
1711
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Hue') > -1)) {
|
|
1757
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Hue') > -1)) {
|
|
1712
1758
|
toolbarItems.push({ id: parent.element.id + '_hue', prefixIcon: 'e-icons e-fade', cssClass: 'top-icon e-fade',
|
|
1713
1759
|
tooltipText: this.l10n.getConstant('Hue'), align: 'Center' });
|
|
1714
1760
|
}
|
|
1715
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Saturation') > -1)) {
|
|
1761
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Saturation') > -1)) {
|
|
1716
1762
|
toolbarItems.push({ id: parent.element.id + '_saturation', prefixIcon: 'e-icons e-saturation', cssClass: 'top-icon e-saturation',
|
|
1717
1763
|
tooltipText: this.l10n.getConstant('Saturation'), align: 'Center' });
|
|
1718
1764
|
}
|
|
1719
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Exposure') > -1)) {
|
|
1765
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Exposure') > -1)) {
|
|
1720
1766
|
toolbarItems.push({ id: parent.element.id + '_exposure', prefixIcon: 'e-icons e-grain', cssClass: 'top-icon e-grain',
|
|
1721
1767
|
tooltipText: this.l10n.getConstant('Exposure'), align: 'Center' });
|
|
1722
1768
|
}
|
|
1723
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Opacity') > -1)) {
|
|
1769
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Opacity') > -1)) {
|
|
1724
1770
|
toolbarItems.push({ id: parent.element.id + '_opacity', prefixIcon: 'e-icons e-opacity', cssClass: 'top-icon e-opacity',
|
|
1725
1771
|
tooltipText: this.l10n.getConstant('Opacity'), align: 'Center' });
|
|
1726
1772
|
}
|
|
1727
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Blur') > -1)) {
|
|
1773
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Blur') > -1)) {
|
|
1728
1774
|
toolbarItems.push({ id: parent.element.id + '_blur', prefixIcon: 'e-icons e-tint', cssClass: 'top-icon e-tint',
|
|
1729
1775
|
tooltipText: this.l10n.getConstant('Blur'), align: 'Center' });
|
|
1730
1776
|
}
|
|
@@ -1743,37 +1789,47 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1743
1789
|
ToolbarModule.prototype.getFilterToolbarItem = function () {
|
|
1744
1790
|
var toolbarItems = [];
|
|
1745
1791
|
var parent = this.parent;
|
|
1746
|
-
|
|
1792
|
+
var isCustomized = false;
|
|
1793
|
+
var defItems = ['Default', 'Chrome', 'Cold', 'Warm', 'Grayscale', 'Sepia', 'Invert'];
|
|
1794
|
+
if (parent.toolbar) {
|
|
1795
|
+
for (var i = 0; i < defItems.length; i++) {
|
|
1796
|
+
if (parent.toolbar.indexOf(defItems[i]) !== -1) {
|
|
1797
|
+
isCustomized = true;
|
|
1798
|
+
break;
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Default') > -1)) {
|
|
1747
1803
|
toolbarItems.push({ id: parent.element.id + '_default', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
1748
1804
|
tooltipText: this.l10n.getConstant('Default'), align: 'Center',
|
|
1749
1805
|
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_defaultCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Default') + '</span></div></div>' });
|
|
1750
1806
|
}
|
|
1751
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Chrome') > -1)) {
|
|
1807
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Chrome') > -1)) {
|
|
1752
1808
|
toolbarItems.push({ id: parent.element.id + '_chrome', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
1753
1809
|
tooltipText: this.l10n.getConstant('Chrome'), align: 'Center',
|
|
1754
1810
|
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_chromeCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Chrome') + '</span></div></div>' });
|
|
1755
1811
|
}
|
|
1756
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Cold') > -1)) {
|
|
1812
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Cold') > -1)) {
|
|
1757
1813
|
toolbarItems.push({ id: parent.element.id + '_cold', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
1758
1814
|
tooltipText: this.l10n.getConstant('Cold'), align: 'Center',
|
|
1759
1815
|
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_coldCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Cold') + '</span></div></div>' });
|
|
1760
1816
|
}
|
|
1761
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Warm') > -1)) {
|
|
1817
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Warm') > -1)) {
|
|
1762
1818
|
toolbarItems.push({ id: parent.element.id + '_warm', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
1763
1819
|
tooltipText: this.l10n.getConstant('Warm'), align: 'Center',
|
|
1764
1820
|
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_warmCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Warm') + '</span></div></div>' });
|
|
1765
1821
|
}
|
|
1766
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Grayscale') > -1)) {
|
|
1822
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Grayscale') > -1)) {
|
|
1767
1823
|
toolbarItems.push({ id: parent.element.id + '_grayscale', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
1768
1824
|
tooltipText: this.l10n.getConstant('Grayscale'), align: 'Center',
|
|
1769
1825
|
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_grayscaleCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Grayscale') + '</span></div></div>' });
|
|
1770
1826
|
}
|
|
1771
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Sepia') > -1)) {
|
|
1827
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Sepia') > -1)) {
|
|
1772
1828
|
toolbarItems.push({ id: parent.element.id + '_sepia', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
1773
1829
|
tooltipText: this.l10n.getConstant('Sepia'), align: 'Center',
|
|
1774
1830
|
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_sepiaCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Sepia') + '</span></div></div>' });
|
|
1775
1831
|
}
|
|
1776
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Invert') > -1)) {
|
|
1832
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Invert') > -1)) {
|
|
1777
1833
|
toolbarItems.push({ id: parent.element.id + '_invert', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
1778
1834
|
tooltipText: this.l10n.getConstant('Invert'), align: 'Center',
|
|
1779
1835
|
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_invertCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Invert') + '</span></div></div>' });
|
|
@@ -2047,7 +2103,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2047
2103
|
if (hdrWrapper) {
|
|
2048
2104
|
hdrWrapper.style.display = 'none';
|
|
2049
2105
|
}
|
|
2050
|
-
document.getElementById(parent.currentFilter + 'Canvas')
|
|
2106
|
+
if (document.getElementById(parent.currentFilter + 'Canvas')) {
|
|
2107
|
+
document.getElementById(parent.currentFilter + 'Canvas').parentElement.parentElement.classList.add('e-selected');
|
|
2108
|
+
}
|
|
2051
2109
|
_this.enableDisableTbrBtn();
|
|
2052
2110
|
toolbar.refreshOverflow();
|
|
2053
2111
|
}
|
|
@@ -2838,7 +2896,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2838
2896
|
for (var _i = 0, selectors_1 = selectors; _i < selectors_1.length; _i++) {
|
|
2839
2897
|
var selector = selectors_1[_i];
|
|
2840
2898
|
var element = document.querySelector(selector);
|
|
2841
|
-
if (element.classList.contains('e-selected-btn')) {
|
|
2899
|
+
if (element && element.classList.contains('e-selected-btn')) {
|
|
2842
2900
|
element.classList.remove('e-selected-btn');
|
|
2843
2901
|
break;
|
|
2844
2902
|
}
|
package/tslint.json
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"rules": {
|
|
3
|
+
"chai-vague-errors": true,
|
|
4
|
+
"use-isnan": true,
|
|
5
|
+
"missing-jsdoc": true,
|
|
6
|
+
"missing-optional-annotation": true,
|
|
7
|
+
"no-backbone-get-set-outside-model": true,
|
|
8
|
+
"no-banned-terms": true,
|
|
9
|
+
"no-constant-condition": true,
|
|
10
|
+
"no-control-regex": true,
|
|
11
|
+
"no-cookies": true,
|
|
12
|
+
"no-delete-expression": true,
|
|
13
|
+
"no-document-write": true,
|
|
14
|
+
"no-document-domain": true,
|
|
15
|
+
"no-disable-auto-sanitization": true,
|
|
16
|
+
"no-duplicate-case": true,
|
|
17
|
+
"no-duplicate-parameter-names": true,
|
|
18
|
+
"no-empty-interfaces": true,
|
|
19
|
+
"no-exec-script": true,
|
|
20
|
+
"no-function-constructor-with-string-args": true,
|
|
21
|
+
"no-function-expression": true,
|
|
22
|
+
"no-invalid-regexp": true,
|
|
23
|
+
"no-for-in": true,
|
|
24
|
+
"member-access": true,
|
|
25
|
+
"no-multiline-string": true,
|
|
26
|
+
"no-multiple-var-decl": true,
|
|
27
|
+
"no-unnecessary-bind": true,
|
|
28
|
+
"no-unnecessary-semicolons": true,
|
|
29
|
+
"no-octal-literal": true,
|
|
30
|
+
"no-regex-spaces": true,
|
|
31
|
+
"no-sparse-arrays": true,
|
|
32
|
+
"no-string-based-set-immediate": true,
|
|
33
|
+
"no-string-based-set-interval": true,
|
|
34
|
+
"no-unused-imports": true,
|
|
35
|
+
"no-with-statement": true,
|
|
36
|
+
"prefer-array-literal": true,
|
|
37
|
+
"promise-must-complete": false,
|
|
38
|
+
"react-no-dangerous-html": true,
|
|
39
|
+
"use-named-parameter": true,
|
|
40
|
+
"valid-typeof": true,
|
|
41
|
+
"max-func-body-length": [true, 100, {
|
|
42
|
+
"ignore-parameters-to-function-regex": "describe"
|
|
43
|
+
}],
|
|
44
|
+
"class-name": true,
|
|
45
|
+
"curly": true,
|
|
46
|
+
"eofline": false,
|
|
47
|
+
"forin": true,
|
|
48
|
+
"indent": [
|
|
49
|
+
true,
|
|
50
|
+
"spaces"
|
|
51
|
+
],
|
|
52
|
+
"label-position": true,
|
|
53
|
+
"max-line-length": [true, 140],
|
|
54
|
+
"no-arg": true,
|
|
55
|
+
"no-console": [true,
|
|
56
|
+
"debug",
|
|
57
|
+
"info",
|
|
58
|
+
"log",
|
|
59
|
+
"time",
|
|
60
|
+
"timeEnd",
|
|
61
|
+
"trace"
|
|
62
|
+
],
|
|
63
|
+
"no-construct": true,
|
|
64
|
+
"no-parameter-properties": true,
|
|
65
|
+
"no-debugger": true,
|
|
66
|
+
"no-duplicate-variable": true,
|
|
67
|
+
"no-empty": true,
|
|
68
|
+
"no-eval": true,
|
|
69
|
+
"no-string-literal": true,
|
|
70
|
+
"no-switch-case-fall-through": true,
|
|
71
|
+
"trailing-comma": true,
|
|
72
|
+
"no-trailing-whitespace": true,
|
|
73
|
+
"no-unused-expression": true,
|
|
74
|
+
"no-use-before-declare": false,
|
|
75
|
+
"no-var-requires": true,
|
|
76
|
+
"one-line": [true,
|
|
77
|
+
"check-open-brace",
|
|
78
|
+
"check-catch",
|
|
79
|
+
"check-else",
|
|
80
|
+
"check-whitespace"
|
|
81
|
+
],
|
|
82
|
+
"no-any": true,
|
|
83
|
+
"no-conditional-assignment": true,
|
|
84
|
+
"no-angle-bracket-type-assertion": false,
|
|
85
|
+
"align": [true, "parameters", "arguments", "statements"],
|
|
86
|
+
"no-empty-line-after-opening-brace": false,
|
|
87
|
+
"typedef-whitespace": [false],
|
|
88
|
+
"ban": true,
|
|
89
|
+
"quotemark": [true, "single"],
|
|
90
|
+
"semicolon": true,
|
|
91
|
+
"triple-equals": [true, "allow-null-check"],
|
|
92
|
+
"typedef": [true,
|
|
93
|
+
"call-signature",
|
|
94
|
+
"parameter",
|
|
95
|
+
"property-declaration",
|
|
96
|
+
"variable-declaration",
|
|
97
|
+
"arrow-parameter",
|
|
98
|
+
"member-variable-declaration"],
|
|
99
|
+
"variable-name": true,
|
|
100
|
+
"whitespace": [true,
|
|
101
|
+
"check-branch",
|
|
102
|
+
"check-decl",
|
|
103
|
+
"check-operator",
|
|
104
|
+
"check-separator",
|
|
105
|
+
"check-type"
|
|
106
|
+
],
|
|
107
|
+
"jsdoc-format": true,
|
|
108
|
+
"no-var-keyword": true,
|
|
109
|
+
"radix": true
|
|
110
|
+
}
|
|
111
|
+
}
|