mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 07:18:49 +01:00
This commit is contained in:
parent
81224760da
commit
a593bc7503
4 changed files with 13 additions and 5 deletions
|
|
@ -686,7 +686,9 @@ const onSearch = (data: IBlock[], dialog: Dialog) => {
|
|||
const title = escapeHtml(getNotebookName(item.box)) + getDisplayName(item.hPath, false);
|
||||
resultHTML += `<div data-type="search-item" class="b3-list-item${index === 0 ? " b3-list-item--focus" : ""}" data-node-id="${item.id}" data-root-id="${item.rootID}">
|
||||
<svg class="b3-list-item__graphic"><use xlink:href="#${getIconByType(item.type)}"></use></svg>
|
||||
<span class="b3-list-item__text">${unicode2Emoji(item.ial.icon)}${item.ial.icon ? " " : ""}${item.content}</span>
|
||||
<svg class="b3-list-item__graphic"><use xlink:href="#${getIconByType(item.type)}"></use></svg>
|
||||
${unicode2Emoji(item.ial.icon, false, "b3-list-item__graphic", true)}
|
||||
<span class="b3-list-item__text">${item.content}</span>
|
||||
<span class="b3-list-item__meta b3-list-item__meta--ellipsis" title="${title}">${title}</span>
|
||||
</div>`;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -626,7 +626,8 @@ ${unicode2Emoji(getNotebookIcon(item.box) || Constants.SIYUAN_IMAGE_NOTE, false,
|
|||
item.children.forEach((childItem, childIndex) => {
|
||||
resultHTML += `<div style="padding-left: 22px" data-type="search-item" class="b3-list-item${childIndex === 0 && index === 0 ? " b3-list-item--focus" : ""}" data-node-id="${childItem.id}" data-root-id="${childItem.rootID}">
|
||||
<svg class="b3-list-item__graphic"><use xlink:href="#${getIconByType(childItem.type)}"></use></svg>
|
||||
<span class="b3-list-item__text">${unicode2Emoji(childItem.ial.icon)}${childItem.ial.icon ? " " : ""}${childItem.content}</span>
|
||||
${unicode2Emoji(childItem.ial.icon, false, "b3-list-item__graphic", true)}
|
||||
<span class="b3-list-item__text">${childItem.content}</span>
|
||||
</div>`;
|
||||
})
|
||||
resultHTML += "</div>";
|
||||
|
|
@ -634,7 +635,8 @@ ${unicode2Emoji(getNotebookIcon(item.box) || Constants.SIYUAN_IMAGE_NOTE, false,
|
|||
const title = escapeHtml(getNotebookName(item.box)) + getDisplayName(item.hPath, false);
|
||||
resultHTML += `<div data-type="search-item" class="b3-list-item${index === 0 ? " b3-list-item--focus" : ""}" data-node-id="${item.id}" data-root-id="${item.rootID}">
|
||||
<svg class="b3-list-item__graphic"><use xlink:href="#${getIconByType(item.type)}"></use></svg>
|
||||
<span class="b3-list-item__text">${unicode2Emoji(item.ial.icon)}${item.ial.icon ? " " : ""}${item.content}</span>
|
||||
${unicode2Emoji(item.ial.icon, false, "b3-list-item__graphic", true)}
|
||||
<span class="b3-list-item__text">${item.content}</span>
|
||||
<span class="b3-list-item__meta b3-list-item__meta--ellipsis" title="${title}">${title}</span>
|
||||
</div>`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -380,9 +380,13 @@ export const globalShortcut = () => {
|
|||
}).forEach(item => {
|
||||
let icon = `<svg class="b3-list-item__graphic"><use xlink:href="#${item.icon}"></use></svg>`;
|
||||
let rootId = "";
|
||||
const initData = item.headElement.getAttribute("data-initdata")
|
||||
if (item.model instanceof Editor) {
|
||||
rootId = ` data-node-id="${item.model.editor.protyle.block.rootID}"`;
|
||||
icon = unicode2Emoji(item.docIcon || Constants.SIYUAN_IMAGE_FILE, false, "b3-list-item__graphic", true);
|
||||
} else if (initData) {
|
||||
rootId = ` data-node-id="${JSON.parse(initData).rootId}"`;
|
||||
icon = unicode2Emoji(item.docIcon || Constants.SIYUAN_IMAGE_FILE, false, "b3-list-item__graphic", true);
|
||||
}
|
||||
tabHtml += `<li data-id="${item.id}"${rootId} class="b3-list-item${currentId === item.id ? " b3-list-item--focus" : ""}"${currentId === item.id ? ' data-original="true"' : ""}>${icon}<span class="b3-list-item__text">${escapeHtml(item.title)}</span></li>`;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ export const movePathTo = (paths?: string[], range?: Range, cb?: (toPath: string
|
|||
<span class="b3-list-item__toggle b3-list-item__toggle--hl">
|
||||
<svg class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg>
|
||||
</span>
|
||||
<span class="b3-list-item__graphic">${unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_NOTE)}</span>
|
||||
${unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_NOTE, false, "b3-list-item__graphic", true)}
|
||||
<span class="b3-list-item__text">${escapeHtml(item.name)}</span>
|
||||
</li></ul>`;
|
||||
}
|
||||
|
|
@ -158,7 +158,7 @@ export const movePathTo = (paths?: string[], range?: Range, cb?: (toPath: string
|
|||
let fileHTML = "";
|
||||
data.data.forEach((item: { boxIcon: string, box: string, hPath: string, path: string }) => {
|
||||
fileHTML += `<li style="padding: 4px" class="b3-list-item${fileHTML === "" ? " b3-list-item--focus" : ""}" data-path="${item.path}" data-box="${item.box}">
|
||||
<span class="b3-list-item__graphic">${unicode2Emoji(item.boxIcon || Constants.SIYUAN_IMAGE_NOTE)}</span>
|
||||
${unicode2Emoji(item.boxIcon || Constants.SIYUAN_IMAGE_NOTE, false, "b3-list-item__graphic", true)}
|
||||
<span class="b3-list-item__showall">${escapeHtml(item.hPath)}</span>
|
||||
</li>`;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue