remove obsidian naming
This commit is contained in:
parent
233b27b00b
commit
76b4c70a79
28
main.ts
28
main.ts
|
@ -1,5 +1,5 @@
|
||||||
import { App, Plugin, PluginSettingTab, Setting } from 'obsidian';
|
import { App, Plugin, PluginSettingTab, Setting } from 'obsidian';
|
||||||
import { AppView, OBSIDIAN_INTELLIGENCE_VIEW_TYPE } from './src/ui/AppView';
|
import { AppView, INTELLIGENCE_VIEW_TYPE } from './src/ui/AppView';
|
||||||
import OpenAI from 'openai';
|
import OpenAI from 'openai';
|
||||||
import { IThread } from './src/ui/types';
|
import { IThread } from './src/ui/types';
|
||||||
|
|
||||||
|
@ -25,25 +25,11 @@ export default class Intelligence extends Plugin {
|
||||||
|
|
||||||
async onload() {
|
async onload() {
|
||||||
await this.loadSettings();
|
await this.loadSettings();
|
||||||
this.registerView(OBSIDIAN_INTELLIGENCE_VIEW_TYPE, (leaf) => new AppView(leaf, this));
|
this.registerView(INTELLIGENCE_VIEW_TYPE, (leaf) => new AppView(leaf, this));
|
||||||
|
|
||||||
const ribbonIconEl = this.addRibbonIcon(
|
|
||||||
'bot',
|
|
||||||
'Open Obsidian Intelligence',
|
|
||||||
(evt: MouseEvent) => {
|
|
||||||
this.activateView();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
// Perform additional things with the ribbon
|
|
||||||
ribbonIconEl.addClass('my-plugin-ribbon-class');
|
|
||||||
|
|
||||||
// This adds a status bar item to the bottom of the app. Does not work on mobile apps.
|
|
||||||
const statusBarItemEl = this.addStatusBarItem();
|
|
||||||
statusBarItemEl.setText('Status Bar Text');
|
|
||||||
|
|
||||||
this.addCommand({
|
this.addCommand({
|
||||||
id: 'obsidian-intelligence-view-open',
|
id: 'intelligence-view-open',
|
||||||
name: 'Open Obsidian Intelligence',
|
name: 'Open Intelligence',
|
||||||
callback: () => {
|
callback: () => {
|
||||||
this.activateView();
|
this.activateView();
|
||||||
},
|
},
|
||||||
|
@ -68,10 +54,10 @@ export default class Intelligence extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
async activateView() {
|
async activateView() {
|
||||||
this.app.workspace.detachLeavesOfType(OBSIDIAN_INTELLIGENCE_VIEW_TYPE);
|
this.app.workspace.detachLeavesOfType(INTELLIGENCE_VIEW_TYPE);
|
||||||
|
|
||||||
await this.app.workspace.getRightLeaf(false).setViewState({
|
await this.app.workspace.getRightLeaf(false).setViewState({
|
||||||
type: OBSIDIAN_INTELLIGENCE_VIEW_TYPE,
|
type: INTELLIGENCE_VIEW_TYPE,
|
||||||
active: true,
|
active: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -79,7 +65,7 @@ export default class Intelligence extends Plugin {
|
||||||
}
|
}
|
||||||
async revealView() {
|
async revealView() {
|
||||||
this.app.workspace.revealLeaf(
|
this.app.workspace.revealLeaf(
|
||||||
this.app.workspace.getLeavesOfType(OBSIDIAN_INTELLIGENCE_VIEW_TYPE)[0],
|
this.app.workspace.getLeavesOfType(INTELLIGENCE_VIEW_TYPE)[0],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "Intelligence",
|
"name": "Intelligence",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "OpenAI GPT Assistants functionality inside Obsidian",
|
"description": "Integrate OpenAI GPT Assistants functionality",
|
||||||
"author": "John Mavrick",
|
"author": "John Mavrick",
|
||||||
"authorUrl": "https://beacons.ai/johnmavrick",
|
"authorUrl": "https://beacons.ai/johnmavrick",
|
||||||
"fundingUrl": "https://patreon.com/johnmavrick",
|
"fundingUrl": "https://patreon.com/johnmavrick",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "obsidian-intelligence",
|
"name": "obsidian-intelligence",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "AI-powered assistants inside Obsidian",
|
"description": "Integrate OpenAI GPT Assistants functionality",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "node esbuild.config.mjs",
|
"dev": "node esbuild.config.mjs",
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { App } from 'obsidian';
|
||||||
import Intelligence from '../../main';
|
import Intelligence from '../../main';
|
||||||
import OpenAI from 'openai';
|
import OpenAI from 'openai';
|
||||||
|
|
||||||
export const OBSIDIAN_INTELLIGENCE_VIEW_TYPE = 'obsidian-intelligence-view';
|
export const INTELLIGENCE_VIEW_TYPE = 'obsidian-intelligence-view';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,11 +55,11 @@ export class AppView extends ItemView {
|
||||||
}
|
}
|
||||||
|
|
||||||
getViewType() {
|
getViewType() {
|
||||||
return OBSIDIAN_INTELLIGENCE_VIEW_TYPE;
|
return INTELLIGENCE_VIEW_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
getDisplayText() {
|
getDisplayText() {
|
||||||
return 'Obsidian Intelligence';
|
return 'Intelligence';
|
||||||
}
|
}
|
||||||
getIcon(): string {
|
getIcon(): string {
|
||||||
return 'bot';
|
return 'bot';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Notice } from 'obsidian';
|
import { Notice } from 'obsidian';
|
||||||
|
|
||||||
export const createNotice = (message: string, timeout = 5000): void => {
|
export const createNotice = (message: string, timeout = 5000): void => {
|
||||||
new Notice(`Obsidian Intelligence: ${message}`, timeout);
|
new Notice(`Intelligence: ${message}`, timeout);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue