From 9b9173d64fde540cb9128cb2dd4db5499d6e654d Mon Sep 17 00:00:00 2001 From: BatJan Date: Fri, 27 Jul 2018 11:24:29 +0200 Subject: [PATCH] Use the umbConfirmAction directive when deleting tags (#2795) --- .../src/less/property-editors.less | 49 +++- .../propertyeditors/tags/tags.controller.js | 39 ++- .../src/views/propertyeditors/tags/tags.html | 50 ++-- src/Umbraco.Web.UI/umbraco/config/lang/da.xml | 33 +-- src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 225 ++++++++--------- .../umbraco/config/lang/en_us.xml | 227 +++++++++--------- 6 files changed, 342 insertions(+), 281 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 6ec097af2b..e88d792b13 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -3,20 +3,20 @@ // -------------------------------------------------- .umb-editor { min-width:66.6%; - + &-pull { float:left; width:66.6%; } - + &-push { float:right; - } + } } .umb-editor-tiny { width: 60px; - + &.umb-editor-push { width:30%; min-width:0; @@ -53,7 +53,7 @@ float:right; width:35%; } - + &--pull, &--push { .umb-editor { min-width:0; @@ -372,7 +372,7 @@ ul.color-picker li a { > li:not(.unsortable) { cursor: move; } -} +} .umb-sortable-thumbnails li:hover .umb-sortable-thumbnails__actions { opacity: 1; @@ -902,10 +902,39 @@ ul.color-picker li a { // // Tags // -------------------------------------------------- -.umb-tags{border: @gray-10 solid 1px; padding: 10px; font-size: 13px; text-shadow: none;} -.umb-tags .tag{cursor: pointer; margin: 7px; padding: 7px; background: @turquoise} -.umb-tags .tag i{padding: 2px;} -.umb-tags input{border: none; background: @white} +.umb-tags{ + border: @gray-10 solid 1px; + padding: 10px; + font-size: 13px; + text-shadow: none; + + .tag{ + cursor: default; + margin: 7px; + padding: 10px; + background: @turquoise; + position: relative; + + .icon-trash{ + cursor: pointer; + padding: 2px; + font-size: 12px; + position: relative; + right: -6px; + } + + .umb_confirm-action__overlay.-left{ + top: 6px; + left: auto; + right: 15px; + } + } + + input{ + border: none; + background: @white; + } +} // // Date/time picker diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js index 745fe48d0f..15a67629e6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js @@ -5,11 +5,11 @@ angular.module("umbraco") var $typeahead; $scope.isLoading = true; - $scope.tagToAdd = ""; - + $scope.tagToAdd = ""; + function setModelValue(val) { - - $scope.model.value = val || $scope.model.value; + + $scope.model.value = val || $scope.model.value; if ($scope.model.value) { if (!$scope.model.config.storageType || $scope.model.config.storageType !== "Json") { //it is csv @@ -20,9 +20,9 @@ angular.module("umbraco") if($scope.model.value.length > 0) { // split the csv string, and remove any duplicate values var tempArray = $scope.model.value.split(',').map(function(v) { - return v.trim(); + return v.trim(); }); - + $scope.model.value = tempArray.filter(function(v, i, self) { return self.indexOf(v) === i; }); @@ -40,7 +40,7 @@ angular.module("umbraco") $scope.isLoading = false; //load current value - setModelValue(); + setModelValue(); // Method required by the valPropertyValidator directive (returns true if the property editor has at least one tag selected) $scope.validateMandatory = function () { @@ -64,7 +64,7 @@ angular.module("umbraco") $scope.addTagOnEnter = function (e) { var code = e.keyCode || e.which; - if (code == 13) { //Enter keycode + if (code == 13) { //Enter keycode if ($element.find('.tags-' + $scope.model.alias).parent().find(".tt-dropdown-menu .tt-cursor").length === 0) { //this is required, otherwise the html form will attempt to submit. e.preventDefault(); @@ -83,17 +83,38 @@ angular.module("umbraco") $typeahead.typeahead('val', ''); }; - + // Set the visible prompt to -1 to ensure it will not be visible + $scope.promptIsVisible = "-1"; $scope.removeTag = function (tag) { var i = $scope.model.value.indexOf(tag); + if (i >= 0) { + // Make sure to hide the prompt so it does not stay open because another item gets a new number in the array index + $scope.promptIsVisible = "-1"; + + // Remove the tag from the index $scope.model.value.splice(i, 1); + //this is required to re-validate $scope.propertyForm.tagCount.$setViewValue($scope.model.value.length); } }; + $scope.showPrompt = function (idx, tag){ + + var i = $scope.model.value.indexOf(tag); + + // Make the prompt visible for the clicked tag only + if (i === idx) { + $scope.promptIsVisible = i; + } + } + + $scope.hidePrompt = function(){ + $scope.promptIsVisible = "-1"; + } + //vice versa $scope.model.onValueChanged = function (newVal, oldVal) { //update the display val again if it has changed from the server diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html index 7e4de164de..18990b3e4a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.html @@ -1,27 +1,35 @@
- -
- Loading... -
-
+
+ Loading... +
- +
- - - - + - + + -
- -
\ No newline at end of file + + + + + + + + +
+ + diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml index 0ea581230c..90a8d574f4 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml @@ -132,6 +132,7 @@ Gem og generer modeller Fortryd Genskab + Slet tag For @@ -153,7 +154,7 @@ Indhold tilbagerullet Sendt til udgivelse Sendt til oversættelse - + For at skifte det valgte indholds dokumenttype, skal du først vælge en ny dokumenttype, som er gyldig på denne placering. Kontroller derefter, at alle egenskaber bliver overført rigtigt til den nye dokumenttype, og klik derefter på Gem. @@ -211,7 +212,7 @@ Dette dokument er udgivet, men dets url ville kollidere med indholdet %0% Udgiv Udgivet - Udgivet (Ventede ændringer) + Udgivet (Ventede ændringer) Udgivet Udgivelsesstatus Udgivelsesdato @@ -985,7 +986,7 @@ Mange hilsner fra Umbraco robotten Nulstil - + Nuværende version @@ -1149,19 +1150,19 @@ Mange hilsner fra Umbraco robotten Makro - En makro er et element, som kan have forskellige indstillinger, når det indsættes. + En makro er et element, som kan have forskellige indstillinger, når det indsættes. Brug det som en genbrugelig del af dit design såsom gallerier, formularer og lister. Sideværdi - Viser værdien af et felt fra den nuværende side. Kan indstilles til at bruge rekursive værdier eller + Viser værdien af et felt fra den nuværende side. Kan indstilles til at bruge rekursive værdier eller vise en standardværdi i tilfælde af, at feltet er tomt. Partial view - Et Partial View er et skabelonelement, som kan indsættes i andre skabeloner og derved + Et Partial View er et skabelonelement, som kan indsættes i andre skabeloner og derved genbruges og deles på tværs af sideskabelonerne. @@ -1172,7 +1173,7 @@ Mange hilsner fra Umbraco robotten Indsæt en underliggende skabelon @RenderBody() element. ]]> @@ -1181,8 +1182,8 @@ Mange hilsner fra Umbraco robotten Definer en sektion @section { ... }. Herefter kan denne sektion flettes ind i + Definerer en del af din skabelon som en navngivet sektion, ved at + omkranse den i @section { ... }. Herefter kan denne sektion flettes ind i overliggende skabelon ved at indsætte et @RenderSection element. ]]> @@ -1190,15 +1191,15 @@ Mange hilsner fra Umbraco robotten Indsæt en sektion @RenderSection(name) element. Den underliggende skabelon skal have + Henter indholdet af en sektion fra den underliggende skabelon ind, ved at indsætte et + @RenderSection(name) element. Den underliggende skabelon skal have defineret en sektion via et @section [name]{ ... } element. ]]> Sektionsnavn Sektionen er obligatorisk - + Hvis obligatorisk, skal underskabelonen indeholde en @section -definition. @@ -1210,7 +1211,7 @@ Mange hilsner fra Umbraco robotten Returner alt indhold indhold af typen "%0%" - + fra mit website hvor @@ -1242,14 +1243,14 @@ Mange hilsner fra Umbraco robotten Skabelon - + Rich Text Editor Billede Macro Embed Overskrift - Citat + Citat Vælg indholdstype Vælg layout Tilføj række @@ -1601,4 +1602,4 @@ Mange hilsner fra Umbraco robotten Karakterer tilbage - \ No newline at end of file + diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index b0548bae93..0d24970c54 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -138,6 +138,7 @@ Save and generate models Undo Redo + Delete tag Viewing for @@ -920,41 +921,41 @@ To manage your website, simply open the Umbraco back office and start adding con Umbraco: Reset Password - - - - - - + + + + + + + - - + +
+
- - - + + + -
- -
- -
+ +
+ +
-
+ - + - - - + + +
+

