feat: add option to open new note in a new tab
This commit is contained in:
parent
9ca51ffc59
commit
e7aabb9cb9
2 changed files with 14 additions and 0 deletions
|
|
@ -278,6 +278,8 @@ export default class MediaDbPlugin extends Plugin {
|
||||||
try {
|
try {
|
||||||
console.debug('MDB | creating new note');
|
console.debug('MDB | creating new note');
|
||||||
|
|
||||||
|
options.openNote = this.settings.openNoteInNewTab;
|
||||||
|
|
||||||
const fileContent = await this.generateMediaDbNoteContents(mediaTypeModel, options);
|
const fileContent = await this.generateMediaDbNoteContents(mediaTypeModel, options);
|
||||||
|
|
||||||
if (!options.folder) {
|
if (!options.folder) {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ export interface MediaDbPluginSettings {
|
||||||
useCustomYamlStringifier: boolean;
|
useCustomYamlStringifier: boolean;
|
||||||
templates: boolean;
|
templates: boolean;
|
||||||
customDateFormat: string;
|
customDateFormat: string;
|
||||||
|
openNoteInNewTab: boolean;
|
||||||
|
|
||||||
movieTemplate: string;
|
movieTemplate: string;
|
||||||
seriesTemplate: string;
|
seriesTemplate: string;
|
||||||
|
|
@ -61,6 +62,7 @@ const DEFAULT_SETTINGS: MediaDbPluginSettings = {
|
||||||
useCustomYamlStringifier: true,
|
useCustomYamlStringifier: true,
|
||||||
templates: true,
|
templates: true,
|
||||||
customDateFormat: 'L',
|
customDateFormat: 'L',
|
||||||
|
openNoteInNewTab: true,
|
||||||
|
|
||||||
movieTemplate: '',
|
movieTemplate: '',
|
||||||
seriesTemplate: '',
|
seriesTemplate: '',
|
||||||
|
|
@ -206,6 +208,16 @@ export class MediaDbSettingTab extends PluginSettingTab {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
new Setting(containerEl)
|
||||||
|
.setName('Open note in new tab')
|
||||||
|
.setDesc('Open the newly created note in a new tab.')
|
||||||
|
.addToggle(cb => {
|
||||||
|
cb.setValue(this.plugin.settings.openNoteInNewTab).onChange(data => {
|
||||||
|
this.plugin.settings.openNoteInNewTab = data;
|
||||||
|
this.plugin.saveSettings();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
containerEl.createEl('h3', { text: 'New File Location' });
|
containerEl.createEl('h3', { text: 'New File Location' });
|
||||||
// region new file location
|
// region new file location
|
||||||
new Setting(containerEl)
|
new Setting(containerEl)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue