From c0fa7d115fae540f98d347f7546d04f776fe7bc3 Mon Sep 17 00:00:00 2001 From: Mohammad Razeghi Date: Mon, 15 Apr 2024 19:39:28 +0200 Subject: [PATCH] fix error style --- manifest.json | 4 ++-- package.json | 2 +- query-modal.ts | 8 ++++---- styles.css | 4 +--- versions.json | 5 +++-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/manifest.json b/manifest.json index ac8c44c..ae01229 100644 --- a/manifest.json +++ b/manifest.json @@ -1,11 +1,11 @@ { "id": "image-search", "name": "Image Search", - "version": "0.0.1", + "version": "0.0.2", "minAppVersion": "1.5.12", "description": "Search and insert images using Google API", "author": "Mohammad Razeghi", "authorUrl": "https://github.com/razeghi71", "fundingUrl": "https://www.buymeacoffee.com/marzghi", "isDesktopOnly": false -} +} \ No newline at end of file diff --git a/package.json b/package.json index 9793496..e3cb398 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-image-search", - "version": "0.0.1", + "version": "0.0.2", "description": "This is image search plugin for Obsidian (https://obsidian.md)", "main": "main.js", "scripts": { diff --git a/query-modal.ts b/query-modal.ts index 383429c..f150bd2 100644 --- a/query-modal.ts +++ b/query-modal.ts @@ -30,7 +30,7 @@ export class QueryModal extends Modal { } private async callApi(query: string): Promise { - const url = `https://www.googleapis.com/customsearch/v1?q=${encodeURIComponent(query)}&cx=${this.settings.searchEngineId}&searchType=image&num=10&key=${this.settings.apiKey}`; + const url = `https://www.googaleapis.com/customsearch/v1?q=${encodeURIComponent(query)}&cx=${this.settings.searchEngineId}&searchType=image&num=10&key=${this.settings.apiKey}`; const response = await fetch(url); if (!response.ok) { @@ -54,9 +54,8 @@ export class QueryModal extends Modal { }); } catch (error) { this.imageList - .createEl("li") - .createDiv({ cls: "error" }) - .setText("Search was unsuccessful. Please check the API Key and Search engine ID in settings."); + .createDiv({ cls: "responsive-gallery-error" }) + .setText("Search was unsuccessful. Please check your connection, the API Key and Search engine ID in settings."); } } @@ -64,3 +63,4 @@ export class QueryModal extends Modal { this.contentEl.empty(); } } + diff --git a/styles.css b/styles.css index 14d80fb..5c99a7e 100644 --- a/styles.css +++ b/styles.css @@ -35,11 +35,9 @@ ul.responsive-gallery img { width: 100%; padding: 20px; text-align: center; - background-color: var(--background-modifier-error); - color: var(--text-normal); + color: var(--text-error); border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); - margin: 10px 0; font-size: 1rem; font-weight: bold; } diff --git a/versions.json b/versions.json index 8fb1847..700b85f 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,4 @@ { - "0.0.1": "1.5.12" -} + "0.0.1": "1.5.12", + "0.0.2": "1.5.12" +} \ No newline at end of file