MCPcopy Create free account
hub / github.com/UNLINEARITY/Obsidian-CodeSpace / display

Method display

src/settings.ts:186–489  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184 }
185
186 display(): void {
187 const { containerEl } = this;
188 containerEl.empty();
189
190 new Setting(containerEl)
191 .setHeading()
192 .setName(t('SETTINGS_HEADING'));
193
194 new Setting(containerEl)
195 .setName(t('SETTINGS_EXTENSIONS_NAME'))
196 .setDesc(t('SETTINGS_EXTENSIONS_DESC'))
197 .addTextArea((text) => {
198 text
199 .setPlaceholder(t('SETTINGS_EXTENSIONS_PLACEHOLDER'))
200 .setValue(this.plugin.settings.extensions)
201 .onChange(async (value) => {
202 this.plugin.settings.extensions = value;
203 await this.plugin.saveSettings();
204 });
205 // Make the textarea larger by default
206 text.inputEl.rows = 6;
207 });
208
209 new Setting(containerEl)
210 .setName(t('SETTINGS_LINE_NUMBERS_NAME'))
211 .setDesc(t('SETTINGS_LINE_NUMBERS_DESC'))
212 .addToggle((toggle) =>
213 toggle
214 .setValue(this.plugin.settings.showLineNumbers)
215 .onChange(async (value) => {
216 this.plugin.settings.showLineNumbers = value;
217 await this.plugin.saveSettings();
218 })
219 );
220
221 new Setting(containerEl)
222 .setName(t('SETTINGS_EDITOR_FONT_SIZE_NAME'))
223 .setDesc(t('SETTINGS_EDITOR_FONT_SIZE_DESC'))
224 .addText((text) =>
225 text
226 .setPlaceholder("16")
227 .setValue(String(this.plugin.settings.editorFontSize))
228 .onChange(async (value) => {
229 const num = parseInt(value);
230 if (!isNaN(num) && num >= 9 && num <= 36) {
231 this.plugin.settings.editorFontSize = num;
232 await this.plugin.saveSettings();
233 }
234 })
235 );
236
237 new Setting(containerEl)
238 .setName(t('SETTINGS_EMBED_FONT_SIZE_NAME'))
239 .setDesc(t('SETTINGS_EMBED_FONT_SIZE_DESC'))
240 .addText((text) =>
241 text
242 .setPlaceholder("13")
243 .setValue(String(this.plugin.settings.embedFontSize))

Callers

nothing calls this directly

Calls 11

removeMountMethod · 0.95
createMountMethod · 0.95
relinkMountMethod · 0.95
normalizeMountPathMethod · 0.95
tFunction · 0.90
createMountIdFunction · 0.85
setValueMethod · 0.80
saveSettingsMethod · 0.80
onChangeMethod · 0.45
addOptionMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected