0
0
Fork 0

Remove the modals that are no longer needed

This commit is contained in:
Oliver Akins 2022-06-02 21:55:48 -06:00
parent 68953651dc
commit bbeb588633
No known key found for this signature in database
GPG key ID: 3C2014AF9457AF99
4 changed files with 0 additions and 116 deletions

View file

@ -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();
}
}

View file

@ -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();
};
};

View file

@ -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();
});
});
};
};

View file

@ -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();
});
});
};
};