diff --git a/desktopapp/controllers.js b/desktopapp/controllers.js index 772bfce..97f4503 100644 --- a/desktopapp/controllers.js +++ b/desktopapp/controllers.js @@ -1,29 +1,60 @@ angular.module('workApp', []) .controller('workController', function( - $scope + $scope, + $interval ) { $scope.username="user"; //localStorage.clear(); + $scope.working=false; $scope.projects=[]; + $scope.currentproject={}; if(localStorage.getItem("w_l_projects")) { $scope.projects=JSON.parse(localStorage.getItem("w_l_projects")); //w_local_ } - - $scope.newproject={}; - $scope.newproject.id=$scope.projects[$scope.projects.length-1].id+1; + if($scope.projects.length>0) + { + $scope.newproject={ + id: $scope.projects[$scope.projects.length-1].id+1 + }; + }else{ + $scope.newproject={ + id: 0 + }; + } + //$scope.newproject.id=$scope.projects[$scope.projects.length-1].id+1; $scope.addNewProject = function(){ $scope.newproject.totaltime="0"; $scope.projects.push($scope.newproject); localStorage.setItem("w_l_projects", angular.toJson($scope.projects)); - $scope.newproject={}; - $scope.newproject.id=$scope.projects.length+1; + $scope.newproject={ + id: $scope.projects[$scope.projects.length-1].id+1 + }; }; $scope.removeProject = function(index){ $scope.projects.splice(index, 1); localStorage.setItem("w_l_projects", angular.toJson($scope.projects)); }; + $scope.projectSelect = function(index){ + $scope.currentproject=$scope.projects[index]; + }; + var interval; + $scope.currentStrike=0; + $scope.btnWork = function(){ + $scope.working=true; + $scope.currentStrike=0; + interval = $interval(function(){ + $scope.currentStrike++; + $scope.currentproject.totaltime++; + }, 1000); + }; + $scope.btnStop = function(){ + $interval.cancel(interval); + $scope.working=false; + localStorage.setItem("w_l_projects", angular.toJson($scope.projects)); + + } $scope.openCode = function(){ toastr.info("Visiting code"); @@ -38,4 +69,10 @@ angular.module('workApp', []) } }; - }); + }) + + .filter('secondsToDateTime', [function() { + return function(seconds) { + return new Date(2016, 0, 1).setSeconds(seconds); + }; +}]); diff --git a/desktopapp/img/coding/adaptive-layout.png b/desktopapp/img/coding/adaptive-layout.png new file mode 100644 index 0000000..00610e1 Binary files /dev/null and b/desktopapp/img/coding/adaptive-layout.png differ diff --git a/desktopapp/img/coding/api.png b/desktopapp/img/coding/api.png new file mode 100644 index 0000000..6aed245 Binary files /dev/null and b/desktopapp/img/coding/api.png differ diff --git a/desktopapp/img/coding/binary-code.png b/desktopapp/img/coding/binary-code.png new file mode 100644 index 0000000..fc746f7 Binary files /dev/null and b/desktopapp/img/coding/binary-code.png differ diff --git a/desktopapp/img/coding/bugs-search-1.png b/desktopapp/img/coding/bugs-search-1.png new file mode 100644 index 0000000..a5cf069 Binary files /dev/null and b/desktopapp/img/coding/bugs-search-1.png differ diff --git a/desktopapp/img/coding/bugs-search.png b/desktopapp/img/coding/bugs-search.png new file mode 100644 index 0000000..89fa435 Binary files /dev/null and b/desktopapp/img/coding/bugs-search.png differ diff --git a/desktopapp/img/coding/c-document.png b/desktopapp/img/coding/c-document.png new file mode 100644 index 0000000..9b346f3 Binary files /dev/null and b/desktopapp/img/coding/c-document.png differ diff --git a/desktopapp/img/coding/cloud-coding.png b/desktopapp/img/coding/cloud-coding.png new file mode 100644 index 0000000..fa7139e Binary files /dev/null and b/desktopapp/img/coding/cloud-coding.png differ diff --git a/desktopapp/img/coding/code-rate.png b/desktopapp/img/coding/code-rate.png new file mode 100644 index 0000000..cd4f371 Binary files /dev/null and b/desktopapp/img/coding/code-rate.png differ diff --git a/desktopapp/img/coding/command-line.png b/desktopapp/img/coding/command-line.png new file mode 100644 index 0000000..a8b47c6 Binary files /dev/null and b/desktopapp/img/coding/command-line.png differ diff --git a/desktopapp/img/coding/css-code.png b/desktopapp/img/coding/css-code.png new file mode 100644 index 0000000..2980d0a Binary files /dev/null and b/desktopapp/img/coding/css-code.png differ diff --git a/desktopapp/img/coding/css-document.png b/desktopapp/img/coding/css-document.png new file mode 100644 index 0000000..347eb20 Binary files /dev/null and b/desktopapp/img/coding/css-document.png differ diff --git a/desktopapp/img/coding/document-settings.png b/desktopapp/img/coding/document-settings.png new file mode 100644 index 0000000..34fbc70 Binary files /dev/null and b/desktopapp/img/coding/document-settings.png differ diff --git a/desktopapp/img/coding/editing-code.png b/desktopapp/img/coding/editing-code.png new file mode 100644 index 0000000..d95f028 Binary files /dev/null and b/desktopapp/img/coding/editing-code.png differ diff --git a/desktopapp/img/coding/error-404.png b/desktopapp/img/coding/error-404.png new file mode 100644 index 0000000..b0c7f6b Binary files /dev/null and b/desktopapp/img/coding/error-404.png differ diff --git a/desktopapp/img/coding/hacker.png b/desktopapp/img/coding/hacker.png new file mode 100644 index 0000000..f241735 Binary files /dev/null and b/desktopapp/img/coding/hacker.png differ diff --git a/desktopapp/img/coding/html-document.png b/desktopapp/img/coding/html-document.png new file mode 100644 index 0000000..e9aed14 Binary files /dev/null and b/desktopapp/img/coding/html-document.png differ diff --git a/desktopapp/img/coding/html.png b/desktopapp/img/coding/html.png new file mode 100644 index 0000000..0f31e0b Binary files /dev/null and b/desktopapp/img/coding/html.png differ diff --git a/desktopapp/img/coding/list.png b/desktopapp/img/coding/list.png new file mode 100644 index 0000000..aab6c3d Binary files /dev/null and b/desktopapp/img/coding/list.png differ diff --git a/desktopapp/img/coding/mobile-programming.png b/desktopapp/img/coding/mobile-programming.png new file mode 100644 index 0000000..7081e42 Binary files /dev/null and b/desktopapp/img/coding/mobile-programming.png differ diff --git a/desktopapp/img/coding/password.png b/desktopapp/img/coding/password.png new file mode 100644 index 0000000..847c349 Binary files /dev/null and b/desktopapp/img/coding/password.png differ diff --git a/desktopapp/img/coding/php-code.png b/desktopapp/img/coding/php-code.png new file mode 100644 index 0000000..9efba0e Binary files /dev/null and b/desktopapp/img/coding/php-code.png differ diff --git a/desktopapp/img/coding/php-document.png b/desktopapp/img/coding/php-document.png new file mode 100644 index 0000000..04005ca Binary files /dev/null and b/desktopapp/img/coding/php-document.png differ diff --git a/desktopapp/img/coding/program-interface.png b/desktopapp/img/coding/program-interface.png new file mode 100644 index 0000000..33810ce Binary files /dev/null and b/desktopapp/img/coding/program-interface.png differ diff --git a/desktopapp/img/coding/programming-1.png b/desktopapp/img/coding/programming-1.png new file mode 100644 index 0000000..9a57a76 Binary files /dev/null and b/desktopapp/img/coding/programming-1.png differ diff --git a/desktopapp/img/coding/programming.png b/desktopapp/img/coding/programming.png new file mode 100644 index 0000000..3b48b8c Binary files /dev/null and b/desktopapp/img/coding/programming.png differ diff --git a/desktopapp/img/coding/table.png b/desktopapp/img/coding/table.png new file mode 100644 index 0000000..3bcef97 Binary files /dev/null and b/desktopapp/img/coding/table.png differ diff --git a/desktopapp/img/coding/ui-design.png b/desktopapp/img/coding/ui-design.png new file mode 100644 index 0000000..773b087 Binary files /dev/null and b/desktopapp/img/coding/ui-design.png differ diff --git a/desktopapp/img/coding/ux-design.png b/desktopapp/img/coding/ux-design.png new file mode 100644 index 0000000..1572191 Binary files /dev/null and b/desktopapp/img/coding/ux-design.png differ diff --git a/desktopapp/img/coding/virus.png b/desktopapp/img/coding/virus.png new file mode 100644 index 0000000..3a50c90 Binary files /dev/null and b/desktopapp/img/coding/virus.png differ diff --git a/desktopapp/img/coding/web-interface.png b/desktopapp/img/coding/web-interface.png new file mode 100644 index 0000000..36daf4a Binary files /dev/null and b/desktopapp/img/coding/web-interface.png differ diff --git a/desktopapp/index.html b/desktopapp/index.html index a2dc67e..6fb1f72 100644 --- a/desktopapp/index.html +++ b/desktopapp/index.html @@ -14,8 +14,7 @@
- project github: https://github.com/idoctnef/collectivecarApp -
+ + + {{currentproject.title}} +- project Taigan: https://github.com/idoctnef/collectivecarApp + Total time: {{currentproject.totaltime | secondsToDateTime | date:'HH:mm:ss'}}
- Total time: 10h 34min -
-- Current strike time: 10h 34min + Current strike time: {{currentStrike | secondsToDateTime | date:'HH:mm:ss'}}