mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-17 19:51:28 +00:00
Preparing v0.24.0
This commit is contained in:
29
src/modules/features/ModuleGlobalHistory.ts
Normal file
29
src/modules/features/ModuleGlobalHistory.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { AbstractObsidianModule, type IObsidianModule } from "../AbstractObsidianModule.ts";
|
||||
import { VIEW_TYPE_GLOBAL_HISTORY, GlobalHistoryView } from "./GlobalHistory/GlobalHistoryView.ts";
|
||||
|
||||
|
||||
export class ModuleObsidianGlobalHistory extends AbstractObsidianModule implements IObsidianModule {
|
||||
|
||||
$everyOnloadStart(): Promise<boolean> {
|
||||
|
||||
this.addCommand({
|
||||
id: "livesync-global-history",
|
||||
name: "Show vault history",
|
||||
callback: () => {
|
||||
this.showGlobalHistory()
|
||||
}
|
||||
})
|
||||
|
||||
this.registerView(
|
||||
VIEW_TYPE_GLOBAL_HISTORY,
|
||||
(leaf) => new GlobalHistoryView(leaf, this.plugin)
|
||||
);
|
||||
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
|
||||
showGlobalHistory() {
|
||||
void this.core.$$showView(VIEW_TYPE_GLOBAL_HISTORY);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user