diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2018-11-16 05:47:29 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2018-11-16 05:47:29 +0900 |
| commit | bceb02d760f53877f0f677144bc468ffbc4e66f2 (patch) | |
| tree | cc12d9836b81deecead9417c8fd6df635784fefd /src/client/app/desktop/views | |
| parent | [Client] Add missing icon (diff) | |
| download | misskey-bceb02d760f53877f0f677144bc468ffbc4e66f2.tar.gz misskey-bceb02d760f53877f0f677144bc468ffbc4e66f2.tar.bz2 misskey-bceb02d760f53877f0f677144bc468ffbc4e66f2.zip | |
local only visibility (#3254)
* local only visibility
* fix UI
Diffstat (limited to 'src/client/app/desktop/views')
| -rw-r--r-- | src/client/app/desktop/views/components/note.vue | 24 | ||||
| -rw-r--r-- | src/client/app/desktop/views/components/post-form.vue | 16 |
2 files changed, 36 insertions, 4 deletions
diff --git a/src/client/app/desktop/views/components/note.vue b/src/client/app/desktop/views/components/note.vue index e2b67c150f..6bd4674269 100644 --- a/src/client/app/desktop/views/components/note.vue +++ b/src/client/app/desktop/views/components/note.vue @@ -20,6 +20,15 @@ <router-link class="name" :to="note.user | userPage" v-user-preview="note.userId">{{ note.user | userName }}</router-link> <span>{{ this.$t('reposted-by').substr(this.$t('reposted-by').indexOf('}') + 1) }}</span> <mk-time :time="note.createdAt"/> + <span class="visibility" v-if="note.visibility != 'public'"> + <template v-if="note.visibility == 'home'"><fa icon="home"/></template> + <template v-if="note.visibility == 'followers'"><fa icon="unlock"/></template> + <template v-if="note.visibility == 'specified'"><fa icon="envelope"/></template> + <template v-if="note.visibility == 'private'"><fa icon="lock"/></template> + </span> + <span class="localOnly" v-if="note.localOnly == true"> + <template><fa icon="heart"/></template> + </span> </div> <article> <mk-avatar class="avatar" :user="appearNote.user"/> @@ -199,9 +208,6 @@ export default Vue.extend({ > span flex-shrink 0 - &:last-of-type - margin-right 8px - .name overflow hidden flex-shrink 1 @@ -215,6 +221,18 @@ export default Vue.extend({ flex-shrink 0 font-size 0.9em + > .visibility + margin-left 8px + + [data-icon] + margin-right 0 + + > .localOnly + margin-left 4px + + [data-icon] + margin-right 0 + & + article padding-top 8px diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue index e05fab168c..02478b4eb3 100644 --- a/src/client/app/desktop/views/components/post-form.vue +++ b/src/client/app/desktop/views/components/post-form.vue @@ -14,6 +14,7 @@ <b>{{ $t('recent-tags') }}:</b> <a v-for="tag in recentHashtags.slice(0, 5)" @click="addTag(tag)" :title="$t('click-to-tagging')">#{{ tag }}</a> </div> + <div class="local-only" v-if="this.localOnly == true">{{ $t('local-only-message') }}</div> <input v-show="useCw" v-model="cw" :placeholder="$t('annotations')"> <div class="textarea"> <textarea :class="{ with: (files.length != 0 || poll) }" @@ -112,6 +113,7 @@ export default Vue.extend({ geo: null, visibility: this.$store.state.settings.rememberNoteVisibility ? (this.$store.state.device.visibility || this.$store.state.settings.defaultNoteVisibility) : this.$store.state.settings.defaultNoteVisibility, visibleUsers: [], + localOnly: false, autocomplete: null, draghover: false, recentHashtags: JSON.parse(localStorage.getItem('hashtags') || '[]'), @@ -363,7 +365,14 @@ export default Vue.extend({ source: this.$refs.visibilityButton }); w.$once('chosen', v => { - this.visibility = v; + const m = v.match(/^local-(.+)/); + if (m) { + this.localOnly = true; + this.visibility = m[1]; + } else { + this.localOnly = false; + this.visibility = v; + } }); }, @@ -407,6 +416,7 @@ export default Vue.extend({ cw: this.useCw ? this.cw || '' : undefined, visibility: this.visibility, visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined, + localOnly: this.localOnly, geo: this.geo ? { coordinates: [this.geo.longitude, this.geo.latitude], altitude: this.geo.altitude, @@ -640,6 +650,10 @@ export default Vue.extend({ margin-right 8px white-space nowrap + > .local-only + margin 0 0 8px 0 + color var(--primary) + > .mk-uploader margin 8px 0 0 0 padding 8px |