X-Git-Url: http://git.scottworley.com/vopamoi/blobdiff_plain/974848d36d6c4f1b171bd990f3d5659cb0e8134d..7dcd916735fa4df2d8c27ccef144be0081bbe737:/vopamoi.ts diff --git a/vopamoi.ts b/vopamoi.ts index cb2d50e..0d2944c 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -1,7 +1,18 @@ -var tasks = []; +var tasks: string[] = []; + +function createViewTask(task: string) { + const viewTask = document.createElement("div"); + viewTask.appendChild(document.createTextNode(task)); + return viewTask; +} + +function updateView() { + tasks.forEach((t) => document.getElementById(t) || document.body.appendChild(createViewTask(t))); +} function addTask(task: string) { tasks.push(task); + updateView(); } function browserCreateTask(form: any) {