mirror of
https://github.com/scotttomaszewski/obsidian-disciples-journal.git
synced 2026-07-22 05:42:13 +00:00
feat: verse-selection settings + Verse selection settings section
This commit is contained in:
parent
d0c3af1303
commit
2e9dd5f525
1 changed files with 57 additions and 1 deletions
|
|
@ -22,6 +22,10 @@ export interface DisciplesJournalSettings {
|
|||
hideFootnotesInPreview: boolean;
|
||||
chapterNoteFrontmatter: string;
|
||||
passageNoteFrontmatter: string;
|
||||
enableVerseSelection: boolean;
|
||||
defaultInsertFormat: 'inline' | 'codeblock' | 'blockquote';
|
||||
formatChooserStyle: 'split' | 'toggle' | 'submenu';
|
||||
enableAppendToNote: boolean;
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: DisciplesJournalSettings = {
|
||||
|
|
@ -41,7 +45,11 @@ export const DEFAULT_SETTINGS: DisciplesJournalSettings = {
|
|||
hideFootnotes: false,
|
||||
hideFootnotesInPreview: false,
|
||||
chapterNoteFrontmatter: '',
|
||||
passageNoteFrontmatter: ''
|
||||
passageNoteFrontmatter: '',
|
||||
enableVerseSelection: true,
|
||||
defaultInsertFormat: 'inline',
|
||||
formatChooserStyle: 'split',
|
||||
enableAppendToNote: false
|
||||
};
|
||||
|
||||
export class DisciplesJournalSettingsTab extends PluginSettingTab {
|
||||
|
|
@ -266,6 +274,54 @@ export class DisciplesJournalSettingsTab extends PluginSettingTab {
|
|||
await this.plugin.saveSettings();
|
||||
}));
|
||||
|
||||
new Setting(containerEl).setName('Verse selection').setHeading();
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Enable verse selection')
|
||||
.setDesc('Tap verses in a rendered passage to select them and copy/insert them into notes.')
|
||||
.addToggle(toggle => toggle
|
||||
.setValue(this.plugin.settings.enableVerseSelection)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.enableVerseSelection = value;
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Default insert format')
|
||||
.setDesc('The format used by the main button before you pick another.')
|
||||
.addDropdown(dropdown => dropdown
|
||||
.addOption('inline', 'Inline reference')
|
||||
.addOption('codeblock', 'Bible code block')
|
||||
.addOption('blockquote', 'Blockquote with text')
|
||||
.setValue(this.plugin.settings.defaultInsertFormat)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.defaultInsertFormat = value as DisciplesJournalSettings['defaultInsertFormat'];
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Format chooser style')
|
||||
.setDesc('How the action bar lets you pick a format.')
|
||||
.addDropdown(dropdown => dropdown
|
||||
.addOption('split', 'Split buttons (default format + chevron)')
|
||||
.addOption('toggle', 'Format toggle + action buttons')
|
||||
.addOption('submenu', 'Action menus with format submenus')
|
||||
.setValue(this.plugin.settings.formatChooserStyle)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.formatChooserStyle = value as DisciplesJournalSettings['formatChooserStyle'];
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Enable "Append to note…"')
|
||||
.setDesc('Add an action that appends the selection to the end of a note you pick. Overlaps with Insert at cursor, so it is off by default.')
|
||||
.addToggle(toggle => toggle
|
||||
.setValue(this.plugin.settings.enableAppendToNote)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.enableAppendToNote = value;
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
|
||||
new Setting(containerEl).setName('ESV API').setHeading();
|
||||
|
||||
const apiInfoDiv = containerEl.createDiv({cls: 'disciples-journal-api-info'});
|
||||
|
|
|
|||
Loading…
Reference in a new issue