mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-01-30 04:11:33 -08:00
feat: menu item to open new window
This commit is contained in:
parent
300ae255eb
commit
0156e80bbd
3 changed files with 11 additions and 1 deletions
|
|
@ -32,6 +32,7 @@
|
|||
"OpenTidGi": "Open TidGi",
|
||||
"OpenTidGiMenuBar": "Open TidGi MenuBar",
|
||||
"OpenLinkInNewWindow": "Open Link in New Window",
|
||||
"OpenWorkspaceInNewWindow": "Open Workspace in New Window",
|
||||
"Preferences": "Preferences...",
|
||||
"TidGiSupport": "TidGi Support",
|
||||
"TidGiWebsite": "TidGi Website",
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
"OpenTidGiMenuBar": "打开太记小窗口",
|
||||
"OpenCommandPalette": "打开搜索与命令面板",
|
||||
"OpenLinkInNewWindow": "在新窗口中打开链接",
|
||||
"OpenWorkspaceInNewWindow": "在新窗口中打开工作区",
|
||||
"Preferences": "设置...",
|
||||
"TidGiSupport": "TidGi 用户支持",
|
||||
"TidGiWebsite": "TidGi 官网",
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ interface IWorkspaceMenuRequiredServices {
|
|||
| 'restartWorkspaceViewService'
|
||||
| 'realignActiveWorkspace'
|
||||
| 'openUrlInWorkspace'
|
||||
| 'openWorkspaceWindowWithView'
|
||||
>;
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +68,7 @@ export async function getWorkspaceMenuTemplate(
|
|||
t: TFunction<[_DefaultNamespace, ...Array<Exclude<FlatNamespace, _DefaultNamespace>>]>,
|
||||
service: IWorkspaceMenuRequiredServices,
|
||||
): Promise<MenuItemConstructorOptions[]> {
|
||||
const { active, id, mainWikiID, hibernated, tagName, isSubWiki, wikiFolderLocation, gitUrl, storageService, port, name, enableHTTPAPI } = workspace;
|
||||
const { active, id, mainWikiID, hibernated, tagName, isSubWiki, wikiFolderLocation, gitUrl, storageService, port, name, enableHTTPAPI, lastUrl, homeUrl } = workspace;
|
||||
/* eslint-disable @typescript-eslint/no-misused-promises */
|
||||
const template: MenuItemConstructorOptions[] = [
|
||||
{
|
||||
|
|
@ -78,6 +79,13 @@ export async function getWorkspaceMenuTemplate(
|
|||
await openWorkspaceTagTiddler(workspace, service);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('ContextMenu.OpenWorkspaceInNewWindow'),
|
||||
enabled: !hibernated,
|
||||
click: async () => {
|
||||
await service.workspaceView.openWorkspaceWindowWithView(workspace, { uri: lastUrl ?? homeUrl });
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('WorkspaceSelector.EditWorkspace'),
|
||||
click: async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue