2024-01-20 17:47:56 +00:00
|
|
|
import { GpgSettingsTab } from 'src/SettingsTab';
|
2024-01-20 19:31:51 +00:00
|
|
|
import { HotKeys } from 'src/HotKeys';
|
2024-01-20 20:43:40 +00:00
|
|
|
import { Plugin } from 'obsidian';
|
2024-01-21 16:45:00 +00:00
|
|
|
import { GpgEncryptSettings, Settings } from 'src/Settings';
|
2024-01-22 15:34:10 +00:00
|
|
|
import { livePreviewExtensionGpgEncrypt } from 'src/LivePreview';
|
2025-12-03 13:56:42 +00:00
|
|
|
import { registerReadingModeProcessor } from 'src/ReadingModeProcessor';
|
2024-01-04 18:45:32 +00:00
|
|
|
|
2024-01-21 16:45:00 +00:00
|
|
|
// My plugin PGP Encrypt
|
2024-01-20 20:43:40 +00:00
|
|
|
export default class GpgEncryptPlugin extends Plugin {
|
2024-01-21 16:45:00 +00:00
|
|
|
|
|
|
|
|
// Settings property in PGP Encrypt Plugin
|
2024-01-20 20:43:40 +00:00
|
|
|
settings: GpgEncryptSettings;
|
2024-01-04 18:45:32 +00:00
|
|
|
|
2024-01-21 16:45:00 +00:00
|
|
|
// OnLoad Method in PGP Encrypt Plugin
|
2024-01-04 18:45:32 +00:00
|
|
|
async onload() {
|
2024-01-20 19:31:51 +00:00
|
|
|
// Load settings variables
|
2024-01-21 16:45:00 +00:00
|
|
|
await new Settings(this).loadSettings();
|
2024-01-20 19:31:51 +00:00
|
|
|
// Add setting tab
|
|
|
|
|
this.addSettingTab(new GpgSettingsTab(this.app, this));
|
|
|
|
|
// Add hotkeys
|
2024-01-20 20:43:40 +00:00
|
|
|
let hotKeys: HotKeys = new HotKeys(this.app, this);
|
|
|
|
|
this.addCommand(hotKeys.GpgEncryptInline);
|
|
|
|
|
this.addCommand(hotKeys.GpgEncryptDocument);
|
2024-01-22 15:34:10 +00:00
|
|
|
// Add Live Privew Extension GPG Encrypt
|
2024-01-23 02:31:28 +00:00
|
|
|
this.registerEditorExtension(livePreviewExtensionGpgEncrypt(this.app, this));
|
2025-12-03 13:56:42 +00:00
|
|
|
// Add Reading Mode Post Processor for GPG Encrypt
|
|
|
|
|
this.registerMarkdownPostProcessor(registerReadingModeProcessor(this.app, this));
|
2024-01-04 18:45:32 +00:00
|
|
|
}
|
|
|
|
|
|
2024-01-21 16:45:00 +00:00
|
|
|
// OnUnload Method in PGP Encrypt Plugin
|
2024-01-04 18:45:32 +00:00
|
|
|
onunload() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|