lossless-group_perplexed-pl.../main.ts
mpstaton a6417ec351 refactor(main): backed up main and fixed it relative to refactor
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
2025-07-26 18:00:59 +03:00

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');
}
}