]> git.scottworley.com Git - vopamoi/blame_incremental - vopamoi.ts
Tasks can be focused
[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 viewTask.setAttribute("tabindex", "0");
7 return viewTask;
8}
9
10function updateView() {
11 tasks.forEach((t) => document.getElementById(t) || document.body.appendChild(createViewTask(t)));
12}
13
14function addTask(task: string) {
15 tasks.push(task);
16 updateView();
17}
18
19function browserCreateTask(form: any) {
20 addTask(form.taskName.value);
21 form.taskName.value = "";
22 return false;
23}