From 28a8def24d10456905eeaf420708a8f145208ff6 Mon Sep 17 00:00:00 2001 From: hacker-c <1507559148@qq.com> Date: Mon, 17 Mar 2025 21:17:20 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20refactor:=20remove=20unused=20co?= =?UTF-8?q?de?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - main.ts | 24 ++---------------------- manifest.json | 2 +- package.json | 2 +- styles.css | 8 -------- versions.json | 2 +- 6 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 styles.css diff --git a/README.md b/README.md index 0bc28ac..40a976a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ This is an Obsidian plugin designed to open projects or files directly in GitHub 1. Download Release Files: - main.js - manifest.json - - styles.css (if applicable) 2. Copy Files to Plugin Folder: Paste the downloaded files into your vault’s plugin folder: `VaultFolder/.obsidian/plugins/open-in-github` 3. Enable the Plugin: diff --git a/main.ts b/main.ts index dd27959..f7d1799 100644 --- a/main.ts +++ b/main.ts @@ -35,8 +35,8 @@ export default class OpenInGitHubPlugin extends Plugin { // add icon addIcon(CONSTS.TITLE_ID, customIcon) - // Left open-in-github button - const ribbonIconEl = this.addRibbonIcon(CONSTS.TITLE_ID, CONSTS.TITLE, this.openGitHub) + // left open-in-github button + this.addRibbonIcon(CONSTS.TITLE_ID, CONSTS.TITLE, this.openGitHub) // add file menu this.registerEvent( @@ -61,28 +61,8 @@ export default class OpenInGitHubPlugin extends Plugin { }); }) ); - - // Perform additional things with the ribbon - ribbonIconEl.addClass('my-plugin-ribbon-class') - - // Bottom right open-file-in-github button - // This adds a status bar item to the bottom of the app. Does not work on mobile apps. - // const statusBarItemEl = this.addStatusBarItem(); - // const parser = new DOMParser() - // const svgDoc = parser.parseFromString(customIcon(24, 80), 'image/svg+xml') - // const svgElement = svgDoc.documentElement as unknown as HTMLElement - // svgElement.setAttribute('width', '16'); - // svgElement.setAttribute('height', '16'); - // statusBarItemEl.appendChild(svgElement); - // statusBarItemEl.addEventListener('click', e => openGitHub(e, true)) - - // When registering intervals, this function will automatically clear the interval when the plugin is disabled. - this.registerInterval(window.setInterval(() => console.log('setInterval'), 5 * 60 * 1000)) } - - onunload() { } - async loadSettings() { this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()) } diff --git a/manifest.json b/manifest.json index f3ad16b..70aae42 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "open-in-github", "name": "Open in GitHub", - "version": "1.0.0", + "version": "1.0.1", "minAppVersion": "0.15.0", "description": "Open the current project or file in github.com.", "author": "Murphy Chen", diff --git a/package.json b/package.json index 6a00766..a9f81ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-sample-plugin", - "version": "1.0.0", + "version": "1.0.1", "description": "This is a sample plugin for Obsidian (https://obsidian.md)", "main": "main.js", "scripts": { diff --git a/styles.css b/styles.css deleted file mode 100644 index 71cc60f..0000000 --- a/styles.css +++ /dev/null @@ -1,8 +0,0 @@ -/* - -This CSS file will be included with your plugin, and -available in the app when your plugin is enabled. - -If your plugin does not need CSS, delete this file. - -*/ diff --git a/versions.json b/versions.json index 26382a1..18af01b 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,3 @@ { - "1.0.0": "0.15.0" + "1.0.1": "0.15.0" }