diff --git a/src/modals/DirectoryModal.ts b/src/modals/DirectoryModal.ts deleted file mode 100644 index 9a8815c..0000000 --- a/src/modals/DirectoryModal.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Modal, Setting } from "obsidian"; -import FileHider from "../main"; -import { createStyleLine } from "../utils"; - -export class DirectoryModal extends Modal { - private plugin: FileHider; - - constructor(plugin: FileHider) { - super(plugin.app); - this.plugin = plugin; - } - - onOpen() { - const {contentEl: content} = this; - content.createEl(`h1`, { text: `Folder List` }); - content.createEl(`hr`); - let body = content.createEl(`div`, { cls: `folder-list-modal-body` }); - this.plugin.settings.hiddenFolders.forEach(folder => { - let c = body.createEl(`div`); - new Setting(c) - .setName(folder) - .addButton(btn => { - btn.setIcon(`cross`) - .setTooltip(`Remove Folder`) - .onClick((e) => { - this.plugin.unhideFolder(folder); - c.hide(); - }); - }); - }); - } - - onClose() { - const {contentEl} = this; - contentEl.empty(); - } -} \ No newline at end of file diff --git a/src/modals/FileModal.ts b/src/modals/FileModal.ts deleted file mode 100644 index 9aca18f..0000000 --- a/src/modals/FileModal.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Modal, Setting } from "obsidian"; -import FileHider from "../main"; -import { createStyleLine } from "../utils"; - -export class FileModal extends Modal { - private plugin: FileHider; - - constructor(plugin: FileHider) { - super(plugin.app); - this.plugin = plugin; - }; - - onOpen() { - const {contentEl: content} = this; - content.createEl(`h1`, { text: `File List` }); - content.createEl(`hr`); - let body = content.createEl(`div`, { cls: `file-list-modal-body` }); - this.plugin.settings.hiddenFiles.forEach(file => { - let c = body.createEl(`div`); - new Setting(c) - .setName(file) - .addButton(btn => { - btn.setIcon(`cross`) - .setTooltip(`Remove File`) - .onClick((e) => { - this.plugin.unhideFile(file); - c.hide(); - }); - }); - }); - }; - - onClose() { - const {contentEl} = this; - contentEl.empty(); - }; -}; \ No newline at end of file diff --git a/src/settings/manageHiddenFiles.ts b/src/settings/manageHiddenFiles.ts deleted file mode 100644 index ba2c63f..0000000 --- a/src/settings/manageHiddenFiles.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Setting } from "obsidian"; -import FileHider from "../main"; -import { FileModal } from "../modals/FileModal"; - -export class ManageHiddenFiles { - - public static create(plugin: FileHider, container: HTMLElement) { - return new Setting(container) - .setName(`Hidden Files`) - .setDesc(`Add or remove files from the list that are being hidden`) - .addButton(b => { - b.setButtonText(`Manage File List`) - .onClick(event => { - // sanity check to prevent other code from opening the modal - if (!event.isTrusted) { return } - - new FileModal(plugin).open(); - }); - }); - }; -}; \ No newline at end of file diff --git a/src/settings/manageHiddenFolders.ts b/src/settings/manageHiddenFolders.ts deleted file mode 100644 index 56744bd..0000000 --- a/src/settings/manageHiddenFolders.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { DirectoryModal } from "../modals/DirectoryModal"; -import { Setting } from "obsidian"; -import FileHider from "../main"; - -export class ManageHiddenDirectories { - - public static create(plugin: FileHider, container: HTMLElement) { - return new Setting(container) - .setName(`Hidden Folders`) - .setDesc(`Add or remove folders from the list that are being hidden`) - .addButton(b => { - b.setButtonText(`Manage Folder List`) - .onClick(event => { - // sanity check to prevent other code from opening the modal - if (!event.isTrusted) { return } - - new DirectoryModal(plugin).open(); - }); - }); - }; -}; \ No newline at end of file