-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
42 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* @Author: cumany [email protected] | ||
* @Date: 2023-07-26 16:57:16 | ||
* @LastEditors: cumany [email protected] | ||
* @LastEditTime: 2024-03-27 14:27:56 | ||
* @LastEditTime: 2024-04-01 18:22:30 | ||
* @Description: | ||
*/ | ||
import { Notice, Plugin, } from "obsidian" | ||
|
@@ -13,7 +13,7 @@ import PluginProcessor from "@/utils/downloader" | |
import ThemeProcessor from "@/utils/tdownloader" | ||
import PluginStatistics from "@/utils/pluginstatistics" | ||
import ThemeStatistics from "@/utils/themestatistics" | ||
|
||
export interface PkmerSettings { | ||
token: string | ||
} | ||
|
@@ -40,7 +40,7 @@ export default class PkmerPlugin extends Plugin { | |
) | ||
// 监听自定义事件 | ||
addEventListener("reload-statusbar", async () => { | ||
this.reloadStatusBarHandler(); | ||
this.reloadStatusBarHandler(); | ||
}) | ||
} | ||
reloadStatusBarHandler = async () => { | ||
|
@@ -119,13 +119,16 @@ export default class PkmerPlugin extends Plugin { | |
id: "open-pkmer-market-view", | ||
name: "Open Pkmer Market View", | ||
callback: () => { | ||
|
||
|
||
this.openView('') | ||
} | ||
}) | ||
} | ||
|
||
private registerCustomRibbon() { | ||
this.addRibbonIcon("download", "Open Pkmer Market", () => { | ||
|
||
this.openView(''); | ||
}) | ||
} | ||
|
@@ -138,6 +141,7 @@ export default class PkmerPlugin extends Plugin { | |
// 注册点击事件,并使用防抖函数作为处理程序 | ||
this.registerDomEvent(this.statusBarIconEl, "click", () => { | ||
|
||
|
||
this.updateStatusBar("statusbar") | ||
}) | ||
} | ||
|
@@ -162,6 +166,7 @@ export default class PkmerPlugin extends Plugin { | |
type: "updated", | ||
count: updatedCount | ||
}; | ||
|
||
this.openView(JSON.stringify(data)) | ||
} | ||
|
||
|
@@ -170,21 +175,21 @@ export default class PkmerPlugin extends Plugin { | |
type: "tupdated", | ||
count: tupdatedCount | ||
}; | ||
|
||
this.openView(JSON.stringify(data)) | ||
|
||
} | ||
} else | ||
this.openView(''); | ||
} else | ||
{ | ||
} | ||
} else { | ||
this.statusBarIconEl.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rocket"><path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"/><path d="m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"/><path d="M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"/><path d="M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"/></svg>` | ||
this.statusBarIconEl.setAttribute("aria-label", "Updated Info: Plugins: " + updatedCount + "/" + installedCount + ", Themes: " + tupdatedCount + "/" + tinstalledCount); | ||
this.openView('') | ||
if (event === "statusbar") | ||
this.openView(''); | ||
} | ||
|
||
|
||
} | ||
private openView(state: string) { | ||
openView(state: string) { | ||
let pkmerDownloaderFound = false; | ||
|
||
app.workspace.iterateAllLeaves((leaf) => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,12 @@ | |
* @Author: cumany [email protected] | ||
* @Date: 2023-07-24 16:35:56 | ||
* @LastEditors: cumany [email protected] | ||
* @LastEditTime: 2023-12-06 11:12:00 | ||
* @LastEditTime: 2024-04-01 18:17:35 | ||
* @Description: | ||
*/ | ||
import PkmerLoginModal from "./components/login/PkmerLoginModal"; | ||
import PkmerPlugin from "./main"; | ||
import { App, PluginSettingTab, Setting, Platform } from "obsidian"; | ||
import { DEFAULT_VIEW_TYPE } from "./views/PluginMarket"; | ||
export class PkmerSettingTab extends PluginSettingTab { | ||
plugin: PkmerPlugin; | ||
|
||
|
@@ -74,7 +73,8 @@ export class PkmerSettingTab extends PluginSettingTab { | |
.onClick(() => { | ||
app.setting.close(); | ||
setTimeout(() => { | ||
this.app.workspace.getLeaf().setViewState({ active: true, type: DEFAULT_VIEW_TYPE }); | ||
|
||
this.plugin.openView(""); | ||
}, 100); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* @Author: cumany [email protected] | ||
* @Date: 2023-07-23 17:35:33 | ||
* @LastEditors: cumany [email protected] | ||
* @LastEditTime: 2024-03-26 12:21:11 | ||
* @LastEditTime: 2024-04-01 11:34:47 | ||
* @Description: | ||
*/ | ||
import { ItemView, WorkspaceLeaf } from "obsidian" | ||
|
@@ -43,7 +43,7 @@ export class PkmderDownloaderView extends ItemView { | |
|
||
async onOpen() { | ||
const { contentEl } = this | ||
|
||
console.log("welcome Pkmer Market") | ||
const pluginMarketApp = createApp(PluginMarketView, { | ||
settings: this.settings, | ||
app: this.app, | ||
|