<script src="vopamoi.js" defer="true"></script>
</head>
<body onload="browserInit();">
- <form onsubmit="return browserCreateTask(this);">
+ <form onsubmit="return BrowserUI.addTask(this);">
<input id="taskName" name="taskName">
</form>
</body>
},
};
+const BrowserUI = {
+ addTask: function (form: any) {
+ if (form.taskName.value) {
+ UI.addTask(form.taskName.value);
+ form.taskName.value = "";
+ }
+ return false;
+ },
+};
+
function focusTaskNameInput(event: any) {
document.getElementById("taskName")!.focus();
event.preventDefault();
}
}
-function browserCreateTask(form: any) {
- if (form.taskName.value) {
- UI.addTask(form.taskName.value);
- }
- form.taskName.value = "";
- return false;
-}
-
function browserInit() {
document.body.addEventListener("keydown", handleKey, { capture: false });
Log.replay();