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 +='
' + - '
{{tree.name}}
' + + '
{{tree.name}}
' + '' + '
'; } @@ -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}}' + '' + '
' + '' + @@ -75,6 +75,16 @@ angular.module("umbraco.directives") emitEvent("treeNodeSelect", { element: e, tree: scope.tree, node: n, event: ev }); }; + /** + Method called when an item is right-clicked in the tree, this passes the + DOM element, the tree node object and the original click + and emits it as a treeNodeSelect element if there is a callback object + defined on the tree + */ + scope.altSelect = function(e,n,ev){ + emitEvent("treeNodeAltSelect", { element: e, tree: scope.tree, node: n, event: ev }); + }; + /** method to set the current animation for the node. * This changes dynamically based on if we are changing sections or just loading normal tree data. * When changing sections we don't want all of the tree-ndoes to do their 'leave' animations. diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/utill.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/utill.directive.js index f9a4f94737..2bca517e10 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/utill.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/utill.directive.js @@ -33,4 +33,17 @@ angular.module('umbraco.directives') scope.$apply(attrs.onFocus); }); }; +}) + +.directive('onRightClick',function(){ + document.oncontextmenu = function (e) { + if(e.target.hasAttribute('on-right-click')) { + return false; + } + }; + return function(scope,el,attrs){ + el.bind('contextmenu',function(e){ + scope.$apply(attrs.onRightClick); + }) ; + }; }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/filters/timespan.filter.js b/src/Umbraco.Web.UI.Client/src/common/filters/timespan.filter.js new file mode 100644 index 0000000000..f12aa4054a --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/filters/timespan.filter.js @@ -0,0 +1,15 @@ +angular.module("umbraco.filters").filter('timespan', function() { + return function(input) { + var sec_num = parseInt(input, 10); + var hours = Math.floor(sec_num / 3600); + var minutes = Math.floor((sec_num - (hours * 3600)) / 60); + var seconds = sec_num - (hours * 3600) - (minutes * 60); + + if (hours < 10) {hours = "0"+hours;} + if (minutes < 10) {minutes = "0"+minutes;} + if (seconds < 10) {seconds = "0"+seconds;} + var time = hours+':'+minutes+':'+seconds; + return time; + }; + }); + \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/services/keyboard.service.js b/src/Umbraco.Web.UI.Client/src/common/services/keyboard.service.js index 53b677aabb..a0306e11c6 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/keyboard.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/keyboard.service.js @@ -11,11 +11,20 @@ angular.module('umbraco.services') 'keyCode': false }; + var isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0; + // Store all keyboard combination shortcuts keyboardManagerService.keyboardEvent = {}; + // Add a new keyboard combination shortcut keyboardManagerService.bind = function (label, callback, opt) { + + //replace ctrl key with meta key + if(isMac){ + label = label.replace("ctrl","meta"); + } + var fct, elt, code, k; // Initialize opt object opt = angular.extend({}, defaultOpt, opt); diff --git a/src/Umbraco.Web.UI.Client/src/common/services/localization.service.js b/src/Umbraco.Web.UI.Client/src/common/services/localization.service.js index 4f09611ef5..886a8b8488 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/localization.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/localization.service.js @@ -52,7 +52,7 @@ angular.module('umbraco.services') if(value){ var localizer = value.split(':'); var retval = {tokens: undefined, key: localizer[0].substring(0)}; - if(localizer.length > 0){ + if(localizer.length > 1){ retval.tokens = localizer[1].split(','); for (var x = 0; x < retval.tokens.length; x++) { retval.tokens[x] = scope.$eval(retval.tokens[x]); @@ -65,13 +65,19 @@ angular.module('umbraco.services') // checks the dictionary for a localized resource string localize: function(value,tokens) { + var deferred = $q.defer(); + if(service.resourceFileLoaded){ - return service._lookup(value,tokens); + var val = service._lookup(value,tokens); + deferred.resolve(val); }else{ service.initLocalizedResources().then(function(dic){ - return service._lookup(value,tokens); + var val = service._lookup(value,tokens); + deferred.resolve(val); }); } + + return deferred.promise; }, _lookup: function(value,tokens){ var entry = service.dictionary[value]; diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index 03c2598c79..053cfabca5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -230,13 +230,14 @@ angular.module('umbraco.services') return; } - service.active = false; - - $timeout(function(){ - if(!service.active){ - service.hideTree(); - } - }, 300); + if(!service.touchDevice){ + service.active = false; + $timeout(function(){ + if(!service.active){ + service.hideTree(); + } + }, 300); + } }, /** diff --git a/src/Umbraco.Web.UI.Client/src/less/panel.less b/src/Umbraco.Web.UI.Client/src/less/panel.less index 2eeeca65e3..7522f97c43 100644 --- a/src/Umbraco.Web.UI.Client/src/less/panel.less +++ b/src/Umbraco.Web.UI.Client/src/less/panel.less @@ -5,7 +5,7 @@ position: absolute; top: 0px; bottom: 0px; left: 0px; right: 0px;} -.umb-panel-nobody{padding-top: 100px;} +.umb-panel-nobody{padding-top: 100px; overflow: auto;} .umb-panel-header { background: @grayLighter; border-bottom: 1px solid @grayLight; diff --git a/src/Umbraco.Web.UI.Client/src/less/tree.less b/src/Umbraco.Web.UI.Client/src/less/tree.less index 2aa2256860..6e3d534e2a 100644 --- a/src/Umbraco.Web.UI.Client/src/less/tree.less +++ b/src/Umbraco.Web.UI.Client/src/less/tree.less @@ -154,6 +154,7 @@ a.umb-options { position: absolute; right: 0px; top: 0px; + background: @grayLighter; } a.umb-options i { @@ -162,8 +163,7 @@ a.umb-options i { border-radius: 20px; background: #333; display: inline-block; - border: 3px solid @grayLighter; - margin: 10px -2px 0 0; + margin: 10px 2px 0 0; } li.root > div > a.umb-options { @@ -174,8 +174,6 @@ li.root > div > a.umb-options { .hide-header h5{display: none !important} - - .umb-icon-item { padding: 2px; padding-left: 55px; @@ -474,4 +472,10 @@ body.touch .umb-tree li div { font-size: 110%; } +body.touch .umb-actions a{ + padding: 14px 25px 14px 20px; + font-size: 110%; +} + +body.touch a.umb-options i {margin-top: 20px;} diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dashboard.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dashboard.controller.js index b3de721ec8..006146095a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dashboard.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dashboard.controller.js @@ -8,15 +8,17 @@ * */ -function DashboardController($scope, $routeParams, dashboardResource) { +function DashboardController($scope, $routeParams, dashboardResource, localizationService) { $scope.dashboard = {}; - $scope.dashboard.name = $routeParams.section; + localizationService.localize("sections_" + $routeParams.section).then(function(name){ + $scope.dashboard.name = name; + }); - dashboardResource.getDashboard($scope.dashboard.name).then(function(tabs){ + dashboardResource.getDashboard($routeParams.section).then(function(tabs){ $scope.dashboard.tabs = tabs; }); } //register it -angular.module('umbraco').controller("Umbraco.DashboardController", DashboardController); +angular.module('umbraco').controller("Umbraco.DashboardController", DashboardController); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html index 41b0fd5306..8c6d8bb569 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html @@ -2,14 +2,17 @@
- +

{{user.name}}

- Session expires in {{user.remainingAuthSeconds | number:0}} seconds + + : {{user.remainingAuthSeconds | timespan}}

@@ -18,15 +21,17 @@
-
Your profile
+

- Edit your profile + + Edit +

-
Your recent history
+