Convert add_game.js to TypeScript (issue #17)

- Add ts/utils.ts: fully-typed port of utils.js (onSwap, toISOUTCString,
  syncSelectInputUntilChanged, conditionalElementHandler, disableElementsWhen*,
  getValueFromProperty). Uses document.querySelector throughout; fixes
  removeEventListener bug (was passing function reference instead of named
  listener); uses boolean disabled property instead of string "disabled"/""
- Add ts/add_game.ts: TypeScript conversion of add_game.js, imports
  syncSelectInputUntilChanged from ts/utils.ts (resolves to dist/utils.js
  at runtime)
- Update add_game view to serve compiled dist/add_game.js

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-19 13:06:58 +02:00
parent ce5e5fb729
commit 4f535be270
3 changed files with 238 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
import { syncSelectInputUntilChanged } from "./utils.js";
const syncData = [
{
source: "#id_name",
source_value: "value",
target: "#id_sort_name",
target_value: "value",
},
];
syncSelectInputUntilChanged(syncData, "form");