From e857c56691b194f2b70d918d14a82510afb4d362 Mon Sep 17 00:00:00 2001 From: "[Amy Ly]" <[amyly@ufl.edu]> Date: Sun, 22 Jan 2017 12:09:48 -0500 Subject: [PATCH 01/11] changed page background --- todo-src/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/todo-src/style.css b/todo-src/style.css index eb51b03..b745146 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -1,4 +1,4 @@ /* Styles go here */ body { - background: green; -} + background: #7DC5AF +} \ No newline at end of file From bdf6baf9a122e3feff1b116eab4590a960bcab07 Mon Sep 17 00:00:00 2001 From: "[Amy Ly]" <[amyly@ufl.edu]> Date: Sun, 22 Jan 2017 13:17:04 -0500 Subject: [PATCH 02/11] reverting change --- todo-src/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/todo-src/style.css b/todo-src/style.css index b745146..eb51b03 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -1,4 +1,4 @@ /* Styles go here */ body { - background: #7DC5AF -} \ No newline at end of file + background: green; +} From 9d81ca55f60263fe147104c182f8924e67795804 Mon Sep 17 00:00:00 2001 From: "[Amy Ly]" <[amyly@ufl.edu]> Date: Sun, 22 Jan 2017 13:52:00 -0500 Subject: [PATCH 03/11] changed bg color --- 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 eb51b03..1189eb7 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -1,4 +1,4 @@ /* Styles go here */ body { - background: green; + background: #5999C8; } From 60f3d30d5b6715e165b34b9a98397b0b2e992948 Mon Sep 17 00:00:00 2001 From: hackleman Date: Mon, 23 Jan 2017 17:32:37 -0600 Subject: [PATCH 04/11] modified: todo-src/index.html Edit Button: creates editBtn array in script that mirrors the main todo list editBtn is initialized to false values for each entry in the todo list. when a user presses the edit button, an editing box is toggled on and off. the checmark button then saves the change. --- todo-src/index.html | 36 ++++++++++++++++++++++++++++-------- todo-src/script.js | 28 ++++++++++++++++++++++------ 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 89203ad..9c23a4a 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -11,9 +11,9 @@

My little to do app!

- +
- +
@@ -23,22 +23,42 @@

My little to do app!

- +

stuff i gotta do asap

