onlyworlds_obsidian-plugin/Modals/WorldCopyModal.ts

26 lines
698 B
TypeScript
Raw Permalink Normal View History

2024-08-18 13:36:28 +00:00
import { Modal, App } from 'obsidian';
export class WorldCopyModal extends Modal {
worldName: string;
constructor(app: App, worldName: string) {
super(app);
this.worldName = worldName;
}
onOpen() {
let { contentEl } = this;
contentEl.createEl('h3', { text: `Copied ${this.worldName}` });
contentEl.createEl('p', {
text: `Copied ${this.worldName} to clipboard and to World Data file`
});
contentEl.createEl('button', { text: 'OK', type: 'button' }, (button) => {
button.onclick = () => this.close();
});
}
onClose() {
this.contentEl.empty();
}
}