From d3daedcc1affb35cb2dac7578c6b18fa292b8cd6 Mon Sep 17 00:00:00 2001 From: dezayasa Date: Mon, 14 Sep 2015 12:51:17 -0400 Subject: [PATCH 01/10] html: allow enter key to submit todo --- todo-src/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 89203ad..d5a7e81 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -13,17 +13,17 @@

My little to do app!

- +
-
- +

stuff i gotta do asap

diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..aea5020 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -19,7 +19,11 @@ myApp.controller('MainCtrl', function ($scope){ var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); } - + + $scope.completeItem = function(item) { + console.log("in complete"); + $scope.todos.class = "complete"; + } }); diff --git a/todo-src/style.css b/todo-src/style.css index eb51b03..7349754 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -2,3 +2,8 @@ body { background: green; } + +/* to change the text style when complete */ +.complete { + text-decoration:line-through; +} \ No newline at end of file From c3a0c597106c170f8f2a3968a9784306e59f169d Mon Sep 17 00:00:00 2001 From: Khaled Hassan Date: Mon, 14 Sep 2015 17:43:53 -0400 Subject: [PATCH 03/10] refactor todos as objects with text member --- todo-src/index.html | 5 ++--- todo-src/script.js | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index d5a7e81..9ea1b5e 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -29,9 +29,8 @@

stuff i gotta do asap

  • - - {{do}} - diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..91f8c68 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -3,20 +3,30 @@ var myApp = angular.module('app', []); myApp.controller('MainCtrl', function ($scope){ - $scope.todos = ["Learn Angular", "Learn node"]; + + $scope.todos = [ + { + text: "Learn Angular" + }, + { + text: "Learn node" + } + ]; + $scope.newItem = ""; - + $scope.addItem = function(){ console.log("in add"); if ($scope.newItem !== ""){ - $scope.todos.push($scope.newItem); + $scope.todos.push({ + text: $scope.newItem, + }); $scope.newItem = ""; } } - $scope.deleteItem = function(item){ + $scope.deleteItem = function(index){ console.log("in delete"); - var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); } From ad01020ac4daa6a269fbd7afa9c3a53afb2994bd Mon Sep 17 00:00:00 2001 From: Stephanie Cruz Date: Tue, 15 Sep 2015 00:32:11 -0400 Subject: [PATCH 04/10] second commit for "complete" task, changed approach to add second "completed" list --- todo-src/index.html | 12 ++++++++++++ todo-src/script.js | 12 +++++++++++- todo-src/style.css | 6 ++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/todo-src/index.html b/todo-src/index.html index 9ea1b5e..d09f7ea 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -34,8 +34,20 @@

    stuff i gotta do asap

    + +
+ +

This shit is DONE, yo.

+
    +
  • + {{el.text}} +
  • +
+
diff --git a/todo-src/script.js b/todo-src/script.js index 91f8c68..03e176b 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -13,6 +13,8 @@ myApp.controller('MainCtrl', function ($scope){ } ]; + $scope.completeItems = []; + $scope.newItem = ""; $scope.addItem = function(){ @@ -29,7 +31,15 @@ myApp.controller('MainCtrl', function ($scope){ console.log("in delete"); $scope.todos.splice(index, 1); } - + + $scope.completeItem = function(index) { + console.log("in complete"); + $scope.todos.textDecoration = "line-through"; + $scope.completeItems.push({ + text: $scope.do, + }); + $scope.deleteItem(index); + } }); diff --git a/todo-src/style.css b/todo-src/style.css index eb51b03..65efdb0 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -2,3 +2,9 @@ body { background: green; } + +/* Styling for complete */ + +#complete { + text-decoration: line-through; +} \ No newline at end of file From 858c302af4a092b2684bf5a8204cc536cda07e5f Mon Sep 17 00:00:00 2001 From: Stephanie Cruz Date: Tue, 15 Sep 2015 01:04:54 -0400 Subject: [PATCH 05/10] complete button now takes item from todo list and transfers to completed list --- todo-src/index.html | 13 ++++++------- todo-src/script.js | 7 +++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index be9e5db..d9ac5b7 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -33,16 +33,10 @@

stuff i gotta do asap

- - - - @@ -54,6 +48,11 @@

This shit is DONE, yo.

+ + + diff --git a/todo-src/script.js b/todo-src/script.js index 1bc240d..f931ae5 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -33,12 +33,15 @@ myApp.controller('MainCtrl', function ($scope){ } $scope.completeItem = function(index) { console.log("in complete"); - $scope.todos.textDecoration = "line-through"; $scope.completeItems.push({ - text: $scope.do, + text: $scope.todos[index].text, }); $scope.deleteItem(index); } + /* Testing out the clear function */ + $scope.clear = function() { + $scope.completeItems.length = 0; + } }); From 22d270227c51ba1f6db54701af12399adec5ab66 Mon Sep 17 00:00:00 2001 From: Stephanie Cruz Date: Tue, 15 Sep 2015 01:06:40 -0400 Subject: [PATCH 06/10] minor change and comments --- todo-src/index.html | 9 +++------ todo-src/script.js | 7 ++----- todo-src/style.css | 1 - 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index d9ac5b7..4e0e5a3 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -41,17 +41,14 @@

stuff i gotta do asap

+ +

This shit is DONE, yo.

  • {{el.text}}
  • -
- - - + diff --git a/todo-src/script.js b/todo-src/script.js index f931ae5..232f16c 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -31,6 +31,7 @@ myApp.controller('MainCtrl', function ($scope){ console.log("in delete"); $scope.todos.splice(index, 1); } + $scope.completeItem = function(index) { console.log("in complete"); $scope.completeItems.push({ @@ -38,11 +39,7 @@ myApp.controller('MainCtrl', function ($scope){ }); $scope.deleteItem(index); } - /* Testing out the clear function */ - $scope.clear = function() { - $scope.completeItems.length = 0; - } - + }); /************************* diff --git a/todo-src/style.css b/todo-src/style.css index 32fdcfe..ba4f78c 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -5,6 +5,5 @@ body { /* Styling for complete */ - #complete { text-decoration: line-through; \ No newline at end of file From 4ae26e8c5ff390114b7878cd45189cd9f28acd05 Mon Sep 17 00:00:00 2001 From: Stephanie Cruz Date: Tue, 15 Sep 2015 01:20:44 -0400 Subject: [PATCH 07/10] had to make the title for completed items list more professional or w/e :P --- todo-src/index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 4e0e5a3..399399d 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -42,8 +42,7 @@

stuff i gotta do asap

- -

This shit is DONE, yo.

+

Completed Items

  • {{el.text}} From bd44f7f62a4d4268febd6b98f081ebc644b54e3e Mon Sep 17 00:00:00 2001 From: Stephanie Cruz Date: Tue, 15 Sep 2015 01:38:46 -0400 Subject: [PATCH 08/10] i forgot a bracket ugh --- todo-src/style.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/todo-src/style.css b/todo-src/style.css index ba4f78c..a0bd892 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -6,4 +6,5 @@ body { /* Styling for complete */ #complete { - text-decoration: line-through; \ No newline at end of file + text-decoration: line-through; +} \ No newline at end of file From 529af69e074a8fa5b50775b3e5966b83ba7625c8 Mon Sep 17 00:00:00 2001 From: juliochavez Date: Tue, 15 Sep 2015 02:42:07 -0400 Subject: [PATCH 09/10] Add Clear Completed Items button and clearing fuctionality. --- todo-src/index.html | 8 +++++++- todo-src/script.js | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/todo-src/index.html b/todo-src/index.html index 399399d..f96ef7f 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -42,12 +42,18 @@

    stuff i gotta do asap

-

Completed Items

+

+ Completed Items +

  • {{el.text}}
+ + diff --git a/todo-src/script.js b/todo-src/script.js index 232f16c..ea93d8c 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -40,6 +40,11 @@ myApp.controller('MainCtrl', function ($scope){ $scope.deleteItem(index); } + $scope.clearCompletedItems = function() { + console.log("in clearCompletedItems"); + $scope.completeItems.length = 0; + } + }); /************************* From 6c7cf68825a81614fe4adf7f9182ae1f97a33c64 Mon Sep 17 00:00:00 2001 From: mapearson Date: Tue, 15 Sep 2015 13:08:48 -0400 Subject: [PATCH 10/10] Finished edit button --- todo-src/index.html | 22 ++++++++++++---------- todo-src/script.js | 13 +++++++++---- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index f96ef7f..7fcc5de 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -11,9 +11,9 @@

My little to do app!

- +
-
+
@@ -23,13 +23,15 @@

My little to do app!

-
+

stuff i gotta do asap

- + +
+
  • - {{do.text}} + {{do.text}} @@ -42,21 +44,21 @@

    stuff i gotta do asap

-

- Completed Items +

+ Completed Items

  • {{el.text}}
  • -
+
- + - \ No newline at end of file + diff --git a/todo-src/script.js b/todo-src/script.js index ea93d8c..db64fce 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -26,12 +26,17 @@ myApp.controller('MainCtrl', function ($scope){ $scope.newItem = ""; } } - + $scope.toggleEditMode = function() + { + console.log("in edit"); + $scope.editmode = !($scope.editmode); + } + $scope.deleteItem = function(index){ console.log("in delete"); $scope.todos.splice(index, 1); } - + $scope.completeItem = function(index) { console.log("in complete"); $scope.completeItems.push({ @@ -56,5 +61,5 @@ myApp.controller('MainCtrl', function ($scope){ * - make it prettier * - add a due date * - add reminder (setInterval) - * - * *********************/ \ No newline at end of file + * + * *********************/