Skip to content

Commit

Permalink
Basic app completed(Added 4 buttons)
Browse files Browse the repository at this point in the history
  • Loading branch information
anoopk23 committed Oct 27, 2017
1 parent b6eaeba commit 950a5d4
Show file tree
Hide file tree
Showing 10 changed files with 577 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .idea/Todo.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/typescript-compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/watcherTasks.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

274 changes: 274 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TodoList</title>
</head>
<body>
<h1>My Todos</h1>
<input type="text" id="inp">
<button id="btn">ADD</button>
<hr></hr>
<ul id="todos">
</ul>

<script src="todo.js"></script>
<script src="userinput.js"></script>
</body>
</html>
54 changes: 54 additions & 0 deletions todo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
var TodoList = (function () {
function TodoList() {
this.todoList = [];
}
TodoList.prototype.add = function (atodo) {
this.todoList.push(atodo);
};
TodoList.prototype.delete = function (index) {
this.todoList.splice(index, 1);
// this.status.splice(index, 1);
};
TodoList.prototype.update = function (index, taskUpdate) {
this.todoList[index].task = taskUpdate;
};
TodoList.prototype.changeStatus = function (index) {
this.todoList[index].done = !this.todoList[index].done;
};
TodoList.prototype.getList = function () {
return this.todoList;
};
TodoList.prototype.display = function () {
// console.log('Tasks '+this.todo);
// console.log('Status '+this.status);
var a = 2;
};
return TodoList;
}());
// let atodo = {task : "kill him", done : "false"};
var list = new TodoList();
function addTodo(task, done) {
list.add({
task: task,
done: false
});
}
function deleteTodo(index) {
list.delete(index);
}
function updateTodo(index, taskupdate) {
list.update(index, taskupdate);
}
function changeStatusTodo(index) {
list.changeStatus(index);
}
function getTodos() {
return list.getList();
}
// list.add({task: "Learn Angular",done: false});
// Task name
// done
//mark as read
//delete
//update
// list.display()
Loading

0 comments on commit 950a5d4

Please sign in to comment.