|
@@ -34,6 +34,7 @@ const closeMenu = (tab: Tab) => {
|
|
|
});
|
|
|
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "close",
|
|
|
icon: "iconClose",
|
|
|
label: window.siyuan.languages.close,
|
|
|
accelerator: window.siyuan.config.keymap.general.closeTab.custom,
|
|
@@ -43,6 +44,7 @@ const closeMenu = (tab: Tab) => {
|
|
|
}).element);
|
|
|
if (tab.parent.children.length > 1) {
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "closeOthers",
|
|
|
label: window.siyuan.languages.closeOthers,
|
|
|
accelerator: window.siyuan.config.keymap.general.closeOthers.custom,
|
|
|
click() {
|
|
@@ -50,6 +52,7 @@ const closeMenu = (tab: Tab) => {
|
|
|
}
|
|
|
}).element);
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "closeAll",
|
|
|
label: window.siyuan.languages.closeAll,
|
|
|
accelerator: window.siyuan.config.keymap.general.closeAll.custom,
|
|
|
click() {
|
|
@@ -58,6 +61,7 @@ const closeMenu = (tab: Tab) => {
|
|
|
}).element);
|
|
|
if (unmodifiedTabs.length > 0) {
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "closeUnmodified",
|
|
|
label: window.siyuan.languages.closeUnmodified,
|
|
|
accelerator: window.siyuan.config.keymap.general.closeUnmodified.custom,
|
|
|
click() {
|
|
@@ -67,6 +71,7 @@ const closeMenu = (tab: Tab) => {
|
|
|
}
|
|
|
if (leftTabs.length > 0) {
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "closeLeft",
|
|
|
label: window.siyuan.languages.closeLeft,
|
|
|
accelerator: window.siyuan.config.keymap.general.closeLeft.custom,
|
|
|
click: async () => {
|
|
@@ -76,6 +81,7 @@ const closeMenu = (tab: Tab) => {
|
|
|
}
|
|
|
if (rightTabs.length > 0) {
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "closeRight",
|
|
|
label: window.siyuan.languages.closeRight,
|
|
|
accelerator: window.siyuan.config.keymap.general.closeRight.custom,
|
|
|
click() {
|
|
@@ -84,11 +90,12 @@ const closeMenu = (tab: Tab) => {
|
|
|
}).element);
|
|
|
}
|
|
|
}
|
|
|
- window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
|
|
+ window.siyuan.menus.menu.append(new MenuItem({id: "separator_1", type: "separator"}).element);
|
|
|
};
|
|
|
|
|
|
const splitSubMenu = (app: App, tab: Tab) => {
|
|
|
const subMenus: IMenu[] = [{
|
|
|
+ id: "splitLR",
|
|
|
icon: "iconSplitLR",
|
|
|
accelerator: window.siyuan.config.keymap.general.splitLR.custom,
|
|
|
label: window.siyuan.languages.splitLR,
|
|
@@ -98,6 +105,7 @@ const splitSubMenu = (app: App, tab: Tab) => {
|
|
|
}];
|
|
|
if (tab.parent.children.length > 1) {
|
|
|
subMenus.push({
|
|
|
+ id: "splitMoveR",
|
|
|
icon: "iconLayoutRight",
|
|
|
accelerator: window.siyuan.config.keymap.general.splitMoveR.custom,
|
|
|
label: window.siyuan.languages.splitMoveR,
|
|
@@ -111,6 +119,7 @@ const splitSubMenu = (app: App, tab: Tab) => {
|
|
|
});
|
|
|
}
|
|
|
subMenus.push({
|
|
|
+ id: "splitTB",
|
|
|
icon: "iconSplitTB",
|
|
|
accelerator: window.siyuan.config.keymap.general.splitTB.custom,
|
|
|
label: window.siyuan.languages.splitTB,
|
|
@@ -121,6 +130,7 @@ const splitSubMenu = (app: App, tab: Tab) => {
|
|
|
|
|
|
if (tab.parent.children.length > 1) {
|
|
|
subMenus.push({
|
|
|
+ id: "splitMoveB",
|
|
|
icon: "iconLayoutBottom",
|
|
|
accelerator: window.siyuan.config.keymap.general.splitMoveB.custom,
|
|
|
label: window.siyuan.languages.splitMoveB,
|
|
@@ -137,6 +147,7 @@ const splitSubMenu = (app: App, tab: Tab) => {
|
|
|
getAllWnds(window.siyuan.layout.centerLayout, wndsTemp);
|
|
|
if (wndsTemp.length > 1) {
|
|
|
subMenus.push({
|
|
|
+ id: "unsplit",
|
|
|
label: window.siyuan.languages.unsplit,
|
|
|
accelerator: window.siyuan.config.keymap.general.unsplit.custom,
|
|
|
click: () => {
|
|
@@ -155,6 +166,7 @@ const splitSubMenu = (app: App, tab: Tab) => {
|
|
|
}
|
|
|
});
|
|
|
subMenus.push({
|
|
|
+ id: "unsplitAll",
|
|
|
label: window.siyuan.languages.unsplitAll,
|
|
|
accelerator: window.siyuan.config.keymap.general.unsplitAll.custom,
|
|
|
click: () => {
|
|
@@ -170,6 +182,7 @@ export const initTabMenu = (app: App, tab: Tab) => {
|
|
|
window.siyuan.menus.menu.remove();
|
|
|
closeMenu(tab);
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "split",
|
|
|
label: window.siyuan.languages.split,
|
|
|
submenu: splitSubMenu(app, tab)
|
|
|
}).element);
|
|
@@ -188,6 +201,7 @@ export const initTabMenu = (app: App, tab: Tab) => {
|
|
|
}
|
|
|
if (rootId) {
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "copy",
|
|
|
label: window.siyuan.languages.copy,
|
|
|
icon: "iconCopy",
|
|
|
type: "submenu",
|
|
@@ -195,6 +209,7 @@ export const initTabMenu = (app: App, tab: Tab) => {
|
|
|
}).element);
|
|
|
} else if (model && model instanceof Asset) {
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "copy",
|
|
|
label: window.siyuan.languages.copy,
|
|
|
icon: "iconCopy",
|
|
|
click() {
|
|
@@ -204,6 +219,7 @@ export const initTabMenu = (app: App, tab: Tab) => {
|
|
|
}
|
|
|
if (tab.headElement.classList.contains("item--pin")) {
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "unpin",
|
|
|
label: window.siyuan.languages.unpin,
|
|
|
icon: "iconUnpin",
|
|
|
click: () => {
|
|
@@ -212,6 +228,7 @@ export const initTabMenu = (app: App, tab: Tab) => {
|
|
|
}).element);
|
|
|
} else {
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "pin",
|
|
|
label: window.siyuan.languages.pin,
|
|
|
icon: "iconPin",
|
|
|
click: () => {
|
|
@@ -221,6 +238,7 @@ export const initTabMenu = (app: App, tab: Tab) => {
|
|
|
}
|
|
|
/// #if !BROWSER
|
|
|
window.siyuan.menus.menu.append(new MenuItem({
|
|
|
+ id: "tabToWindow",
|
|
|
label: window.siyuan.languages.tabToWindow,
|
|
|
accelerator: window.siyuan.config.keymap.general.tabToWindow.custom,
|
|
|
icon: "iconOpenWindow",
|