Last active
August 29, 2015 14:02
-
-
Save sh4869/8785fe667679ce8c4f64 to your computer and use it in GitHub Desktop.
Todo List made by dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: 'Open Sans', sans-serif; | |
background-color: WhiteSmoke; | |
margin: 15px; | |
} | |
#to-do-input { | |
font-family: 'Open Sans', sans-serif; | |
font-size: 14px; | |
padding: 5px 0px 5px 5px; | |
width: 100%; | |
border: 1px solid Silver; | |
background-color: White; | |
} | |
#to-do-list #finish-list { | |
padding:0px; | |
margin:0px; | |
list-style-position:inside; | |
} | |
#to-do-list li { | |
padding:5px 0px 5px 5px; | |
border-bottom: 1px dotted Silver; | |
} | |
#to-do-list li:hover { | |
color: red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:html'; | |
//add HTML_tag element | |
InputElement toDoInput; | |
UListElement toDoList; | |
UListElement finishList; | |
ButtonElement toDoClear; | |
ButtonElement finishClear; | |
void main() { | |
//gets an Element object | |
toDoInput = querySelector('#to-do-input'); | |
toDoList = querySelector('#to-do-list'); | |
toDoClear = querySelector('#to-do-clear'); | |
finishList = querySelector('#finish-list'); | |
finishClear = querySelector('#finish-clear'); | |
toDoInput.onChange.listen(addToDoItem); | |
toDoClear.onClick.listen(deleteAllElements); | |
finishClear.onClick.listen(deletefinshElements); | |
} | |
void addToDoItem(Event e) { | |
var newToDo = new LIElement(); | |
newToDo.text = toDoInput.value; | |
newToDo.onClick.listen((e) { | |
finishList.children.add(newToDo); | |
}); | |
toDoInput.value = ''; | |
toDoList.children.add(newToDo); | |
} | |
void deleteAllElements(Event e) { | |
toDoList.children.clear(); | |
toDoInput.value = ''; | |
} | |
void deletefinshElements(Event e){ | |
finishList.children.clear(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Todo</title> | |
<link rel="stylesheet" href="todo.css"> | |
</head> | |
<body> | |
<h2 id="to-do-title">Procrastinator's Todo</h2> | |
<button id="to-do-clear">Delete ALL</button> | |
<div> | |
<input id="to-do-input" type="text" placeholder="What needs to be done?"> </input> | |
</div> | |
<div> | |
<ul id="to-do-list"> | |
</ul> | |
</div> | |
<h3>Finish task</h3> | |
<button id="finish-clear">Delte finish task</button> | |
<div> | |
<ul id="finish-list"> | |
</ul> | |
</div> | |
<script type="application/dart" src="todo.dart"></script> | |
<script src="packages/browser/dart.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment