Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
felipe-ds-lima committed Jan 13, 2024
1 parent b1bffac commit a104993
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 21 deletions.
19 changes: 3 additions & 16 deletions main.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand All @@ -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;
}
Expand All @@ -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);
}
}
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"1.0.3": "0.15.0"
"1.0.3": "0.15.0",
"1.0.4": "0.15.0"
}

0 comments on commit a104993

Please sign in to comment.