mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-13 01:35:57 +00:00
- (Beta) ignore files handling Fixed: - Buttons on lock-detected-dialogue now can be shown in narrow-width devices. Improved: - Some constant has been flattened to be evaluated. - The usage of the deprecated API of obsidian has been reduced. - Now the indexedDB adapter will be enabled while the importing configuration. Misc: - Compiler, framework, and dependencies have been upgraded. - Due to standing for these impacts (especially in esbuild and svelte,) terser has been introduced. Feel free to notify your opinion to me! I do not like to obfuscate the code too.
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import {
|
|
ItemView,
|
|
WorkspaceLeaf
|
|
} from "./deps";
|
|
import GlobalHistoryComponent from "./GlobalHistory.svelte";
|
|
import type ObsidianLiveSyncPlugin from "./main";
|
|
|
|
export const VIEW_TYPE_GLOBAL_HISTORY = "global-history";
|
|
export class GlobalHistoryView extends ItemView {
|
|
|
|
component: GlobalHistoryComponent;
|
|
plugin: ObsidianLiveSyncPlugin;
|
|
icon: "clock";
|
|
title: string;
|
|
navigation: true;
|
|
|
|
getIcon(): string {
|
|
return "clock";
|
|
}
|
|
|
|
constructor(leaf: WorkspaceLeaf, plugin: ObsidianLiveSyncPlugin) {
|
|
super(leaf);
|
|
this.plugin = plugin;
|
|
}
|
|
|
|
|
|
getViewType() {
|
|
return VIEW_TYPE_GLOBAL_HISTORY;
|
|
}
|
|
|
|
getDisplayText() {
|
|
return "Vault history";
|
|
}
|
|
|
|
// eslint-disable-next-line require-await
|
|
async onOpen() {
|
|
this.component = new GlobalHistoryComponent({
|
|
target: this.contentEl,
|
|
props: {
|
|
plugin: this.plugin,
|
|
},
|
|
});
|
|
}
|
|
|
|
// eslint-disable-next-line require-await
|
|
async onClose() {
|
|
this.component.$destroy();
|
|
}
|
|
}
|