From 186b13142f1b9783d164390dc87163d9ff042948 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 27 Sep 2022 15:36:00 +0200 Subject: [PATCH] basic setup --- src/main.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main.ts diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..95103d6 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,28 @@ +import { Plugin, Platform, WorkspaceLeaf } from "obsidian"; +import { defaultSettings, SimpleTimeTrackerSettings } from "./settings"; +import { SimpleTimeTrackerSettingsTab } from "./settings-tab"; + +export default class SimpleTimeTrackerPlugin extends Plugin { + + settings: SimpleTimeTrackerSettings; + + async onload(): Promise { + await this.loadSettings(); + + this.addSettingTab(new SimpleTimeTrackerSettingsTab(this.app, this)); + + this.registerMarkdownCodeBlockProcessor("simple-time-tracker", (s, e) => { + e.empty(); + + e.addClass("simple-time-tracker"); + }); + } + + async loadSettings() { + this.settings = Object.assign({}, defaultSettings, await this.loadData()); + } + + async saveSettings() { + await this.saveData(this.settings); + } +}