From a572462e8220d1531e357fa7c20c501a9f04b0ad Mon Sep 17 00:00:00 2001 From: nau Date: Mon, 5 Sep 2016 11:23:39 +0200 Subject: [PATCH] work strikes chart functionality implemented --- desktopapp/controllers.js | 45 ++++++- desktopapp/index.html | 18 ++- desktopapp/main.js | 2 +- desktopapp/package.json | 3 + webapp/controllers.js | 115 +++++++++++++++-- webapp/img/apibrowser.png | Bin 0 -> 17535 bytes webapp/img/browser.png | Bin 0 -> 11852 bytes webapp/img/codetags.png | Bin 0 -> 11815 bytes webapp/img/coding/adaptive-layout.png | Bin 0 -> 8394 bytes webapp/img/coding/api.png | Bin 0 -> 16392 bytes webapp/img/coding/binary-code.png | Bin 0 -> 9757 bytes webapp/img/coding/bugs-search-1.png | Bin 0 -> 13852 bytes webapp/img/coding/bugs-search.png | Bin 0 -> 11218 bytes webapp/img/coding/c-document.png | Bin 0 -> 7903 bytes webapp/img/coding/cloud-coding.png | Bin 0 -> 11280 bytes webapp/img/coding/code-rate.png | Bin 0 -> 13979 bytes webapp/img/coding/command-line.png | Bin 0 -> 4694 bytes webapp/img/coding/css-code.png | Bin 0 -> 6014 bytes webapp/img/coding/css-document.png | Bin 0 -> 8498 bytes webapp/img/coding/document-settings.png | Bin 0 -> 10524 bytes webapp/img/coding/editing-code.png | Bin 0 -> 6114 bytes webapp/img/coding/error-404.png | Bin 0 -> 5839 bytes webapp/img/coding/hacker.png | Bin 0 -> 8541 bytes webapp/img/coding/html-document.png | Bin 0 -> 7503 bytes webapp/img/coding/html.png | Bin 0 -> 6101 bytes webapp/img/coding/list.png | Bin 0 -> 6182 bytes webapp/img/coding/mobile-programming.png | Bin 0 -> 5793 bytes webapp/img/coding/password.png | Bin 0 -> 7190 bytes webapp/img/coding/php-code.png | Bin 0 -> 5743 bytes webapp/img/coding/php-document.png | Bin 0 -> 7655 bytes webapp/img/coding/program-interface.png | Bin 0 -> 6525 bytes webapp/img/coding/programming-1.png | Bin 0 -> 5811 bytes webapp/img/coding/programming.png | Bin 0 -> 9657 bytes webapp/img/coding/table.png | Bin 0 -> 6565 bytes webapp/img/coding/ui-design.png | Bin 0 -> 8930 bytes webapp/img/coding/ux-design.png | Bin 0 -> 6589 bytes webapp/img/coding/virus.png | Bin 0 -> 11625 bytes webapp/img/coding/web-interface.png | Bin 0 -> 6760 bytes webapp/img/diagram.png | Bin 0 -> 12038 bytes webapp/img/edit.png | Bin 0 -> 710 bytes webapp/img/monitor.png | Bin 0 -> 9163 bytes webapp/img/smartphone.png | Bin 0 -> 11550 bytes webapp/img/statistics.png | Bin 0 -> 13789 bytes webapp/img/tablet.png | Bin 0 -> 13254 bytes webapp/img/trash.png | Bin 0 -> 731 bytes webapp/index.html | 149 ++++++++++++----------- webapp/own.css | 6 + webapp/package.json | 24 ++++ 48 files changed, 273 insertions(+), 89 deletions(-) create mode 100644 webapp/img/apibrowser.png create mode 100644 webapp/img/browser.png create mode 100644 webapp/img/codetags.png create mode 100644 webapp/img/coding/adaptive-layout.png create mode 100644 webapp/img/coding/api.png create mode 100644 webapp/img/coding/binary-code.png create mode 100644 webapp/img/coding/bugs-search-1.png create mode 100644 webapp/img/coding/bugs-search.png create mode 100644 webapp/img/coding/c-document.png create mode 100644 webapp/img/coding/cloud-coding.png create mode 100644 webapp/img/coding/code-rate.png create mode 100644 webapp/img/coding/command-line.png create mode 100644 webapp/img/coding/css-code.png create mode 100644 webapp/img/coding/css-document.png create mode 100644 webapp/img/coding/document-settings.png create mode 100644 webapp/img/coding/editing-code.png create mode 100644 webapp/img/coding/error-404.png create mode 100644 webapp/img/coding/hacker.png create mode 100644 webapp/img/coding/html-document.png create mode 100644 webapp/img/coding/html.png create mode 100644 webapp/img/coding/list.png create mode 100644 webapp/img/coding/mobile-programming.png create mode 100644 webapp/img/coding/password.png create mode 100644 webapp/img/coding/php-code.png create mode 100644 webapp/img/coding/php-document.png create mode 100644 webapp/img/coding/program-interface.png create mode 100644 webapp/img/coding/programming-1.png create mode 100644 webapp/img/coding/programming.png create mode 100644 webapp/img/coding/table.png create mode 100644 webapp/img/coding/ui-design.png create mode 100644 webapp/img/coding/ux-design.png create mode 100644 webapp/img/coding/virus.png create mode 100644 webapp/img/coding/web-interface.png create mode 100644 webapp/img/diagram.png create mode 100644 webapp/img/edit.png create mode 100644 webapp/img/monitor.png create mode 100644 webapp/img/smartphone.png create mode 100644 webapp/img/statistics.png create mode 100644 webapp/img/tablet.png create mode 100644 webapp/img/trash.png create mode 100644 webapp/package.json diff --git a/desktopapp/controllers.js b/desktopapp/controllers.js index 656a647..74c9d32 100644 --- a/desktopapp/controllers.js +++ b/desktopapp/controllers.js @@ -1,5 +1,5 @@ -angular.module('workApp', []) +angular.module('workApp', ['chart.js']) .controller('workController', function( $scope, $interval @@ -16,11 +16,21 @@ angular.module('workApp', []) if($scope.projects.length>0) { $scope.newproject={ - id: $scope.projects[$scope.projects.length-1].id+1 + id: $scope.projects[$scope.projects.length-1].id+1, + chart: { + labels: [], + series: ['Working time'], + data: [] + } }; }else{ $scope.newproject={ - id: 0 + id: 0, + chart: { + labels: [], + series: ['Working time'], + data: [] + } }; } //$scope.newproject.id=$scope.projects[$scope.projects.length-1].id+1; @@ -29,7 +39,12 @@ angular.module('workApp', []) $scope.projects.push($scope.newproject); localStorage.setItem("w_l_projects", angular.toJson($scope.projects)); $scope.newproject={ - id: $scope.projects[$scope.projects.length-1].id+1 + id: $scope.projects[$scope.projects.length-1].id+1, + chart: { + labels: [], + series: ['Working time'], + data: [] + } }; }; $scope.editingIndex=""; @@ -48,6 +63,7 @@ angular.module('workApp', []) $scope.removeProject = function(index){ $scope.projects.splice(index, 1); localStorage.setItem("w_l_projects", angular.toJson($scope.projects)); + $scope.projectSelect(0); }; $scope.projectSelect = function(index){ $scope.btnStop(); @@ -66,8 +82,15 @@ angular.module('workApp', []) }; $scope.btnStop = function(){ $interval.cancel(interval); - $scope.working=false; - localStorage.setItem("w_l_projects", angular.toJson($scope.projects)); + if($scope.working==true) + { + $scope.working=false; + $scope.currentproject.chart.labels.push("work strike " + $scope.currentproject.chart.labels.length); + $scope.currentproject.chart.data.push($scope.currentStrike); + + localStorage.setItem("w_l_projects", angular.toJson($scope.projects)); + } + } @@ -84,6 +107,16 @@ angular.module('workApp', []) } }; + //chart + /*$scope.chart={ + labels: ['A', 'B', 'C', 'D', 'E', 'F', 'G'], + series: ['Working time', 'Series B'], + data: [ + [65, 59, 80, 81, 56, 55, 40], + [28, 48, 40, 19, 86, 27, 90] + ] + };*/ + }) .filter('secondsToDateTime', [function() { diff --git a/desktopapp/index.html b/desktopapp/index.html index 90df1d5..1b38524 100644 --- a/desktopapp/index.html +++ b/desktopapp/index.html @@ -23,7 +23,7 @@