api descriptions
This commit is contained in:
parent
99980028d0
commit
30d07f79f3
6 changed files with 20 additions and 5 deletions
|
|
@ -3,6 +3,7 @@ import {MediaTypeModel} from '../models/MediaTypeModel';
|
|||
export abstract class APIModel {
|
||||
apiName: string;
|
||||
apiUrl: string;
|
||||
apiDescription: string;
|
||||
types: string[];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ export class OMDbAPI extends APIModel {
|
|||
|
||||
this.plugin = plugin;
|
||||
this.apiName = 'OMDbAPI';
|
||||
this.apiDescription = 'A free API for Movies and Series.';
|
||||
this.apiUrl = 'http://www.omdbapi.com/';
|
||||
this.types = ['movie', 'series'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ export class TestAPI extends APIModel {
|
|||
constructor() {
|
||||
super();
|
||||
this.apiName = 'testAPI';
|
||||
this.apiDescription = 'The test API used during development.';
|
||||
this.apiUrl = 'www.test.api';
|
||||
this.types = ['test'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,10 @@ export class MediaDbAdvancedSearchModal extends Modal {
|
|||
for (const api of this.apiManager.apis) {
|
||||
const apiToggleListElementWrapper = contentEl.createEl('div', {cls: 'media-db-plugin-list-wrapper'});
|
||||
|
||||
apiToggleListElementWrapper.createEl('span', {text: api.apiName, cls: 'media-db-plugin-list-text'});
|
||||
const apiToggleTextWrapper = apiToggleListElementWrapper.createEl('div', {cls: 'media-db-plugin-list-text-wrapper'});
|
||||
apiToggleTextWrapper.createEl('span', {text: api.apiName, cls: 'media-db-plugin-list-text'});
|
||||
apiToggleTextWrapper.createEl('small', {text: api.apiDescription, cls: 'media-db-plugin-list-text'});
|
||||
|
||||
const apiToggleComponentWrapper = apiToggleListElementWrapper.createEl('div', {cls: 'media-db-plugin-list-toggle'});
|
||||
|
||||
const apiToggleComponent = new ToggleComponent(apiToggleComponentWrapper);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export class MediaDbSettingTab extends PluginSettingTab {
|
|||
|
||||
new Setting(containerEl)
|
||||
.setName('New file location')
|
||||
.setDesc('New book notes will be placed here.')
|
||||
.setDesc('New media db entries will be placed here.')
|
||||
.addSearch(cb => {
|
||||
new FolderSuggest(this.app, cb.inputEl);
|
||||
cb.setPlaceholder('Example: folder1/folder2')
|
||||
|
|
@ -44,7 +44,7 @@ export class MediaDbSettingTab extends PluginSettingTab {
|
|||
|
||||
new Setting(containerEl)
|
||||
.setName('OMDb API key')
|
||||
.setDesc('API key for www.omdbapi.com.')
|
||||
.setDesc('API key for "www.omdbapi.com".')
|
||||
.addText(cb => {
|
||||
cb.setPlaceholder('API key')
|
||||
.setValue(this.plugin.settings.OMDbKey)
|
||||
|
|
|
|||
13
styles.css
13
styles.css
|
|
@ -1,13 +1,22 @@
|
|||
.media-db-plugin-list-wrapper {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
/* margin: 5px; */
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.media-db-plugin-list-toggle {
|
||||
|
||||
}
|
||||
|
||||
.media-db-plugin-list-text {
|
||||
.media-db-plugin-list-text-wrapper {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
|
||||
.media-db-plugin-list-text {
|
||||
display: block;
|
||||
}
|
||||
|
||||
small.media-db-plugin-list-text{
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue