mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-17 22:25:29 +01:00
This commit is contained in:
parent
aa29fc044b
commit
3adf0d6d63
7 changed files with 42 additions and 1 deletions
|
|
@ -1171,6 +1171,33 @@ export class Gutter {
|
|||
}
|
||||
}]
|
||||
}).element);
|
||||
} else if (type === "NodeHeading" && !window.siyuan.config.readonly) {
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
const headingSubMenu = [];
|
||||
if (subType !== "h1") {
|
||||
headingSubMenu.push({
|
||||
icon: "iconHeading1",
|
||||
label: window.siyuan.languages.heading1,
|
||||
click() {
|
||||
protyle.toolbar.showRender(protyle, nodeElement);
|
||||
}
|
||||
})
|
||||
}
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
type: "submenu",
|
||||
icon: "iconRefresh",
|
||||
label: window.siyuan.languages.tWithSubtitle,
|
||||
submenu: headingSubMenu
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
icon: "iconCopy",
|
||||
label: window.siyuan.languages.copyHeadings,
|
||||
click() {
|
||||
fetchPost("/api/block/getHeadingChildrenDOM", {id: nodeElement.getAttribute("data-node-id")}, (response) => {
|
||||
writeText(response.data + Constants.ZWSP);
|
||||
})
|
||||
}
|
||||
}).element);
|
||||
}
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
|
|
@ -1188,7 +1215,7 @@ export class Gutter {
|
|||
const ids = protyle.path.split("/");
|
||||
if (ids.length > 2) {
|
||||
/// #if MOBILE
|
||||
openMobileFileById(ids[ids.length - 2],[Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]);
|
||||
openMobileFileById(ids[ids.length - 2], [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]);
|
||||
/// #else
|
||||
openFileById({
|
||||
id: ids[ids.length - 2],
|
||||
|
|
|
|||
|
|
@ -109,6 +109,10 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
|
|||
files = event.dataTransfer.items;
|
||||
}
|
||||
}
|
||||
// 复制标题及其下方块使用 writeText,需将 textPLain 转换为 textHTML
|
||||
if (textPlain.endsWith(Constants.ZWSP) && !textHTML) {
|
||||
textHTML = textPlain
|
||||
}
|
||||
/// #if !MOBILE
|
||||
if (!textHTML && !textPlain && ("clipboardData" in event)) {
|
||||
if ("darwin" === window.siyuan.config.system.os) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue