mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
🚨
This commit is contained in:
parent
2c59586b68
commit
ae1ff7ba39
5 changed files with 12 additions and 14 deletions
|
|
@ -10,7 +10,7 @@ import {Dialog} from "./index";
|
||||||
import {isMobile} from "../util/functions";
|
import {isMobile} from "../util/functions";
|
||||||
import {confirmDialog} from "./confirmDialog";
|
import {confirmDialog} from "./confirmDialog";
|
||||||
import {getCurrentWindow} from "@electron/remote";
|
import {getCurrentWindow} from "@electron/remote";
|
||||||
import {originalPath} from "../util/pathName";
|
import { getWorkspaceName } from "../menus/workspace";
|
||||||
|
|
||||||
export const lockFile = (id: string) => {
|
export const lockFile = (id: string) => {
|
||||||
const html = `<div class="b3-dialog__scrim"></div>
|
const html = `<div class="b3-dialog__scrim"></div>
|
||||||
|
|
@ -292,7 +292,3 @@ export const downloadProgress = (data: { id: string, percent: number }) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getWorkspaceName = () => {
|
|
||||||
return window.siyuan.config.system.workspaceDir;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ export class Backlink extends Model {
|
||||||
if (item.tagName === "LI" && !item.querySelector(".b3-list-item__arrow--open")) {
|
if (item.tagName === "LI" && !item.querySelector(".b3-list-item__arrow--open")) {
|
||||||
this.toggleItem(item, false);
|
this.toggleItem(item, false);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
this.element.addEventListener("click", (event) => {
|
this.element.addEventListener("click", (event) => {
|
||||||
this.setFocus();
|
this.setFocus();
|
||||||
|
|
@ -270,7 +270,7 @@ export class Backlink extends Model {
|
||||||
if (item.tagName === "LI" && !item.querySelector(".b3-list-item__arrow--open")) {
|
if (item.tagName === "LI" && !item.querySelector(".b3-list-item__arrow--open")) {
|
||||||
this.toggleItem(item, true);
|
this.toggleItem(item, true);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
break;
|
break;
|
||||||
case "mCollapse":
|
case "mCollapse":
|
||||||
this.mTree.element.querySelectorAll(".protyle").forEach(item => {
|
this.mTree.element.querySelectorAll(".protyle").forEach(item => {
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ export const workspaceMenu = (rect: DOMRect) => {
|
||||||
if (item.closed) {
|
if (item.closed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
workspaceItem(item)
|
workspaceItem(item);
|
||||||
});
|
});
|
||||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
|
@ -107,7 +107,7 @@ export const workspaceMenu = (rect: DOMRect) => {
|
||||||
type: "readonly"
|
type: "readonly"
|
||||||
}).element);
|
}).element);
|
||||||
response.data.forEach((item: IWorkspace) => {
|
response.data.forEach((item: IWorkspace) => {
|
||||||
workspaceItem(item)
|
workspaceItem(item);
|
||||||
});
|
});
|
||||||
/// #endif
|
/// #endif
|
||||||
window.siyuan.menus.menu.popup({x: rect.left, y: rect.bottom});
|
window.siyuan.menus.menu.popup({x: rect.left, y: rect.bottom});
|
||||||
|
|
@ -160,4 +160,7 @@ const workspaceItem = (item: IWorkspace) => {
|
||||||
}]
|
}]
|
||||||
}).element);
|
}).element);
|
||||||
/// #endif
|
/// #endif
|
||||||
}
|
};
|
||||||
|
export const getWorkspaceName = () => {
|
||||||
|
return window.siyuan.config.system.workspaceDir;
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -1484,7 +1484,7 @@ export class WYSIWYG {
|
||||||
openMobileFileById(refBlockId, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
|
openMobileFileById(refBlockId, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
|
||||||
/// #else
|
/// #else
|
||||||
if (aElement) {
|
if (aElement) {
|
||||||
window.open(aElement.getAttribute("data-href"))
|
window.open(aElement.getAttribute("data-href"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (window.siyuan.shiftIsPressed) {
|
if (window.siyuan.shiftIsPressed) {
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,9 @@ import {mountHelp} from "./mount";
|
||||||
import {MenuItem} from "../menus/Menu";
|
import {MenuItem} from "../menus/Menu";
|
||||||
import {addGA, initAssets, setInlineStyle, setMode} from "./assets";
|
import {addGA, initAssets, setInlineStyle, setMode} from "./assets";
|
||||||
import {renderSnippet} from "../config/util/snippets";
|
import {renderSnippet} from "../config/util/snippets";
|
||||||
import {originalPath} from "./pathName";
|
|
||||||
import {openFileById} from "../editor/util";
|
import {openFileById} from "../editor/util";
|
||||||
import {focusByRange} from "../protyle/util/selection";
|
import {focusByRange} from "../protyle/util/selection";
|
||||||
import {exitSiYuan, getWorkspaceName} from "../dialog/processSystem";
|
import {exitSiYuan} from "../dialog/processSystem";
|
||||||
import {openSetting} from "../config";
|
import {openSetting} from "../config";
|
||||||
import {getSearch} from "./functions";
|
import {getSearch} from "./functions";
|
||||||
import {initStatus} from "../layout/status";
|
import {initStatus} from "../layout/status";
|
||||||
|
|
@ -28,7 +27,7 @@ import {showMessage} from "../dialog/message";
|
||||||
import {editor} from "../config/editor";
|
import {editor} from "../config/editor";
|
||||||
import {goBack, goForward} from "./backForward";
|
import {goBack, goForward} from "./backForward";
|
||||||
import {replaceLocalPath} from "../editor/rename";
|
import {replaceLocalPath} from "../editor/rename";
|
||||||
import {workspaceMenu} from "../menus/workspace";
|
import {getWorkspaceName, workspaceMenu} from "../menus/workspace";
|
||||||
|
|
||||||
const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => {
|
const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => {
|
||||||
if (key1 === "general") {
|
if (key1 === "general") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue