mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25:11 +00:00
Fix Khoj Obsidian plugin build
This commit is contained in:
@@ -18,6 +18,7 @@ do
|
|||||||
|
|
||||||
# Bump Obsidian plugin to current version
|
# Bump Obsidian plugin to current version
|
||||||
cd $project_root/src/interface/obsidian
|
cd $project_root/src/interface/obsidian
|
||||||
|
yarn build # verify build before bumping version
|
||||||
yarn version --$version_type --no-git-tag-version
|
yarn version --$version_type --no-git-tag-version
|
||||||
# append current version, min Obsidian app version from manifest to versions json
|
# append current version, min Obsidian app version from manifest to versions json
|
||||||
cp $project_root/versions.json .
|
cp $project_root/versions.json .
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export class KhojChatView extends KhojPaneView {
|
|||||||
title: "Show Conversations (^O)",
|
title: "Show Conversations (^O)",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
chatSessions.addEventListener('click', async (_) => { await this.toggleChatSessions(chatBodyEl) });
|
chatSessions.addEventListener('click', async (_) => { await this.toggleChatSessions() });
|
||||||
setIcon(chatSessions, "history");
|
setIcon(chatSessions, "history");
|
||||||
|
|
||||||
let chatInput = inputRow.createEl("textarea", {
|
let chatInput = inputRow.createEl("textarea", {
|
||||||
@@ -607,16 +607,16 @@ export class KhojChatView extends KhojPaneView {
|
|||||||
return `${time_string}, ${date_string}`;
|
return `${time_string}, ${date_string}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
createNewConversation(chatBodyEl: HTMLElement|undefined = undefined) {
|
createNewConversation() {
|
||||||
chatBodyEl = chatBodyEl ?? this.contentEl.getElementsByClassName("khoj-chat-body")[0] as HTMLElement;
|
let chatBodyEl = this.contentEl.getElementsByClassName("khoj-chat-body")[0] as HTMLElement;
|
||||||
chatBodyEl.innerHTML = "";
|
chatBodyEl.innerHTML = "";
|
||||||
chatBodyEl.dataset.conversationId = "";
|
chatBodyEl.dataset.conversationId = "";
|
||||||
chatBodyEl.dataset.conversationTitle = "";
|
chatBodyEl.dataset.conversationTitle = "";
|
||||||
this.renderMessage(chatBodyEl, "Hey 👋🏾, what's up?", "khoj");
|
this.renderMessage(chatBodyEl, "Hey 👋🏾, what's up?", "khoj");
|
||||||
}
|
}
|
||||||
|
|
||||||
async toggleChatSessions(chatBodyEl: HTMLElement|undefined = undefined, forceShow: boolean = false): Promise<boolean> {
|
async toggleChatSessions(forceShow: boolean = false): Promise<boolean> {
|
||||||
chatBodyEl = chatBodyEl ?? this.contentEl.getElementsByClassName("khoj-chat-body")[0] as HTMLElement;
|
let chatBodyEl = this.contentEl.getElementsByClassName("khoj-chat-body")[0] as HTMLElement;
|
||||||
if (!forceShow && this.contentEl.getElementsByClassName("side-panel")?.length > 0) {
|
if (!forceShow && this.contentEl.getElementsByClassName("side-panel")?.length > 0) {
|
||||||
chatBodyEl.innerHTML = "";
|
chatBodyEl.innerHTML = "";
|
||||||
return this.getChatHistory(chatBodyEl);
|
return this.getChatHistory(chatBodyEl);
|
||||||
@@ -630,7 +630,7 @@ export class KhojChatView extends KhojPaneView {
|
|||||||
const newConversationButtonEl = newConversationEl.createEl("button");
|
const newConversationButtonEl = newConversationEl.createEl("button");
|
||||||
newConversationButtonEl.classList.add("new-conversation-button");
|
newConversationButtonEl.classList.add("new-conversation-button");
|
||||||
newConversationButtonEl.classList.add("side-panel-button");
|
newConversationButtonEl.classList.add("side-panel-button");
|
||||||
newConversationButtonEl.addEventListener('click', (_) => this.createNewConversation(chatBodyEl));
|
newConversationButtonEl.addEventListener('click', (_) => this.createNewConversation());
|
||||||
setIcon(newConversationButtonEl, "plus");
|
setIcon(newConversationButtonEl, "plus");
|
||||||
newConversationButtonEl.innerHTML += "New";
|
newConversationButtonEl.innerHTML += "New";
|
||||||
newConversationButtonEl.title = "New Conversation (^N)";
|
newConversationButtonEl.title = "New Conversation (^N)";
|
||||||
@@ -793,7 +793,7 @@ export class KhojChatView extends KhojPaneView {
|
|||||||
chatBodyEl.innerHTML = "";
|
chatBodyEl.innerHTML = "";
|
||||||
chatBodyEl.dataset.conversationId = "";
|
chatBodyEl.dataset.conversationId = "";
|
||||||
chatBodyEl.dataset.conversationTitle = "";
|
chatBodyEl.dataset.conversationTitle = "";
|
||||||
this.toggleChatSessions(chatBodyEl, true);
|
this.toggleChatSessions(true);
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user