summaryrefslogtreecommitdiff
path: root/packages/frontend/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-10-31 20:14:39 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-10-31 20:14:39 +0900
commitbf01c1ee640943ff6dcd52d1cf2b519954805f07 (patch)
tree874e5177804d1ec3f42c2179b09939fe220997b9 /packages/frontend/src
parentUpdate .eslintrc.js (diff)
parentUpdate CHANGELOG.md (diff)
downloadsharkey-bf01c1ee640943ff6dcd52d1cf2b519954805f07.tar.gz
sharkey-bf01c1ee640943ff6dcd52d1cf2b519954805f07.tar.bz2
sharkey-bf01c1ee640943ff6dcd52d1cf2b519954805f07.zip
Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop
Diffstat (limited to 'packages/frontend/src')
-rw-r--r--packages/frontend/src/navbar.ts9
-rw-r--r--packages/frontend/src/pages/timeline.vue62
-rw-r--r--packages/frontend/src/ui/_common_/common.ts63
3 files changed, 79 insertions, 55 deletions
diff --git a/packages/frontend/src/navbar.ts b/packages/frontend/src/navbar.ts
index 7f182a98f7..e72a4dc316 100644
--- a/packages/frontend/src/navbar.ts
+++ b/packages/frontend/src/navbar.ts
@@ -6,7 +6,7 @@
import { computed, reactive } from 'vue';
import { $i } from '@/account.js';
import { miLocalStorage } from '@/local-storage.js';
-import { openInstanceMenu } from '@/ui/_common_/common.js';
+import { openInstanceMenu, openToolsMenu } from '@/ui/_common_/common.js';
import { lookup } from '@/scripts/lookup.js';
import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
@@ -142,6 +142,13 @@ export const navbarItemDef = reactive({
openInstanceMenu(ev);
},
},
+ tools: {
+ title: i18n.ts.tools,
+ icon: 'ti ti-tool',
+ action: (ev) => {
+ openToolsMenu(ev);
+ },
+ },
reload: {
title: i18n.ts.reload,
icon: 'ti ti-refresh',
diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue
index f601bc8a85..5b97385ead 100644
--- a/packages/frontend/src/pages/timeline.vue
+++ b/packages/frontend/src/pages/timeline.vue
@@ -140,36 +140,42 @@ function focus(): void {
tlComponent.focus();
}
-const headerActions = $computed(() => [
- ...[deviceKind === 'desktop' ? {
- icon: 'ti ti-refresh',
- text: i18n.ts.reload,
- handler: (ev) => {
- console.log('called');
- tlComponent.reloadTimeline();
- },
- } : {}], {
- icon: 'ti ti-dots',
- text: i18n.ts.options,
- handler: (ev) => {
- os.popupMenu([{
- type: 'switch',
- text: i18n.ts.showRenotes,
- icon: 'ti ti-repeat',
- ref: $$(withRenotes),
- }, src === 'local' || src === 'social' ? {
- type: 'switch',
- text: i18n.ts.showRepliesToOthersInTimeline,
- ref: $$(withReplies),
- } : undefined, {
- type: 'switch',
- text: i18n.ts.fileAttachedOnly,
- icon: 'ti ti-photo',
- ref: $$(onlyFiles),
- }], ev.currentTarget ?? ev.target);
+const headerActions = $computed(() => {
+ const tmp = [
+ {
+ icon: 'ti ti-dots',
+ text: i18n.ts.options,
+ handler: (ev) => {
+ os.popupMenu([{
+ type: 'switch',
+ text: i18n.ts.showRenotes,
+ icon: 'ti ti-repeat',
+ ref: $$(withRenotes),
+ }, src === 'local' || src === 'social' ? {
+ type: 'switch',
+ text: i18n.ts.showRepliesToOthersInTimeline,
+ ref: $$(withReplies),
+ } : undefined, {
+ type: 'switch',
+ text: i18n.ts.fileAttachedOnly,
+ icon: 'ti ti-photo',
+ ref: $$(onlyFiles),
+ }], ev.currentTarget ?? ev.target);
+ },
},
+ ];
+ if (deviceKind === 'desktop') {
+ tmp.unshift({
+ icon: 'ti ti-refresh',
+ text: i18n.ts.reload,
+ handler: (ev: Event) => {
+ console.log('called');
+ tlComponent.reloadTimeline();
+ },
+ });
}
-]);
+ return tmp;
+});
const headerTabs = $computed(() => [...(defaultStore.reactiveState.pinnedUserLists.value.map(l => ({
key: 'list:' + l.id,
diff --git a/packages/frontend/src/ui/_common_/common.ts b/packages/frontend/src/ui/_common_/common.ts
index 125d340fe7..ff6157f5f8 100644
--- a/packages/frontend/src/ui/_common_/common.ts
+++ b/packages/frontend/src/ui/_common_/common.ts
@@ -3,12 +3,42 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
+import type { MenuItem } from '@/types/menu.js';
import * as os from '@/os.js';
import { instance } from '@/instance.js';
import { host } from '@/config.js';
import { i18n } from '@/i18n.js';
import { $i } from '@/account.js';
+function toolsMenuItems(): MenuItem[] {
+ return [{
+ type: 'link',
+ to: '/scratchpad',
+ text: i18n.ts.scratchpad,
+ icon: 'ti ti-terminal-2',
+ }, {
+ type: 'link',
+ to: '/api-console',
+ text: 'API Console',
+ icon: 'ti ti-terminal-2',
+ }, {
+ type: 'link',
+ to: '/clicker',
+ text: '🍪👈',
+ icon: 'ti ti-cookie',
+ }, ($i && ($i.isAdmin || $i.policies.canManageCustomEmojis)) ? {
+ type: 'link',
+ to: '/custom-emojis-manager',
+ text: i18n.ts.manageCustomEmojis,
+ icon: 'ti ti-icons',
+ } : undefined, ($i && ($i.isAdmin || $i.policies.canManageAvatarDecorations)) ? {
+ type: 'link',
+ to: '/avatar-decorations',
+ text: i18n.ts.manageAvatarDecorations,
+ icon: 'ti ti-sparkles',
+ } : undefined];
+}
+
export function openInstanceMenu(ev: MouseEvent) {
os.popupMenu([{
text: instance.name ?? host,
@@ -47,32 +77,7 @@ export function openInstanceMenu(ev: MouseEvent) {
type: 'parent',
text: i18n.ts.tools,
icon: 'ti ti-tool',
- children: [{
- type: 'link',
- to: '/scratchpad',
- text: i18n.ts.scratchpad,
- icon: 'ti ti-terminal-2',
- }, {
- type: 'link',
- to: '/api-console',
- text: 'API Console',
- icon: 'ti ti-terminal-2',
- }, {
- type: 'link',
- to: '/clicker',
- text: '🍪👈',
- icon: 'ti ti-cookie',
- }, ($i && ($i.isAdmin || $i.policies.canManageCustomEmojis)) ? {
- type: 'link',
- to: '/custom-emojis-manager',
- text: i18n.ts.manageCustomEmojis,
- icon: 'ti ti-icons',
- } : undefined, ($i && ($i.isAdmin || $i.policies.canManageAvatarDecorations)) ? {
- type: 'link',
- to: '/avatar-decorations',
- text: i18n.ts.manageAvatarDecorations,
- icon: 'ti ti-sparkles',
- } : undefined],
+ children: toolsMenuItems(),
}, null, (instance.impressumUrl) ? {
text: i18n.ts.impressum,
icon: 'ti ti-file-invoice',
@@ -105,3 +110,9 @@ export function openInstanceMenu(ev: MouseEvent) {
align: 'left',
});
}
+
+export function openToolsMenu(ev: MouseEvent) {
+ os.popupMenu(toolsMenuItems(), ev.currentTarget ?? ev.target, {
+ align: 'left',
+ });
+}