From 5183906d80bc7d579aec872ef268ea1c5819a99f Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 9 Sep 2015 21:48:03 -0400 Subject: [PATCH 01/14] Added option to assign a priority to a to-do item --- todo-src/index.html | 14 +++++++------- todo-src/script.js | 29 ++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 89203ad..ed68759 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -14,15 +14,15 @@

My little to do app!

-
+
- - -
+ +

stuff i gotta do asap

diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..65fc6f7 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -6,21 +6,44 @@ myApp.controller('MainCtrl', function ($scope){ $scope.todos = ["Learn Angular", "Learn node"]; $scope.newItem = ""; - $scope.addItem = function(){ + $scope.addItem = function(){ //Does not use this function because change of button console.log("in add"); if ($scope.newItem !== ""){ $scope.todos.push($scope.newItem); $scope.newItem = ""; } } + + $scope.addItemHigh = function(){ + console.log("in add"); + if ($scope.newItem !== ""){ + $scope.todos.push("NOW: " + $scope.newItem); + $scope.newItem = ""; + } + } + + $scope.addItemMedium = function(){ + console.log("in add"); + if ($scope.newItem !== ""){ + $scope.todos.push("TOMORROW: " + $scope.newItem); + $scope.newItem = ""; + } + } + + $scope.addItemLow = function(){ + console.log("in add"); + if ($scope.newItem !== ""){ + $scope.todos.push("SOMEDAY: " + $scope.newItem); + $scope.newItem = ""; + } + } $scope.deleteItem = function(item){ console.log("in delete"); var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); } - - + }); /************************* From 86996a4369f9252f4f9263f13fa7fa53f9497447 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 10 Sep 2015 01:26:34 -0400 Subject: [PATCH 02/14] Made instruction for adding/choosing priority clearer --- todo-src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo-src/index.html b/todo-src/index.html index ed68759..ac59e1b 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -15,7 +15,7 @@

My little to do app!

- +
From d59661d2c759ff52d54fe7e7f2078c58c70e91cc Mon Sep 17 00:00:00 2001 From: scivy17 Date: Thu, 10 Sep 2015 12:20:18 -0400 Subject: [PATCH 03/14] added delete all function need to know how they will be marked completed for me to complete --- todo-src/index.html | 2 ++ todo-src/script.js | 11 +++++++++++ todo-src/style.css | 5 ++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/todo-src/index.html b/todo-src/index.html index 89203ad..8d7fd01 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -37,6 +37,8 @@

stuff i gotta do asap

+ +
diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..7016929 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -19,6 +19,17 @@ myApp.controller('MainCtrl', function ($scope){ var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); } + + $scope.deleteAll = function(){ + var length = $scope.todos.length; //get all the todos in the list + if(length !== 0){ + var a = confirm("Are you really sure you want to do this?"); + if(a){ + console.log("deleted All"); + $scope.todos.splice(0, length); //delete all them from the list + } + } + } }); diff --git a/todo-src/style.css b/todo-src/style.css index 553d571..4889f6b 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -1,2 +1,5 @@ /* Styles go here */ - +#DeleteAll { + background-color: red; + color: white; +} From 565285cfb014489616ac0af9a68b7db13d264b3b Mon Sep 17 00:00:00 2001 From: scivy17 Date: Mon, 14 Sep 2015 13:00:21 -0400 Subject: [PATCH 04/14] fixed bug in original code --- todo-src/script.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/todo-src/script.js b/todo-src/script.js index 7016929..77b29c1 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -9,7 +9,9 @@ myApp.controller('MainCtrl', function ($scope){ $scope.addItem = function(){ console.log("in add"); if ($scope.newItem !== ""){ - $scope.todos.push($scope.newItem); + if($scope.todos.indexOf($scope.newItem) === -1){ + $scope.todos.push($scope.newItem); + } $scope.newItem = ""; } } From 7d2f1242762054517bfada7c4db834e10c263a10 Mon Sep 17 00:00:00 2001 From: peach Date: Mon, 14 Sep 2015 17:51:47 -0400 Subject: [PATCH 05/14] Display total number of things to do --- todo-src/index.html | 2 +- todo-src/script.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 89203ad..b7b2a55 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -24,7 +24,7 @@

My little to do app!

-

stuff i gotta do asap

+

stuff i gotta do asap: total things to do

    diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..2908381 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -5,7 +5,7 @@ var myApp = angular.module('app', []); myApp.controller('MainCtrl', function ($scope){ $scope.todos = ["Learn Angular", "Learn node"]; $scope.newItem = ""; - + $scope.addItem = function(){ console.log("in add"); if ($scope.newItem !== ""){ @@ -19,6 +19,10 @@ myApp.controller('MainCtrl', function ($scope){ var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); } + + $scope.get_len = function() { + return $scope.todos.length; + } }); From 9eb99cf531824d1e02fdeee8d63e44c8290d60e3 Mon Sep 17 00:00:00 2001 From: peach Date: Mon, 14 Sep 2015 18:01:11 -0400 Subject: [PATCH 06/14] Add comment to test push permission --- todo-src/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/todo-src/index.html b/todo-src/index.html index b7b2a55..0e9be4b 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -24,6 +24,7 @@

    My little to do app!

+

stuff i gotta do asap: total things to do

diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..0127620 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -4,6 +4,7 @@ var myApp = angular.module('app', []); myApp.controller('MainCtrl', function ($scope){ $scope.todos = ["Learn Angular", "Learn node"]; + $scope.dones = [false, false]; $scope.newItem = ""; $scope.addItem = function(){ @@ -18,9 +19,20 @@ myApp.controller('MainCtrl', function ($scope){ console.log("in delete"); var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); + $scope.dones.splice(index, 1); } + $scope.toggleItem = function(item){ + console.log("in toggle"); + var index = $scope.todos.indexOf(item); + $scope.dones[index] = !$scope.dones[index]; + } + $scope.getActive = function(item){ + console.log("in toggle"); + var index = $scope.todos.indexOf(item); + return !$scope.dones[index]; + } }); /************************* From 0a6a3007ca436dae67a7329d814f7ae8f9230553 Mon Sep 17 00:00:00 2001 From: jthakore Date: Mon, 14 Sep 2015 18:31:07 -0400 Subject: [PATCH 08/14] change color --- todo-src/style.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/todo-src/style.css b/todo-src/style.css index 553d571..0617668 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -1,2 +1,5 @@ /* Styles go here */ - +/*1.Change the background color of the to-do app*/ +body{ + background-color: #e7e7f6; +} \ No newline at end of file From cf496d1f8b6ededde31c8b06c40a4b3c0ce8eda4 Mon Sep 17 00:00:00 2001 From: scivy17 Date: Mon, 14 Sep 2015 18:38:42 -0400 Subject: [PATCH 09/14] Merge branch 'master' into kevin-delete_all Conflicts: todo-src/style.css --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3b4fb19..d2b47ca 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ You will be demonstrating your knowledge of GitHub workflow and Scrum fundamenta 5. Show the total number of items in the to-do list at above the list. - This number should change when items are added / deleted (duh). 6. A button to clear all "completed" tasks +7. Add functionality to enter todo item upon hitting the enter key, so you dont need to press the "add" button #####In order to complete these tasks, you will need to: From 8e694522a66bd1d8bf85e64a04c79b6f0f24609c Mon Sep 17 00:00:00 2001 From: victorh3 Date: Mon, 14 Sep 2015 18:45:52 -0400 Subject: [PATCH 10/14] Fixed merge conflicts --- todo-src/index.html | 19 ++++++++++--------- todo-src/script.js | 32 ++++++++++++++++++++++++++++++-- todo-src/style.css | 2 +- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 8d7fd01..a904b10 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -14,17 +14,18 @@

My little to do app!

-
- - - - +
+
+ + -

stuff i gotta do asap

+ +

stuff i gotta do asap: total things to do

    diff --git a/todo-src/script.js b/todo-src/script.js index 77b29c1..cf5b5e3 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -5,8 +5,9 @@ var myApp = angular.module('app', []); myApp.controller('MainCtrl', function ($scope){ $scope.todos = ["Learn Angular", "Learn node"]; $scope.newItem = ""; - + $scope.addItem = function(){ + console.log("in add"); if ($scope.newItem !== ""){ if($scope.todos.indexOf($scope.newItem) === -1){ @@ -15,6 +16,30 @@ myApp.controller('MainCtrl', function ($scope){ $scope.newItem = ""; } } + + $scope.addItemHigh = function(){ + console.log("in add"); + if ($scope.newItem !== ""){ + $scope.todos.push("NOW: " + $scope.newItem); + $scope.newItem = ""; + } + } + + $scope.addItemMedium = function(){ + console.log("in add"); + if ($scope.newItem !== ""){ + $scope.todos.push("TOMORROW: " + $scope.newItem); + $scope.newItem = ""; + } + } + + $scope.addItemLow = function(){ + console.log("in add"); + if ($scope.newItem !== ""){ + $scope.todos.push("SOMEDAY: " + $scope.newItem); + $scope.newItem = ""; + } + } $scope.deleteItem = function(item){ console.log("in delete"); @@ -32,8 +57,11 @@ myApp.controller('MainCtrl', function ($scope){ } } } + + $scope.get_len = function() { + return $scope.todos.length; + } - }); /************************* diff --git a/todo-src/style.css b/todo-src/style.css index 4889f6b..df10a3e 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -2,4 +2,4 @@ #DeleteAll { background-color: red; color: white; -} +} \ No newline at end of file From d26f5a84ba9fd96e302d015453f24d82b9b9046f Mon Sep 17 00:00:00 2001 From: Joshua Kegley Date: Wed, 9 Sep 2015 13:08:56 -0400 Subject: [PATCH 11/14] added red background --- todo-src/style.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/todo-src/style.css b/todo-src/style.css index 553d571..b7de88d 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -1,2 +1,4 @@ /* Styles go here */ - +body { + background: red; +} From de79db8046093e67bc7765cd1ef7e7c6780c54f8 Mon Sep 17 00:00:00 2001 From: Joshua Kegley Date: Wed, 9 Sep 2015 13:24:01 -0400 Subject: [PATCH 12/14] testing background --- todo-src/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo-src/style.css b/todo-src/style.css index b7de88d..eb51b03 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -1,4 +1,4 @@ /* Styles go here */ body { - background: red; + background: green; } From 2a91f22e062ef4c34ce7daba1e01d8397c694422 Mon Sep 17 00:00:00 2001 From: Sergio Puleri Date: Wed, 9 Sep 2015 16:13:07 -0400 Subject: [PATCH 13/14] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3b4fb19..d2b47ca 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ You will be demonstrating your knowledge of GitHub workflow and Scrum fundamenta 5. Show the total number of items in the to-do list at above the list. - This number should change when items are added / deleted (duh). 6. A button to clear all "completed" tasks +7. Add functionality to enter todo item upon hitting the enter key, so you dont need to press the "add" button #####In order to complete these tasks, you will need to: From 0d37ceec00d6d86b313b0c1817aa2127ab17e524 Mon Sep 17 00:00:00 2001 From: victorh3 Date: Mon, 14 Sep 2015 19:28:54 -0400 Subject: [PATCH 14/14] Added Edit Button --- todo-src/index.html | 37 ++++++++++++++++++++++++++++--------- todo-src/script.js | 38 +++++++++++++++++++------------------- 2 files changed, 47 insertions(+), 28 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 28b24ff..d3652d0 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -27,21 +27,40 @@

    My little to do app!

    stuff i gotta do asap: total things to do

    -
      +
    • - {{do}} - - - + + +
+
+ +
+
+ +
+
+ +
+ + - -
diff --git a/todo-src/script.js b/todo-src/script.js index e253edd..a9d469d 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -5,6 +5,7 @@ var myApp = angular.module('app', []); myApp.controller('MainCtrl', function ($scope){ $scope.todos = ["Learn Angular", "Learn node"]; $scope.dones = [false, false]; + $scope.editor = { text : null, index : null }; $scope.newItem = ""; $scope.addItem = function(){ @@ -19,7 +20,6 @@ myApp.controller('MainCtrl', function ($scope){ } $scope.addItemHigh = function(){ - console.log("in add"); if ($scope.newItem !== ""){ $scope.todos.push("NOW: " + $scope.newItem); @@ -43,29 +43,29 @@ myApp.controller('MainCtrl', function ($scope){ } } - $scope.addItemHigh = function(){ - console.log("in add"); - if ($scope.newItem !== ""){ - $scope.todos.push("NOW: " + $scope.newItem); - $scope.newItem = ""; - } + $scope.editItem = function(item){ + console.log("in edit"); + var index = $scope.todos.indexOf(item); + $scope.editor.index = index; + $scope.editor.text = item; } - $scope.addItemMedium = function(){ - console.log("in add"); - if ($scope.newItem !== ""){ - $scope.todos.push("TOMORROW: " + $scope.newItem); - $scope.newItem = ""; - } + $scope.saveItem = function(item){ + console.log("in save"); + $scope.todos[$scope.editor.index] = $scope.editor.text; + $scope.editor.index = null; } - $scope.addItemLow = function(){ - console.log("in add"); - if ($scope.newItem !== ""){ - $scope.todos.push("SOMEDAY: " + $scope.newItem); - $scope.newItem = ""; - } + $scope.cancelItem = function(item){ + console.log("in cancel"); + $scope.editor.index = null; + } + + $scope.editingMode = function(item){ + var index = $scope.todos.indexOf(item); + return $scope.editor.index === index; } + $scope.deleteItem = function(item){ console.log("in delete");