mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-08 05:39:13 +00:00
Rename KhojModal to KhojSearchModal, a more specific name for it
In preparation to introduce Khoj chat in Obsidian
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { Notice, Plugin } from 'obsidian';
|
import { Notice, Plugin } from 'obsidian';
|
||||||
import { KhojSetting, KhojSettingTab, DEFAULT_SETTINGS } from 'src/settings'
|
import { KhojSetting, KhojSettingTab, DEFAULT_SETTINGS } from 'src/settings'
|
||||||
import { KhojModal } from 'src/modal'
|
import { KhojSearchModal } from 'src/search_modal'
|
||||||
import { configureKhojBackend } from './utils';
|
import { configureKhojBackend } from './utils';
|
||||||
|
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ export default class Khoj extends Plugin {
|
|||||||
name: 'Search',
|
name: 'Search',
|
||||||
checkCallback: (checking) => {
|
checkCallback: (checking) => {
|
||||||
if (!checking && this.settings.connectedToBackend)
|
if (!checking && this.settings.connectedToBackend)
|
||||||
new KhojModal(this.app, this.settings).open();
|
new KhojSearchModal(this.app, this.settings).open();
|
||||||
return this.settings.connectedToBackend;
|
return this.settings.connectedToBackend;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -27,7 +27,7 @@ export default class Khoj extends Plugin {
|
|||||||
name: 'Find similar notes',
|
name: 'Find similar notes',
|
||||||
editorCheckCallback: (checking) => {
|
editorCheckCallback: (checking) => {
|
||||||
if (!checking && this.settings.connectedToBackend)
|
if (!checking && this.settings.connectedToBackend)
|
||||||
new KhojModal(this.app, this.settings, true).open();
|
new KhojSearchModal(this.app, this.settings, true).open();
|
||||||
return this.settings.connectedToBackend;
|
return this.settings.connectedToBackend;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -36,7 +36,7 @@ export default class Khoj extends Plugin {
|
|||||||
this.addRibbonIcon('search', 'Khoj', (_: MouseEvent) => {
|
this.addRibbonIcon('search', 'Khoj', (_: MouseEvent) => {
|
||||||
// Called when the user clicks the icon.
|
// Called when the user clicks the icon.
|
||||||
this.settings.connectedToBackend
|
this.settings.connectedToBackend
|
||||||
? new KhojModal(this.app, this.settings).open()
|
? new KhojSearchModal(this.app, this.settings).open()
|
||||||
: new Notice(`❗️Ensure Khoj backend is running and Khoj URL is pointing to it in the plugin settings`);
|
: new Notice(`❗️Ensure Khoj backend is running and Khoj URL is pointing to it in the plugin settings`);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -59,5 +59,5 @@ export default class Khoj extends Plugin {
|
|||||||
await configureKhojBackend(this.app.vault, this.settings, false);
|
await configureKhojBackend(this.app.vault, this.settings, false);
|
||||||
}
|
}
|
||||||
this.saveData(this.settings);
|
this.saveData(this.settings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export interface SearchResult {
|
|||||||
file: string;
|
file: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class KhojModal extends SuggestModal<SearchResult> {
|
export class KhojSearchModal extends SuggestModal<SearchResult> {
|
||||||
setting: KhojSetting;
|
setting: KhojSetting;
|
||||||
rerank: boolean = false;
|
rerank: boolean = false;
|
||||||
find_similar_notes: boolean;
|
find_similar_notes: boolean;
|
||||||
Reference in New Issue
Block a user