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