localization and visual tweaking

This commit is contained in:
perploug
2013-10-17 01:10:14 +02:00
parent eef44e97c5
commit aef7525354
7 changed files with 45 additions and 5 deletions

View File

@@ -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;
};
});

View File

@@ -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;

View File

@@ -14,6 +14,7 @@ function MainController($scope, $location, $routeParams, $rootScope, $timeout, $
//detect if the current device is touch-enabled
$scope.touchDevice = ("ontouchstart" in window || window.touch || window.navigator.msMaxTouchPoints===5 || window.DocumentTouch && document instanceof DocumentTouch);
//$scope.touchDevice = true;
navigationService.touchDevice = $scope.touchDevice;
//the null is important because we do an explicit bool check on this in the view

View File

@@ -59,6 +59,18 @@ function NavigationController($scope,$rootScope, $location, $log, $routeParams,
navigationService.showMenu(ev, args);
});
$scope.treeEventHandler.bind("treeNodeAltSelect", function (ev, args) {
ev.stopPropagation();
ev.preventDefault();
$scope.currentNode = args.node;
args.scope = $scope;
args.skipDefault = true;
navigationService.showMenu(ev, args);
});
//this reacts to the options item in the tree
$scope.searchShowMenu = function (ev, args) {
@@ -79,7 +91,10 @@ function NavigationController($scope,$rootScope, $location, $log, $routeParams,
var n = args.node;
//here we need to check for some legacy tree code
/*if(n.metaData && n.metaData.application){
$location.path(n.metaData.application).search("");
}else*/
if (n.metaData && n.metaData["jsClickCallback"] && angular.isString(n.metaData["jsClickCallback"]) && n.metaData["jsClickCallback"] !== "") {
//this is a legacy tree node!
var jsPrefix = "javascript:";
@@ -106,10 +121,13 @@ function NavigationController($scope,$rootScope, $location, $log, $routeParams,
historyService.add({ name: n.name, link: n.routePath, icon: n.icon });
//not legacy, lets just set the route value and clear the query string if there is one.
$location.path(n.routePath).search("");
}else if(n.metaData && n.metaData.application){
$location.path("#/" + n.metaData.application);
}
navigationService.hideNavigation();
});
/** Opens a dialog but passes in this scope instance to be used for the dialog */
$scope.openDialog = function (currentNode, action, currentSection) {

View File

@@ -1,7 +1,7 @@
<div class="umb-dialog-body with-footer" ng-controller="Umbraco.Editors.Content.CreateController">
<div class="umb-pane">
<h5><localize key="create_createunder">Create a page under</localize> {{currentNode.name}}</h5>
<h5><localize key="create_createUnder">Create a page under</localize> {{currentNode.name}}</h5>
<ul class="umb-actions umb-actions-child">
<li ng-repeat="docType in allowedTypes">

View File

@@ -1,7 +1,7 @@
<div class="umb-dialog-body with-footer" ng-controller="Umbraco.Editors.Media.CreateController">
<div class="umb-pane">
<h5>Create media under {{currentNode.name}}</h5>
<h5><localize key="create_createUnder">Create under</localize> {{currentNode.name}}</h5>
<ul class="umb-actions">
<li class="action">
<ul class="umb-actions-child">
@@ -39,5 +39,7 @@
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar">
<button class="btn" ng-click="nav.hideDialog()">Do something else</button>
<button class="btn" ng-click="nav.hideDialog()">
<localize key="buttons_somethingElse">Do something else</localize>
</button>
</div>