mirror of
https://github.com/gnoxnahte/obsidian-auto-embed.git
synced 2026-07-22 09:50:24 +00:00
Some foundation for preload options
Switching computers
This commit is contained in:
parent
04a21a21b3
commit
e0cae5611b
4 changed files with 48 additions and 0 deletions
|
|
@ -82,6 +82,7 @@ A brief overview with some steps on how the plugin works. *Not required to use t
|
|||
- [ ] Google Maps
|
||||
- [ ] Google Calendar
|
||||
- [ ] Other websites. [Iframely](https://iframely.com/domains) has a list of websites that can be embedded.
|
||||
- [ ] Add preview websites when hovering a link and holding `Ctrl` for websites that aren't embedded using the syntax.
|
||||
- [ ] Add tests
|
||||
- [ ] Updated README.md
|
||||
- [ ] Improve readability. Open to suggestions, especially if something isn't clear.
|
||||
|
|
|
|||
22
SettingsExplanation.md
Normal file
22
SettingsExplanation.md
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Settings
|
||||
This is an explanation of all the settings that the plugin has.
|
||||
|
||||
## General
|
||||
### Preview Embed
|
||||
Opens this for you to test your embeds
|
||||

|
||||
|
||||
### Dark Mode
|
||||
Sets dark mode for supported websites:
|
||||
- Reddit
|
||||
- Twitter/X
|
||||
|
||||
## Show thumbnail
|
||||
|
||||
|
||||
### Thumbnail supported websites list
|
||||
- YouTube
|
||||
- CodePen
|
||||
- TikTok
|
||||
|
||||
##
|
||||
BIN
readme-assets/settings/Preview-Settings.png
Normal file
BIN
readme-assets/settings/Preview-Settings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 182 KiB |
|
|
@ -14,6 +14,13 @@ export enum GoogleDocsViewOptions {
|
|||
EditDefault,
|
||||
}
|
||||
|
||||
export enum PreloadOptions {
|
||||
None,
|
||||
Placeholder,
|
||||
Placeholder_ClickToLoad,
|
||||
Thumbnail,
|
||||
Thumbnail_ClickToLoad,
|
||||
}
|
||||
|
||||
// export type SupportedWebsites = "CodePen" | "Google Docs" | "Imgur" | "Reddit" | "SoundCloud" | "Spotify" | "Steam" | "TikTok" | "Twitter/X" | "YouTube";
|
||||
|
||||
|
|
@ -26,6 +33,7 @@ export type SupportedWebsitesMap = {
|
|||
export interface PluginSettings {
|
||||
// General
|
||||
darkMode: boolean;
|
||||
preloadOption: PreloadOptions;
|
||||
|
||||
enabledWebsites: SupportedWebsitesMap;
|
||||
|
||||
|
|
@ -152,6 +160,23 @@ export class AutoEmbedSettingTab extends PluginSettingTab {
|
|||
await this.plugin.saveSettings();
|
||||
})
|
||||
);
|
||||
|
||||
const preloadOptions = EnumToRecord(PreloadOptions);
|
||||
Object.entries(preloadOptions).forEach(([key, value]) => {
|
||||
preloadOptions[key] = value.replace("_", " + ");
|
||||
});
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Preload options")
|
||||
.setDesc("Choose how the embed behaves before loading")
|
||||
.addDropdown(dropdown => dropdown
|
||||
.addOptions(preloadOptions)
|
||||
.setValue(PreloadOptions[settings.preloadOption])
|
||||
.onChange(async (value) => {
|
||||
settings.preloadOption = PreloadOptions[value as keyof typeof PreloadOptions];
|
||||
await this.plugin.saveSettings();
|
||||
})
|
||||
)
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Supported website")
|
||||
|
|
|
|||
Loading…
Reference in a new issue