🎨 The backlink panel no longer displays child-block references https://github.com/siyuan-note/siyuan/issues/12861

This commit is contained in:
Daniel 2024-10-21 23:40:51 +08:00
parent c9f5a2de3d
commit f708e99a74
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
19 changed files with 53 additions and 8 deletions

View file

@ -191,6 +191,14 @@ export const editor = {
<span class="fn__space"></span>
<input class="b3-text-field fn__flex-center fn__size200" id="backmentionExpandCount" type="number" min="-1" max="512" value="${window.siyuan.config.editor.backmentionExpandCount}"/>
</div>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.backlinkContainChildren}
<div class="b3-label__text">${window.siyuan.languages.backlinkContainChildrenTip}</div>
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="backlinkContainChildren" type="checkbox"${window.siyuan.config.editor.backlinkContainChildren ? " checked" : ""}/>
</label>
<div class="fn__flex b3-label config__item">
<div class="fn__flex-1">
${window.siyuan.languages.generateHistory}
@ -386,6 +394,7 @@ export const editor = {
blockRefDynamicAnchorTextMaxLen: parseInt((editor.element.querySelector("#blockRefDynamicAnchorTextMaxLen") as HTMLInputElement).value),
backlinkExpandCount: parseInt((editor.element.querySelector("#backlinkExpandCount") as HTMLInputElement).value),
backmentionExpandCount: parseInt((editor.element.querySelector("#backmentionExpandCount") as HTMLInputElement).value),
backlinkContainChildren: (editor.element.querySelector("#backlinkContainChildren") as HTMLInputElement).checked,
dynamicLoadBlocks: dynamicLoadBlocks,
codeLigatures: (editor.element.querySelector("#codeLigatures") as HTMLInputElement).checked,
codeTabSpaces: parseInt((editor.element.querySelector("#codeTabSpaces") as HTMLInputElement).value),

View file

@ -24,8 +24,9 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
"onlySearchForDoc", "onlySearchForDocTip", "dynamicLoadBlocks", "dynamicLoadBlocksTip", "fontSizeScrollZoom", "fontSizeScrollZoomTip",
"listItemDotNumberClickFocus", "listItemDotNumberClickFocusTip", "editorMarkdownInlineAsterisk", "editorMarkdownInlineUnderscore",
"editorMarkdownInlineSup", "editorMarkdownInlineSupTip", "editorMarkdownInlineSub", "editorMarkdownInlineSubTip",
"editorMarkdownInlineTag", "editorMarkdownInlineTagTip", "editorMarkdownInlineMath", "editorMarkdownInlineMathTip",
"allowHTMLBLockScript", "allowHTMLBLockScriptTip",
"editorMarkdownInlineTag", "editorMarkdownInlineTagTip", "editorMarkdownInlineMath", "editorMarkdownInlineMathTip", "editorMarkdownInlineStrikethrough", "editorMarkdownInlineStrikethroughTip",
"allowHTMLBLockScript", "allowHTMLBLockScriptTip", "backlinkExpandCount", "backlinkExpandTip", "backmentionExpandCount", "backmentionExpandTip",
"backlinkContainChildren", "backlinkContainChildrenTip"
]),
// 文档树

View file

@ -437,7 +437,6 @@ export class Backlink extends Model {
defID: this.blockId,
refTreeID: docId,
keyword: isMention ? this.inputsElement[1].value : this.inputsElement[0].value,
containChildren: false
}, (response) => {
svgElement.removeAttribute("disabled");
svgElement.classList.add("b3-list-item__arrow--open");

View file

@ -45,6 +45,7 @@ const setEditor = (modelMainElement: Element) => {
window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen = parseInt((modelMainElement.querySelector("#blockRefDynamicAnchorTextMaxLen") as HTMLInputElement).value);
window.siyuan.config.editor.backlinkExpandCount = parseInt((modelMainElement.querySelector("#backlinkExpandCount") as HTMLInputElement).value);
window.siyuan.config.editor.backmentionExpandCount = parseInt((modelMainElement.querySelector("#backmentionExpandCount") as HTMLInputElement).value);
window.siyuan.config.editor.backlinkContainChildren = (modelMainElement.querySelector("#backlinkContainChildren") as HTMLInputElement).checked;
window.siyuan.config.editor.codeLigatures = (modelMainElement.querySelector("#codeLigatures") as HTMLInputElement).checked;
window.siyuan.config.editor.codeTabSpaces = parseInt((modelMainElement.querySelector("#codeTabSpaces") as HTMLInputElement).value);
window.siyuan.config.editor.fontSize = parseInt((modelMainElement.querySelector("#fontSize") as HTMLInputElement).value);
@ -220,6 +221,14 @@ export const initEditor = () => {
<input class="b3-text-field fn__block" id="backmentionExpandCount" type="number" min="-1" max="512" value="${window.siyuan.config.editor.backmentionExpandCount}"/>
<div class="b3-label__text">${window.siyuan.languages.backmentionExpandTip}</div>
</div>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.backlinkContainChildren}
<div class="b3-label__text">${window.siyuan.languages.backlinkContainChildrenTip}</div>
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="backlinkContainChildren" type="checkbox"${window.siyuan.config.editor.backlinkContainChildren ? " checked" : ""}/>
</label>
<div class="b3-label">
${window.siyuan.languages.generateHistory}
<span class="fn__hr"></span>

View file

@ -44,7 +44,6 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean, updateReadonly?
defID: protyle.element.getAttribute("data-defid"),
refTreeID: protyle.block.rootID,
keyword: isMention ? inputsElement[1].value : inputsElement[0].value,
containChildren: false
}, response => {
protyle.options.backlinkData = isMention ? response.data.backmentions : response.data.backlinks;
renderBacklink(protyle, protyle.options.backlinkData);

View file

@ -341,6 +341,10 @@ declare namespace Config {
* The default number of backlinks to mention
*/
backmentionExpandCount: number;
/**
* Whether the backlink contains children
*/
backlinkContainChildren: boolean;
/**
* The maximum length of the dynamic anchor text for block references
*/