Removed the last bit of Sample Plugin code

This commit is contained in:
David Ingerslev 2025-03-09 21:45:46 +00:00
parent dfc24f575f
commit 31af2eed70

64
main.ts
View file

@ -1,4 +1,4 @@
import { App, displayTooltip, Editor, MarkdownView, Modal, Notice, Plugin, PluginSettingTab, Setting, moment, TooltipPlacement, EventRef } from 'obsidian';
import { App, displayTooltip, Editor, MarkdownView, Notice, Plugin, PluginSettingTab, Setting, moment, TooltipPlacement, EventRef } from 'obsidian';
import MsgReader from '@kenjiuno/msgreader';
import proxyData from 'mustache-validator';
const Mustache = require('mustache');
@ -191,54 +191,8 @@ export default class OutlookMeetingNotes extends Plugin {
//TODO: Add commands to create meeting notes.
// This adds a simple command that can be triggered anywhere
this.addCommand({
id: 'open-sample-modal-simple',
name: 'Open sample modal (simple)',
callback: () => {
new OutlookMeetingNotesModal(this.app).open();
}
});
// This adds an editor command that can perform some operation on the current editor instance
this.addCommand({
id: 'sample-editor-command',
name: 'OutlookMeetingNotes editor command',
editorCallback: (editor: Editor, view: MarkdownView) => {
console.log(editor.getSelection());
editor.replaceSelection('OutlookMeetingNotes Editor Command');
}
});
// This adds a complex command that can check whether the current state of the app allows execution of the command
this.addCommand({
id: 'open-sample-modal-complex',
name: 'Open sample modal (complex)',
checkCallback: (checking: boolean) => {
// Conditions to check
const markdownView = this.app.workspace.getActiveViewOfType(MarkdownView);
if (markdownView) {
// If checking is true, we're simply 'checking' if the command can be run.
// If checking is false, then we want to actually perform the operation.
if (!checking) {
new OutlookMeetingNotesModal(this.app).open();
}
// This command will only show up in Command Palette when the check function returns true
return true;
}
}
});
// This adds a settings tab so the user can configure various aspects of the plugin
this.addSettingTab(new OutlookMeetingNotesSettingTab(this.app, this));
// If the plugin hooks up any global DOM events (on parts of the app that doesn't belong to this plugin)
// Using this function will automatically remove the event listener when this plugin is disabled.
// this.registerDomEvent(document, 'click', (evt: MouseEvent) => {
// console.log('click', evt);
// });
// When registering intervals, this function will automatically clear the interval when the plugin is disabled.
//this.registerInterval(window.setInterval(() => console.log('setInterval'), 5 * 60 * 1000));
}
onunload() {
@ -346,22 +300,6 @@ export default class OutlookMeetingNotes extends Plugin {
}
class OutlookMeetingNotesModal extends Modal {
constructor(app: App) {
super(app);
}
onOpen() {
const { contentEl } = this;
contentEl.setText('Woah!');
}
onClose() {
const { contentEl } = this;
contentEl.empty();
}
}
class OutlookMeetingNotesSettingTab extends PluginSettingTab {
plugin: OutlookMeetingNotes;