Skip to content

Commit

Permalink
Reformat code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xezard committed Nov 2, 2024
1 parent 0beb8e1 commit 1eb9821
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 73 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
[![Discord chat](https://img.shields.io/discord/775493797702139914?color=blue&label=discord)](https://discord.gg/JZ9uZ5aXwf)
[![Wakatime](https://wakatime.com/badge/user/d6a049ff-6a4a-43a6-84ca-2a7d63329349/project/01a424cf-1ab3-4b40-9d2d-a3a86e47b869.svg)](https://wakatime.com/badge/user/d6a049ff-6a4a-43a6-84ca-2a7d63329349/project/01a424cf-1ab3-4b40-9d2d-a3a86e47b869)

**OEncrypt** is a plugin for [Obsidian](https://obsidian.md/) that allows you to encrypt and decrypt text notes using PGP keys. This plugin ensures the security of your notes by allowing you to store confidential information in encrypted form. Use it to protect personal notes, passwords, and other sensitive information.
**OEncrypt** is a plugin for [Obsidian](https://obsidian.md/) that allows you to encrypt and decrypt
text notes using PGP keys. This plugin ensures the security of your notes by allowing you to store
confidential information in encrypted form. Use it to protect personal notes, passwords, and other
sensitive information.

## Features

Expand All @@ -23,12 +26,16 @@
(A public PGP key is sufficient for encryption.)
- **Encryption/decryption of text or note**:
- Select the text or note file that you want to encrypt or decrypt.
- Right-click on the selected text or note file, and then click on the "Encrypt" or "Decrypt" button
- Right-click on the selected text or note file, and then click on the "Encrypt" or "Decrypt"
button
- **Key Management**: You can add, delete and update your PGP keys in the plugin settings.

## Bugs and Feedback

For bugs, questions and discussions please use the [Github Issues](https://github.com/Xezard/OEncrypt/issues).
For bugs, questions and discussions please use
the [Github Issues](https://github.com/Xezard/OEncrypt/issues).

## License
XGlow is licensed under the Apache-2.0 License. Please see [LICENSE](https://github.com/Xezard/OEncrypt/blob/master/LICENSE "LICENSE") for more info.

XGlow is licensed under the Apache-2.0 License. Please
see [LICENSE](https://github.com/Xezard/OEncrypt/blob/master/LICENSE "LICENSE") for more info.
93 changes: 46 additions & 47 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,65 +27,64 @@ import { ModalsRegistry } from 'src/services/modalsRegistry'
import { EditorExtensionsRegistry } from 'src/services/editorExtensionsRegistry'

export default class OEncryptPlugin extends Plugin {
private state: PluginState
private translationService: TranslationService
private uiService: UIService
private settings: PluginSettings
private pgpService: PGPService
private modalsRegistry: ModalsRegistry
private encryptionService: EncryptionService
private commandsRegistry: CommandsRegistry
private eventRegistry: EventRegistry
private editorExtensionsRegistry: EditorExtensionsRegistry
private state: PluginState
private translationService: TranslationService
private uiService: UIService
private settings: PluginSettings
private pgpService: PGPService
private modalsRegistry: ModalsRegistry
private encryptionService: EncryptionService
private commandsRegistry: CommandsRegistry
private eventRegistry: EventRegistry
private editorExtensionsRegistry: EditorExtensionsRegistry

async onload() {
this.state = new PluginState(this)
this.state = new PluginState(this)

await this.state.load()
await this.state.load()

this.translationService = new TranslationService(this.app)
this.uiService = new UIService(this.translationService)
this.settings = new PluginSettings(
this,
this.state,
this.translationService,
this.uiService
)
this.translationService = new TranslationService(this.app)
this.uiService = new UIService(this.translationService)
this.settings = new PluginSettings(
this,
this.state,
this.translationService,
this.uiService
)

this.addSettingTab(this.settings)
this.addSettingTab(this.settings)

this.pgpService = new PGPService(this.state)
this.modalsRegistry = new ModalsRegistry(this.app, this.state, this.translationService)
this.encryptionService = new EncryptionService(
this.app,
this.state,
this.translationService,
this.pgpService,
this.modalsRegistry
)
this.pgpService = new PGPService(this.state)
this.modalsRegistry = new ModalsRegistry(this.app, this.state, this.translationService)
this.encryptionService = new EncryptionService(
this.app,
this.state,
this.translationService,
this.pgpService,
this.modalsRegistry
)

this.commandsRegistry = new CommandsRegistry(
this,
this.translationService,
this.encryptionService
)
this.commandsRegistry = new CommandsRegistry(
this,
this.translationService,
this.encryptionService
)

await this.commandsRegistry.loadAndRegisterCommands()
this.eventRegistry = new EventRegistry(
this,
this.translationService,
this.encryptionService,
)

this.eventRegistry = new EventRegistry(
this,
this.translationService,
this.encryptionService,
)

this.editorExtensionsRegistry = new EditorExtensionsRegistry(
this,
this.translationService,
this.encryptionService
)
this.editorExtensionsRegistry = new EditorExtensionsRegistry(
this,
this.translationService,
this.encryptionService
)
}

async onunload() {
async onunload() {
await this.state.save()
}
}
44 changes: 22 additions & 22 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"compilerOptions": {
"baseUrl": ".",
"inlineSourceMap": true,
"inlineSources": true,
"module": "ESNext",
"target": "ES6",
"allowJs": true,
"noImplicitAny": true,
"moduleResolution": "node",
"importHelpers": true,
"isolatedModules": true,
"strictNullChecks": true,
"lib": [
"DOM",
"ES5",
"ES6",
"ES7"
]
},
"include": [
"**/*.ts"
]
"compilerOptions": {
"baseUrl": ".",
"inlineSourceMap": true,
"inlineSources": true,
"module": "ESNext",
"target": "ES6",
"allowJs": true,
"noImplicitAny": true,
"moduleResolution": "node",
"importHelpers": true,
"isolatedModules": true,
"strictNullChecks": true,
"lib": [
"DOM",
"ES5",
"ES6",
"ES7"
]
},
"include": [
"**/*.ts"
]
}

0 comments on commit 1eb9821

Please sign in to comment.