MCPcopy
hub / github.com/callumalpass/tasknotes / onOpen

Method onOpen

src/modals/TextInputModal.ts:36–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 }
35
36 onOpen() {
37 const { contentEl } = this;
38 contentEl.empty();
39
40 new Setting(contentEl).setName(this.options.title).setHeading();
41
42 new Setting(contentEl).addText((text) => {
43 this.inputEl = text.inputEl;
44 text.setPlaceholder(this.options.placeholder || "")
45 .setValue(this.options.initialValue || "")
46 .onChange(() => {
47 // Optional: real-time validation could go here
48 });
49
50 // Focus the input
51 window.setTimeout(() => {
52 this.inputEl.focus();
53 this.inputEl.select();
54 }, 100);
55
56 this.options.onInputReady?.(this.inputEl);
57 });
58
59 const buttonContainer = contentEl.createEl("div", { cls: "modal-button-container" });
60 buttonContainer.classList.remove(
61 "tn-static-display-block-2a1b75c9",
62 "tn-static-display-flex-4d51fc62",
63 "tn-static-display-flex-8bb39979",
64 "tn-static-display-inline-block-60e32dcb",
65 "tn-static-display-inline-cccfa456",
66 "tn-static-display-inline-flex-f984c520",
67 "tn-static-display-none-6b99de8b",
68 "tn-static-min-height-800px-997b4c8c"
69 );
70 buttonContainer.classList.add("tn-static-display-flex-75816cae");
71 buttonContainer.classList.remove(
72 "tn-static-display-flex-8bb39979",
73 "tn-static-gap-0-5rem-ce2fca4d",
74 "tn-static-gap-12px-ed7b3d87",
75 "tn-static-gap-6px-f0abc1db",
76 "tn-static-gap-8px-33fcd4c3"
77 );
78 buttonContainer.classList.add("tn-static-gap-10px-f3d7ce77");
79 buttonContainer.classList.remove(
80 "tn-static-justify-content-center-03c4bb6f",
81 "tn-static-justify-content-space-between-a562f4fd"
82 );
83 buttonContainer.classList.add("tn-static-justify-content-flex-end-455f8cca");
84 buttonContainer.classList.remove(
85 "tn-static-font-size-12px-b0cc7e05",
86 "tn-static-margin-top-0-5rem-3dc98b5e",
87 "tn-static-margin-top-0-d462248a",
88 "tn-static-margin-top-12px-91e0f558",
89 "tn-static-margin-top-16px-1b0f4999",
90 "tn-static-margin-top-1rem-2239d6d5",
91 "tn-static-margin-top-30px-2fbbbcd4",
92 "tn-static-margin-top-4px-96ad6099",
93 "tn-static-margin-top-8px-8a77e5a3",

Callers

nothing calls this directly

Calls 10

setPlaceholderMethod · 0.80
focusMethod · 0.80
resolveMethod · 0.80
setHeadingMethod · 0.65
setValueMethod · 0.65
setTimeoutMethod · 0.65
closeMethod · 0.65
setNameMethod · 0.45
addTextMethod · 0.45
onChangeMethod · 0.45

Tested by

no test coverage detected