mirror of
https://github.com/lossless-group/perplexed-plugin.git
synced 2026-07-22 06:49:50 +00:00
On branch fix/lmstudio Changes to be committed: modified: main.ts new file: main.ts.bak new file: src/core/PerplexedPlugin.ts modified: src/core/PerplexedPluginCore.ts modified: src/services/perplexityService.ts new file: src/settings/PerplexedSettingTab.ts modified: src/settings/PerplexedSettings.ts new file: src/settings/PerplexitySettings.ts
43 lines
No EOL
1.2 KiB
TypeScript
43 lines
No EOL
1.2 KiB
TypeScript
import { Notice } from 'obsidian';
|
|
import { PerplexedPluginCore } from './src/core/PerplexedPluginCore';
|
|
import { PerplexedSettingTab } from './src/settings/PerplexedSettingTab';
|
|
|
|
export default class PerplexedPlugin extends PerplexedPluginCore {
|
|
private statusBarItemEl?: HTMLElement;
|
|
private ribbonIconEl?: HTMLElement;
|
|
|
|
async onload(): Promise<void> {
|
|
await super.onload();
|
|
this.registerCommands();
|
|
this.setupUI();
|
|
}
|
|
|
|
protected registerCommands(): void {
|
|
this.addCommand({
|
|
id: 'show-perplexed-settings',
|
|
name: 'Show Settings',
|
|
callback: () => {
|
|
new PerplexedSettingTab(this.app, this).display();
|
|
}
|
|
});
|
|
}
|
|
|
|
protected setupUI(): void {
|
|
if (this.settings.showStatusBar) {
|
|
this.statusBarItemEl = this.addStatusBarItem();
|
|
this.statusBarItemEl.setText('Perplexed');
|
|
}
|
|
|
|
this.ribbonIconEl = this.addRibbonIcon(
|
|
'zap',
|
|
'Perplexed',
|
|
() => new Notice('Perplexed plugin is ready')
|
|
);
|
|
}
|
|
|
|
onunload() {
|
|
this.statusBarItemEl?.remove();
|
|
this.ribbonIconEl?.remove();
|
|
console.log('Perplexed plugin unloaded');
|
|
}
|
|
} |