]> git.scottworley.com Git - vopamoi/commitdiff
Start
authorScott Worley <scottworley@scottworley.com>
Tue, 25 Jan 2022 10:08:21 +0000 (02:08 -0800)
committerScott Worley <scottworley@scottworley.com>
Tue, 25 Jan 2022 10:08:21 +0000 (02:08 -0800)
.gitignore [new file with mode: 0644]
Makefile [new file with mode: 0644]
index.html [new file with mode: 0644]
vopamoi.ts [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..ba4cead
--- /dev/null
@@ -0,0 +1 @@
+vopamoi.js
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..46292dc
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,11 @@
+objs = vopamoi.js
+
+all: $(objs)
+
+.PHONY: all clean
+
+%.js: %.ts
+       tsc --strict $<
+
+clean:
+       -rm $(objs)
diff --git a/index.html b/index.html
new file mode 100644 (file)
index 0000000..5721f96
--- /dev/null
@@ -0,0 +1,11 @@
+<!doctype html>
+<html>
+  <head>
+    <script src="vopamoi.js" defer="true"></script>
+  </head>
+  <body>
+    <form onsubmit="return browserCreateTask(this);">
+      <input name="taskName">
+    </form>
+  </body>
+</html>
diff --git a/vopamoi.ts b/vopamoi.ts
new file mode 100644 (file)
index 0000000..cb2d50e
--- /dev/null
@@ -0,0 +1,11 @@
+var tasks = [];
+
+function addTask(task: string) {
+  tasks.push(task);
+}
+
+function browserCreateTask(form: any) {
+  addTask(form.taskName.value);
+  form.taskName.value = "";
+  return false;
+}