mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -36,14 +36,14 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {
|
||||
click() {
|
||||
const dialog = new Dialog({
|
||||
title: window.siyuan.languages.aiCustomAction,
|
||||
content: `<div class="b3-dialog__content"><input class="b3-text-field fn__block" value=""></div>
|
||||
content: `<div class="b3-dialog__content"><textarea class="b3-text-field fn__block"></textarea></div>
|
||||
<div class="b3-dialog__action">
|
||||
<button class="b3-button b3-button--cancel">${window.siyuan.languages.cancel}</button><div class="fn__space"></div>
|
||||
<button class="b3-button b3-button--text">${window.siyuan.languages.confirm}</button>
|
||||
</div>`,
|
||||
width: isMobile() ? "92vw" : "520px",
|
||||
});
|
||||
const inputElement = dialog.element.querySelector("input") as HTMLInputElement;
|
||||
const inputElement = dialog.element.querySelector("textarea");
|
||||
const btnsElement = dialog.element.querySelectorAll(".b3-button");
|
||||
dialog.bindInput(inputElement, () => {
|
||||
(btnsElement[1] as HTMLButtonElement).click();
|
||||
|
||||
@@ -6,14 +6,14 @@ import {fillContent} from "./actions";
|
||||
export const AIChat = (protyle: IProtyle, element: Element) => {
|
||||
const dialog = new Dialog({
|
||||
title: "AI Chat",
|
||||
content: `<div class="b3-dialog__content"><input class="b3-text-field fn__block" value=""></div>
|
||||
content: `<div class="b3-dialog__content"><textarea class="b3-text-field fn__block"></textarea></div>
|
||||
<div class="b3-dialog__action">
|
||||
<button class="b3-button b3-button--cancel">${window.siyuan.languages.cancel}</button><div class="fn__space"></div>
|
||||
<button class="b3-button b3-button--text">${window.siyuan.languages.confirm}</button>
|
||||
</div>`,
|
||||
width: isMobile() ? "92vw" : "520px",
|
||||
});
|
||||
const inputElement = dialog.element.querySelector("input") as HTMLInputElement;
|
||||
const inputElement = dialog.element.querySelector("textarea");
|
||||
const btnsElement = dialog.element.querySelectorAll(".b3-button");
|
||||
dialog.bindInput(inputElement, () => {
|
||||
(btnsElement[1] as HTMLButtonElement).click();
|
||||
|
||||
Reference in New Issue
Block a user