diff --git a/README.md b/README.md index 1c2339b..a6c5292 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # OEncrypt +![demo.gif](docs%2Fdemo.gif) + +[![CI](https://github.com/Xezard/OEncrypt/actions/workflows/ci.yml/badge.svg)](https://github.com/Xezard/OEncrypt/actions/workflows/ci.yml) ![Obsidian](https://img.shields.io/badge/Tested%20on%20Obsidian-v.1.7.4-informational) [![License](https://img.shields.io/github/license/Xezard/OEncrypt)](https://github.com/Xezard/OEncrypt/blob/master/LICENSE) ![Lines of code](https://img.shields.io/endpoint?url=https://ghloc.vercel.app/api/Xezard/OEncrypt/badge?filter=.ts&label=Lines%20of%20code&color=blue) diff --git a/assets/styles.css b/assets/styles.css new file mode 100644 index 0000000..6f11900 --- /dev/null +++ b/assets/styles.css @@ -0,0 +1,7 @@ +.file-info-display { + margin-left: 1rem; +} + +.passphrase-input { + width: 100%; +} \ No newline at end of file diff --git a/docs/demo.gif b/docs/demo.gif new file mode 100644 index 0000000..3913ba4 Binary files /dev/null and b/docs/demo.gif differ diff --git a/src/modals/PassphraseModal.ts b/src/modals/PassphraseModal.ts index 11fa7cc..79791a7 100644 --- a/src/modals/PassphraseModal.ts +++ b/src/modals/PassphraseModal.ts @@ -66,9 +66,8 @@ export class PassphraseModal extends Modal implements PluginModal { const passphraseSetting = new Setting(this.contentEl).addText((text) => { this.input = text.inputEl - + this.input.className = 'passphrase-input' this.input.type = 'password' - this.input.style.width = '100%' text.onChange((value) => { this.passphrase = value diff --git a/src/services/encryptionService.ts b/src/services/encryptionService.ts index 2fe3dc0..90365fd 100644 --- a/src/services/encryptionService.ts +++ b/src/services/encryptionService.ts @@ -168,7 +168,7 @@ export class EncryptionService { const newFilePath = `${baseFilePath}${extension}` await this.app.vault.create(newFilePath, content) - await this.app.vault.delete(activeFile) + await this.app.fileManager.trashFile(activeFile) await this.app.workspace.openLinkText(newFilePath, '', false) } diff --git a/src/services/uiService.ts b/src/services/uiService.ts index 43265e0..3331acd 100644 --- a/src/services/uiService.ts +++ b/src/services/uiService.ts @@ -30,7 +30,6 @@ export class UIService { if (!fileInfoElement) { fileInfoElement = document.createElement('div') fileInfoElement.className = 'file-info-display' - fileInfoElement.style.marginLeft = '1rem' setting.settingEl.appendChild(fileInfoElement) } else { fileInfoElement.empty()