Vanessa 2024-12-07 11:07:42 +08:00
parent 27e689da26
commit 04806ea4b9
6 changed files with 12 additions and 10 deletions

View file

@ -695,14 +695,14 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
} else if (type === "doc") {
fetchPost("/api/history/getDocHistoryContent", {
historyPath: dataPath,
highlight: CSS && CSS.highlights,
highlight: CSS && CSS.highlights ? true : false,
k: (firstPanelElement.querySelector(".b3-text-field") as HTMLInputElement).value
}, (response) => {
if (response.data.isLargeDoc) {
mdElement.value = response.data.content;
mdElement.classList.remove("fn__none");
docElement.classList.add("fn__none");
searchTextMarkRender(mdElement, []);
searchTextMarkRender(mdElement, []);
} else {
mdElement.classList.add("fn__none");
docElement.classList.remove("fn__none");
@ -712,7 +712,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
protyle: historyEditor.protyle,
action: [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML],
});
searchMarkRender(historyEditor.protyle, historyEditor.protyle.wysiwyg.element.querySelectorAll('span[data-type~="search-mark"]'));
searchMarkRender(historyEditor.protyle, historyEditor.protyle.wysiwyg.element.querySelectorAll('span[data-type~="search-mark"]'));
}
});
}

View file

@ -437,7 +437,7 @@ export class Backlink extends Model {
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
defID: this.blockId,
refTreeID: docId,
highlight: CSS && CSS.highlights,
highlight: CSS && CSS.highlights ? true : false,
keyword: isMention ? this.inputsElement[1].value : this.inputsElement[0].value,
}, (response) => {
svgElement.removeAttribute("disabled");

View file

@ -30,5 +30,7 @@ export const searchMarkRender = (protyle: IProtyle, matchElements: NodeListOf<El
export const searchTextMarkRender = (element: HTMLElement, k: string[]) => {
if (!CSS || !CSS.highlights) {
return;
}
}

View file

@ -73,7 +73,7 @@ export const getDocByScroll = (options: {
query: options.protyle.query?.key,
queryMethod: options.protyle.query?.method,
queryTypes: options.protyle.query?.types,
highlight: CSS && CSS.highlights,
highlight: CSS && CSS.highlights ? true : false,
}, response => {
if (response.code === 1) {
fetchPost("/api/filetree/getDoc", {
@ -81,7 +81,7 @@ export const getDocByScroll = (options: {
query: options.protyle.query?.key,
queryMethod: options.protyle.query?.method,
queryTypes: options.protyle.query?.types,
highlight: CSS && CSS.highlights,
highlight: CSS && CSS.highlights ? true : false,
}, response => {
onGet({
data: response,
@ -113,7 +113,7 @@ export const getDocByScroll = (options: {
query: options.protyle.query?.key,
queryMethod: options.protyle.query?.method,
queryTypes: options.protyle.query?.types,
highlight: CSS && CSS.highlights,
highlight: CSS && CSS.highlights ? true : false,
}, response => {
onGet({
data: response,

View file

@ -40,7 +40,7 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean, updateReadonly?
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
defID: protyle.element.getAttribute("data-defid"),
refTreeID: protyle.block.rootID,
highlight: CSS && CSS.highlights,
highlight: CSS && CSS.highlights ? true : false,
keyword: isMention ? inputsElement[1].value : inputsElement[0].value,
}, response => {
protyle.options.backlinkData = isMention ? response.data.backmentions : response.data.backlinks;

View file

@ -1221,7 +1221,7 @@ export const getArticle = (options: {
mode: zoomIn ? 0 : 3,
size: zoomIn ? Constants.SIZE_GET_MAX : window.siyuan.config.editor.dynamicLoadBlocks,
zoom: zoomIn,
highlight: CSS && CSS.highlights,
highlight:CSS && CSS.highlights ? true : false,
}, getResponse => {
options.edit.protyle.query = {
key: options.value || null,