mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
This commit is contained in:
parent
e881cfdd2e
commit
5dadb67362
3 changed files with 22 additions and 9 deletions
|
|
@ -132,7 +132,7 @@ export const initNavigationMenu = (liElement: HTMLElement) => {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: Constants.ZWSP,
|
||||||
label: window.siyuan.languages.mgmt,
|
label: window.siyuan.languages.mgmt,
|
||||||
click: () => {
|
click: () => {
|
||||||
viewCards(notebookId, name, "Notebook");
|
viewCards(notebookId, escapeHtml(name), "Notebook");
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
}).element);
|
}).element);
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ import {lockScreen} from "../dialog/processSystem";
|
||||||
import {showMessage} from "../dialog/message";
|
import {showMessage} from "../dialog/message";
|
||||||
import {unicode2Emoji} from "../emoji";
|
import {unicode2Emoji} from "../emoji";
|
||||||
import {Dock} from "../layout/dock";
|
import {Dock} from "../layout/dock";
|
||||||
|
import {escapeHtml} from "../util/escape";
|
||||||
|
import {viewCards} from "../card/viewCards";
|
||||||
|
|
||||||
const togglePinDock = (dock: Dock, icon: string) => {
|
const togglePinDock = (dock: Dock, icon: string) => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -113,7 +115,7 @@ export const workspaceMenu = (rect: DOMRect) => {
|
||||||
window.siyuan.notebooks.forEach(item => {
|
window.siyuan.notebooks.forEach(item => {
|
||||||
if (!item.closed) {
|
if (!item.closed) {
|
||||||
submenu.push({
|
submenu.push({
|
||||||
label: item.name,
|
label: escapeHtml(item.name),
|
||||||
iconHTML: unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_NOTE, false, "b3-menu__icon", true),
|
iconHTML: unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_NOTE, false, "b3-menu__icon", true),
|
||||||
accelerator: window.siyuan.storage[Constants.LOCAL_DAILYNOTEID] === item.id ? window.siyuan.config.keymap.general.dailyNote.custom : "",
|
accelerator: window.siyuan.storage[Constants.LOCAL_DAILYNOTEID] === item.id ? window.siyuan.config.keymap.general.dailyNote.custom : "",
|
||||||
click: () => {
|
click: () => {
|
||||||
|
|
@ -135,12 +137,23 @@ export const workspaceMenu = (rect: DOMRect) => {
|
||||||
}).element);
|
}).element);
|
||||||
}
|
}
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
label: window.siyuan.languages.spaceRepetition,
|
label: window.siyuan.languages.riffCard,
|
||||||
|
type: "submenu",
|
||||||
icon: "iconRiffCard",
|
icon: "iconRiffCard",
|
||||||
accelerator: window.siyuan.config.keymap.general.riffCard.custom,
|
submenu: [{
|
||||||
click: () => {
|
iconHTML: Constants.ZWSP,
|
||||||
openCard();
|
label: window.siyuan.languages.spaceRepetition,
|
||||||
}
|
accelerator: window.siyuan.config.keymap.general.riffCard.custom,
|
||||||
|
click: () => {
|
||||||
|
openCard();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
iconHTML: Constants.ZWSP,
|
||||||
|
label: window.siyuan.languages.mgmt,
|
||||||
|
click: () => {
|
||||||
|
viewCards("", window.siyuan.languages.all, "");
|
||||||
|
}
|
||||||
|
}],
|
||||||
}).element);
|
}).element);
|
||||||
}
|
}
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ const closeTab = (ipcData: IWebSocketData) => {
|
||||||
if (tab && tab instanceof Tab) {
|
if (tab && tab instanceof Tab) {
|
||||||
tab.parent.removeTab(ipcData.data);
|
tab.parent.removeTab(ipcData.data);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
export const onWindowsMsg = (ipcData: IWebSocketData) => {
|
export const onWindowsMsg = (ipcData: IWebSocketData) => {
|
||||||
switch (ipcData.cmd) {
|
switch (ipcData.cmd) {
|
||||||
case "closetab":
|
case "closetab":
|
||||||
|
|
@ -26,4 +26,4 @@ export const onWindowsMsg = (ipcData: IWebSocketData) => {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue