From 4632eecb7641d0933f7d391e14097ae4797d292b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Wed, 23 Jan 2019 20:43:06 +0900 Subject: [PATCH] Back to the #3813 (#3949) * Revert "Revert "Resolve #3813 (#3814)"" This reverts commit f433182c4cd449a08eb436df30bee731345240c1. * Keep CW is back * New Wave https://github.com/syuilo/misskey/pull/3949#pullrequestreview-194787210 --- locales/ja-JP.yml | 3 +++ .../app/desktop/views/components/post-form.vue | 6 ++++++ src/client/app/desktop/views/components/settings.vue | 12 +++++++++++- src/client/app/mobile/views/components/post-form.vue | 6 ++++++ src/client/app/mobile/views/pages/settings.vue | 6 ++++++ src/client/app/store.ts | 1 + 6 files changed, 33 insertions(+), 1 deletion(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5ab57da71e..bae7a1173d 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -884,6 +884,8 @@ desktop/views/components/settings.vue: auto-popout-desc: "ウィンドウが開かれるとき、ポップアウト(ブラウザ外に切り離す)可能なら自動でポップアウトします。この設定はブラウザに記憶されます。" deck-nav: "デッキ内ナビゲーション" deck-nav-desc: "デッキを使用しているとき、ナビゲーションが発生する際にページ遷移を行わずに一時的なカラムで受けるようにします。" + keep-cw: "CW保持" + keep-cw-desc: "投稿にリプライする際、リプライ元の投稿にCWが設定されていたとき、デフォルトで同じCWを設定するようにします。" deck-default: "デッキをデフォルトのUIにする" display: "デザインと表示" @@ -1664,6 +1666,7 @@ mobile/views/pages/settings.vue: notification-position-top: "上" behavior: "動作" fetch-on-scroll: "スクロールで自動読み込み" + keep-cw: "CW保持" note-visibility: "投稿の公開範囲" default-note-visibility: "デフォルトの公開範囲" remember-note-visibility: "投稿の公開範囲を記憶する" diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue index 9c2807663b..5b2a305404 100644 --- a/src/client/app/desktop/views/components/post-form.vue +++ b/src/client/app/desktop/views/components/post-form.vue @@ -222,6 +222,12 @@ export default Vue.extend({ }); } + // keep cw when reply + if (this.$store.state.settings.keepCw && this.reply && this.reply.cw) { + this.useCw = true; + this.cw = this.reply.cw; + } + this.$nextTick(() => { // 書きかけの投稿を復元 if (!this.instant && !this.mention) { diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue index bd17018a6f..95c107a0d5 100644 --- a/src/client/app/desktop/views/components/settings.vue +++ b/src/client/app/desktop/views/components/settings.vue @@ -31,7 +31,12 @@ {{ $t('auto-popout') }} {{ $t('auto-popout-desc') }} - {{ $t('deck-nav') }}{{ $t('deck-nav-desc') }} + {{ $t('deck-nav') }} + {{ $t('deck-nav-desc') }} + + {{ $t('keep-cw') }} + {{ $t('keep-cw-desc') }} +
@@ -336,6 +341,11 @@ export default Vue.extend({ set(value) { this.$store.commit('settings/set', { key: 'deckNav', value }); } }, + keepCw: { + get() { return this.$store.state.settings.keepCw; }, + set(value) { this.$store.commit('settings/set', { key: 'keepCw', value }); } + }, + darkmode: { get() { return this.$store.state.device.darkmode; }, set(value) { this.$store.commit('device/set', { key: 'darkmode', value }); } diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue index 24263d18fe..b6e70a5b11 100644 --- a/src/client/app/mobile/views/components/post-form.vue +++ b/src/client/app/mobile/views/components/post-form.vue @@ -210,6 +210,12 @@ export default Vue.extend({ }); } + // keep cw when reply + if (this.$store.state.settings.keepCw && this.reply && this.reply.cw) { + this.useCw = true; + this.cw = this.reply.cw; + } + this.focus(); this.$nextTick(() => { diff --git a/src/client/app/mobile/views/pages/settings.vue b/src/client/app/mobile/views/pages/settings.vue index 80b15acdea..cc7eb1e300 100644 --- a/src/client/app/mobile/views/pages/settings.vue +++ b/src/client/app/mobile/views/pages/settings.vue @@ -66,6 +66,7 @@
{{ $t('fetch-on-scroll') }} + {{ $t('keep-cw') }} {{ $t('disable-via-mobile') }} {{ $t('load-raw-images') }} {{ $t('load-remote-media') }} @@ -247,6 +248,11 @@ export default Vue.extend({ set(value) { this.$store.dispatch('settings/set', { key: 'fetchOnScroll', value }); } }, + keepCw: { + get() { return this.$store.state.settings.keepCw; }, + set(value) { this.$store.dispatch('settings/set', { key: 'keepCw', value }); } + }, + rememberNoteVisibility: { get() { return this.$store.state.settings.rememberNoteVisibility; }, set(value) { this.$store.dispatch('settings/set', { key: 'rememberNoteVisibility', value }); } diff --git a/src/client/app/store.ts b/src/client/app/store.ts index 350826e5ef..46655b7bd5 100644 --- a/src/client/app/store.ts +++ b/src/client/app/store.ts @@ -12,6 +12,7 @@ const defaultSettings = { mobileHome: [], deck: null, deckNav: true, + keepCw: false, tagTimelines: [], fetchOnScroll: true, showMaps: true,