diff options
| author | eugenijm <eugenijm@protonmail.com> | 2019-05-07 19:13:45 +0300 |
|---|---|---|
| committer | eugenijm <eugenijm@protonmail.com> | 2019-05-07 19:13:45 +0300 |
| commit | 4af343374af30d781dd6b7a5298928339f6a425d (patch) | |
| tree | 7b9c5b1371ff6c82bdf0e2407f7190458363e7f0 /src | |
| parent | befaa477a39234b9455faebfe54e90569013ebd0 (diff) | |
Move scope visibility notice to the status form, make it dismissible
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/mobile_post_status_modal/mobile_post_status_modal.vue | 2 | ||||
| -rw-r--r-- | src/components/post_status_form/post_status_form.js | 6 | ||||
| -rw-r--r-- | src/components/post_status_form/post_status_form.vue | 20 | ||||
| -rw-r--r-- | src/i18n/en.json | 6 | ||||
| -rw-r--r-- | src/modules/config.js | 1 |
5 files changed, 33 insertions, 2 deletions
diff --git a/src/components/mobile_post_status_modal/mobile_post_status_modal.vue b/src/components/mobile_post_status_modal/mobile_post_status_modal.vue index ca431c5f..c3cc5155 100644 --- a/src/components/mobile_post_status_modal/mobile_post_status_modal.vue +++ b/src/components/mobile_post_status_modal/mobile_post_status_modal.vue @@ -6,7 +6,7 @@ @click="closePostForm" > <div class="post-form-modal-panel panel" @click.stop=""> - <div class="panel-heading">{{$t('post_status.new_status') + ' (' + $t('post_status.scope.' + visibility) + ')'}}</div> + <div class="panel-heading">{{$t('post_status.new_status')}}</div> <PostStatusForm class="panel-body" @posted="closePostForm" @onScopeChange="onScopeChange" /> </div> </div> diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index d956ebe6..998794bf 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -182,6 +182,9 @@ const PostStatusForm = { }, safeDMEnabled () { return this.$store.state.instance.safeDM + }, + hideScopeNotice () { + return this.$store.state.config.hideScopeNotice } }, methods: { @@ -339,6 +342,9 @@ const PostStatusForm = { changeVis (visibility) { this.newStatus.visibility = visibility this.$emit('onScopeChange', visibility) + }, + dismissScopeNotice () { + this.$store.dispatch('setOption', { name: 'hideScopeNotice', value: true }) } } } diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 1ce2b647..15a466ec 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -9,7 +9,25 @@ class="visibility-notice"> <router-link :to="{ name: 'user-settings' }">{{ $t('post_status.account_not_locked_warning_link') }}</router-link> </i18n> - <p v-if="newStatus.visibility === 'direct'" class="visibility-notice"> + <p v-if="!hideScopeNotice && newStatus.visibility === 'public'" class="visibility-notice"> + <span>{{ $t('post_status.scope_notice.public') }}</span> + <a v-on:click.prevent="dismissScopeNotice()" style="float: right" class="button-icon"> + <i class='icon-cancel'></i> + </a> + </p> + <p v-else-if="!hideScopeNotice && newStatus.visibility === 'unlisted'" class="visibility-notice"> + <span>{{ $t('post_status.scope_notice.unlisted') }}</span> + <a v-on:click.prevent="dismissScopeNotice()" style="float: right" class="button-icon"> + <i class='icon-cancel'></i> + </a> + </p> + <p v-else-if="!hideScopeNotice && newStatus.visibility === 'private'" class="visibility-notice"> + <span>{{ $t('post_status.scope_notice.private') }}</span> + <a v-on:click.prevent="dismissScopeNotice()" style="float: right" class="button-icon"> + <i class='icon-cancel'></i> + </a> + </p> + <p v-else-if="newStatus.visibility === 'direct'" class="visibility-notice"> <span v-if="safeDMEnabled">{{ $t('post_status.direct_warning_to_first_only') }}</span> <span v-else>{{ $t('post_status.direct_warning_to_all') }}</span> </p> diff --git a/src/i18n/en.json b/src/i18n/en.json index 2f48c389..f98fa034 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -94,6 +94,12 @@ "direct_warning_to_all": "This post will be visible to all the mentioned users.", "direct_warning_to_first_only": "This post will only be visible to the mentioned users at the beginning of the message.", "posting": "Posting", + "scope_notice": { + "public": "Post to public timelines", + "private": "Post to followers only", + "unlisted": "Do not post to public timelines", + "direct": "Post to mentioned users only" + }, "scope": { "direct": "Direct - Post to mentioned users only", "private": "Followers-only - Post to followers only", diff --git a/src/modules/config.js b/src/modules/config.js index 1666a2c5..88969a97 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -30,6 +30,7 @@ const defaultState = { muteWords: [], highlight: {}, interfaceLanguage: browserLocale, + hideScopeNotice: false, scopeCopy: undefined, // instance default subjectLineBehavior: undefined, // instance default alwaysShowSubjectInput: undefined, // instance default |
