diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index bccb82e51..ae3110a7d 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -593,6 +593,9 @@ fillAbuseReportDescription: "通報理由の詳細を記入してください。 abuseReported: "内容が送信されました。ご報告ありがとうございました。" send: "送信" abuseMarkAsResolved: "対応済みにする" +openInNewTab: "新しいタブで開く" +openInSideView: "サイドビューで開く" +defaultNavigationBehaviour: "デフォルトのナビゲーション" _serverDisconnectedBehavior: reload: "自動でリロード" diff --git a/src/client/components/avatar.vue b/src/client/components/avatar.vue index 627818a8e..d90607bb8 100644 --- a/src/client/components/avatar.vue +++ b/src/client/components/avatar.vue @@ -2,9 +2,9 @@ - + - + diff --git a/src/client/components/ui/context-menu.vue b/src/client/components/ui/context-menu.vue index 98586cf3f..3a11589e8 100644 --- a/src/client/components/ui/context-menu.vue +++ b/src/client/components/ui/context-menu.vue @@ -1,5 +1,5 @@ - + {}"> diff --git a/src/client/components/ui/menu.vue b/src/client/components/ui/menu.vue index 5e74828c2..9e4e319c8 100644 --- a/src/client/components/ui/menu.vue +++ b/src/client/components/ui/menu.vue @@ -12,12 +12,12 @@ - + {{ item.text }} - + {{ item.text }} diff --git a/src/client/components/ui/radio.vue b/src/client/components/ui/radio.vue index 8f2b843ee..890ff0875 100644 --- a/src/client/components/ui/radio.vue +++ b/src/client/components/ui/radio.vue @@ -51,7 +51,7 @@ export default defineComponent({ .novjtctn { position: relative; display: inline-block; - margin: 0 32px 0 0; + margin: 16px 32px 0 0; cursor: pointer; transition: all 0.3s; diff --git a/src/client/components/ui/window.vue b/src/client/components/ui/window.vue index d545ac482..4c90ab9c8 100644 --- a/src/client/components/ui/window.vue +++ b/src/client/components/ui/window.vue @@ -2,14 +2,16 @@ - - + + + + - - - + + + @@ -85,6 +87,15 @@ export default defineComponent({ required: false, default: false, }, + closeRight: { + type: Boolean, + required: false, + default: false, + }, + contextmenu: { + type: Array, + required: false, + } }, emits: ['closed'], @@ -129,6 +140,12 @@ export default defineComponent({ } }, + onContextmenu(e) { + if (this.contextmenu) { + os.contextMenu(this.contextmenu, e); + } + }, + // 最前面へ移動 top() { let z = 0; diff --git a/src/client/components/url-preview.vue b/src/client/components/url-preview.vue index df02698b5..55872113b 100644 --- a/src/client/components/url-preview.vue +++ b/src/client/components/url-preview.vue @@ -8,7 +8,7 @@ - + diff --git a/src/client/components/url.vue b/src/client/components/url.vue index 649ce5fa2..ceb0381f8 100644 --- a/src/client/components/url.vue +++ b/src/client/components/url.vue @@ -1,5 +1,5 @@ - diff --git a/src/client/components/user-info.vue b/src/client/components/user-info.vue index 893747b7c..09736b1a2 100644 --- a/src/client/components/user-info.vue +++ b/src/client/components/user-info.vue @@ -3,7 +3,7 @@ - + diff --git a/src/client/components/user-preview.vue b/src/client/components/user-preview.vue index d1a11dc79..d25848986 100644 --- a/src/client/components/user-preview.vue +++ b/src/client/components/user-preview.vue @@ -5,7 +5,7 @@ - + diff --git a/src/client/components/users-dialog.vue b/src/client/components/users-dialog.vue index c8ca93703..f2e8ec480 100644 --- a/src/client/components/users-dialog.vue +++ b/src/client/components/users-dialog.vue @@ -6,13 +6,13 @@ - + - + {{ $t('loadMore') }} diff --git a/src/client/init.ts b/src/client/init.ts index 4a08f0999..86991b69e 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -4,14 +4,13 @@ import '@/style.scss'; -import { createApp } from 'vue'; +import { createApp, defineAsyncComponent } from 'vue'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; -import Root from './root.vue'; import widgets from './widgets'; import directives from './directives'; import components from '@/components'; -import { version, apiUrl } from '@/config'; +import { version, apiUrl, deckmode } from '@/config'; import { store } from './store'; import { router } from './router'; import { applyTheme } from '@/scripts/theme'; @@ -152,7 +151,12 @@ store.dispatch('instance/fetch').then(() => { stream.init(store.state.i); -const app = createApp(Root); +const app = createApp(await ( + window.location.search === '?zen' ? import('@/ui/zen.vue') : + !store.getters.isSignedIn ? import('@/ui/visitor.vue') : + deckmode ? import('@/ui/deck.vue') : + import('@/ui/default.vue') +).then(x => x.default)); if (_DEV_) { app.config.performance = true; diff --git a/src/client/os.ts b/src/client/os.ts index 3241f82e5..daff26efa 100644 --- a/src/client/os.ts +++ b/src/client/os.ts @@ -5,6 +5,7 @@ import { store } from '@/store'; import { apiUrl } from '@/config'; import MkPostFormDialog from '@/components/post-form-dialog.vue'; import MkWaitingDialog from '@/components/waiting-dialog.vue'; +import { resolve } from '@/router'; const ua = navigator.userAgent.toLowerCase(); export const isMobile = /mobile|iphone|ipad|android/.test(ua); @@ -162,7 +163,8 @@ export function popup(component: Component | typeof import('*.vue'), props: Reco }; } -export function pageWindow(url: string, component: Component | typeof import('*.vue'), props: Record) { +export function pageWindow(url: string) { + const { component, props } = resolve(url); popup(defineAsyncComponent(() => import('@/components/page-window.vue')), { initialUrl: url, initialComponent: markRaw(component), diff --git a/src/client/pages/docs.vue b/src/client/pages/docs.vue index ea3e16df9..245dff6b5 100644 --- a/src/client/pages/docs.vue +++ b/src/client/pages/docs.vue @@ -4,7 +4,7 @@ - {{ doc.title }} + {{ doc.title }} diff --git a/src/client/pages/explore.vue b/src/client/pages/explore.vue index cf191a748..c7378e0dd 100644 --- a/src/client/pages/explore.vue +++ b/src/client/pages/explore.vue @@ -38,8 +38,8 @@ {{ $t('popularTags') }} - {{ tag.tag }} - {{ tag.tag }} + {{ tag.tag }} + {{ tag.tag }} diff --git a/src/client/pages/follow-requests.vue b/src/client/pages/follow-requests.vue index 86e409ebb..9f67a8a9e 100644 --- a/src/client/pages/follow-requests.vue +++ b/src/client/pages/follow-requests.vue @@ -12,7 +12,7 @@ - + @{{ acct(req.follower) }} diff --git a/src/client/pages/messaging/index.vue b/src/client/pages/messaging/index.vue index 07b1cbab8..f62a33b86 100644 --- a/src/client/pages/messaging/index.vue +++ b/src/client/pages/messaging/index.vue @@ -4,13 +4,12 @@ {{ $t('startMessaging') }} - @@ -27,7 +26,7 @@ {{ $t('you') }}:{{ message.text }} - + @@ -90,18 +89,6 @@ export default defineComponent({ }, methods: { - go(message) { - const url = message.groupId ? `/my/messaging/group/${message.groupId}` : `/my/messaging/${getAcct(this.isMe(message) ? message.recipient : message.user)}`; - if (this.navHook) { - this.navHook(url, defineAsyncComponent(() => import('@/pages/messaging/messaging-room.vue')), { - userAcct: message.groupId ? null : getAcct(this.isMe(message) ? message.recipient : message.user), - groupId: message.groupId - }); - } else { - this.$router.push(url); - } - }, - getAcct, isMe(message) { diff --git a/src/client/pages/messaging/messaging-room.vue b/src/client/pages/messaging/messaging-room.vue index 4210b8cf8..4aca8bdab 100644 --- a/src/client/pages/messaging/messaging-room.vue +++ b/src/client/pages/messaging/messaging-room.vue @@ -317,7 +317,7 @@ const Component = defineComponent({ text: this.$t('openInWindow'), icon: faWindowMaximize, action: () => { - os.pageWindow(url, Component, this.$props); + os.pageWindow(url); this.$router.back(); }, }, this.inWindow ? undefined : { diff --git a/src/client/pages/my-groups/index.vue b/src/client/pages/my-groups/index.vue index f05226faa..e384dfc36 100644 --- a/src/client/pages/my-groups/index.vue +++ b/src/client/pages/my-groups/index.vue @@ -10,7 +10,7 @@ - {{ group.name }} + {{ group.name }} diff --git a/src/client/pages/my-lists/index.vue b/src/client/pages/my-lists/index.vue index 5e29436ed..9d0e19228 100644 --- a/src/client/pages/my-lists/index.vue +++ b/src/client/pages/my-lists/index.vue @@ -4,7 +4,7 @@ - {{ list.name }} + {{ list.name }} diff --git a/src/client/pages/note.vue b/src/client/pages/note.vue index cd31ccc33..a458d6c06 100644 --- a/src/client/pages/note.vue +++ b/src/client/pages/note.vue @@ -42,6 +42,12 @@ export default defineComponent({ MkRemoteCaution, MkButton, }, + props: { + noteId: { + type: String, + required: true + } + }, data() { return { INFO: computed(() => this.note ? { @@ -77,7 +83,7 @@ export default defineComponent({ }; }, watch: { - $route: 'fetch' + noteId: 'fetch' }, created() { this.fetch(); @@ -86,7 +92,7 @@ export default defineComponent({ fetch() { Progress.start(); os.api('notes/show', { - noteId: this.$route.params.note + noteId: this.noteId }).then(note => { Promise.all([ os.api('users/notes', { diff --git a/src/client/pages/page-editor/page-editor.vue b/src/client/pages/page-editor/page-editor.vue index 363f46c34..cd033219f 100644 --- a/src/client/pages/page-editor/page-editor.vue +++ b/src/client/pages/page-editor/page-editor.vue @@ -12,7 +12,7 @@ - {{ $t('_pages.viewPage') }} + {{ $t('_pages.viewPage') }} {{ $t('_pages.title') }} diff --git a/src/client/pages/page.vue b/src/client/pages/page.vue index eb470fdc1..e8a8a6bdf 100644 --- a/src/client/pages/page.vue +++ b/src/client/pages/page.vue @@ -20,9 +20,9 @@ - {{ $t('_pages.viewSource') }} + {{ $t('_pages.viewSource') }} - {{ $t('_pages.editThisPage') }} + {{ $t('_pages.editThisPage') }} {{ $t('unpin') }} {{ $t('pin') }} diff --git a/src/client/pages/settings/general.vue b/src/client/pages/settings/general.vue index 80152c5e6..d61d8620e 100644 --- a/src/client/pages/settings/general.vue +++ b/src/client/pages/settings/general.vue @@ -2,6 +2,10 @@ {{ $t('general') }} + + {{ $t('defaultNavigationBehaviour') }} + {{ $t('openInSideView') }} + {{ $t('whenServerDisconnected') }} {{ $t('_serverDisconnectedBehavior.reload') }} @@ -51,6 +55,10 @@ {{ $t('deck') }} + + {{ $t('defaultNavigationBehaviour') }} + {{ $t('openInWindow') }} + {{ $t('_deck.alwaysShowMainColumn') }} @@ -146,6 +154,16 @@ export default defineComponent({ set(value) { this.$store.commit('device/set', { key: 'showFixedPostForm', value }); } }, + defaultSideView: { + get() { return this.$store.state.device.defaultSideView; }, + set(value) { this.$store.commit('device/set', { key: 'defaultSideView', value }); } + }, + + deckNavWindow: { + get() { return this.$store.state.device.deckNavWindow; }, + set(value) { this.$store.commit('device/set', { key: 'deckNavWindow', value }); } + }, + chatOpenBehavior: { get() { return this.$store.state.device.chatOpenBehavior; }, set(value) { this.$store.commit('device/set', { key: 'chatOpenBehavior', value }); } diff --git a/src/client/pages/settings/index.vue b/src/client/pages/settings/index.vue index 4ca30ee68..1bffa9c0a 100644 --- a/src/client/pages/settings/index.vue +++ b/src/client/pages/settings/index.vue @@ -1,52 +1,57 @@ - + {{ $t('basicSettings') }} - {{ $t('profile') }} - {{ $t('privacy') }} - {{ $t('reaction') }} - {{ $t('notifications') }} - {{ $t('integration') }} - {{ $t('security') }} + {{ $t('profile') }} + {{ $t('privacy') }} + {{ $t('reaction') }} + {{ $t('notifications') }} + {{ $t('integration') }} + {{ $t('security') }} {{ $t('clientSettings') }} - {{ $t('general') }} - {{ $t('theme') }} - {{ $t('sidebar') }} - {{ $t('sounds') }} - {{ $t('plugins') }} + {{ $t('general') }} + {{ $t('theme') }} + {{ $t('sidebar') }} + {{ $t('sounds') }} + {{ $t('plugins') }} {{ $t('otherSettings') }} - {{ $t('muteAndBlock') }} - {{ $t('wordMute') }} - API - {{ $t('other') }} + {{ $t('muteAndBlock') }} + {{ $t('wordMute') }} + API + {{ $t('other') }} {{ $t('logout') }} - - - - - + + + + + + diff --git a/src/client/ui/default.vue b/src/client/ui/default.vue index 754ed72c8..b674186db 100644 --- a/src/client/ui/default.vue +++ b/src/client/ui/default.vue @@ -20,6 +20,8 @@ + + @@ -47,19 +49,21 @@ - +
@{{ acct(req.follower) }}
{{ $t('you') }}:{{ message.text }}