iceshrimp-legacy/packages/client/src/scripts/helpMenu.ts

83 lines
1.8 KiB
TypeScript
Raw Normal View History

2023-04-01 20:56:43 +02:00
import { defaultStore } from "@/store";
import { instance } from "@/instance";
import { host } from "@/config";
import * as os from "@/os";
import XTutorial from "../components/MkTutorialDialog.vue";
import { i18n } from "@/i18n";
export function openHelpMenu_(ev: MouseEvent) {
os.popupMenu(
[
{
text: instance.name ?? host,
type: "label",
},
{
type: "link",
text: i18n.ts.instanceInfo,
icon: "ph-info ph-bold ph-lg",
to: "/about",
},
{
type: "link",
2023-07-15 23:21:17 +02:00
text: i18n.ts.aboutFirefish,
2023-04-01 20:56:43 +02:00
icon: "ph-lightbulb ph-bold ph-lg",
2023-07-20 18:36:48 +02:00
to: "/about-iceshrimp",
2023-04-01 20:56:43 +02:00
},
{
type: "button",
text: i18n.ts.tos,
icon: "ph-scroll ph-bold ph-lg",
action: () => {
window.open(instance.tosUrl, "_blank");
},
},
2023-04-01 20:56:43 +02:00
{
2023-05-08 04:05:05 +02:00
type: "button",
2023-05-09 01:26:36 +02:00
text: i18n.ts.apps,
2023-04-01 20:56:43 +02:00
icon: "ph-device-mobile ph-bold ph-lg",
2023-05-08 04:05:05 +02:00
action: () => {
2023-07-19 19:06:57 +02:00
window.open("https://joinfirefish.org/apps", "_blank");
2023-05-08 04:05:05 +02:00
},
2023-04-01 20:56:43 +02:00
},
{
type: "button",
action: async () => {
defaultStore.set("tutorial", 0);
os.popup(XTutorial, {}, {}, "closed");
},
text: i18n.ts.replayTutorial,
icon: "ph-circle-wavy-question ph-bold ph-lg",
},
null,
{
type: "parent",
text: i18n.ts.developer,
icon: "ph-code ph-bold ph-lg",
children: [
{
type: "link",
to: "/api-console",
text: "API Console",
icon: "ph-terminal-window ph-bold ph-lg",
},
{
text: i18n.ts.document,
icon: "ph-file-doc ph-bold ph-lg",
action: () => {
window.open("/api-doc", "_blank");
},
},
{
type: "link",
to: "/scratchpad",
text: "AiScript Scratchpad",
icon: "ph-scribble-loop ph-bold ph-lg",
},
],
},
],
2023-04-02 06:10:31 +02:00
ev.currentTarget ?? ev.target,
2023-04-01 20:56:43 +02:00
);
}