From 4340e55de723c91524ad6f6862c45a053306100f Mon Sep 17 00:00:00 2001 From: nigeledavis Date: Mon, 18 Sep 2017 14:03:34 -0400 Subject: [PATCH 01/13] added comments --- todo-src/script.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..0c8b879 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 !== ""){ @@ -13,14 +13,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 +32,5 @@ myApp.controller('MainCtrl', function ($scope){ * - make it prettier * - add a due date * - add reminder (setInterval) - * - * *********************/ \ No newline at end of file + * + * *********************/ From e65a96810a066e606496e9798451a424050f7318 Mon Sep 17 00:00:00 2001 From: "nigeledavis@ufl.edu" Date: Mon, 18 Sep 2017 14:28:50 -0400 Subject: [PATCH 02/13] added comments --- todo-src/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo-src/script.js b/todo-src/script.js index 0c8b879..9ef957d 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -13,7 +13,7 @@ myApp.controller('MainCtrl', function ($scope){ $scope.newItem = ""; } } - //// + // $scope.deleteItem = function(item){ console.log("in delete"); var index = $scope.todos.indexOf(item); From 5c26f20c71daa636f14d68ae8ab429a21846a446 Mon Sep 17 00:00:00 2001 From: "nigeledavis@ufl.edu" Date: Mon, 18 Sep 2017 15:58:32 -0400 Subject: [PATCH 03/13] created dynamically updating number of tasks --- todo-src/index.html | 16 +++++++++------- todo-src/script.js | 11 ++++++++++- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 475819d..fd1f1a9 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -10,10 +10,12 @@ -

My little to do app!

- + +

My little to do app! +

+
- +
@@ -23,13 +25,13 @@

My little to do app!

- +

stuff i gotta do asap

- +
  • - + {{do}}
- + diff --git a/todo-src/script.js b/todo-src/script.js index 9ef957d..120528a 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -5,21 +5,30 @@ var myApp = angular.module('app', []); myApp.controller('MainCtrl', function ($scope){ $scope.todos = ["Learn Angular", "Learn node"]; $scope.newItem = ""; + $scope.totalNumber = 2; $scope.addItem = function(){ console.log("in add"); if ($scope.newItem !== ""){ $scope.todos.push($scope.newItem); $scope.newItem = ""; + $scope.totalNumber ++; + document.getElementById('numberOfItems').innerHTML = $scope.totalNumber; } } - // + $scope.deleteItem = function(item){ console.log("in delete"); var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); + $scope.totalNumber --; + document.getElementById('numberOfItems').innerHTML = $scope.totalNumber; } +//creates a dynamically updating number of tasks + window.onload = function() { + document.getElementById('numberOfItems').innerHTML = $scope.totalNumber; + }; }); From e453c7244d6b6cae04586510600b20ccbce9071f Mon Sep 17 00:00:00 2001 From: juanfparra12 <31254711+juanfparra12@users.noreply.github.com> Date: Tue, 19 Sep 2017 17:46:02 -0400 Subject: [PATCH 04/13] Priority --- todo-src/index.html | 27 +++++++++++++++++++++------ todo-src/script.js | 16 ++++++++++------ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 89203ad..692418f 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -7,13 +7,16 @@ + + +

My little to do app!

- +
- +
@@ -23,22 +26,34 @@

My little to do app!

- +

stuff i gotta do asap

- +
  • - + {{do}} +
    +
    + +
    +
- + + + diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..abbfc4c 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 !== ""){ @@ -13,14 +13,18 @@ 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); } - - + function Edit_Btn_Click(elem) { + var Driver_Reference = elem.dataset.value; + + alert("Edit button pressed! Artist ID: " + Driver_Reference); +} + }); /************************* @@ -32,5 +36,5 @@ myApp.controller('MainCtrl', function ($scope){ * - make it prettier * - add a due date * - add reminder (setInterval) - * - * *********************/ \ No newline at end of file + * + * *********************/ From 6455942e015412c60f782e77bcc907a7c9dd8bc2 Mon Sep 17 00:00:00 2001 From: tjakkala Date: Tue, 19 Sep 2017 11:27:23 -0400 Subject: [PATCH 05/13] added a checkbox --- todo-src/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/todo-src/index.html b/todo-src/index.html index fd1f1a9..c33b895 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -32,6 +32,9 @@

stuff i gotta do asap

  • + + + {{do}} - +

    stuff i gotta do asap

    - +
    • - - {{do}} + + + + {{do.name}} + + + + + + +
    - + From 3c2ae43b4569f969a45f5a75ceb6820aef7685e5 Mon Sep 17 00:00:00 2001 From: Sunny Patel Date: Wed, 20 Sep 2017 15:26:25 -0400 Subject: [PATCH 07/13] added the edit button functionality --- todo-src/index.html | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 89203ad..c6e0254 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -11,9 +11,9 @@

    My little to do app!

    - +
    - +
    @@ -23,22 +23,31 @@

    My little to do app!

    - +

    stuff i gotta do asap

    - +
    • - - {{do}} + + + + {{do.name}} + + + + + + +
    - + From af3b611738014aec3fa467a2a21e1bccb3717dcc Mon Sep 17 00:00:00 2001 From: Sunny Patel Date: Wed, 20 Sep 2017 15:27:22 -0400 Subject: [PATCH 08/13] edit functions added --- todo-src/script.js | 89 +++++++++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 36 deletions(-) diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..c6e0254 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -1,36 +1,53 @@ -// Code goes here - -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 !== ""){ - $scope.todos.push($scope.newItem); - $scope.newItem = ""; - } - } - - $scope.deleteItem = function(item){ - console.log("in delete"); - var index = $scope.todos.indexOf(item); - $scope.todos.splice(index, 1); - } - - -}); - -/************************* - * Homework (not rly): - * - "enter" button functionality instead of clicking button - * - edit button functionality - * - button to mark item as "complete" - * - have a total number of items at the top - * - make it prettier - * - add a due date - * - add reminder (setInterval) - * - * *********************/ \ No newline at end of file + + + + + + + + + + + + +

    My little to do app!

    + +
    + +
    + + + + +
    + +

    stuff i gotta do asap

    + +
      + +
    • + + + + + + {{do.name}} + + + + + + + +
    • +
    +
    + + + + From 2fd78aa2554c22f6afd0aaa986a383acf0ca1932 Mon Sep 17 00:00:00 2001 From: Sunny Patel Date: Wed, 20 Sep 2017 15:51:52 -0400 Subject: [PATCH 09/13] added edit functions --- todo-src/script.js | 109 +++++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/todo-src/script.js b/todo-src/script.js index c6e0254..5b00408 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -1,53 +1,56 @@ - - - - - - - - - - - - -

    My little to do app!

    - -
    - -
    - - - - -
    - -

    stuff i gotta do asap

    - -
      - -
    • - - - - - - {{do.name}} - - - - - - - -
    • -
    -
    - - - - +// Code goes here + +var myApp = angular.module('app', []); + +myApp.controller('MainCtrl', function ($scope){ + $scope.todos = [ + {name: "Learn Angular", editing:false}, + {name: "Learn node", editing: false} + ]; + $scope.newItem = ""; + + $scope.addItem = function(){ + console.log("in add"); + if ($scope.newItem !== ""){ + $scope.todos.push($scope.newItem); + $scope.newItem = ""; + } + } + + $scope.deleteItem = function(item){ + console.log("in delete"); + var index = $scope.todos.indexOf(item); + $scope.todos.splice(index, 1); + } + +// Edit function +$scope.editItem = function (item) { + item.editing = true; + item.oldName = item.name; + } + + $scope.doneEditing = function (item) { + item.editing = false; + //dong some background ajax calling for persistence... + }; + $scope.Cancel = function (item) { + item.editing = false; + item.name = item.oldName; + }; + + //End of Edit functions + + +}); + +/************************* + * Homework (not rly): + * - "enter" button functionality instead of clicking button + * - edit button functionality + * - button to mark item as "complete" + * - have a total number of items at the top + * - make it prettier + * - add a due date + * - add reminder (setInterval) + * + * *********************/ From 5e60e136159c85ea5ff9a2eb85ceacaf8526852a Mon Sep 17 00:00:00 2001 From: juanfparra12 <31254711+juanfparra12@users.noreply.github.com> Date: Wed, 20 Sep 2017 16:14:30 -0400 Subject: [PATCH 10/13] Update script.js --- todo-src/script.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/todo-src/script.js b/todo-src/script.js index abbfc4c..2b1ac87 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -19,12 +19,7 @@ myApp.controller('MainCtrl', function ($scope){ var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); } - function Edit_Btn_Click(elem) { - var Driver_Reference = elem.dataset.value; - - alert("Edit button pressed! Artist ID: " + Driver_Reference); -} - + }); /************************* From 88d19fc6ce076f6f370def9d239f120d01cf1052 Mon Sep 17 00:00:00 2001 From: juanfparra12 <31254711+juanfparra12@users.noreply.github.com> Date: Wed, 20 Sep 2017 16:24:59 -0400 Subject: [PATCH 11/13] Update index.html --- todo-src/index.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index 3d8e88f..10144e8 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -12,10 +12,6 @@ - -

    My little to do app!

    - -

    My little to do app! From aa2a116c163b9d947a6153b764602a217480b46e Mon Sep 17 00:00:00 2001 From: Sunny Patel Date: Wed, 20 Sep 2017 17:05:17 -0400 Subject: [PATCH 12/13] edit button added --- todo-src/index.html | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/todo-src/index.html b/todo-src/index.html index eaa2f12..4179c59 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -9,19 +9,13 @@ - - - -

    My little to do app! -

    -

    - - + +

    My little to do app!

    - + From 5d2a7474e0003d41bf7000698204211325905ceb Mon Sep 17 00:00:00 2001 From: Sunny Patel Date: Wed, 20 Sep 2017 17:05:51 -0400 Subject: [PATCH 13/13] edit functions added --- todo-src/script.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/todo-src/script.js b/todo-src/script.js index 461385b..5b00408 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -9,16 +9,11 @@ myApp.controller('MainCtrl', function ($scope){ ]; $scope.newItem = ""; - $scope.totalNumber = 2; - - $scope.addItem = function(){ console.log("in add"); if ($scope.newItem !== ""){ $scope.todos.push($scope.newItem); $scope.newItem = ""; - $scope.totalNumber ++; - document.getElementById('numberOfItems').innerHTML = $scope.totalNumber; } } @@ -26,11 +21,8 @@ myApp.controller('MainCtrl', function ($scope){ console.log("in delete"); var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); - $scope.totalNumber --; - document.getElementById('numberOfItems').innerHTML = $scope.totalNumber; } - // Edit function $scope.editItem = function (item) { item.editing = true; @@ -48,12 +40,6 @@ $scope.editItem = function (item) { //End of Edit functions -======= -//creates a dynamically updating number of tasks - window.onload = function() { - document.getElementById('numberOfItems').innerHTML = $scope.totalNumber; - }; - });