big changes; we have a good TS config now
This commit is contained in:
parent
cbbaf54b33
commit
4497991344
54 changed files with 750 additions and 671 deletions
|
|
@ -1,13 +1,14 @@
|
|||
import { App, Notice, PluginSettingTab, Setting } from 'obsidian';
|
||||
|
||||
import MediaDbPlugin from '../main';
|
||||
import { FolderSuggest } from './suggesters/FolderSuggest';
|
||||
import { FileSuggest } from './suggesters/FileSuggest';
|
||||
import PropertyMappingModelsComponent from './PropertyMappingModelsComponent.svelte';
|
||||
import { PropertyMapping, PropertyMappingModel, PropertyMappingOption } from './PropertyMapping';
|
||||
import type { App } from 'obsidian';
|
||||
import { Notice, PluginSettingTab, Setting } from 'obsidian';
|
||||
import { mount } from 'svelte';
|
||||
import type MediaDbPlugin from '../main';
|
||||
import type { MediaTypeModel } from '../models/MediaTypeModel';
|
||||
import { MEDIA_TYPES } from '../utils/MediaTypeManager';
|
||||
import { MediaTypeModel } from '../models/MediaTypeModel';
|
||||
import { fragWithHTML } from '../utils/Utils';
|
||||
import { PropertyMapping, PropertyMappingModel, PropertyMappingOption } from './PropertyMapping';
|
||||
import PropertyMappingModelsComponent from './PropertyMappingModelsComponent.svelte';
|
||||
import { FileSuggest } from './suggesters/FileSuggest';
|
||||
import { FolderSuggest } from './suggesters/FolderSuggest';
|
||||
|
||||
export interface MediaDbPluginSettings {
|
||||
OMDbKey: string;
|
||||
|
|
@ -193,7 +194,7 @@ export class MediaDbSettingTab extends PluginSettingTab {
|
|||
});
|
||||
});
|
||||
|
||||
new Setting(containerEl)
|
||||
new Setting(containerEl)
|
||||
.setName('Moby Games key')
|
||||
.setDesc('API key for "www.mobygames.com".')
|
||||
.addText(cb => {
|
||||
|
|
@ -205,7 +206,7 @@ export class MediaDbSettingTab extends PluginSettingTab {
|
|||
});
|
||||
});
|
||||
|
||||
new Setting(containerEl)
|
||||
new Setting(containerEl)
|
||||
.setName('Giant Bomb Key')
|
||||
.setDesc('API key for "www.giantbomb.com".')
|
||||
.addText(cb => {
|
||||
|
|
@ -254,7 +255,10 @@ export class MediaDbSettingTab extends PluginSettingTab {
|
|||
.onChange(data => {
|
||||
const newDateFormat = data ? data : DEFAULT_SETTINGS.customDateFormat;
|
||||
this.plugin.settings.customDateFormat = newDateFormat;
|
||||
document.getElementById('media-db-dateformat-preview').textContent = this.plugin.dateFormatter.getPreview(newDateFormat); // update preview
|
||||
const previewEl = document.getElementById('media-db-dateformat-preview');
|
||||
if (previewEl) {
|
||||
previewEl.textContent = this.plugin.dateFormatter.getPreview(newDateFormat); // update preview
|
||||
}
|
||||
void this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
|
|
@ -689,7 +693,7 @@ export class MediaDbSettingTab extends PluginSettingTab {
|
|||
Don't forget to save your changes using the save button for each individual category.
|
||||
</p>`;
|
||||
|
||||
new PropertyMappingModelsComponent({
|
||||
mount(PropertyMappingModelsComponent, {
|
||||
target: this.containerEl,
|
||||
props: {
|
||||
models: this.plugin.settings.propertyMappingModels.map(x => x.copy()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue