diff options
Diffstat (limited to 'www/js/TimelineCtrl.js')
| -rw-r--r-- | www/js/TimelineCtrl.js | 162 |
1 files changed, 155 insertions, 7 deletions
diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index 47c061a7..e81b9fec 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -37,18 +37,19 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla return (Math.round(1000 / (myframes / mylen))); }; - - $scope.move = function (percentage) { - var range = timeline.getWindow(); + function move(percentage) + { + var range = timeline.getWindow(); var interval = range.end - range.start; timeline.setWindow({ start: range.start.valueOf() - interval * percentage, end: range.end.valueOf() - interval * percentage }); - }; + } - $scope.zoom = function (percentage) { + function zoom (percentage) + { var range = timeline.getWindow(); var interval = range.end - range.start; @@ -56,6 +57,16 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla start: range.start.valueOf() - interval * percentage, end: range.end.valueOf() + interval * percentage }); + } + + $scope.move = function (percentage) { + move(percentage); + + }; + + $scope.zoom = function (percentage) { + zoom(percentage); + }; @@ -338,14 +349,15 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla var maxItems = 200; // THAT magic # --> 300 and ZM on my m/c cries $scope.maxItems = maxItems; - //flat colors for graph - https://flatuicolors.com - var colors = ['#3498db', '#83adb5', '#c7bbc9', '#f39c12', '#bfb5b2', '#e74c3c']; + //flat colors for graph - https://flatuicolors.com http://www.flatuicolorpicker.com + var colors = ['#3498db', '#D2527F', '#f39c12', '#9b59b6', '#e74c3c','#7A942E',]; var container; container = angular.element(document.getElementById('visualization')); var timeline = ""; $scope.monitors = message; + var navControls = true; $ionicPopover.fromTemplateUrl('templates/timeline-popover.html', { scope: $scope, @@ -365,6 +377,24 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla timeline.fit(); }; + $scope.toggleNav = function() + { + navControls=!navControls; + var element = angular.element(document.getElementById("timeline-ctrl")); + + if (navControls) + { + element.removeClass("animated bounceOutLeft"); + element.addClass("animated bounceInRight"); + } + else + { + element.removeClass("animated bounceInRight"); + element.addClass("animated bounceOutLeft"); + } + + }; + //------------------------------------------------- // Called with day/week/month // so we can redraw the graph @@ -560,5 +590,123 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla } + $scope.radialMenuOptions = { + content: '', + size:"small", + + background: '#982112', + isOpen: true, + toggleOnClick: false, + button: { + cssClass: "fa fa-arrows-alt", + size:"small", + }, + items: [ + { + content: '', + cssClass: 'fa fa-chevron-circle-up', + empty: false, + onclick: function () { + zoom(0.2); + } + }, + + { + content: '', + cssClass: 'fa fa-chevron-circle-up', + empty: true, + onclick: function () { + // controlPTZ($scope.monitorId, 'DownLeft'); + } + }, + + { + content: '', + cssClass: 'fa fa-chevron-circle-up', + empty: false, + + onclick: function () { + //controlPTZ($scope.monitorId, 'Left'); + move(0.2); + } + }, + { + content: 'D', + empty: true, + + onclick: function () { + console.log('About'); + } + }, + + { + content: '', + cssClass: 'fa fa-chevron-circle-up', + empty: true, + onclick: function () { + //controlPTZ($scope.monitorId, 'UpLeft'); + + } + }, + + { + content: '', + cssClass: 'fa fa-chevron-circle-up', + empty: false, + onclick: function () { + //controlPTZ($scope.monitorId, 'Up'); + zoom(-0.2); + } + }, + + { + content: '', + cssClass: 'fa fa-chevron-circle-up', + empty: true, + onclick: function () { + //controlPTZ($scope.monitorId, 'UpRight'); + + } + }, + + { + content: 'H', + empty: true, + onclick: function () { + console.log('About'); + } + }, + + { + content: '', + cssClass: 'fa fa-chevron-circle-up', + empty: false, + onclick: function () { + //controlPTZ($scope.monitorId, 'Right'); + move(-0.2); + } + }, + + + { + content: '', + cssClass: 'fa fa-chevron-circle-up', + empty: true, + onclick: function () { + //controlPTZ($scope.monitorId, 'DownRight'); + } + }, + + { + content: 'K', + empty: true, + onclick: function () { + console.log('About'); + } + }, + ]}; + + + }]); |
