Skip to content

Commit

Permalink
fix error style
Browse files Browse the repository at this point in the history
  • Loading branch information
razeghi71 committed Apr 15, 2024
1 parent e46a081 commit c0fa7d1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions query-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class QueryModal extends Modal {
}

private async callApi(query: string): Promise<string[]> {
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) {
Expand All @@ -54,13 +54,13 @@ 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.");
}
}

onClose() {
this.contentEl.empty();
}
}

4 changes: 1 addition & 3 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 3 additions & 2 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"0.0.1": "1.5.12"
}
"0.0.1": "1.5.12",
"0.0.2": "1.5.12"
}

0 comments on commit c0fa7d1

Please sign in to comment.