mirror of
https://github.com/sean2077/obsidian-dynamic-theme-background.git
synced 2026-07-22 06:44:57 +00:00
fix: comply with Obsidian plugin guidelines
- Remove "Obsidian" prefix from plugin name across all files - Fix deactivateView antipattern in onunload and settings-view - Improve view management to reuse existing leaves - Update all UI text to sentence case - Replace h3/h4 headings with Setting.setHeading() - Remove "Settings" from setting titles - Update wallpaper API provider labels to sentence case Resolves all issues mentioned in https://github.com/obsidianmd/obsidian-releases/pull/7359#issuecomment-3403529390
This commit is contained in:
parent
6d3b3e12e1
commit
5ab3478aeb
12 changed files with 127 additions and 123 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<div align="center">
|
||||
|
||||
# 🌈 Obsidian DTB
|
||||
# 🌈 Dynamic Theme Background
|
||||
### Build Your Own Wallpaper Library in Obsidian!
|
||||
*Make every note-taking experience visually inspiring*
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div align="center">
|
||||
|
||||
# 🌈 Obsidian DTB
|
||||
# 🌈 动态主题背景 (DTB)
|
||||
### 在 Obsidian 中打造你的专属壁纸库!
|
||||
*让每一次笔记体验都充满视觉灵感*
|
||||
|
||||
|
|
|
|||
124
src/i18n/en.ts
124
src/i18n/en.ts
|
|
@ -1,6 +1,6 @@
|
|||
export default {
|
||||
// ===== 设置标题 =====
|
||||
settings_title: "🌈 Dynamic Theme Background Settings",
|
||||
settings_title: "🌈 Dynamic Theme Background",
|
||||
version: "🛠️ Version: ",
|
||||
author: "🎨 Author: ",
|
||||
homepage: "🏠 Homepage: ",
|
||||
|
|
@ -8,34 +8,34 @@ export default {
|
|||
// ===== 基础设置 =====
|
||||
enable_plugin_name: "Enable dynamic background",
|
||||
enable_plugin_desc: "Turn the dynamic background feature on or off.",
|
||||
basic_settings_title: "Basic Settings",
|
||||
reload_plugin_tooltip: "Refresh Background",
|
||||
enable_status_bar_name: "Enable Status Bar",
|
||||
basic_settings_title: "Basic settings",
|
||||
reload_plugin_tooltip: "Refresh background",
|
||||
enable_status_bar_name: "Enable status bar",
|
||||
enable_status_bar_desc: "Turn the status bar feature on or off.",
|
||||
status_bar_title:
|
||||
"🖱️Left Click: Switch Random Wallpaper\n🖱️Middle Click: Open Settings Tab\n🖱️Right Click: Save Current Background",
|
||||
"🖱️Left Click: Switch random wallpaper\n🖱️Middle Click: Open settings tab\n🖱️Right Click: Save current background",
|
||||
|
||||
// ===== 外观设置 =====
|
||||
appearance_settings_title: "Appearance Settings",
|
||||
appearance_settings_title: "Appearance",
|
||||
appearance_settings_hint:
|
||||
"💡 Global appearance settings. These act as defaults and have lower priority than per-background overrides. If changes here seem ineffective, check whether the currently active background has its own appearance overrides.",
|
||||
blur_depth_name: "Background Blur",
|
||||
blur_depth_name: "Background blur",
|
||||
blur_depth_desc: "Set the background blurriness, from 0 to 30.",
|
||||
reset_blur_tooltip: "Reset to default blur",
|
||||
brightness_name: "Background Brightness",
|
||||
brightness_name: "Background brightness",
|
||||
brightness_desc: "Set the background brightness, from 0 to 1.5.",
|
||||
reset_brightness_tooltip: "Reset to default brightness",
|
||||
saturate_name: "Background Saturation",
|
||||
saturate_name: "Background saturation",
|
||||
saturate_desc: "Set the background saturation, from 0 to 2.",
|
||||
reset_saturate_tooltip: "Reset to default saturation",
|
||||
bg_mask_color_name: "Background Mask Color & Opacity",
|
||||
bg_mask_color_name: "Background mask color & opacity",
|
||||
bg_mask_color_desc: "Set the background mask color and adjust its opacity with the slider on the right.",
|
||||
reset_bg_mask_color_tooltip: "Reset background mask color and opacity to default",
|
||||
overlay_dark_tooltip: "Dark theme overlay",
|
||||
overlay_light_tooltip: "Light theme overlay",
|
||||
per_bg_reset_hint:
|
||||
"Reset only clears overrides for this background, so it inherits global settings (does not modify global settings)",
|
||||
bg_size_name: "Background Size",
|
||||
bg_size_name: "Background size",
|
||||
bg_size_desc:
|
||||
"Set how the background image is sized. 'Intelligent' means choosing size based on image and window dimensions.",
|
||||
reset_bg_size_tooltip: "Reset to default background size",
|
||||
|
|
@ -47,10 +47,10 @@ export default {
|
|||
bg_size_option_intelligent: "Automatically choose the best background size based on image and window dimensions.",
|
||||
|
||||
// ===== 模式设置 =====
|
||||
mode_settings_title: "Mode Settings",
|
||||
switch_mode_name: "Switch Mode",
|
||||
mode_settings_title: "Mode",
|
||||
switch_mode_name: "Switch mode",
|
||||
switch_mode_desc: "Choose how the background switches.",
|
||||
mode_time_based: "Time-Slot",
|
||||
mode_time_based: "Time-slot",
|
||||
mode_interval: "Interval",
|
||||
mode_manual: "Manual",
|
||||
mode_time_based_tooltip:
|
||||
|
|
@ -58,66 +58,66 @@ export default {
|
|||
mode_interval_tooltip:
|
||||
"Automatically switch background at set time intervals, suitable for regular background rotation",
|
||||
mode_manual_tooltip: "Completely manual background control, requiring manual switching through commands or buttons",
|
||||
time_rules_title: "Time Slot Rules",
|
||||
manage_time_rules_name: "Manage Time Slot Rules",
|
||||
time_rules_title: "Time slot rules",
|
||||
manage_time_rules_name: "Manage time slot rules",
|
||||
manage_time_rules_desc: "Add, edit or remove time slot rules for background switching.",
|
||||
add_time_rule_button: "Add Rule",
|
||||
add_time_rule_button: "Add rule",
|
||||
add_time_rule_tooltip: "Click to add a new time slot rule",
|
||||
clear_time_rules_button: "Clear Rules",
|
||||
clear_time_rules_button: "Clear rules",
|
||||
clear_time_rules_tooltip: "Clear all time slot rules",
|
||||
reset_time_rules_button: "Restore Defaults",
|
||||
reset_time_rules_button: "Restore defaults",
|
||||
reset_time_rules_tooltip: "Reset the time slot rules to their default settings.",
|
||||
time_rule_hint:
|
||||
"💡 When time slot rules overlap, the first matching rule takes precedence. The indicator 🔥 means the current active rule.",
|
||||
rule_name_label: "Rule Name:",
|
||||
start_time_label: "Start Time (HH:MM):",
|
||||
end_time_label: "End Time (HH:MM):",
|
||||
interval_name: "Switch Interval",
|
||||
rule_name_label: "Rule name:",
|
||||
start_time_label: "Start time (HH:MM):",
|
||||
end_time_label: "End time (HH:MM):",
|
||||
interval_name: "Switch interval",
|
||||
interval_desc: "How often to switch the background (in minutes).",
|
||||
confirm_clear_time_rules: "Are you sure you want to clear all time slot rules?",
|
||||
active_time_rule: "Currently Active Time Slot Rule",
|
||||
active_time_rule: "Currently active time slot rule",
|
||||
|
||||
// ===== 背景管理 =====
|
||||
bg_management_title: "Background Management",
|
||||
bg_management_title: "Background management",
|
||||
add_new_bg_name: "Add new background",
|
||||
add_new_bg_desc: "Add a new background to the list.",
|
||||
add_image_bg_button: "Add Image",
|
||||
add_color_bg_button: "Add Color",
|
||||
add_gradient_bg_button: "Add Gradient",
|
||||
add_folder_bg_button: "Add Image Folder",
|
||||
restore_default_bg_button: "Restore Defaults",
|
||||
add_image_bg_button: "Add image",
|
||||
add_color_bg_button: "Add color",
|
||||
add_gradient_bg_button: "Add gradient",
|
||||
add_folder_bg_button: "Add image folder",
|
||||
restore_default_bg_button: "Restore defaults",
|
||||
restore_default_bg_tooltip: "Add default gradient backgrounds to the list",
|
||||
restore_default_bg_success: "🎉 Successfully added {count} default backgrounds",
|
||||
restore_default_bg_no_new: "All default backgrounds already exist in the list",
|
||||
add_folder_modal_title: "Add Images from Folder",
|
||||
folder_path_label: "Folder Path (vault internal path):",
|
||||
add_folder_modal_title: "Add images from folder",
|
||||
folder_path_label: "Folder path (vault internal path):",
|
||||
folder_path_placeholder: "e.g., assets/images or photos",
|
||||
folder_scan_success: "🎉 Successfully added {count} images from folder",
|
||||
folder_scan_error: "Failed to scan folder: {error}",
|
||||
folder_not_found: "Folder not found or empty",
|
||||
folder_no_new_images: "All images in this folder already exist in the background list",
|
||||
edit_time_rule_title: "Edit Time Rule",
|
||||
add_modal_title_image: "Add Image Background",
|
||||
add_modal_title_color: "Add Color Background",
|
||||
add_modal_title_gradient: "Add Gradient Background",
|
||||
bg_name_label: "Background Name:",
|
||||
edit_time_rule_title: "Edit time rule",
|
||||
add_modal_title_image: "Add image background",
|
||||
add_modal_title_color: "Add color background",
|
||||
add_modal_title_gradient: "Add gradient background",
|
||||
bg_name_label: "Background name:",
|
||||
image_url_label: "Image URL (remote link or vault internal path):",
|
||||
color_value_label: "Color value (e.g. #ff0000):",
|
||||
gradient_css_label: "CSS gradient (e.g. linear-gradient(45deg, #ff0000, #0000ff)):",
|
||||
select_background_option: "Select Background",
|
||||
select_background_option: "Select background",
|
||||
background_management_hint:
|
||||
"💡 Tip: You can drag background items to reorder them; The background with 🔥 indicator is the currently applied background.",
|
||||
drag_handle_tooltip: "Drag to reorder",
|
||||
random_wallpaper_settings_title: "Random Wallpaper Settings",
|
||||
enable_random_wallpaper_name: "Enable Random Wallpaper",
|
||||
random_wallpaper_settings_title: "Random wallpaper",
|
||||
enable_random_wallpaper_name: "Enable random wallpaper",
|
||||
enable_random_wallpaper_desc:
|
||||
"When enabled, random wallpapers will be fetched from wallpaper APIs and the background list, otherwise it will use the background list in order.",
|
||||
save_image_path_title: "Save Image Path",
|
||||
save_image_path_title: "Save image path",
|
||||
save_image_path_placeholder: "Enter the path to save the image",
|
||||
current_background: "当前背景",
|
||||
current_background: "Current background",
|
||||
|
||||
// ===== 壁纸API管理 =====
|
||||
wallpaper_api_management_title: "Wallpaper API Management",
|
||||
wallpaper_api_management_title: "Wallpaper API management",
|
||||
add_api_name: "Add API",
|
||||
add_api_desc: "Add a new wallpaper API configuration",
|
||||
add_api_button: "Add API",
|
||||
|
|
@ -130,28 +130,28 @@ export default {
|
|||
wallpaper_api_url_name: "Wallpaper API URL",
|
||||
wallpaper_api_url_desc:
|
||||
"Supports Unsplash, Pixabay, Pexels APIs. Default uses Unsplash API (need to replace YOUR_ACCESS_KEY)",
|
||||
fallback_on_error_name: "Fallback on API Error",
|
||||
fallback_on_error_name: "Fallback on API error",
|
||||
fallback_on_error_desc: "When API request fails, fallback to use local background list",
|
||||
test_api_connection_name: "Test API Connection",
|
||||
test_api_connection_name: "Test API connection",
|
||||
test_api_connection_desc: "Test whether current API settings can fetch wallpapers normally",
|
||||
|
||||
// ===== 命令相关 =====
|
||||
command_open_settings_tab_name: "DTB: Open Settings in New Tab",
|
||||
command_open_settings_tab_name: "DTB: Open settings in new tab",
|
||||
command_toggle_name: "DTB: Toggle dynamic background",
|
||||
command_toggle_enabled_notice: "✅ DTB: Dynamic background enabled",
|
||||
command_toggle_disabled_notice: "❌ DTB: Dynamic background disabled",
|
||||
command_next_bg_name: "DTB: Switch to next background",
|
||||
command_next_bg_notice: "🎨 DTB: Background switched to: {bgName}",
|
||||
command_test_bg_name: "DTB: Test current time period background",
|
||||
command_test_bg_success_notice: "🕒 DTB: Current period: {ruleName}, Background: {bgName}",
|
||||
command_test_bg_success_notice: "🕒 DTB: Current period: {ruleName}, background: {bgName}",
|
||||
command_test_bg_no_bg_notice: "⚠️ DTB: No background set for period {ruleName}",
|
||||
command_test_bg_no_rule_notice: "⚠️ DTB: No matching rule for the current time",
|
||||
command_test_bg_not_supported_notice: "⚠️ DTB: Current mode does not support background testing",
|
||||
command_fetch_random_wallpaper_name: "DTB: Fetch Random Wallpaper",
|
||||
command_fetch_random_wallpaper_name: "DTB: Fetch random wallpaper",
|
||||
command_fetch_random_wallpaper_notice_success: "🎉 DTB: Applied random wallpaper",
|
||||
command_fetch_random_wallpaper_notice_failed:
|
||||
"❌ DTB: Failed to fetch random wallpaper, please check API settings and network connection",
|
||||
command_save_current_background_name: "DTB: Save Current Background",
|
||||
command_save_current_background_name: "DTB: Save current background",
|
||||
|
||||
// ===== 通用按钮文本 =====
|
||||
button_cancel: "Cancel",
|
||||
|
|
@ -217,27 +217,27 @@ export default {
|
|||
api_modal_test_failed: "API test failed: {error}",
|
||||
api_modal_api_url: "API URL",
|
||||
api_modal_headers_optional: "Headers (optional)",
|
||||
api_modal_add_header: "Add Header",
|
||||
api_modal_header_key: "Header Key",
|
||||
api_modal_header_value: "Header Value",
|
||||
api_modal_api_parameters: "API Parameters",
|
||||
api_modal_api_documentation: "📖 API Documentation",
|
||||
api_modal_add_header: "Add header",
|
||||
api_modal_header_key: "Header key",
|
||||
api_modal_header_value: "Header value",
|
||||
api_modal_api_parameters: "API parameters",
|
||||
api_modal_api_documentation: "📖 API documentation",
|
||||
api_modal_token_url: "🔑 Token URL",
|
||||
api_modal_extra_params: "Extra Parameters (JSON)",
|
||||
api_modal_extra_params: "Extra parameters (JSON)",
|
||||
api_modal_extra_params_desc: "Additional parameters not covered above, in JSON format",
|
||||
api_modal_extra_params_placeholder: '{\n "customParam": "value",\n "anotherParam": 123\n}',
|
||||
api_modal_test_api: "Test API",
|
||||
api_modal_save: "Save",
|
||||
api_modal_title_edit: "Edit Wallpaper API",
|
||||
api_modal_title_add: "Add Wallpaper API",
|
||||
api_modal_basic_config: "Basic Configuration",
|
||||
api_modal_api_name: "API Name",
|
||||
api_modal_title_edit: "Edit wallpaper API",
|
||||
api_modal_title_add: "Add wallpaper API",
|
||||
api_modal_basic_config: "Basic configuration",
|
||||
api_modal_api_name: "API name",
|
||||
api_modal_api_name_placeholder: "e.g., Unsplash Nature",
|
||||
api_modal_description_optional: "Description (optional)",
|
||||
api_modal_api_type: "API Type",
|
||||
api_modal_custom_settings: "Custom Settings",
|
||||
api_modal_api_type: "API type",
|
||||
api_modal_custom_settings: "Custom settings",
|
||||
api_modal_no_custom_settings: "This API type has no configurable custom settings",
|
||||
api_modal_image_url_json_path: "Image URL JSON Path",
|
||||
api_modal_image_url_json_path: "Image URL JSON path",
|
||||
api_modal_no_description: "No description provided.",
|
||||
api_modal_unnamed_api: "Unnamed API",
|
||||
api_initialized_notice: "{apiName} initialized: {count} wallpapers found across {pages} pages.",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export default {
|
||||
// ===== 设置标题 =====
|
||||
settings_title: "🌈 动态主题背景设置",
|
||||
settings_title: "🌈 动态主题背景",
|
||||
version: "🛠️ 版本: ",
|
||||
author: "🎨 作者: ",
|
||||
homepage: "🏠 首页: ",
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ export default class DynamicThemeBackgroundPlugin extends Plugin {
|
|||
await this.loadSettings();
|
||||
|
||||
// 左侧栏图标
|
||||
this.addRibbonIcon("rainbow", "🌈 Obsidian DTB", async (evt: MouseEvent) => {
|
||||
await this.applyRandomWallpaper();
|
||||
});
|
||||
// this.addRibbonIcon("rainbow", "🌈 DTB", async (evt: MouseEvent) => {
|
||||
// await this.applyRandomWallpaper();
|
||||
// });
|
||||
|
||||
// 状态栏
|
||||
if (this.settings.statusBarEnabled) {
|
||||
|
|
@ -69,7 +69,6 @@ export default class DynamicThemeBackgroundPlugin extends Plugin {
|
|||
|
||||
onunload() {
|
||||
this.stopBackgroundManager();
|
||||
this.deactivateView(); // 清理自定义视图
|
||||
|
||||
// 清理所有注册的API实例(包括状态管理器中的所有订阅)
|
||||
apiManager.deleteAllApis();
|
||||
|
|
@ -87,26 +86,27 @@ export default class DynamicThemeBackgroundPlugin extends Plugin {
|
|||
await this.saveData(this.settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止并清理设置标签页视图
|
||||
*/
|
||||
deactivateView() {
|
||||
this.app.workspace.detachLeavesOfType(DTB_SETTINGS_VIEW_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活设置标签页视图
|
||||
*/
|
||||
async activateView() {
|
||||
this.deactivateView();
|
||||
const leaf = this.app.workspace.getLeaf("tab");
|
||||
await leaf.setViewState({
|
||||
type: DTB_SETTINGS_VIEW_TYPE,
|
||||
active: true,
|
||||
});
|
||||
// 检查是否已经存在该类型的 leaf
|
||||
const existingLeaf = this.app.workspace.getLeavesOfType(DTB_SETTINGS_VIEW_TYPE)[0];
|
||||
|
||||
// 确保标签页获得焦点
|
||||
this.app.workspace.revealLeaf(leaf);
|
||||
if (existingLeaf) {
|
||||
// 如果已存在,则聚焦它
|
||||
this.app.workspace.revealLeaf(existingLeaf);
|
||||
} else {
|
||||
// 如果不存在,则创建新的 leaf
|
||||
const leaf = this.app.workspace.getLeaf("tab");
|
||||
await leaf.setViewState({
|
||||
type: DTB_SETTINGS_VIEW_TYPE,
|
||||
active: true,
|
||||
});
|
||||
|
||||
// 确保标签页获得焦点
|
||||
this.app.workspace.revealLeaf(leaf);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ export class DTBSettingTab extends PluginSettingTab {
|
|||
|
||||
// 创建左侧标题容器
|
||||
const titleContainer = headerContainer.createDiv();
|
||||
titleContainer.createEl("h2", { text: t("settings_title"), cls: "" });
|
||||
// 移除顶级标题,按照Obsidian指南
|
||||
|
||||
// 创建右侧信息容器
|
||||
const infoContainer = headerContainer.createDiv("dtb-links");
|
||||
|
|
@ -120,7 +120,7 @@ export class DTBSettingTab extends PluginSettingTab {
|
|||
cls: "dtb-link",
|
||||
});
|
||||
infoContainer.createEl("a", {
|
||||
text: t("homepage") + "Obsidian DTB",
|
||||
text: t("homepage") + "DTB",
|
||||
href: "https://obsidian-dynamic-theme-background.pages.dev",
|
||||
cls: "dtb-link",
|
||||
});
|
||||
|
|
@ -133,7 +133,9 @@ export class DTBSettingTab extends PluginSettingTab {
|
|||
displayBasicSettings() {
|
||||
const containerEl = this.basicSettingEl;
|
||||
containerEl.empty();
|
||||
containerEl.createEl("h3", { text: t("basic_settings_title") });
|
||||
|
||||
// 基础设置标题
|
||||
new Setting(containerEl).setName(t("basic_settings_title")).setHeading();
|
||||
|
||||
// 是否启用插件
|
||||
new Setting(containerEl)
|
||||
|
|
@ -181,7 +183,7 @@ export class DTBSettingTab extends PluginSettingTab {
|
|||
);
|
||||
|
||||
// 外观设置
|
||||
containerEl.createEl("h4", { text: t("appearance_settings_title") });
|
||||
new Setting(containerEl).setName(t("appearance_settings_title")).setHeading();
|
||||
// 外观设置提示(全局外观优先级说明)
|
||||
const appearanceHint = containerEl.createDiv("dtb-hint");
|
||||
appearanceHint.textContent = t("appearance_settings_hint");
|
||||
|
|
@ -392,7 +394,9 @@ export class DTBSettingTab extends PluginSettingTab {
|
|||
displayModeSettings() {
|
||||
const containerEl = this.modeSettingsEl;
|
||||
containerEl.empty();
|
||||
containerEl.createEl("h3", { text: t("mode_settings_title") });
|
||||
|
||||
// 模式设置标题
|
||||
new Setting(containerEl).setName(t("mode_settings_title")).setHeading();
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName(t("switch_mode_name"))
|
||||
|
|
@ -425,7 +429,7 @@ export class DTBSettingTab extends PluginSettingTab {
|
|||
|
||||
// 时间规则(仅在时间模式下显示)
|
||||
if (this.plugin.settings.mode === "time-based") {
|
||||
containerEl.createEl("h4", { text: t("time_rules_title") });
|
||||
new Setting(containerEl).setName(t("time_rules_title")).setHeading();
|
||||
const buttonContainer = containerEl.createDiv("dtb-large-button-container");
|
||||
new Setting(buttonContainer)
|
||||
.setName(t("manage_time_rules_name"))
|
||||
|
|
@ -655,8 +659,8 @@ export class DTBSettingTab extends PluginSettingTab {
|
|||
const containerEl = this.bgManagementEl;
|
||||
containerEl.empty();
|
||||
|
||||
// 背景管理
|
||||
containerEl.createEl("h3", { text: t("bg_management_title") });
|
||||
// 背景管理标题
|
||||
new Setting(containerEl).setName(t("bg_management_title")).setHeading();
|
||||
|
||||
// 保存远程图片的本地路径
|
||||
const imageFolderInputContainer = containerEl.createDiv("setting-item dtb-flex-container-spaced");
|
||||
|
|
@ -1078,7 +1082,8 @@ export class DTBSettingTab extends PluginSettingTab {
|
|||
const containerEl = this.wallpaperApiSettingsEl;
|
||||
containerEl.empty();
|
||||
|
||||
containerEl.createEl("h3", { text: t("wallpaper_api_management_title") });
|
||||
// 壁纸API管理标题
|
||||
new Setting(containerEl).setName(t("wallpaper_api_management_title")).setHeading();
|
||||
|
||||
// 添加 API 按钮
|
||||
const buttonContainer = containerEl.createDiv("dtb-large-button-container");
|
||||
|
|
|
|||
|
|
@ -56,6 +56,5 @@ export class DTBSettingsView extends ItemView {
|
|||
this.settingTab.containerEl.empty();
|
||||
}
|
||||
this.settingTab = null; // 释放引用,帮助垃圾回收
|
||||
this.plugin.deactivateView(); // 确保视图被正确清理
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export class CustomApi extends BaseWallpaperApi {
|
|||
return [
|
||||
{
|
||||
key: "imageUrlJsonPath",
|
||||
label: "Image URL JSON Path",
|
||||
label: "Image URL JSON path",
|
||||
type: "string",
|
||||
required: true,
|
||||
placeholder: "$.data.images[*].url or $.url or $[*].imageUrl",
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export class PexelsApi extends BaseWallpaperApi {
|
|||
return [
|
||||
{
|
||||
key: "api_key",
|
||||
label: "API Key",
|
||||
label: "API key",
|
||||
type: "password",
|
||||
required: true,
|
||||
placeholder: "Your Pexels API key",
|
||||
|
|
@ -73,7 +73,7 @@ export class PexelsApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "query",
|
||||
label: "Search Query",
|
||||
label: "Search query",
|
||||
type: "string",
|
||||
required: false,
|
||||
placeholder: "nature, landscape, abstract...",
|
||||
|
|
@ -166,14 +166,14 @@ export class PexelsApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "per_page",
|
||||
label: "Photos Per Page",
|
||||
label: "Photos per page",
|
||||
type: "number",
|
||||
defaultValue: defaultParams.per_page,
|
||||
description: "Number of photos per page (max 80)",
|
||||
},
|
||||
{
|
||||
key: "page",
|
||||
label: "Page Number",
|
||||
label: "Page number",
|
||||
type: "number",
|
||||
defaultValue: defaultParams.page,
|
||||
description: "Page number to fetch",
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ export class PixabayApi extends BaseWallpaperApi {
|
|||
return [
|
||||
{
|
||||
key: "key",
|
||||
label: "API Key",
|
||||
label: "API key",
|
||||
type: "password",
|
||||
required: true,
|
||||
placeholder: "Your Pixabay API key",
|
||||
|
|
@ -78,7 +78,7 @@ export class PixabayApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "q",
|
||||
label: "Search Query",
|
||||
label: "Search query",
|
||||
type: "string",
|
||||
required: false,
|
||||
placeholder: "yellow flowers, nature, abstract...",
|
||||
|
|
@ -121,7 +121,7 @@ export class PixabayApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "image_type",
|
||||
label: "Image Type",
|
||||
label: "Image type",
|
||||
type: "select",
|
||||
defaultValue: defaultParams.image_type,
|
||||
description: "Filter results by image type",
|
||||
|
|
@ -199,35 +199,35 @@ export class PixabayApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "min_width",
|
||||
label: "Minimum Width",
|
||||
label: "Minimum width",
|
||||
type: "number",
|
||||
defaultValue: defaultParams.min_width,
|
||||
description: "Minimum image width in pixels",
|
||||
},
|
||||
{
|
||||
key: "min_height",
|
||||
label: "Minimum Height",
|
||||
label: "Minimum height",
|
||||
type: "number",
|
||||
defaultValue: defaultParams.min_height,
|
||||
description: "Minimum image height in pixels",
|
||||
},
|
||||
{
|
||||
key: "editors_choice",
|
||||
label: "Editor's Choice",
|
||||
label: "Editor's choice",
|
||||
type: "boolean",
|
||||
defaultValue: defaultParams.editors_choice,
|
||||
description: "Select images that have received an Editor's Choice award",
|
||||
},
|
||||
{
|
||||
key: "safesearch",
|
||||
label: "Safe Search",
|
||||
label: "Safe search",
|
||||
type: "boolean",
|
||||
defaultValue: defaultParams.safesearch,
|
||||
description: "Only images suitable for all ages",
|
||||
},
|
||||
{
|
||||
key: "order",
|
||||
label: "Order By",
|
||||
label: "Order by",
|
||||
type: "select",
|
||||
defaultValue: defaultParams.order,
|
||||
description: "How the results should be ordered",
|
||||
|
|
@ -238,14 +238,14 @@ export class PixabayApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "per_page",
|
||||
label: "Photos Per Page",
|
||||
label: "Photos per page",
|
||||
type: "number",
|
||||
defaultValue: defaultParams.per_page,
|
||||
description: "Number of images per page (3-200)",
|
||||
},
|
||||
{
|
||||
key: "page",
|
||||
label: "Page Number",
|
||||
label: "Page number",
|
||||
type: "number",
|
||||
defaultValue: defaultParams.page,
|
||||
description: "Page number to fetch",
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export class UnsplashApi extends BaseWallpaperApi {
|
|||
return [
|
||||
{
|
||||
key: "client_id",
|
||||
label: "Access Key",
|
||||
label: "Access key",
|
||||
type: "password",
|
||||
required: true,
|
||||
placeholder: "Your Unsplash access key",
|
||||
|
|
@ -73,7 +73,7 @@ export class UnsplashApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "query",
|
||||
label: "Search Query",
|
||||
label: "Search query",
|
||||
type: "string",
|
||||
required: false,
|
||||
placeholder: "nature, landscape, abstract...",
|
||||
|
|
@ -81,7 +81,7 @@ export class UnsplashApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "order_by",
|
||||
label: "Order By",
|
||||
label: "Order by",
|
||||
type: "select",
|
||||
defaultValue: defaultParams.order_by,
|
||||
description: "How to sort the search results",
|
||||
|
|
@ -126,7 +126,7 @@ export class UnsplashApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "content_filter",
|
||||
label: "Content Filter",
|
||||
label: "Content filter",
|
||||
type: "select",
|
||||
defaultValue: defaultParams.content_filter,
|
||||
description: "Limit results by content safety",
|
||||
|
|
@ -145,14 +145,14 @@ export class UnsplashApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "per_page",
|
||||
label: "Photos Per Page",
|
||||
label: "Photos per page",
|
||||
type: "number",
|
||||
defaultValue: defaultParams.per_page,
|
||||
description: "Number of photos per page (max 30)",
|
||||
},
|
||||
{
|
||||
key: "page",
|
||||
label: "Page Number",
|
||||
label: "Page number",
|
||||
type: "number",
|
||||
defaultValue: defaultParams.page,
|
||||
description: "Page number to fetch",
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ export class WallhavenApi extends BaseWallpaperApi {
|
|||
return [
|
||||
{
|
||||
key: "apikey",
|
||||
label: "API Key",
|
||||
label: "API key",
|
||||
type: "password",
|
||||
required: false,
|
||||
placeholder: "Your Wallhaven API key (optional)",
|
||||
|
|
@ -72,7 +72,7 @@ export class WallhavenApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "q",
|
||||
label: "Search Query",
|
||||
label: "Search query",
|
||||
type: "string",
|
||||
required: false,
|
||||
placeholder: "nature, landscape, abstract...",
|
||||
|
|
@ -107,7 +107,7 @@ export class WallhavenApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "purity",
|
||||
label: "Content Purity",
|
||||
label: "Content purity",
|
||||
type: "multiselect",
|
||||
defaultValue: "100",
|
||||
description: "Select content purity levels",
|
||||
|
|
@ -135,7 +135,7 @@ export class WallhavenApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "sorting",
|
||||
label: "Sort By",
|
||||
label: "Sort by",
|
||||
type: "select",
|
||||
defaultValue: defaultParams.sorting,
|
||||
description: "How to sort the results",
|
||||
|
|
@ -161,7 +161,7 @@ export class WallhavenApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "topRange",
|
||||
label: "Top Range",
|
||||
label: "Top range",
|
||||
type: "select",
|
||||
defaultValue: defaultParams.topRange,
|
||||
description: "Time range for top wallpapers. (Sorting MUST be set to 'toplist')",
|
||||
|
|
@ -176,7 +176,7 @@ export class WallhavenApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "atleast",
|
||||
label: "Minimum Resolution",
|
||||
label: "Minimum resolution",
|
||||
type: "string",
|
||||
required: false,
|
||||
placeholder: "1920x1080",
|
||||
|
|
@ -192,7 +192,7 @@ export class WallhavenApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "ratios",
|
||||
label: "Aspect Ratios",
|
||||
label: "Aspect ratios",
|
||||
type: "string",
|
||||
required: false,
|
||||
placeholder: "16x9,16x10",
|
||||
|
|
@ -208,7 +208,7 @@ export class WallhavenApi extends BaseWallpaperApi {
|
|||
},
|
||||
{
|
||||
key: "page",
|
||||
label: "Page Number",
|
||||
label: "Page number",
|
||||
type: "number",
|
||||
defaultValue: defaultParams.page,
|
||||
description: "Page number to fetch",
|
||||
|
|
|
|||
Loading…
Reference in a new issue