diff --git a/main.ts b/main.ts index cf66516..9adf5a0 100644 --- a/main.ts +++ b/main.ts @@ -1,15 +1,7 @@ import { Notice, Plugin } from "obsidian"; -interface CopyImagePluginSettings { - mySetting: string; -} - export default class CopyImagePlugin extends Plugin { - settings: CopyImagePluginSettings; - async onload() { - await this.loadSettings(); - this.registerDomEvent(document, "contextmenu", (evt: MouseEvent) => { const images = document.getElementsByTagName("img"); (async () => { @@ -25,6 +17,9 @@ export default class CopyImagePlugin extends Plugin { ]) .then(() => { new Notice("Copied image URL to clipboard!"); + }) + .catch(() => { + new Notice("Failed to copy image URL to clipboard!"); }); break; } @@ -34,12 +29,4 @@ export default class CopyImagePlugin extends Plugin { } onunload() {} - - async loadSettings() { - this.settings = Object.assign({}, await this.loadData()); - } - - async saveSettings() { - await this.saveData(this.settings); - } } diff --git a/manifest.json b/manifest.json index 4b61312..e94e0fa 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "copy-image", "name": "Copy Image", - "version": "1.0.3", + "version": "1.0.4", "minAppVersion": "0.15.0", "description": "Easily copy image from Obsidian to clipboard by right clicking image.", "author": "Felipe D.S. Lima", diff --git a/package-lock.json b/package-lock.json index f62d2b3..9e47aec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "copy-image", - "version": "1.0.3", + "version": "1.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "copy-image", - "version": "1.0.3", + "version": "1.0.4", "license": "MIT", "devDependencies": { "@types/node": "^16.11.6", diff --git a/package.json b/package.json index 42f5d13..f0d02a8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "copy-image", "displayName": "Copy Image", - "version": "1.0.3", + "version": "1.0.4", "description": "Easily copy image from Obsidian to clipboard by right clicking image.", "main": "main.js", "scripts": { diff --git a/versions.json b/versions.json index 7598f4c..ec47d13 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,4 @@ { - "1.0.3": "0.15.0" + "1.0.3": "0.15.0", + "1.0.4": "0.15.0" }