Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
c772b1e
beautiful
jgruber27 Sep 19, 2017
0ed2ed8
added group name
jthornbeck Sep 19, 2017
f00b384
Merge branch 'jefferey_hornbeck' into development
jthornbeck Sep 19, 2017
1d644f4
Added Clear Completed Tasks button to html and alert functionality/
lisbecg Sep 19, 2017
c78041c
Complete button
Sep 19, 2017
58831aa
Merge branch 'kurt' into development
Sep 19, 2017
a941a43
Merge branch 'kurt' of https://github.com/cen3031-5a/workflow into li…
lisbecg Sep 19, 2017
0b0a120
Merge remote-tracking branch 'origin/kurt' into development
jthornbeck Sep 19, 2017
fafbd1a
some stuff
jgruber27 Sep 19, 2017
801ae4e
Added button to clear all completed todos.
lisbecg Sep 19, 2017
858e9e4
changes
megan-q Sep 19, 2017
3ad6c28
Merge remote-tracking branch 'origin/megan' into chris
ChrisDBrown5 Sep 19, 2017
ca4510f
editing implemented
mronda Sep 19, 2017
780d29e
fixed max's merge conflicts
jthornbeck Sep 19, 2017
73abdc8
almsot dere
jgruber27 Sep 19, 2017
b84dae0
bleh
megan-q Sep 19, 2017
1f0eda3
Fixed bug.
lisbecg Sep 19, 2017
2dbe46e
fixed js file
ChrisDBrown5 Sep 19, 2017
7b1e066
finito
jgruber27 Sep 19, 2017
4b0e886
fixing from merge
ChrisDBrown5 Sep 19, 2017
ebb9943
added script back
ChrisDBrown5 Sep 19, 2017
c376884
changes
megan-q Sep 19, 2017
3707ea5
Merge branch 'megan' of https://github.com/cen3031-5a/workflow into m…
megan-q Sep 19, 2017
4c1e3bc
adsahdajsd
megan-q Sep 19, 2017
f0a212f
finished clear
ChrisDBrown5 Sep 19, 2017
43df9e1
finished something
ChrisDBrown5 Sep 19, 2017
e56ec5c
added
jthornbeck Sep 19, 2017
8268f2e
added counter
jthornbeck Sep 19, 2017
5d9e917
fixed small bugs
jthornbeck Sep 19, 2017
d9ee843
Merge pull request #1 from cen3031-5a/development
jthornbeck Sep 19, 2017
07296d4
Merge pull request #2 from cen3031-5a/megan
jthornbeck Sep 20, 2017
a9bb45e
Merge branch 'finalDev' into lisbeth
jthornbeck Sep 20, 2017
744b2df
Merge pull request #5 from cen3031-5a/lisbeth
jthornbeck Sep 20, 2017
7ea6095
Merge branch 'finalDev' into chris
jthornbeck Sep 20, 2017
b5542b1
Merge pull request #7 from cen3031-5a/chris
jthornbeck Sep 20, 2017
6d0f95a
add comments
Sep 20, 2017
e7d692a
Merge branch 'finalDev' of https://github.com/cen3031-5a/workflow int…
Sep 20, 2017
bf45b59
add comments
Sep 20, 2017
a3010b4
Merge pull request #9 from cen3031-5a/finalDev
jthornbeck Sep 20, 2017
eaf925c
added comment to html
megan-q Sep 20, 2017
7a96406
added comments
Sep 20, 2017
961d0f4
changed comments
Sep 20, 2017
bcc7cf1
please work
mquach95 Sep 20, 2017
5b574ef
Merge branch 'master' of https://github.com/cen3031-5a/workflow
mquach95 Sep 20, 2017
1247791
comment
Sep 20, 2017
a7a0da7
Merge branch 'master' of https://github.com/cen3031-5a/workflow
Sep 20, 2017
5cb9ed7
comment
Sep 20, 2017
4577ea8
Add files via upload
Sep 20, 2017
59f2ec2
create txt
Sep 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 40 additions & 9 deletions todo-src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@

<body ng-app="app">
<h1 class="text-center">My little to do app!</h1>

<div id="todo" class="col-xs-6 col-xs-offset-3" ng-controller="MainCtrl">

<h2 class="text-center">GROUP 5a</h2>


<div id="todo" class="col-xs-6 col-xs-offset-3" ng-controller="MainCtrl" ng-init="count()">
<h3 ng-model="counter">Counter: {{counter}}</h3>

<div class="input-group">
<input type="text" class="form-control" placeholder="Item to add to todo list" ng-model="newItem">
<span class="input-group-btn">
Expand All @@ -23,22 +26,50 @@ <h1 class="text-center">My little to do app!</h1>
</button>
</span>
</div><!-- /input-group -->


<div>
<select ng-model="newPri" ng-options="item for item in priorities">
<option value="">-- choose priority --</option>
</select>
</div>

<h2>stuff i gotta do asap</h2>

<ul class="list-group">
<!-- http://www.w3schools.com/css/css_float.asp -->
<li class="list-group-item clearfix" ng-repeat="do in todos">

<span>{{do}}</span>


<li class="list-group-item clearfix" ng-repeat="do in todos.entries">

<span>{{do.name}}</span>
<span style="background-color: orange; border-radius: 2px; font-size: 10px;">{{do.pri}}</span>

<button class="btn btn-danger pull-right" type="button" ng-click="deleteItem(do)">
<span class="glyphicon glyphicon-trash " aria-hidden="true"></span>
</button>
<button class="btn btn-danger pull-right" type="button" ng-click="complete(do)">
<span aria-hidden="true"></span>Complete</button>

<button class="btn btn-primary pull-right" type="button" ng-click="editItem(do)">
<span class="glyphicon glyphicon-edit " aria-hidden="true"></span>
</button>

</li>
</ul>

<!--edit section-->
<h2>Edit</h2>
<input type="text" class="form-control" placeholder="Enter description here then press the edit. Cannot have duplicates." ng-model="edit">

<div>
<button class="btn btn-danger pull-right" type="button" ng-click="clearCompletedItems()">
<span class="glyphicon glyphicon-trash " aria-hidden="true"></span>
Clear Completed Tasks
</button>
<!--end of clear button-->
</div>
</div>
<!--end of to div-->
</body>

</html>
157 changes: 144 additions & 13 deletions todo-src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,137 @@

var myApp = angular.module('app', []);

myApp.controller('MainCtrl', function ($scope){
$scope.todos = ["Learn Angular", "Learn node"];
myApp.controller('MainCtrl', function($scope) {

$scope.newItem = "";

$scope.addItem = function(){
$scope.newPri = "";
$scope.priorities = ["NOW", "Tomorrow", "Someday"];
$scope.todos = {
"entries": [
{
"name": "Learn Angular",
"pri": "NOW"
}, {
"name": "Learn node"
}
]
};

$scope.count = function() {
console.log($scope.todos.entries);
var count = 0;
for (i in $scope.todos.entries) {
count++;
console.log(count);
}
$scope.counter = count;
}

$scope.addItem = function() {
console.log("in add");
if ($scope.newItem !== ""){
$scope.todos.push($scope.newItem);
if ($scope.newItem !== "") {
$scope.todos.entries.push({"name": $scope.newItem, "pri": $scope.newPri});
$scope.newItem = "";
$scope.newPri = "";
}
console.log($scope.todos)
$scope.count();
}
$scope.deleteItem = function(item){

$scope.deleteItem = function(item) {
console.log("in delete");
var index = $scope.todos.indexOf(item);
$scope.todos.splice(index, 1);
var index = $scope.todos.entries.indexOf(item);
$scope.todos.entries.splice(index, 1);
$scope.count();

}

$scope.clearCompletedItems = function(){
//if string doesn't contains --complete-- then add it
for(var i in $scope.todos){
if($scope.todos[i].indexOf("--complete--") != -1){
$scope.todos.pop($scope.todos[i]);
}
}
}



$scope.complete = function(item){
if(item.name.indexOf("--complete--") == -1){
var index = $scope.todos.entries.indexOf(item);
$scope.newPri = $scope.todos.entries[index].pri;
$scope.todos.entries.splice(index, 1);
$scope.todos.entries.push({"name": item.name+"--complete--", "pri": $scope.newPri});
$scope.newPri = "";
$scope.newItem = "";
}
}

$scope.clearCompletedItems = function() {
//if string doesn't contains --complete-- then add it
var work = false;
for (var i in $scope.todos.entries) {
if (work) {
i--;
work = false;
};
console.log($scope.todos.entries[i].name);
var check = $scope.todos.entries[i].name.split("--");
console.log(check);
var arr = {};
if (check[1] == "complete") {
$scope.todos.entries.splice(i, 1);
work = true;
// arr.append(i)
// console.log(arr);
}

}
work = false;
for (var i in $scope.todos.entries) {
if (work) {
i--;
work = true;
};
console.log($scope.todos.entries[i].name);
var check = $scope.todos.entries[i].name.split("--");
console.log(check);
var arr = {};
if (check[1] == "complete") {
$scope.todos.entries.splice(i, 1);
work = true;
// arr.append(i)
// console.log(arr);
}

}
$scope.count();


}

$scope.complete = function(item) {
if (item.name.indexOf("--complete--") == -1) {
var index = $scope.todos.entries.indexOf(item);
$scope.newPri = $scope.todos.entries[index].pri;
$scope.todos.entries.splice(index, 1);
$scope.todos.entries.push({
"name": item.name + "--complete--",
"pri": $scope.newPri
});
$scope.newPri = "";
$scope.newItem = "";
}
}

$scope.editItem = function(id) {
for (i in $scope.todos.entries) {
if ($scope.todos.entries[i].name == id.name) {
$scope.todos.entries[i].name = $scope.edit;
}
}
};

});

/*************************
Expand All @@ -32,5 +144,24 @@ myApp.controller('MainCtrl', function ($scope){
* - make it prettier
* - add a due date
* - add reminder (setInterval)
*
* *********************/
*


* Homework fd
* - "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)
* 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)
jh
* *********************/
7 changes: 5 additions & 2 deletions todo-src/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/* Styles go here */
body {

background: grey;
font-family: "Comic Sans MS", cursive, sans-serif;
background: steelblue;

}

/* background is blue and font changed to comic sans*/
/*Please never use cyan again*/
1 change: 1 addition & 0 deletions todo-src/txt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@