From fef4f7fce81d5aca76a8c45713c76c0c482884e7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 19 Oct 2018 06:18:33 +0900 Subject: [PATCH] #2930 (#2933) * wip * wip * Clean up * wip * wip * wip * wip * wip * wip * wip * wip * :art: * wip * wip --- locales/ja-JP.yml | 66 +-- .../app/common/views/components/index.ts | 2 + .../views/components/profile-editor.vue} | 6 +- .../app/common/views/components/ui/input.vue | 20 +- .../app/common/views/widgets/photo-stream.vue | 3 - src/client/app/desktop/script.ts | 4 +- .../desktop/views/components/note-detail.vue | 2 +- .../{notes.note.sub.vue => note.sub.vue} | 17 +- .../components/{notes.note.vue => note.vue} | 86 +++- .../app/desktop/views/components/notes.vue | 2 +- .../desktop/views/components/settings.2fa.vue | 6 +- .../desktop/views/components/settings.api.vue | 6 +- .../views/components/settings.password.vue | 2 +- .../views/components/settings.profile.vue | 106 ---- .../app/desktop/views/components/settings.vue | 455 +++++++++--------- .../desktop/views/pages/deck/deck.column.vue | 54 ++- .../views/pages/deck/deck.note-column.vue | 69 +++ .../views/pages/deck/deck.note.sub.vue | 71 --- .../desktop/views/pages/deck/deck.note.vue | 323 ------------- .../desktop/views/pages/deck/deck.notes.vue | 6 +- .../views/pages/deck/deck.notification.vue | 8 +- .../views/pages/deck/deck.user-column.vue | 261 ++++++++++ .../app/desktop/views/pages/deck/deck.vue | 45 +- .../desktop/views/pages/user/user.photos.vue | 3 - src/client/app/init.ts | 13 + .../app/mobile/views/pages/settings.vue | 8 +- src/client/app/store.ts | 11 +- src/client/theme/dark.json5 | 1 + src/client/theme/light.json5 | 1 + 29 files changed, 824 insertions(+), 833 deletions(-) rename src/client/app/{mobile/views/pages/settings/settings.profile.vue => common/views/components/profile-editor.vue} (95%) rename src/client/app/desktop/views/components/{notes.note.sub.vue => note.sub.vue} (84%) rename src/client/app/desktop/views/components/{notes.note.vue => note.vue} (81%) delete mode 100644 src/client/app/desktop/views/components/settings.profile.vue create mode 100644 src/client/app/desktop/views/pages/deck/deck.note-column.vue delete mode 100644 src/client/app/desktop/views/pages/deck/deck.note.sub.vue delete mode 100644 src/client/app/desktop/views/pages/deck/deck.note.vue create mode 100644 src/client/app/desktop/views/pages/deck/deck.user-column.vue diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5492a4da0..f2af85f42 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -456,6 +456,26 @@ common/views/components/trends.vue: count: "{}人が投稿" empty: "トレンドなし" +common/views/components/profile-editor.vue: + title: "プロフィール" + name: "名前" + account: "アカウント" + location: "場所" + description: "自己紹介" + birthday: "誕生日" + avatar: "アイコン" + banner: "バナー" + is-cat: "このアカウントはCatです" + is-bot: "このアカウントはBotです" + is-locked: "フォローを承認制にする" + careful-bot: "Botからのフォローだけ承認制にする" + advanced: "その他" + privacy: "プライバシー" + save: "保存" + saved: "プロフィールを保存しました" + uploading: "アップロード中" + upload-failed: "アップロードに失敗しました" + common/views/widgets/broadcast.vue: fetching: "確認中" no-broadcasts: "お知らせはありません" @@ -814,9 +834,12 @@ desktop/views/components/settings.vue: advanced: "詳細設定" api-via-stream: "ストリームを経由したAPIリクエスト" api-via-stream-desc: "この設定をオンにすると、websocket接続を経由してAPIリクエストが行われます(パフォーマンス向上が期待できます)。オフにすると、ネイティブの fetch APIが利用されます。この設定はこのデバイスのみ有効です。" + deck-nav: "デッキ内ナビゲーション" + deck-nav-desc: "デッキを使用しているとき、ナビゲーションが発生する際にページ遷移を行わずに一時的なカラムで受けるようにします。" display: "デザインと表示" customize: "ホームをカスタマイズ" + wallpaper: "壁紙" choose-wallpaper: "壁紙を選択" delete-wallpaper: "壁紙を削除" dark-mode: "ダークモード" @@ -839,9 +862,6 @@ desktop/views/components/settings.vue: volume: "ボリューム" test: "テスト" - mobile: "モバイル" - disable-via-mobile: "「モバイルからの投稿」フラグを付けない" - language: "言語" pick-language: "言語を選択" recommended: "推奨" @@ -933,22 +953,6 @@ desktop/views/components/settings.password.vue: not-match: "新しいパスワードが一致しません" changed: "パスワードを変更しました" -desktop/views/components/settings.profile.vue: - avatar: "アイコン" - choice-avatar: "画像を選択" - name: "名前" - location: "場所" - description: "自己紹介" - birthday: "誕生日" - save: "保存" - locked-account: "アカウントの保護" - is-locked: "フォローを承認制にする" - careful-bot: "Botからのフォローだけ承認制にする" - other: "その他" - is-bot: "このアカウントはBotです" - is-cat: "このアカウントはCatです" - profile-updated: "プロフィールを更新しました" - desktop/views/components/sub-note-content.vue: private: "この投稿は非公開です" deleted: "この投稿は削除されました" @@ -1069,11 +1073,6 @@ desktop/views/pages/deck/deck.tl-column.vue: is-media-view: "メディアビュー" edit: "オプション" -desktop/views/pages/deck/deck.note.vue: - reposted-by: "{}がRenote" - private: "この投稿は非公開です" - deleted: "この投稿は削除されました" - desktop/views/pages/stats/stats.vue: all-users: "全てのユーザー" original-users: "このインスタンスのユーザー" @@ -1417,25 +1416,6 @@ mobile/views/pages/notifications.vue: mobile/views/pages/games/reversi.vue: reversi: "リバーシ" -mobile/views/pages/settings/settings.profile.vue: - title: "プロフィール" - name: "名前" - account: "アカウント" - location: "場所" - description: "自己紹介" - birthday: "誕生日" - avatar: "アイコン" - banner: "バナー" - is-cat: "このアカウントはCatです" - is-locked: "フォローを承認制にする" - careful-bot: "Botからのフォローだけ承認制にする" - advanced: "その他" - privacy: "プライバシー" - save: "保存" - saved: "プロフィールを保存しました" - uploading: "アップロード中" - upload-failed: "アップロードに失敗しました" - mobile/views/pages/search.vue: search: "検索" empty: "「{}」に関する投稿は見つかりませんでした。" diff --git a/src/client/app/common/views/components/index.ts b/src/client/app/common/views/components/index.ts index e2b9089d3..0dd013807 100644 --- a/src/client/app/common/views/components/index.ts +++ b/src/client/app/common/views/components/index.ts @@ -1,5 +1,6 @@ import Vue from 'vue'; +import profileEditor from './profile-editor.vue'; import noteSkeleton from './note-skeleton.vue'; import theme from './theme.vue'; import instance from './instance.vue'; @@ -45,6 +46,7 @@ import uiSelect from './ui/select.vue'; import formButton from './ui/form/button.vue'; import formRadio from './ui/form/radio.vue'; +Vue.component('mk-profile-editor', profileEditor); Vue.component('mk-note-skeleton', noteSkeleton); Vue.component('mk-theme', theme); Vue.component('mk-instance', instance); diff --git a/src/client/app/mobile/views/pages/settings/settings.profile.vue b/src/client/app/common/views/components/profile-editor.vue similarity index 95% rename from src/client/app/mobile/views/pages/settings/settings.profile.vue rename to src/client/app/common/views/components/profile-editor.vue index 160a05a3e..10bdc0b57 100644 --- a/src/client/app/mobile/views/pages/settings/settings.profile.vue +++ b/src/client/app/common/views/components/profile-editor.vue @@ -49,6 +49,7 @@
%i18n:@is-cat% + %i18n:@is-bot% %i18n:common.always-mark-nsfw%
@@ -66,7 +67,7 @@ - - - diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue index 778302a7a..1a8cb6b0b 100644 --- a/src/client/app/desktop/views/components/settings.vue +++ b/src/client/app/desktop/views/components/settings.vue @@ -2,38 +2,59 @@
-
-

%i18n:@profile%

- -
+
+ -
-

%i18n:@theme%

- -
+ +
%fa:B twitter% %i18n:@twitter%
+
+ +
+
+
-
-

%i18n:@behaviour%

- - %i18n:@fetch-on-scroll% - %i18n:@fetch-on-scroll-desc% - - - %i18n:@auto-popout% - %i18n:@auto-popout-desc% - + +
%fa:palette% %i18n:@theme%
+ +
+ +
+
+ + +
%fa:sliders-h% %i18n:@behaviour%
+ +
+ + %i18n:@fetch-on-scroll% + %i18n:@fetch-on-scroll-desc% + + + %i18n:@auto-popout% + %i18n:@auto-popout-desc% + + %i18n:@deck-nav%%i18n:@deck-nav-desc% + +
+ %i18n:@advanced% + + %i18n:@api-via-stream% + %i18n:@api-via-stream-desc% + +
+
%i18n:@note-visibility%
@@ -49,24 +70,26 @@
+ -
- %i18n:@advanced% - - %i18n:@api-via-stream% - %i18n:@api-via-stream-desc% - -
- + +
%fa:desktop% %i18n:@display%
-
-

%i18n:@display%

-
- -
-
- - +
+ %i18n:@customize% +
+
+
%i18n:@wallpaper%
+ %i18n:@choose-wallpaper% + %i18n:@delete-wallpaper% +
+
+
%i18n:@navbar-position%
+ %i18n:@navbar-position-top% + %i18n:@navbar-position-left% + %i18n:@navbar-position-right% +
+
%i18n:@dark-mode% %i18n:@use-shadow% %i18n:@rounded-corners% @@ -75,171 +98,186 @@ %i18n:@contrasted-acct% %i18n:common.show-full-acct% %i18n:common.i-like-sushi% -
- %i18n:@post-form-on-timeline% - %i18n:@suggest-recent-hashtags% - %i18n:@show-clock-on-header% - %i18n:common.always-show-nsfw% - %i18n:@show-reply-target% - %i18n:@show-my-renotes% - %i18n:@show-renoted-my-notes% - %i18n:@show-local-renotes% - %i18n:@show-maps% - %i18n:common.disable-animated-mfm% - %i18n:common.show-reversi-board-labels% - %i18n:common.use-contrast-reversi-stones% +
+
+ %i18n:@post-form-on-timeline% + %i18n:@suggest-recent-hashtags% + %i18n:@show-clock-on-header% + %i18n:common.always-show-nsfw% + %i18n:@show-reply-target% + %i18n:@show-my-renotes% + %i18n:@show-renoted-my-notes% + %i18n:@show-local-renotes% + %i18n:@show-maps% + %i18n:common.disable-animated-mfm% + %i18n:common.show-reversi-board-labels% + %i18n:common.use-contrast-reversi-stones% +
+
+ + +
%fa:volume-up% %i18n:@sound%
-
%i18n:@navbar-position%
- %i18n:@navbar-position-top% - %i18n:@navbar-position-left% - %i18n:@navbar-position-right% -
- - -
-

%i18n:@sound%

- - %i18n:@enable-sounds% - %i18n:@enable-sounds-desc% - - - - -
- -
-

%i18n:@mobile%

- %i18n:@disable-via-mobile% -
- -
-

%i18n:@language%

- -
-

%fa:info-circle%%i18n:@language-desc%

-
-
- -
-

%i18n:@cache%

- -
-

%fa:exclamation-triangle%%i18n:@cache-warn%

-
-
- -
-

%i18n:@notification%

- - %i18n:@auto-watch% - %i18n:@auto-watch-desc% - -
- -
-

%i18n:@drive%

- -
- -
-

%i18n:@tags%

- -
- -
-

%i18n:@mute%

- -
- -
-

%i18n:@apps%

- -
- - - -
-

%i18n:@password%

- -
- -
-

%i18n:@2fa%

- -
- - - -
-

API

- -
- -
-

%i18n:@about%

-

%i18n:@operator%: {{ meta.maintainer.name }}

-
- -
-

%i18n:@update%

-

- %i18n:@version% {{ version }} - -

- -
- %i18n:@update-settings% - - %i18n:@prevent-update% - %i18n:@prevent-update-desc% + + %i18n:@enable-sounds% + %i18n:@enable-sounds-desc% -
-
+ + + %fa:volume-up% %i18n:@test% + +
-
-

%i18n:@advanced-settings%

- - %i18n:@debug-mode% - %i18n:@debug-mode-desc% - - - %i18n:@experimental% - %i18n:@experimental-desc% - -
+ +
%fa:language% %i18n:@language%
+
+ + + + + + + + + +
+

%fa:info-circle%%i18n:@language-desc%

+
+
+
+ + +
%fa:trash-alt R% %i18n:@cache%
+
+ %i18n:@clean-cache% +
+

%fa:exclamation-triangle%%i18n:@cache-warn%

+
+
+
+ + +
%fa:bell R% %i18n:@notification%
+
+ + %i18n:@auto-watch% + %i18n:@auto-watch-desc% + +
+
+ + +
%fa:cloud% %i18n:@drive%
+
+ +
+
+ + +
%fa:hashtag% %i18n:@tags%
+
+ +
+
+ + +
%fa:ban% %i18n:@mute%
+
+ +
+
+ + +
%fa:puzzle-piece% %i18n:@apps%
+
+ +
+
+ + +
%fa:unlock-alt% %i18n:@password%
+
+ +
+
+ + +
%fa:mobile-alt% %i18n:@2fa%
+
+ +
+
+ + + + +
%fa:key% API
+
+ +
+
+ + +
%fa:info-circle% %i18n:@about%
+
+

%i18n:@operator%: {{ meta.maintainer.name }}

+
+
+ + +
%fa:sync-alt% %i18n:@update%
+
+

+ %i18n:@version% {{ version }} + +

+ +
+ %i18n:@update-settings% + + %i18n:@prevent-update% + %i18n:@prevent-update-desc% + +
+
+
+ + +
%fa:cogs% %i18n:@advanced-settings%
+
+ + %i18n:@debug-mode% + %i18n:@debug-mode-desc% + + + %i18n:@experimental% + %i18n:@experimental-desc% + +
+
+ + diff --git a/src/client/app/desktop/views/pages/deck/deck.note.sub.vue b/src/client/app/desktop/views/pages/deck/deck.note.sub.vue deleted file mode 100644 index 445bf7e36..000000000 --- a/src/client/app/desktop/views/pages/deck/deck.note.sub.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/pages/deck/deck.note.vue b/src/client/app/desktop/views/pages/deck/deck.note.vue deleted file mode 100644 index 03cf3e291..000000000 --- a/src/client/app/desktop/views/pages/deck/deck.note.vue +++ /dev/null @@ -1,323 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/pages/deck/deck.notes.vue b/src/client/app/desktop/views/pages/deck/deck.notes.vue index 5898f5b05..c656fe917 100644 --- a/src/client/app/desktop/views/pages/deck/deck.notes.vue +++ b/src/client/app/desktop/views/pages/deck/deck.notes.vue @@ -17,7 +17,7 @@
+
@@ -19,11 +23,16 @@ import Vue from 'vue'; import XColumnCore from './deck.column-core.vue'; import Menu from '../../../../common/views/components/menu.vue'; import MkUserListsWindow from '../../components/user-lists-window.vue'; +import XUserColumn from './deck.user-column.vue'; +import XNoteColumn from './deck.note-column.vue'; + import * as uuid from 'uuid'; export default Vue.extend({ components: { - XColumnCore + XColumnCore, + XUserColumn, + XNoteColumn }, computed: { @@ -31,15 +40,21 @@ export default Vue.extend({ if (this.$store.state.settings.deck == null) return []; return this.$store.state.settings.deck.columns; }, + layout(): any[] { if (this.$store.state.settings.deck == null) return []; if (this.$store.state.settings.deck.layout == null) return this.$store.state.settings.deck.columns.map(c => [c.id]); return this.$store.state.settings.deck.layout; }, + style(): any { return { height: `calc(100vh - ${this.$store.state.uiHeaderHeight}px)` }; + }, + + temporaryColumn(): any { + return this.$store.state.device.deckTemporaryColumn; } }, @@ -50,6 +65,8 @@ export default Vue.extend({ }, created() { + this.$store.commit('navHook', this.onNav); + if (this.$store.state.settings.deck == null) { const deck = { columns: [/*{ @@ -95,6 +112,8 @@ export default Vue.extend({ }, beforeDestroy() { + this.$store.commit('navHook', null); + document.documentElement.style.overflow = 'auto'; }, @@ -103,6 +122,30 @@ export default Vue.extend({ return this.$refs[id][0]; }, + onNav(to) { + if (!this.$store.state.settings.deckNav) return false; + + if (to.name == 'user') { + this.$store.commit('device/set', { + key: 'deckTemporaryColumn', + value: { + type: 'user', + acct: to.params.user + } + }); + return true; + } else if (to.name == 'note') { + this.$store.commit('device/set', { + key: 'deckTemporaryColumn', + value: { + type: 'note', + noteId: to.params.note + } + }); + return true; + } + }, + add() { this.os.new(Menu, { source: this.$refs.add, diff --git a/src/client/app/desktop/views/pages/user/user.photos.vue b/src/client/app/desktop/views/pages/user/user.photos.vue index 628d5b6d9..2f525b003 100644 --- a/src/client/app/desktop/views/pages/user/user.photos.vue +++ b/src/client/app/desktop/views/pages/user/user.photos.vue @@ -60,9 +60,6 @@ export default Vue.extend({ margin-right 4px > .stream - display -webkit-flex - display -moz-flex - display -ms-flex display flex justify-content center flex-wrap wrap diff --git a/src/client/app/init.ts b/src/client/app/init.ts index 2cbceb8e7..7277e70d8 100644 --- a/src/client/app/init.ts +++ b/src/client/app/init.ts @@ -148,6 +148,19 @@ export default (callback: (launch: (router: VueRouter, api?: (os: MiOS) => API) }); //#endregion + // Navigation hook + router.beforeEach((to, from, next) => { + if (os.store.state.navHook) { + if (os.store.state.navHook(to)) { + next(false); + } else { + next(); + } + } else { + next(); + } + }); + Vue.mixin({ data() { return { diff --git a/src/client/app/mobile/views/pages/settings.vue b/src/client/app/mobile/views/pages/settings.vue index c0159a048..6ac8c8bd0 100644 --- a/src/client/app/mobile/views/pages/settings.vue +++ b/src/client/app/mobile/views/pages/settings.vue @@ -5,7 +5,7 @@
- +
%fa:palette% %i18n:@theme%
@@ -148,13 +148,7 @@ import Vue from 'vue'; import { apiUrl, version, codename, langs } from '../../../config'; import checkForUpdate from '../../../common/scripts/check-for-update'; -import XProfile from './settings/settings.profile.vue'; - export default Vue.extend({ - components: { - XProfile - }, - data() { return { apiUrl, diff --git a/src/client/app/store.ts b/src/client/app/store.ts index 63365f7fb..0a38decfa 100644 --- a/src/client/app/store.ts +++ b/src/client/app/store.ts @@ -10,6 +10,7 @@ const defaultSettings = { home: null, mobileHome: [], deck: null, + deckNav: true, tagTimelines: [], fetchOnScroll: true, showMaps: true, @@ -57,7 +58,8 @@ const defaultDeviceSettings = { alwaysShowNsfw: false, postStyle: 'standard', navbar: 'top', - mobileNotificationPosition: 'bottom' + mobileNotificationPosition: 'bottom', + deckTemporaryColumn: null }; export default (os: MiOS) => new Vuex.Store({ @@ -68,7 +70,8 @@ export default (os: MiOS) => new Vuex.Store({ state: { i: null, indicate: false, - uiHeaderHeight: 0 + uiHeaderHeight: 0, + navHook: null }, getters: { @@ -90,6 +93,10 @@ export default (os: MiOS) => new Vuex.Store({ setUiHeaderHeight(state, height) { state.uiHeaderHeight = height; + }, + + navHook(state, callback) { + state.navHook = callback; } }, diff --git a/src/client/theme/dark.json5 b/src/client/theme/dark.json5 index 59cff0ae4..deb4c4cee 100644 --- a/src/client/theme/dark.json5 +++ b/src/client/theme/dark.json5 @@ -174,6 +174,7 @@ desktopSettingsNavItemHover: ':lighten<10<$text', deckAcrylicColumnBg: 'rgba(0, 0, 0, 0.25)', + deckUserColumnBg: ':darken<3<@face', mobileHeaderBg: ':lighten<5<$secondary', mobileHeaderFg: '$text', diff --git a/src/client/theme/light.json5 b/src/client/theme/light.json5 index a1b000530..c5b314883 100644 --- a/src/client/theme/light.json5 +++ b/src/client/theme/light.json5 @@ -174,6 +174,7 @@ desktopSettingsNavItemHover: ':darken<10<$text', deckAcrylicColumnBg: 'rgba(0, 0, 0, 0.1)', + deckUserColumnBg: ':darken<4<@face', mobileHeaderBg: ':lighten<5<$secondary', mobileHeaderFg: '$text',