]> git.scottworley.com Git - vopamoi/blame_incremental - vopamoi.ts
Create tasks
[vopamoi] / vopamoi.ts
... / ...
CommitLineData
1var tasks: string[] = [];
2
3function createViewTask(task: string) {
4 const viewTask = document.createElement("div");
5 viewTask.appendChild(document.createTextNode(task));
6 return viewTask;
7}
8
9function updateView() {
10 tasks.forEach((t) => document.getElementById(t) || document.body.appendChild(createViewTask(t)));
11}
12
13function addTask(task: string) {
14 tasks.push(task);
15 updateView();
16}
17
18function browserCreateTask(form: any) {
19 addTask(form.taskName.value);
20 form.taskName.value = "";
21 return false;
22}