This commit is contained in:
Vanessa 2022-08-24 14:47:16 +08:00
parent a7d0fefff1
commit f89d16c3a2
5 changed files with 19 additions and 19 deletions

View file

@ -16,10 +16,10 @@ export const exportAsset = (src: string) => {
properties: ["showOverwriteConfirmation"],
}).then((result: SaveDialogReturnValue) => {
if (!result.canceled) {
fetchPost("/api/file/copyFile", {src, dest: result.filePath})
fetchPost("/api/file/copyFile", {src, dest: result.filePath});
}
});
}
}
};
/// #endif
}
};

View file

@ -69,7 +69,7 @@ const focusStack = (backStack: IBackStack) => {
protyle.contentElement.scrollTop = backStack.scrollTop;
window.siyuan.mobileEditor.protyle.breadcrumb.render(protyle);
});
}
};
export const pushBack = () => {
const protyle = window.siyuan.mobileEditor.protyle;
@ -80,7 +80,7 @@ export const pushBack = () => {
callback: protyle.block.action,
isZoom: protyle.block.showAll
});
}
};
export const goForward = () => {
if (window.JSAndroid && forwardStack.length < 2) {
@ -90,9 +90,9 @@ export const goForward = () => {
if (forwardStack.length < 2) {
return;
}
window.siyuan.backStack.push(forwardStack.pop())
focusStack(forwardStack[forwardStack.length - 1])
}
window.siyuan.backStack.push(forwardStack.pop());
focusStack(forwardStack[forwardStack.length - 1]);
};
export const goBack = () => {
if (window.JSAndroid && window.siyuan.backStack.length < 1) {
@ -114,5 +114,5 @@ export const goBack = () => {
}
const item = window.siyuan.backStack.pop();
forwardStack.push(item);
focusStack(item)
focusStack(item);
};

View file

@ -42,7 +42,7 @@ export class Preview {
// 对于超链接锚点不做任何处理
event.stopPropagation();
event.preventDefault();
return
return;
}
if (isMobile()) {

View file

@ -695,12 +695,12 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
// 外部文件拖入编辑器中或者编辑器内选中文字拖拽
focusByRange(document.caretRangeFromPoint(event.clientX, event.clientY));
if (event.dataTransfer.types[0] === "Files") {
const files:string[] = []
let isAllFile = true
const files:string[] = [];
let isAllFile = true;
for (let i = 0; i < event.dataTransfer.files.length; i++) {
files.push(event.dataTransfer.files[i].path);
if (event.dataTransfer.files[i].type === "") {
isAllFile = false
isAllFile = false;
}
}
if (isAllFile) {
@ -708,18 +708,18 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
window.siyuan.menus.menu.append(new MenuItem({
label:window.siyuan.languages.upload,
icon:"iconUpload",
click(element) {
click() {
uploadLocalFiles(files, protyle);
}
}).element);
window.siyuan.menus.menu.append(new MenuItem({
label:window.siyuan.languages.link,
icon:"iconLink",
click(element) {
let fileText = ""
click() {
let fileText = "";
files.forEach((item) => {
fileText = `[${pathPosix().basename(item)}](${item})\n`
})
fileText = `[${pathPosix().basename(item)}](${item})\n`;
});
insertHTML(protyle.lute.SpinBlockDOM(fileText), protyle);
}
}).element);

View file

@ -218,7 +218,7 @@ const setKey = () => {
dialog.element.querySelector(".b3-button--cancel").addEventListener("click", () => {
dialog.destroy();
});
const inputElement = dialog.element.querySelector(".b3-text-field") as HTMLInputElement
const inputElement = dialog.element.querySelector(".b3-text-field") as HTMLInputElement;
dialog.element.querySelector("#initKeyByPW").addEventListener("click", () => {
if (!inputElement.value) {
showMessage(window.siyuan.languages._kernel[142]);