- +
- + diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..8907c10 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -5,7 +5,23 @@ var myApp = angular.module('app', []); myApp.controller('MainCtrl', function ($scope){ $scope.todos = ["Learn Angular", "Learn node"]; $scope.newItem = ""; - + +// create editBtn array to mirror toDo list, +// holds boolean values depending on whether item has been clicked on + $scope.editBtn = {}; +// for loop initializes each item in editBtn to false + for (var i=0, length = $scope.todos.length; i < length; i++) { + $scope.editBtn[i] = false; + } +// edit function makes editBtn entry true + $scope.edit = function(index){ + $scope.editBtn[index] = true; + } +// update function closes out editBtn functionality + $scope.update = function(index){ + $scope.editBtn[index] = false; + } + $scope.addItem = function(){ console.log("in add"); if ($scope.newItem !== ""){ @@ -13,14 +29,14 @@ myApp.controller('MainCtrl', function ($scope){ $scope.newItem = ""; } } - + $scope.deleteItem = function(item){ console.log("in delete"); var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); } - - + + }); /************************* @@ -32,5 +48,5 @@ myApp.controller('MainCtrl', function ($scope){ * - make it prettier * - add a due date * - add reminder (setInterval) - * - * *********************/ \ No newline at end of file + * + * *********************/ From cec5d5c965bbba097604b2e2e9c5ad9c3566b4bd Mon Sep 17 00:00:00 2001 From: hackleman Date: Mon, 23 Jan 2017 20:35:34 -0600 Subject: [PATCH 05/11] update: fixed a bug that caused the edit function to stop working after adding an item to the list. Updated the html file it is much more streamlined now. --- todo-src/index.html | 23 +++++++++-------------- todo-src/script.js | 4 +++- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 9c23a4a..c715027 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -15,7 +15,7 @@

My little to do app!

- + - -
- - +   -
+ diff --git a/todo-src/script.js b/todo-src/script.js index 8907c10..c4c3b4b 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -16,9 +16,11 @@ myApp.controller('MainCtrl', function ($scope){ // edit function makes editBtn entry true $scope.edit = function(index){ $scope.editBtn[index] = true; + } // update function closes out editBtn functionality - $scope.update = function(index){ + $scope.update = function(index, value){ + $scope.todos[index] = value; $scope.editBtn[index] = false; } From dad9e9574e98f2783729f24fabf0d70bf87abe46 Mon Sep 17 00:00:00 2001 From: hackleman Date: Mon, 23 Jan 2017 21:16:09 -0600 Subject: [PATCH 06/11] added checkboxes --- todo-src/index.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index c715027..7269923 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -35,7 +35,14 @@

stuff i gotta do asap

when user presses the "edit" button, ng-show toggles an input text box on and off which updates the todo list. --> - {{do}} + + + + + + @@ -49,7 +56,6 @@

stuff i gotta do asap

  -
From 20f1ac366b9cbb6fad0c0ee2889aa00d6ded8d42 Mon Sep 17 00:00:00 2001 From: hackleman Date: Tue, 24 Jan 2017 23:12:53 -0600 Subject: [PATCH 07/11] removed bug that caused list to stop working with duplicate entries, fully functional edit and clear tasks button --- todo-src/index.html | 39 +++++++++++++++++++++------------------ todo-src/script.js | 40 +++++++++++++++++++++------------------- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 7269923..cbe49c5 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -28,35 +28,38 @@

stuff i gotta do asap

    -
  • - +
  • + + + + - - - - - - + - + - -  
  • + +
diff --git a/todo-src/script.js b/todo-src/script.js index c4c3b4b..33c2e3d 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -3,41 +3,43 @@ var myApp = angular.module('app', []); myApp.controller('MainCtrl', function ($scope){ - $scope.todos = ["Learn Angular", "Learn node"]; - $scope.newItem = ""; -// create editBtn array to mirror toDo list, -// holds boolean values depending on whether item has been clicked on - $scope.editBtn = {}; -// for loop initializes each item in editBtn to false - for (var i=0, length = $scope.todos.length; i < length; i++) { - $scope.editBtn[i] = false; - } -// edit function makes editBtn entry true - $scope.edit = function(index){ - $scope.editBtn[index] = true; +// I modified the array to contain +// flags for editing and checking off +// this made implementing add/remove and +// clearList much easier + + $scope.todos = [ + {text:"Learn Angular", done:false, edit:false}, + {text: "Learn node", done:false, edit:false}] + $scope.newItem = ""; - } -// update function closes out editBtn functionality $scope.update = function(index, value){ - $scope.todos[index] = value; - $scope.editBtn[index] = false; + $scope.todos[index].text = value; + $scope.todos[index].edit = false; } $scope.addItem = function(){ console.log("in add"); if ($scope.newItem !== ""){ - $scope.todos.push($scope.newItem); + $scope.todos.push({text:$scope.newItem, done:false, edit:false}); $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); } + $scope.remove = function() { + var oldList = $scope.todos; + $scope.todos = []; + angular.forEach(oldList, function(x) { + if (!x.done) $scope.todos.push(x); + }); + } + }); From 1a78e94742f9a8d6f09288122da6d2fb6ded8e5d Mon Sep 17 00:00:00 2001 From: Clinton Andrews Date: Wed, 25 Jan 2017 06:30:44 -0500 Subject: [PATCH 08/11] Change the header since all other issues we're taken already. --- 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 89203ad..3618960 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -10,7 +10,7 @@ -

My little to do app!

+

To Do

From f45fb283aef6983cb596b4bdb31479c1e8bbf622 Mon Sep 17 00:00:00 2001 From: hackleman Date: Wed, 25 Jan 2017 18:04:03 -0600 Subject: [PATCH 09/11] added todo list count functionality --- todo-src/index.html | 4 +--- todo-src/script.js | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index cbe49c5..272f5cd 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -56,9 +56,7 @@

stuff i gotta do asap

+ Clear {{remaining()}} completed tasks
diff --git a/todo-src/script.js b/todo-src/script.js index 33c2e3d..12400b4 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -32,6 +32,14 @@ myApp.controller('MainCtrl', function ($scope){ $scope.todos.splice(index, 1); } + $scope.remaining = function() { + var count = 0; + angular.forEach($scope.todos, function(todo) { + count += todo.done ? true : false; + }); + return count; + } + $scope.remove = function() { var oldList = $scope.todos; $scope.todos = []; From ed9b1f9d235c612eb212dcdbd62152a601ca7eb5 Mon Sep 17 00:00:00 2001 From: Travis Rinehart Date: Wed, 25 Jan 2017 19:43:30 -0500 Subject: [PATCH 10/11] added a priority updated for each to do in the list --- todo-src/animations.css | 31 +++++++++++++++++++++++++++++++ todo-src/index.html | 13 ++++++++++++- todo-src/protractor.js | 18 ++++++++++++++++++ todo-src/script.js | 11 +++++++++-- todo-src/style.css | 1 + 5 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 todo-src/animations.css create mode 100644 todo-src/protractor.js diff --git a/todo-src/animations.css b/todo-src/animations.css new file mode 100644 index 0000000..c94e83f --- /dev/null +++ b/todo-src/animations.css @@ -0,0 +1,31 @@ +/* Sitch container for priority */ +.animate-switch-container { + position:relative; + background:white; + border:1px solid black; + height:40px; + overflow:hidden; +} + +.animate-switch { + padding:10px; +} + +.animate-switch.ng-animate { + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + + position:absolute; + top:0; + left:0; + right:0; + bottom:0; +} + +.animate-switch.ng-leave.ng-leave-active, +.animate-switch.ng-enter { + top:-50px; +} +.animate-switch.ng-leave, +.animate-switch.ng-enter.ng-enter-active { + top:0; +} diff --git a/todo-src/index.html b/todo-src/index.html index 3618960..1aedf0c 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -6,7 +6,9 @@ + + @@ -34,7 +36,16 @@

stuff i gotta do asap

- +
+
+ +
+
top
+
medium
+
low
+
+
diff --git a/todo-src/protractor.js b/todo-src/protractor.js new file mode 100644 index 0000000..719ebe0 --- /dev/null +++ b/todo-src/protractor.js @@ -0,0 +1,18 @@ +var switchElem = element(by.css('[ng-switch]')); +var select = element(by.model('selection')); + +it('should start in low', function () { + expect(switchElem.getText()).toMatch(/someday/); +}); +it('should change to medium', function () { + select.all(by.css('option')).get(1).click(); + expect(switchElem.getText()).toMatch(/tomorrow/); +}); +it('should change to top', function () { + select.all(by.css('option')).get(2).click(); + expect(switchElem.getText()).toMatch(/now/); +}); +it('should select default', function () { + select.all(by.css('option')).get(3).click(); + expect(switchElem.getText()).toMatch(/default/); +}); \ No newline at end of file diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..b8d6776 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -19,10 +19,17 @@ myApp.controller('MainCtrl', function ($scope){ var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); } - - + }); +myApp.controller('switchExample', ['ngAnimate']) +.controller('ExampleController', ['$scope', function ($scope) { + $scope.items = ['now', 'tomorrow', 'someday']; + $scope.selection = $scope.items[0]; +}]); + + + /************************* * Homework (not rly): * - "enter" button functionality instead of clicking button diff --git a/todo-src/style.css b/todo-src/style.css index eb51b03..25d35ae 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -2,3 +2,4 @@ body { background: green; } + From 631547e15af00bdece416643fd6b6674b8130e96 Mon Sep 17 00:00:00 2001 From: hackleman Date: Wed, 25 Jan 2017 19:11:29 -0600 Subject: [PATCH 11/11] put in counter in title --- todo-src/index.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 272f5cd..d0c2471 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -15,16 +15,23 @@

My little to do app!

- + + +
-

stuff i gotta do asap

+

{{todos.length}} stuff(s) i gotta do asap