mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-18 04:58:06 +01:00
This commit is contained in:
parent
83777a14ed
commit
a2dba45103
12 changed files with 228 additions and 163 deletions
|
|
@ -32,7 +32,7 @@ import {mathRender} from "../markdown/mathRender";
|
|||
import {duplicateBlock} from "../wysiwyg/commonHotkey";
|
||||
import {movePathTo} from "../../util/pathName";
|
||||
import {hintMoveBlock} from "../hint/extend";
|
||||
import {makeCard} from "../../card/makeCard";
|
||||
import {makeCard, quickMakeCard} from "../../card/makeCard";
|
||||
import {transferBlockRef} from "../../menus/block";
|
||||
|
||||
export class Gutter {
|
||||
|
|
@ -667,7 +667,15 @@ export class Gutter {
|
|||
this.genWidths(selectsElement, protyle);
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.riffCard,
|
||||
label: window.siyuan.languages.quickMakeCard,
|
||||
iconHTML:`<svg class="b3-menu__icon"><use xlink:href="#iconRiffCard"></use></svg>`,
|
||||
icon: "iconRiffCard",
|
||||
click() {
|
||||
quickMakeCard(selectsElement);
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.addToDeck,
|
||||
icon: "iconRiffCard",
|
||||
click() {
|
||||
makeCard(selectsElement);
|
||||
|
|
@ -1431,7 +1439,15 @@ export class Gutter {
|
|||
}
|
||||
if (type !== "NodeThematicBreak") {
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.riffCard,
|
||||
label: window.siyuan.languages.quickMakeCard,
|
||||
iconHTML:`<svg class="b3-menu__icon"><use xlink:href="#iconRiffCard"></use></svg>`,
|
||||
icon: "iconRiffCard",
|
||||
click() {
|
||||
quickMakeCard([nodeElement]);
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.addToDeck,
|
||||
icon: "iconRiffCard",
|
||||
click() {
|
||||
makeCard([nodeElement]);
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import {genEmptyElement} from "../../block/util";
|
|||
import {transaction} from "../wysiwyg/transaction";
|
||||
import {hideTooltip} from "../../dialog/tooltip";
|
||||
import {transferBlockRef} from "../../menus/block";
|
||||
import {openCardByData} from "../../card/openCard";
|
||||
|
||||
export class Title {
|
||||
public element: HTMLElement;
|
||||
|
|
@ -230,7 +231,9 @@ export class Title {
|
|||
}).element);
|
||||
window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY});
|
||||
});
|
||||
this.element.querySelector(".protyle-attr").addEventListener("click", (event: MouseEvent & { target: HTMLElement }) => {
|
||||
this.element.querySelector(".protyle-attr").addEventListener("click", (event: MouseEvent & {
|
||||
target: HTMLElement
|
||||
}) => {
|
||||
fetchPost("/api/block/getDocInfo", {
|
||||
id: protyle.block.rootID
|
||||
}, (response) => {
|
||||
|
|
@ -353,6 +356,15 @@ export class Title {
|
|||
openFileWechatNotify(protyle);
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.riffCard,
|
||||
icon: "iconRiffCard",
|
||||
click: () => {
|
||||
fetchPost("/api/riff/getTreeRiffDueCards", {rootID: protyle.block.rootID}, (response) => {
|
||||
openCardByData(response.data, `<span class="fn__flex-center">${escapeHtml(this.editElement.textContent)}</span>`);
|
||||
});
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
iconHTML: Constants.ZWSP,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue