From 83b4b6a5f4d84f5e57cdbb55f8d4970df1af28a4 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sat, 8 Jun 2019 22:50:56 +0200 Subject: [PATCH 1/3] Annotate each crop with "Automatic" or "User defined" --- .../src/less/property-editors.less | 16 ++++++++++++++-- .../imagecropper/imagecropper.controller.js | 6 +++++- .../imagecropper/imagecropper.html | 2 ++ src/Umbraco.Web.UI/Umbraco/config/lang/da.xml | 2 ++ src/Umbraco.Web.UI/Umbraco/config/lang/en.xml | 2 ++ src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml | 8 +++++--- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index 9e8dd37ab9..3ff8432f07 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -710,7 +710,8 @@ } .imagecropper .umb-sortable-thumbnails li .crop-name, - .imagecropper .umb-sortable-thumbnails li .crop-size { + .imagecropper .umb-sortable-thumbnails li .crop-size, + .imagecropper .umb-sortable-thumbnails li .crop-annotation { display: block; text-align: left; font-size: 13px; @@ -722,17 +723,28 @@ margin: 10px 0 5px; } - .imagecropper .umb-sortable-thumbnails li .crop-size { + .imagecropper .umb-sortable-thumbnails li .crop-size, + .imagecropper .umb-sortable-thumbnails li .crop-annotation { font-size: 10px; font-style: italic; margin: 0 0 5px; } + .imagecropper .umb-sortable-thumbnails li .crop-annotation { + color: @gray-6; + } + .btn-crop-delete { display: block; text-align: left; } + .imagecropper .cropList-container { + h5 { + margin-left: 10px; + margin-top: 0; + } + } // // folder-browser // -------------------------------------------------- diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js index b5ae731c94..3a8e6db8d8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js @@ -13,7 +13,7 @@ angular.module('umbraco') $scope.clear = clear; $scope.reset = reset; $scope.close = close; - $scope.focalPointChanged = focalPointChanged; + $scope.isCustomCrop = isCustomCrop; //declare a special method which will be called whenever the value has changed from the server $scope.model.onValueChanged = onValueChanged; @@ -201,6 +201,10 @@ angular.module('umbraco') $scope.imageCropperForm.$setDirty(); }; + function isCustomCrop(crop) { + return !!crop.coordinates; + } + var unsubscribe = $scope.$on("formSubmitting", function () { $scope.currentCrop = null; $scope.currentPoint = null; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html index 7438fa04da..5604ac553d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html @@ -58,6 +58,8 @@
{{value.alias}} {{value.width}}px x {{value.height}}px + User defined + Automatic
diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml index 9e6bdc5e57..b70f0f07af 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml @@ -1019,6 +1019,8 @@ Mange hilsner fra Umbraco robotten Nulstil Acceptér Fortryd + Automatisk + Brugerdefineret Vælg en version at sammenligne med den nuværende version diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml index 189bd9f10b..4bf77a48d6 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml @@ -1273,6 +1273,8 @@ To manage your website, simply open the Umbraco back office and start adding con Add new crop Done Undo edits + Automatic + User defined Select a version to compare with the current version diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml index 6ce6f82ccc..010fe7fb4a 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -1274,11 +1274,13 @@ To manage your website, simply open the Umbraco back office and start adding con Enter the link - Reset crop + Reset crop Save crop Add new crop - Done - Undo edits + Done + Undo edits + Automatic + User defined Select a version to compare with the current version From 6425592cc587b072129fe7bfbf520bb18c635a83 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sun, 9 Jun 2019 12:11:45 +0200 Subject: [PATCH 2/3] Only show "custom crop" text ("automatic crop" is implicit) --- .../src/views/propertyeditors/imagecropper/imagecropper.html | 3 +-- src/Umbraco.Web.UI/Umbraco/config/lang/da.xml | 1 - src/Umbraco.Web.UI/Umbraco/config/lang/en.xml | 1 - src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html index 5604ac553d..e2428cec05 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html @@ -58,8 +58,7 @@
{{value.alias}} {{value.width}}px x {{value.height}}px - User defined - Automatic + User defined 
diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml index b70f0f07af..15ee17ca3a 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml @@ -1019,7 +1019,6 @@ Mange hilsner fra Umbraco robotten Nulstil Acceptér Fortryd - Automatisk Brugerdefineret diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml index 4bf77a48d6..1035848a1c 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml @@ -1273,7 +1273,6 @@ To manage your website, simply open the Umbraco back office and start adding con Add new crop Done Undo edits - Automatic User defined diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml index 010fe7fb4a..35d89d283f 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -1279,7 +1279,6 @@ To manage your website, simply open the Umbraco back office and start adding con Add new crop Done Undo edits - Automatic User defined From 201c91d3a8e90409a0b949249b8cc9b853835d50 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sun, 9 Jun 2019 12:32:27 +0200 Subject: [PATCH 3/3] Whoops, accidental removal of focalPointChanged --- .../propertyeditors/imagecropper/imagecropper.controller.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js index 3a8e6db8d8..e3576426a3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.controller.js @@ -14,6 +14,7 @@ angular.module('umbraco') $scope.reset = reset; $scope.close = close; $scope.isCustomCrop = isCustomCrop; + $scope.focalPointChanged = focalPointChanged; //declare a special method which will be called whenever the value has changed from the server $scope.model.onValueChanged = onValueChanged;