diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbcontentname.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbcontentname.directive.js index 9f9d0b521f..59392de6b9 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbcontentname.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbcontentname.directive.js @@ -7,7 +7,7 @@ * Used by editors that require naming an entity. Shows a textbox/headline with a required validator within it's own form. **/ angular.module("umbraco.directives") - .directive('umbContentName', function ($timeout) { + .directive('umbContentName', function ($timeout, localizationService) { return { require: "ngModel", restrict: 'E', @@ -19,7 +19,13 @@ angular.module("umbraco.directives") }, link: function(scope, element, attrs, ngModel) { - var inputElement = element.find("input"); + var inputElement = element.find("input"); + if(scope.placeholder && scope.placeholder[0] === "@"){ + localizationService.localize(scope.placeholder.substring(1)) + .then(function(value){ + scope.placeholder = value; + }); + } ngModel.$render = function(){ $timeout(function(){ diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/hotkey.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/hotkey.directive.js index 8a992a9538..2f66acc36c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/hotkey.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/hotkey.directive.js @@ -4,8 +4,10 @@ **/ angular.module("umbraco.directives") .directive('hotkey', function ($window, keyboardService, $log) { + return function (scope, el, attrs) { var keyCombo = attrs["hotkey"]; + keyboardService.bind(keyCombo, function() { var element = $(el); if(element.is("a,button,input[type='button'],input[type='submit']")){ diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/localize.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/localize.directive.js index 578258a13b..113f24ad5f 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/localize.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/localize.directive.js @@ -8,8 +8,9 @@ angular.module("umbraco.directives") replace: true, link: function (scope, element, attrs) { var key = scope.key; - var value = localizationService.localize(key); - element.html(value); + localizationService.localize(key).then(function(value){ + element.html(value); + }); } }; }) @@ -19,26 +20,18 @@ angular.module("umbraco.directives") link: function (scope, element, attrs) { var keys = attrs.localize.split(','); - for (var i = keys.length - 1; i >= 0; i--) { - var attr = element.attr(keys[i]); - + angular.forEach(keys, function(value, key){ + var attr = element.attr(value); if(attr){ - var localizer = attr.split(':'); - var tokens; - var key = localizer[0]; - - if(localizer.length > 0){ - tokens = localizer[1].split(','); - for (var x = 0; x < tokens.length; x++) { - tokens[x] = scope.$eval(tokens[x]); - } - } - - if(key[0] === '@'){ - element.attr(keys[i], localizationService.localize(key.substring(1), tokens)); + if(attr[0] === '@'){ + var t = localizationService.tokenize(attr.substring(1), scope); + localizationService.localize(t.key, t.tokens).then(function(val){ + element.attr(value, val); + }); } } - } + }); + } }; }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umbtree.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umbtree.directive.js index d638d4fcf1..5e31e10a5e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/umbtree.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/umbtree.directive.js @@ -32,7 +32,7 @@ angular.module("umbraco.directives") if(!hideheader){ template +='
'; } @@ -126,7 +126,10 @@ angular.module("umbraco.directives") emitEvent("treeNodeSelect", { element: e, node: n, event: ev }); }; - + scope.altSelect = function(e,n,ev){ + emitEvent("treeNodeAltSelect", { element: e, tree: scope.tree, node: n, event: ev }); + }; + //watch for section changes scope.$watch("section", function (newVal, oldVal) { diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js index b7c1bdda8b..dc63e7e7be 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js @@ -37,7 +37,7 @@ angular.module("umbraco.directives") '' + '' + '' + - '{{node.name}}' + + '{{node.name}}' + '' + '
- Session expires in {{user.remainingAuthSeconds | number:0}} seconds
+
+