bindHandlers function application
Last updated: 2026-03-04T23:36:57.288Z
Location
Metrics
LOC: 42
Complexity: 5
Params: 0
Signature
bindHandlers(): : void
Source Code
function bindHandlers(): void {
const btnFillAll = document.getElementById(
"btn-fill-all",
) as HTMLButtonElement | null;
btnFillAll?.addEventListener("click", async () => {
const orig = btnFillAll.textContent ?? "";
btnFillAll.textContent = "…";
await doSend({ type: "FILL_ALL_FIELDS" }, btnFillAll, orig);
});
const btnFillAi = document.getElementById(
"btn-fill-ai",
) as HTMLButtonElement | null;
btnFillAi?.addEventListener("click", async () => {
const context = await openAIContextModal();
if (context === null) return;
const orig = btnFillAi.textContent ?? "";
btnFillAi.textContent = "…";
await doSend(
{ type: "FILL_CONTEXTUAL_AI", payload: context },
btnFillAi,
orig,
);
});
const btnFillEmpty = document.getElementById(
"btn-fill-empty",
) as HTMLButtonElement | null;
btnFillEmpty?.addEventListener("click", async () => {
const orig = btnFillEmpty.textContent ?? "";
btnFillEmpty.textContent = "…";
await doSend(
{ type: "FILL_ALL_FIELDS", payload: { fillEmptyOnly: true } },
btnFillEmpty,
orig,
);
});
document.getElementById("btn-settings")?.addEventListener("click", () => {
chrome.runtime.openOptionsPage();
});
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| doSend | calls |
| openAIContextModal | calls |
| click | dynamic_call |
Impact (Incoming)
| Source | Type |
|---|---|
| init | calls |