diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.controller.js index 60d762738f..4934adb5dd 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.controller.js @@ -13,25 +13,11 @@ function textAreaController($scope) { $scope.model.maxlength = false; if ($scope.model.config && $scope.model.config.maxChars) { $scope.model.maxlength = true; - if($scope.model.value == undefined) { - $scope.model.count = ($scope.model.config.maxChars * 1); - } else { - $scope.model.count = ($scope.model.config.maxChars * 1) - $scope.model.value.length; - } } - - $scope.model.change = function() { - if ($scope.model.config && $scope.model.config.maxChars) { - if($scope.model.value == undefined) { - $scope.model.count = ($scope.model.config.maxChars * 1); - } else { - $scope.model.count = ($scope.model.config.maxChars * 1) - $scope.model.value.length; - } - if($scope.model.count < 0) { - $scope.model.value = $scope.model.value.substring(0, ($scope.model.config.maxChars * 1)); - $scope.model.count = 0; - } - } + + $scope.model.change = function () { + $scope.model.count = $scope.model.value.length; } + $scope.model.change(); } -angular.module('umbraco').controller("Umbraco.PropertyEditors.textAreaController", textAreaController); \ No newline at end of file +angular.module('umbraco').controller("Umbraco.PropertyEditors.textAreaController", textAreaController); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.html index 2fdca5d654..80da759fba 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.html @@ -7,9 +7,12 @@ {{textareaFieldForm.textarea.errorMsg}} -
- {{model.count}} - characters left +
+ characters left
+
+ Maximum {0} characters ({1} too many) +
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js index 734903e46c..4ab827db59 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js @@ -4,39 +4,18 @@ function textboxController($scope) { if (!$scope.model.config) { $scope.model.config = {}; } - - $scope.model.maxlength = false; - if ($scope.model.config && $scope.model.config.maxChars) { - $scope.model.maxlength = true; - } - + if (!$scope.model.config.maxChars) { // 500 is the maximum number that can be stored // in the database, so set it to the max, even // if no max is specified in the config $scope.model.config.maxChars = 500; } - - if ($scope.model.maxlength) { - if ($scope.model.value === undefined) { - $scope.model.count = ($scope.model.config.maxChars * 1); - } else { - $scope.model.count = ($scope.model.config.maxChars * 1) - $scope.model.value.length; - } - } - + $scope.model.change = function () { - if ($scope.model.config && $scope.model.config.maxChars) { - if ($scope.model.value === undefined) { - $scope.model.count = ($scope.model.config.maxChars * 1); - } else { - $scope.model.count = ($scope.model.config.maxChars * 1) - $scope.model.value.length; - } - if ($scope.model.count < 0) { - $scope.model.value = $scope.model.value.substring(0, ($scope.model.config.maxChars * 1)); - $scope.model.count = 0; - } - } + $scope.model.count = $scope.model.value.length; } + $scope.model.change(); + } angular.module('umbraco').controller("Umbraco.PropertyEditors.textboxController", textboxController); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html index 6f6ed6bdf6..0e041e7f34 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html @@ -12,9 +12,12 @@ Required -
- {{model.count}} - characters left +
+ characters left
+
+ Maximum {0} characters ({1} too many) +
+
diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml index 875948d4d2..11dcd6ac57 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml @@ -1568,8 +1568,9 @@ Mange hilsner fra Umbraco robotten Ingen ordbog elementer at vælge imellem - - Karakterer tilbage + + >{0} tegn tilbage.]]> + {1} for mange.]]> Slettet indhold med Id: {0} Relateret til original "parent" med id: {1} diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml index fa6f689845..d10bc6ea0c 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml @@ -2078,8 +2078,9 @@ To manage your website, simply open the Umbraco back office and start adding con No Dictionary items to choose from - - characters left + + >{0} characters left.]]> + {1} too many.]]> Trashed content with Id: {0} related to original parent content with Id: {1} 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 6ff4d32f08..c04f639c3a 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -2090,8 +2090,9 @@ To manage your website, simply open the Umbraco back office and start adding con No Dictionary items to choose from - - characters left + + >{0} characters left.]]> + {1} too many.]]> Trashed content with Id: {0} related to original parent content with Id: {1}