Skip to content

Commit

Permalink
0.7.5 add:设置可以直接打开市场
Browse files Browse the repository at this point in the history
  • Loading branch information
cumany committed Dec 6, 2023
1 parent b92b967 commit b779a42
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "pkmer",
"name": "PKMer",
"version": "0.7.4",
"version": "0.7.5",
"minAppVersion": "1.3.5",
"description": "A marketplace of third-party plugins and themes developed by Obsidian enthusiasts in China to enhance the experience of using Obsidian in China.",
"author": "PKMer(windily-cloud&cumany)",
Expand Down
4 changes: 2 additions & 2 deletions src/components/plugin/PluginCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: cumany cuman@qq.com
* @Date: 2023-02-23 17:17:12
* @LastEditors: cumany cuman@qq.com
* @LastEditTime: 2023-11-10 16:20:52
* @LastEditTime: 2023-12-06 10:29:55
* @FilePath: \pkmer-docs\src\components\Widget\WidgetCard.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
Expand Down Expand Up @@ -228,7 +228,7 @@ const handleOpenSettings = () => {
<h3
data-pagefind-meta="title"
class="flex items-center text-lg font-medium leading-6 plugin_name font-heading text-muted-800 dark:text-white">
{{ pluginInfo.name }}
<a :href="pluginInfo.contentUrl?pluginInfo.contentUrl:pluginInfo.readme_zh?pluginInfo.readme_zh:'#'">{{ pluginInfo.name }}</a>

<img
class="ml-2 -mt-2"
Expand Down
23 changes: 21 additions & 2 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* @Author: cumany [email protected]
* @Date: 2023-07-24 16:35:56
* @LastEditors: cumany [email protected]
* @LastEditTime: 2023-09-08 09:12:20
* @LastEditTime: 2023-12-06 11:12:00
* @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;

Expand Down Expand Up @@ -60,6 +60,25 @@ export class PkmerSettingTab extends PluginSettingTab {


}

new Setting(containerEl)
.setName("🥚打开PKMer Market")

.setDesc("点击开始挑选心爱的插件和主题吧")
.addButton((button) => {
button
.setIcon("download")
.setButtonText("进入")
.setClass("px-5")
.setCta()
.onClick(() => {
app.setting.close();
setTimeout(() => {
this.app.workspace.getLeaf().setViewState({ active: true, type: DEFAULT_VIEW_TYPE });
}, 100);
});
});

containerEl.createEl("hr", { cls: "mt-2" });
const div = containerEl.createEl("div", {
cls: "mt-4",
Expand Down
61 changes: 61 additions & 0 deletions src/types/obsidian.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import "obsidian";






declare module "obsidian" {
export interface App {
foldManager: FoldManager
plugins: Plugins
commands: Commands
setting: SettingsManager
}

interface SettingsManager {
activeTab: SettingTab | null;
openTabById(id: string): SettingTab | null;
openTab(tab: SettingTab): void;
open(): void;
close(): void;
onOpen(): void;
onClose(): void;
settingTabs: SettingTab[];
pluginTabs: SettingTab[];
addSettingTab(): void;
removeSettingTab(): void;
containerEl: HTMLDivElement;
}

interface Plugins {
manifests: Record<string, PluginManifest>;
plugins: Record<string, Plugin_2>;
enabledPlugins: any;
enablePlugin(pluginId: string): Promise<boolean>;
disblePlugin(pluginId: string): Promise<void>;
}

interface Commands {
commands: Record<string, Command>;
addCommand(cmd: Command): void;
removeCommand(cmd: Command): void;
}




interface Editor {
cm: CodeMirror.Editor;
}

interface EditorSuggestManager {
suggests: EditorSuggest<any>[];
}





}

0 comments on commit b779a42

Please sign in to comment.