Add 'View on remote server' to right click menu
This commit is contained in:
parent
7b86c7087d
commit
b531145270
|
@ -401,20 +401,20 @@ function onContextmenu(ev: MouseEvent): void {
|
||||||
os.pageWindow(notePage(appearNote));
|
os.pageWindow(notePage(appearNote));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
notePage(appearNote) != location.pathname ? {
|
||||||
icon: "ph-arrows-out-simple ph-bold ph-lg",
|
icon: "ph-arrows-out-simple ph-bold ph-lg",
|
||||||
text: i18n.ts.showInPage,
|
text: i18n.ts.showInPage,
|
||||||
action: () => {
|
action: () => {
|
||||||
router.push(notePage(appearNote), "forcePage");
|
router.push(notePage(appearNote), "forcePage");
|
||||||
},
|
},
|
||||||
},
|
} : undefined,
|
||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
|
type: "a",
|
||||||
icon: "ph-arrow-square-out ph-bold ph-lg",
|
icon: "ph-arrow-square-out ph-bold ph-lg",
|
||||||
text: i18n.ts.openInNewTab,
|
text: i18n.ts.openInNewTab,
|
||||||
action: () => {
|
href: notePage(appearNote),
|
||||||
window.open(notePage(appearNote), "_blank");
|
target: "_blank",
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: "ph-link-simple ph-bold ph-lg",
|
icon: "ph-link-simple ph-bold ph-lg",
|
||||||
|
@ -423,6 +423,13 @@ function onContextmenu(ev: MouseEvent): void {
|
||||||
copyToClipboard(`${url}${notePage(appearNote)}`);
|
copyToClipboard(`${url}${notePage(appearNote)}`);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
note.user.host != null ? {
|
||||||
|
type: "a",
|
||||||
|
icon: "ph-arrow-square-up-right ph-bold ph-lg",
|
||||||
|
text: i18n.ts.showOnRemote,
|
||||||
|
href: note.url ?? note.uri ?? "",
|
||||||
|
target: "_blank",
|
||||||
|
} : undefined,
|
||||||
],
|
],
|
||||||
ev
|
ev
|
||||||
);
|
);
|
||||||
|
|
|
@ -348,20 +348,20 @@ function onContextmenu(ev: MouseEvent): void {
|
||||||
os.pageWindow(notePage(appearNote));
|
os.pageWindow(notePage(appearNote));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
notePage(appearNote) != location.pathname ? {
|
||||||
icon: "ph-arrows-out-simple ph-bold ph-lg",
|
icon: "ph-arrows-out-simple ph-bold ph-lg",
|
||||||
text: i18n.ts.showInPage,
|
text: i18n.ts.showInPage,
|
||||||
action: () => {
|
action: () => {
|
||||||
router.push(notePage(appearNote), "forcePage");
|
router.push(notePage(appearNote), "forcePage");
|
||||||
},
|
},
|
||||||
},
|
} : undefined,
|
||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
|
type: "a",
|
||||||
icon: "ph-arrow-square-out ph-bold ph-lg",
|
icon: "ph-arrow-square-out ph-bold ph-lg",
|
||||||
text: i18n.ts.openInNewTab,
|
text: i18n.ts.openInNewTab,
|
||||||
action: () => {
|
href: notePage(appearNote),
|
||||||
window.open(notePage(appearNote), "_blank");
|
target: "_blank",
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: "ph-link-simple ph-bold ph-lg",
|
icon: "ph-link-simple ph-bold ph-lg",
|
||||||
|
@ -370,6 +370,13 @@ function onContextmenu(ev: MouseEvent): void {
|
||||||
copyToClipboard(`${url}${notePage(appearNote)}`);
|
copyToClipboard(`${url}${notePage(appearNote)}`);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
note.user.host != null ? {
|
||||||
|
type: "a",
|
||||||
|
icon: "ph-arrow-square-up-right ph-bold ph-lg",
|
||||||
|
text: i18n.ts.showOnRemote,
|
||||||
|
href: note.url ?? note.uri ?? "",
|
||||||
|
target: "_blank",
|
||||||
|
} : undefined,
|
||||||
],
|
],
|
||||||
ev
|
ev
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue