From aacf45d6a950fae34d09fd05d1835eb1d588c80d Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 25 Mar 2023 11:12:06 +0800 Subject: [PATCH] :rotating_light: --- app/src/ai/actions.ts | 8 ++++---- app/src/protyle/header/Title.ts | 4 ++-- app/src/protyle/toolbar/index.ts | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/ai/actions.ts b/app/src/ai/actions.ts index 461a3d64a..2dff06be6 100644 --- a/app/src/ai/actions.ts +++ b/app/src/ai/actions.ts @@ -93,12 +93,12 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { window.siyuan.storage[Constants.LOCAL_AI].push({ name: inputElement.value, memo: dialog.element.querySelector("textarea").value, - }) + }); setStorageVal(Constants.LOCAL_AI, window.siyuan.storage[Constants.LOCAL_AI]); dialog.destroy(); }); } - }] + }]; window.siyuan.storage[Constants.LOCAL_AI].forEach((item: { name: string, memo: string }) => { customMenu.push({ iconHTML: Constants.ZWSP, @@ -117,7 +117,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { element.remove(); return true; } - }) + }); } else { fetchPost("/api/ai/chatGPTWithAction", { ids, @@ -135,7 +135,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { event.stopPropagation(); }); } - }) + }); }); window.siyuan.menus.menu.append(new MenuItem({ icon: "iconSparkles", diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.ts index c2b0e8d5c..ee57016ce 100644 --- a/app/src/protyle/header/Title.ts +++ b/app/src/protyle/header/Title.ts @@ -389,7 +389,7 @@ export class Title { click: () => { quickMakeCard([this.element]); } - }] + }]; if (window.siyuan.config.flashcard.deck) { riffCardMenu.push({ iconHTML: Constants.ZWSP, @@ -397,7 +397,7 @@ export class Title { click: () => { makeCard([protyle.block.rootID]); } - }) + }); } window.siyuan.menus.menu.append(new MenuItem({ label: window.siyuan.languages.riffCard, diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index 305d8306a..545f6d144 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -1280,7 +1280,7 @@ export class Toolbar { } }).forEach((item) => { if (inputElement.value === item) { - matchInput = true + matchInput = true; } html += `
${item.replace(inputElement.value.toLowerCase(), "" + inputElement.value.toLowerCase() + "")}
`; }); @@ -1369,7 +1369,7 @@ export class Toolbar { `; const listElement = this.subElement.querySelector(".b3-list"); const previewElement = this.subElement.firstElementChild.lastElementChild; - let previewPath = listElement.firstElementChild.getAttribute("data-value") + let previewPath = listElement.firstElementChild.getAttribute("data-value"); previewTemplate(previewPath, previewElement, protyle.block.parentID); listElement.addEventListener("mouseover", (event) => { const target = event.target as HTMLElement; @@ -1377,11 +1377,11 @@ export class Toolbar { if (!hoverItemElement) { return; } - const currentPath = hoverItemElement.getAttribute("data-value") + const currentPath = hoverItemElement.getAttribute("data-value"); if (previewPath === currentPath) { return; } - previewPath = currentPath + previewPath = currentPath; previewTemplate(previewPath, previewElement, protyle.block.parentID); }); const inputElement = this.subElement.querySelector("input"); @@ -1394,11 +1394,11 @@ export class Toolbar { if (!isEmpty) { const currentElement = upDownHint(listElement, event); if (currentElement) { - const currentPath = currentElement.getAttribute("data-value") + const currentPath = currentElement.getAttribute("data-value"); if (previewPath === currentPath) { return; } - previewPath = currentPath + previewPath = currentPath; previewTemplate(previewPath, previewElement, protyle.block.parentID); } } @@ -1425,11 +1425,11 @@ export class Toolbar { searchHTML += `
${item.content}
`; }); listElement.innerHTML = searchHTML || `
  • ${window.siyuan.languages.emptyContent}
  • `; - const currentPath = response.data.blocks[0]?.path + const currentPath = response.data.blocks[0]?.path; if (previewPath === currentPath) { return; } - previewPath = currentPath + previewPath = currentPath; previewTemplate(previewPath, previewElement, protyle.block.parentID); }); }); @@ -1459,11 +1459,11 @@ export class Toolbar { if (iconElement.parentElement.classList.contains("b3-list-item--focus")) { const sideElement = iconElement.parentElement.previousElementSibling || iconElement.parentElement.nextElementSibling; sideElement.classList.add("b3-list-item--focus"); - const currentPath = sideElement.getAttribute("data-value") + const currentPath = sideElement.getAttribute("data-value"); if (previewPath === currentPath) { return; } - previewPath = currentPath + previewPath = currentPath; previewTemplate(previewPath, previewElement, protyle.block.parentID); } iconElement.parentElement.remove();