From eceafe93de93e1117257a97d667f21e2f32f876e Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 8 Feb 2023 19:39:14 -0800 Subject: [PATCH] move help menu to middle navbar (more!) --- package.json | 2 +- packages/client/src/navbar.ts | 59 +++++++++++++++++ .../src/ui/_common_/navbar-for-mobile.vue | 62 ----------------- packages/client/src/ui/_common_/navbar.vue | 66 +------------------ 4 files changed, 63 insertions(+), 126 deletions(-) diff --git a/package.json b/package.json index fb840731ab..ede5affe0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "13.1.3-beta6", + "version": "13.1.3-beta7", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/navbar.ts b/packages/client/src/navbar.ts index 579247bf5e..5b116cee1b 100644 --- a/packages/client/src/navbar.ts +++ b/packages/client/src/navbar.ts @@ -5,6 +5,10 @@ import * as os from "@/os"; import { i18n } from "@/i18n"; import { ui } from "@/config"; import { unisonReload } from "@/scripts/unison-reload"; +import { defaultStore } from '@/store'; +import { instance } from '@/instance'; +import { host } from '@/config'; +import XTutorial from '@/components/MkTutorialDialog.vue'; export const navbarItemDef = reactive({ notifications: { @@ -144,4 +148,59 @@ export const navbarItemDef = reactive({ location.reload(); }, }, + help: { + title: "help", + icon: "ph-question-bold ph-lg", + action: (ev) => { + os.popupMenu([{ + text: instance.name ?? host, + type: 'label', + }, { + type: 'link', + text: i18n.ts.instanceInfo, + icon: 'ph-info-bold ph-lg', + to: '/about', + }, { + type: 'link', + text: i18n.ts.aboutMisskey, + icon: 'ph-lightbulb-bold ph-lg', + to: '/about-calckey', + }, { + type: 'link', + text: i18n.ts._apps.apps, + icon: 'ph-device-mobile-bold ph-lg', + to: '/apps', + }, { + type: 'button', + action: async () => { + defaultStore.set('tutorial', 0); + os.popup(XTutorial, {}, {}, 'closed'); + }, + text: i18n.ts.replayTutorial, + icon: 'ph-circle-wavy-question-bold ph-lg', + }, null, { + type: 'parent', + text: i18n.ts.developer, + icon: 'ph-code-bold ph-lg', + children: [{ + type: 'link', + to: '/api-console', + text: 'API Console', + icon: 'ph-terminal-window-bold ph-lg', + }, { + text: i18n.ts.document, + icon: 'ph-file-doc-bold ph-lg', + action: () => { + window.open('/api-doc', '_blank'); + }, + }, { + type: 'link', + to: '/scratchpad', + text: 'AiScript Scratchpad', + icon: 'ph-scribble-loop-bold ph-lg', + }] + }], ev.currentTarget ?? ev.target, + ); + }, + }, }); diff --git a/packages/client/src/ui/_common_/navbar-for-mobile.vue b/packages/client/src/ui/_common_/navbar-for-mobile.vue index e0669e7ad8..52dd370863 100644 --- a/packages/client/src/ui/_common_/navbar-for-mobile.vue +++ b/packages/client/src/ui/_common_/navbar-for-mobile.vue @@ -46,12 +46,10 @@