Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/pull/14843

Vanessab3764d6a20dc
diff --git a/app/src/protyle/preview/image.ts b/app/src/protyle/preview/image.ts
index 57639d22d0..033a3962eb 100644
--- a/app/src/protyle/preview/image.ts
+++ b/app/src/protyle/preview/image.ts
@@ -58,10 +58,11 @@ export const previewDocImage = (currentSrc: string, id: string) => {
});
};
-export const previewAttrViewImages = (currentSrc: string, avID: string, viewID: string) => {
+export const previewAttrViewImages = (currentSrc: string, avID: string, viewID: string, query: string) => {
fetchPost("/api/av/getCurrentAttrViewImages", {
id: avID,
- viewID: viewID
+ viewID,
+ query,
}, (response) => {
previewImages(response.data, currentSrc);
});
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index 0bb72c03a8..32392b5a51 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -68,6 +68,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
(imgElement as HTMLImageElement).src,
blockElement.getAttribute("data-av-id"),
blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW),
+ (blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement)?.value.trim() || ""
);
event.preventDefault();
event.stopPropagation();
diff --git a/app/src/protyle/render/av/asset.ts b/app/src/protyle/render/av/asset.ts
index 6df51c3cdf..7217627734 100644
--- a/app/src/protyle/render/av/asset.ts
+++ b/app/src/protyle/render/av/asset.ts
@@ -341,7 +341,8 @@ export const editAssetItem = (options: {
previewAttrViewImages(
linkAddress,
options.blockElement.getAttribute("data-av-id"),
- options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW)
+ options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW),
+ (options.blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement)?.value.trim() || ""
);
}
});
diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.ts
index ad2bf02de3..c76d24c083 100644
--- a/app/src/protyle/render/av/openMenuPanel.ts
+++ b/app/src/protyle/render/av/openMenuPanel.ts
@@ -1259,13 +1259,15 @@ export const openMenuPanel = (options: {
)) {
openAsset(options.protyle.app, assetLink.trim(), parseInt(getSearch("page", assetLink)), "right");
} else if (Constants.SIYUAN_ASSETS_IMAGE.includes(suffix)) {
- previewAttrViewImages(assetLink, avID, options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW));
+ previewAttrViewImages(assetLink, avID, options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW),
+ (options.blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement)?.value.trim() || "");
} else {
window.open(assetLink);
}
/// #else
if (Constants.SIYUAN_ASSETS_IMAGE.includes(suffix)) {
- previewAttrViewImages(assetLink, avID, options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW));
+ previewAttrViewImages(assetLink, avID, options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW),
+ (options.blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement)?.value.trim() || "");
} else {
window.open(assetLink);
}