mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-20 22:14:06 +01:00
This commit is contained in:
parent
f25b36ff38
commit
cd40ec50bb
21 changed files with 341 additions and 398 deletions
|
|
@ -109,68 +109,63 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
|||
openFileAttr(response.data.ial, "bookmark", protyle);
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.wechatReminder,
|
||||
icon: "iconMp",
|
||||
disabled: window.siyuan.config.readonly,
|
||||
click() {
|
||||
openFileWechatNotify(protyle);
|
||||
}
|
||||
}).element);
|
||||
const riffCardMenu = [{
|
||||
iconHTML: "",
|
||||
label: window.siyuan.languages.spaceRepetition,
|
||||
accelerator: window.siyuan.config.keymap.editor.general.spaceRepetition.custom,
|
||||
disabled: window.siyuan.config.readonly,
|
||||
click: () => {
|
||||
fetchPost("/api/riff/getTreeRiffDueCards", {rootID: protyle.block.rootID}, (response) => {
|
||||
openCardByData(protyle.app, response.data, "doc", protyle.block.rootID, response.data.name);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
iconHTML: "",
|
||||
label: window.siyuan.languages.manage,
|
||||
disabled: window.siyuan.config.readonly,
|
||||
click: () => {
|
||||
fetchPost("/api/filetree/getHPathByID", {
|
||||
id: protyle.block.rootID
|
||||
}, (response) => {
|
||||
viewCards(protyle.app, protyle.block.rootID, pathPosix().join(getNotebookName(protyle.notebookId), (response.data)), "Tree");
|
||||
});
|
||||
}
|
||||
}, {
|
||||
iconHTML: "",
|
||||
label: window.siyuan.languages.quickMakeCard,
|
||||
accelerator: window.siyuan.config.keymap.editor.general.quickMakeCard.custom,
|
||||
disabled: window.siyuan.config.readonly,
|
||||
click: () => {
|
||||
let titleElement = protyle.title?.element;
|
||||
if (!titleElement) {
|
||||
titleElement = document.createElement("div");
|
||||
titleElement.setAttribute("data-node-id", protyle.block.rootID);
|
||||
titleElement.setAttribute(Constants.CUSTOM_RIFF_DECKS, response.data.ial[Constants.CUSTOM_RIFF_DECKS]);
|
||||
if (!window.siyuan.config.readonly) {
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.wechatReminder,
|
||||
icon: "iconMp",
|
||||
click() {
|
||||
openFileWechatNotify(protyle);
|
||||
}
|
||||
quickMakeCard(protyle, [titleElement]);
|
||||
}
|
||||
}];
|
||||
if (window.siyuan.config.flashcard.deck) {
|
||||
riffCardMenu.push({
|
||||
}).element);
|
||||
const riffCardMenu: IMenu[] = [{
|
||||
iconHTML: "",
|
||||
label: window.siyuan.languages.addToDeck,
|
||||
disabled: window.siyuan.config.readonly,
|
||||
label: window.siyuan.languages.spaceRepetition,
|
||||
accelerator: window.siyuan.config.keymap.editor.general.spaceRepetition.custom,
|
||||
click: () => {
|
||||
makeCard(protyle.app, [protyle.block.rootID]);
|
||||
fetchPost("/api/riff/getTreeRiffDueCards", {rootID: protyle.block.rootID}, (response) => {
|
||||
openCardByData(protyle.app, response.data, "doc", protyle.block.rootID, response.data.name);
|
||||
});
|
||||
}
|
||||
});
|
||||
}, {
|
||||
iconHTML: "",
|
||||
label: window.siyuan.languages.manage,
|
||||
click: () => {
|
||||
fetchPost("/api/filetree/getHPathByID", {
|
||||
id: protyle.block.rootID
|
||||
}, (response) => {
|
||||
viewCards(protyle.app, protyle.block.rootID, pathPosix().join(getNotebookName(protyle.notebookId), (response.data)), "Tree");
|
||||
});
|
||||
}
|
||||
}, {
|
||||
iconHTML: "",
|
||||
label: window.siyuan.languages.quickMakeCard,
|
||||
accelerator: window.siyuan.config.keymap.editor.general.quickMakeCard.custom,
|
||||
click: () => {
|
||||
let titleElement = protyle.title?.element;
|
||||
if (!titleElement) {
|
||||
titleElement = document.createElement("div");
|
||||
titleElement.setAttribute("data-node-id", protyle.block.rootID);
|
||||
titleElement.setAttribute(Constants.CUSTOM_RIFF_DECKS, response.data.ial[Constants.CUSTOM_RIFF_DECKS]);
|
||||
}
|
||||
quickMakeCard(protyle, [titleElement]);
|
||||
}
|
||||
}];
|
||||
if (window.siyuan.config.flashcard.deck) {
|
||||
riffCardMenu.push({
|
||||
iconHTML: "",
|
||||
label: window.siyuan.languages.addToDeck,
|
||||
click: () => {
|
||||
makeCard(protyle.app, [protyle.block.rootID]);
|
||||
}
|
||||
});
|
||||
}
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.riffCard,
|
||||
type: "submenu",
|
||||
icon: "iconRiffCard",
|
||||
submenu: riffCardMenu,
|
||||
}).element);
|
||||
}
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.riffCard,
|
||||
type: "submenu",
|
||||
icon: "iconRiffCard",
|
||||
submenu: riffCardMenu,
|
||||
disabled: window.siyuan.config.readonly,
|
||||
}).element);
|
||||
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.search,
|
||||
icon: "iconSearch",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue