This commit is contained in:
Vanessa 2022-11-25 23:09:16 +08:00
parent a8f3b1762a
commit b2ba9ace07
10 changed files with 33 additions and 36 deletions

View file

@ -804,9 +804,9 @@ const editKeydown = (event: KeyboardEvent) => {
if (protyle.title?.editElement.contains(range.startContainer)) {
movePathTo([protyle.path], range);
} else if (nodeElement && range && protyle.element.contains(range.startContainer)) {
let selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"))
let selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
if (selectElements.length === 0) {
selectElements = [nodeElement]
selectElements = [nodeElement];
}
movePathTo([], undefined, (toPath) => {
hintMoveBlock(toPath, selectElements, protyle);

View file

@ -92,12 +92,12 @@ export const setProxy = () => {
/// #if !BROWSER
if ("" === window.siyuan.config.system.networkProxy.scheme) {
console.log("network proxy [system]");
return
return;
}
const session = getCurrentWindow().webContents.session;
session.closeAllConnections().then(() => {
const proxyURL = `${window.siyuan.config.system.networkProxy.scheme}://${window.siyuan.config.system.networkProxy.host}:${window.siyuan.config.system.networkProxy.port}`
const proxyURL = `${window.siyuan.config.system.networkProxy.scheme}://${window.siyuan.config.system.networkProxy.host}:${window.siyuan.config.system.networkProxy.port}`;
session.setProxy({proxyRules: proxyURL}).then(
() => console.log("network proxy [" + proxyURL + "]"),
);

View file

@ -119,7 +119,7 @@ export const movePathTo = (paths?: string[], range?: Range, cb?: (toPath:string)
});
if (paths.length) {
fetchPost("/api/filetree/getHPathsByPaths", {paths}, (response) => {
dialog.element.querySelector(".b3-dialog__header .ft__smaller").innerHTML = escapeHtml(response.data.join(", "))
dialog.element.querySelector(".b3-dialog__header .ft__smaller").innerHTML = escapeHtml(response.data.join(", "));
});
}
const searchListElement = dialog.element.querySelector("#foldList");
@ -151,7 +151,7 @@ export const movePathTo = (paths?: string[], range?: Range, cb?: (toPath:string)
}
searchTreeElement.classList.add("fn__none");
searchListElement.classList.remove("fn__none");
searchListElement.scrollTo(0, 0)
searchListElement.scrollTo(0, 0);
fetchPost("/api/filetree/searchDocs", {
k: inputElement.value
}, (data) => {
@ -352,14 +352,14 @@ export const movePathTo = (paths?: string[], range?: Range, cb?: (toPath:string)
return;
}
currentItemElement.classList.remove("b3-list-item--focus");
target.classList.add("b3-list-item--focus")
target.classList.add("b3-list-item--focus");
event.preventDefault();
event.stopPropagation();
break;
}
target = target.parentElement;
}
inputElement.focus()
inputElement.focus();
});
};
@ -378,7 +378,7 @@ const getLeaf = (liElement: HTMLElement) => {
return;
}
const notebookId = liElement.getAttribute("data-box")
const notebookId = liElement.getAttribute("data-box");
fetchPost("/api/filetree/listDocsByPath", {
notebook: notebookId,
path: liElement.getAttribute("data-path"),
@ -418,7 +418,7 @@ data-box="${notebookId}" class="b3-list-item" data-path="${item.path}">
}, 120);
}, 2);
});
}
};
export const getNotebookName = (id: string) => {
let rootPath = "";