- - + + -
+
- - + +
+

Password reset requested

@@ -964,12 +965,12 @@ To manage your website, simply open the Umbraco back office and start adding con

- - + + +
+
Click this link to reset your password - -
@@ -981,22 +982,22 @@ To manage your website, simply open the Umbraco back office and start adding con %1% -

-
-
+ - -


- - - + +


+ + + - + ]]> @@ -1040,53 +1041,53 @@ To manage your website, simply open the Umbraco back office and start adding con
- - - - - - + + + + + + + - - + +
+
- - + + -
- -
- -
+ +
+ +
-
+ - + - - - + + -
+

- - + - +
+
- - +
+

Hi %0%,

-

+

This is an automated mail to inform you that the task '%1%' has been performed on the page '%2%' by the user '%3%'

- - @@ -1096,7 +1097,7 @@ To manage your website, simply open the Umbraco back office and start adding con

Update summary:

+ +
EDIT
%6% -
+

Have a nice day!

@@ -1108,10 +1109,10 @@ To manage your website, simply open the Umbraco back office and start adding con

-


+


@@ -1681,7 +1682,7 @@ To manage your website, simply open the Umbraco back office and start adding con Allow this property value to be displayed on the member profile page tab has no sort order - + Where is this composition used? This composition is currently used in the composition of the following content types: @@ -1936,41 +1937,41 @@ To manage your website, simply open the Umbraco back office and start adding con Umbraco: Invitation - - - - - - + + + + + + + - - + +
+
- - - + + + -
- -
- -
+ +
+ +
-
+
+ - - - + + +
+

- - + + -
+
- - + +
+

Hi %0%,

@@ -1988,12 +1989,12 @@ To manage your website, simply open the Umbraco back office and start adding con
- - + + +
+
Click this link to accept the invite - -
@@ -2008,22 +2009,22 @@ To manage your website, simply open the Umbraco back office and start adding con %3% -

-
-
+ - -


- - - + +


+ + + - + ]]>
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 e70c66b119..cbb86697c8 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -138,6 +138,7 @@ Save and generate models Undo Redo + Delete tag Viewing for @@ -918,41 +919,41 @@ To manage your website, simply open the Umbraco back office and start adding con Umbraco: Reset Password - - - - - - + + + + + + + - - + +
+
- - - + + + -
- -
- -
+ +
+ +
-
+ - + - - - + + +
+

- - + + -
+
- - + +
+

Password reset requested

@@ -962,12 +963,12 @@ To manage your website, simply open the Umbraco back office and start adding con

- - + + +
+
Click this link to reset your password - -
@@ -979,22 +980,22 @@ To manage your website, simply open the Umbraco back office and start adding con %1% -

-
-
+ - -


- - - + +


+ + + - + ]]> @@ -1038,53 +1039,53 @@ To manage your website, simply open the Umbraco back office and start adding con
- - - - - - + + + + + + + - - + +
+
- - + + -
- -
- -
+ +
+ +
-
+ - + - - - + + -
+

- - + - +
+
- - +
+

Hi %0%,

-

+

This is an automated mail to inform you that the task '%1%' has been performed on the page '%2%' by the user '%3%'

- - @@ -1094,7 +1095,7 @@ To manage your website, simply open the Umbraco back office and start adding con

Update summary:

+ +
EDIT
%6% -
+

Have a nice day!

@@ -1106,10 +1107,10 @@ To manage your website, simply open the Umbraco back office and start adding con

-


+


@@ -1273,7 +1274,7 @@ To manage your website, simply open the Umbraco back office and start adding con You have picked a media item currently deleted or in the recycle bin You have picked media items currently deleted or in the recycle bin Deleted item - Trashed + Trashed enter external link @@ -1674,7 +1675,7 @@ To manage your website, simply open the Umbraco back office and start adding con Allow this property value to be displayed on the member profile page tab has no sort order - + Where is this composition used? This composition is currently used in the composition of the following content types: @@ -1929,41 +1930,41 @@ To manage your website, simply open the Umbraco back office and start adding con Umbraco: Invitation - - - - - - + + + + + + + - - + +
+
- - - + + + -
- -
- -
+ +
+ +
-
+
+ - - - + + +
+

- - + + -
+
- - + +
+

Hi %0%,

@@ -1981,12 +1982,12 @@ To manage your website, simply open the Umbraco back office and start adding con
- - + + +
+
Click this link to accept the invite - -
@@ -2001,22 +2002,22 @@ To manage your website, simply open the Umbraco back office and start adding con %3% -

-
-
+ - -


- - - + +


+ + + - + ]]>