diff options
| author | shpuld <shp@cock.li> | 2019-02-03 10:13:09 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-02-03 10:13:09 +0200 |
| commit | b614cb94e502f3491afd07e5bcb785ad122cf100 (patch) | |
| tree | 289e82bd2f5667ab773bb838a88dd312bba90edf | |
| parent | dbb16d56e29b8a32fb7c1a7af56a7953f571cdb4 (diff) | |
| parent | c7ee2ed83100e40247fc35be8b138befc44175bc (diff) | |
merge develop in
| -rw-r--r-- | src/components/attachment/attachment.js | 6 | ||||
| -rw-r--r-- | src/components/post_status_form/post_status_form.js | 2 | ||||
| -rw-r--r-- | src/components/settings/settings.js | 8 | ||||
| -rw-r--r-- | src/components/settings/settings.vue | 4 | ||||
| -rw-r--r-- | src/components/status/status.js | 8 | ||||
| -rw-r--r-- | src/components/style_switcher/style_switcher.js | 2 | ||||
| -rw-r--r-- | src/components/tab_switcher/tab_switcher.js (renamed from src/components/tab_switcher/tab_switcher.jsx) | 12 | ||||
| -rw-r--r-- | src/components/user_card_content/user_card_content.vue | 6 | ||||
| -rw-r--r-- | src/components/user_profile/user_profile.vue | 34 | ||||
| -rw-r--r-- | src/components/user_settings/user_settings.js | 2 | ||||
| -rw-r--r-- | src/components/user_settings/user_settings.vue | 7 | ||||
| -rw-r--r-- | src/i18n/en.json | 3 | ||||
| -rw-r--r-- | src/i18n/fi.json | 2 | ||||
| -rw-r--r-- | src/services/entity_normalizer/entity_normalizer.service.js | 2 | ||||
| -rw-r--r-- | static/config.json | 5 |
15 files changed, 66 insertions, 37 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 47939852..3b7f08dc 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -57,9 +57,9 @@ const Attachment = { } }, openModal (event) { - const modalTypes = this.$store.state.config.playVideosInline - ? ['image'] - : ['image', 'video'] + const modalTypes = this.$store.state.config.playVideosInModal + ? ['image', 'video'] + : ['image'] if (fileTypeService.fileMatchesSomeType(modalTypes, this.attachment) || this.usePlaceHolder ) { diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 8a4e2489..88bc736f 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -16,7 +16,7 @@ const buildMentionsString = ({user, attentions}, currentUser) => { return `@${attention.screen_name}` }) - return mentions.join(' ') + ' ' + return mentions.length > 0 ? mentions.join(' ') + ' ' : '' } const PostStatusForm = { diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 06011e7c..8d138485 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -1,5 +1,5 @@ /* eslint-env browser */ -import TabSwitcher from '../tab_switcher/tab_switcher.jsx' +import TabSwitcher from '../tab_switcher/tab_switcher.js' import StyleSwitcher from '../style_switcher/style_switcher.vue' import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue' import { filter, trim } from 'lodash' @@ -66,7 +66,7 @@ const settings = { Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') || // Future spec, still not supported in Nightly 63 as of 08/2018 Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks'), - playVideosInline: user.playVideosInline, + playVideosInModal: user.playVideosInModal, useContainFit: user.useContainFit } }, @@ -164,8 +164,8 @@ const settings = { this.$store.dispatch('setOption', { name: 'webPushNotifications', value }) if (value) this.$store.dispatch('registerPushNotifications') }, - playVideosInline (value) { - this.$store.dispatch('setOption', { name: 'playVideosInline', value }) + playVideosInModal (value) { + this.$store.dispatch('setOption', { name: 'playVideosInModal', value }) }, useContainFit (value) { this.$store.dispatch('setOption', { name: 'useContainFit', value }) diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 08d659d6..9953780f 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -146,8 +146,8 @@ </ul> </li> <li> - <input type="checkbox" id="playVideosInline" v-model="playVideosInline"> - <label for="playVideosInline">{{$t('settings.play_videos_inline')}}</label> + <input type="checkbox" id="playVideosInModal" v-model="playVideosInModal"> + <label for="playVideosInModal">{{$t('settings.play_videos_in_modal')}}</label> </li> <li> <input type="checkbox" id="useContainFit" v-model="useContainFit"> diff --git a/src/components/status/status.js b/src/components/status/status.js index ec4de516..c718fe9f 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -87,7 +87,7 @@ const Status = { } }, retweet () { return !!this.statusoid.retweeted_status }, - retweeter () { return this.statusoid.user.name }, + retweeter () { return this.statusoid.user.name || this.statusoid.user.screen_name }, retweeterHtml () { return this.statusoid.user.name_html }, status () { if (this.retweet) { @@ -222,9 +222,9 @@ const Status = { if (this.attachmentSize === 'hide') { return [] } - return this.$store.state.config.playVideosInline - ? ['image'] - : ['image', 'video'] + return this.$store.state.config.playVideosInModal + ? ['image', 'video'] + : ['image'] }, galleryAttachments () { return this.status.attachments.filter( diff --git a/src/components/style_switcher/style_switcher.js b/src/components/style_switcher/style_switcher.js index 6a4e1cba..8c3d4861 100644 --- a/src/components/style_switcher/style_switcher.js +++ b/src/components/style_switcher/style_switcher.js @@ -7,7 +7,7 @@ import OpacityInput from '../opacity_input/opacity_input.vue' import ShadowControl from '../shadow_control/shadow_control.vue' import FontControl from '../font_control/font_control.vue' import ContrastRatio from '../contrast_ratio/contrast_ratio.vue' -import TabSwitcher from '../tab_switcher/tab_switcher.jsx' +import TabSwitcher from '../tab_switcher/tab_switcher.js' import Preview from './preview.vue' import ExportImport from '../export_import/export_import.vue' diff --git a/src/components/tab_switcher/tab_switcher.jsx b/src/components/tab_switcher/tab_switcher.js index 9038733c..f9c3f927 100644 --- a/src/components/tab_switcher/tab_switcher.jsx +++ b/src/components/tab_switcher/tab_switcher.js @@ -4,6 +4,7 @@ import './tab_switcher.scss' export default Vue.component('tab-switcher', { name: 'TabSwitcher', + props: ['renderOnlyFocused'], data () { return { active: this.$slots.default.findIndex(_ => _.tag) @@ -44,11 +45,12 @@ export default Vue.component('tab-switcher', { const contents = this.$slots.default.map((slot, index) => { if (!slot.tag) return const active = index === this.active - return ( - <div class={active ? 'active' : 'hidden'}> - {slot} - </div> - ) + if (this.renderOnlyFocused) { + return active + ? <div class="active">{slot}</div> + : <div class="hidden"></div> + } + return <div class={active ? 'active' : 'hidden' }>{slot}</div> }) return ( diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index a93caa5e..d1034d68 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -110,15 +110,15 @@ <div v-if="!hideUserStatsLocal && switcher" class="user-counts"> <div class="user-count" v-on:click.prevent="setProfileView('statuses')"> <h5>{{ $t('user_card.statuses') }}</h5> - <span v-if="!hideUserStatsLocal">{{user.statuses_count}} <br></span> + <span>{{user.statuses_count}} <br></span> </div> <div class="user-count" v-on:click.prevent="setProfileView('friends')"> <h5>{{ $t('user_card.followees') }}</h5> - <span v-if="!hideUserStatsLocal">{{user.friends_count}}</span> + <span>{{user.friends_count}}</span> </div> <div class="user-count" v-on:click.prevent="setProfileView('followers')"> <h5>{{ $t('user_card.followers') }}</h5> - <span v-if="!hideUserStatsLocal">{{user.followers_count}}</span> + <span>{{user.followers_count}}</span> </div> </div> <p @click.prevent="linkClicked" v-if="!hideBio && user.description_html" class="profile-bio" v-html="user.description_html"></p> diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 4ba09dc3..c431c729 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -1,9 +1,20 @@ <template> <div> <div v-if="user.id" class="user-profile panel panel-default"> - <user-card-content :user="user" :switcher="true" :selected="timeline.viewing"></user-card-content> - <tab-switcher> - <Timeline :label="$t('user_card.statuses')" :embedded="true" :title="$t('user_profile.timeline_title')" :timeline="timeline" :timeline-name="'user'" :user-id="fetchBy"/> + <user-card-content + :user="user" + :switcher="true" + :selected="timeline.viewing" + /> + <tab-switcher :renderOnlyFocused="true"> + <Timeline + :label="$t('user_card.statuses')" + :embedded="true" + :title="$t('user_profile.timeline_title')" + :timeline="timeline" + :timeline-name="'user'" + :user-id="fetchBy" + /> <div :label="$t('user_card.followees')"> <FriendsList v-if="user.friends_count > 0" :userId="userId" /> <div class="userlist-placeholder" v-else> @@ -16,8 +27,21 @@ <i class="icon-spin3 animate-spin"></i> </div> </div> - <Timeline :label="$t('user_card.media')" :embedded="true" :title="$t('user_card.media')" timeline-name="media" :timeline="media" :user-id="fetchBy" /> - <Timeline v-if="isUs" :label="$t('user_card.favorites')" :embedded="true" :title="$t('user_card.favorites')" timeline-name="favorites" :timeline="favorites"/> + <Timeline + :label="$t('user_card.media')" + :embedded="true" :title="$t('user_card.media')" + timeline-name="media" + :timeline="media" + :user-id="fetchBy" + /> + <Timeline + v-if="isUs" + :label="$t('user_card.favorites')" + :embedded="true" + :title="$t('user_card.favorites')" + timeline-name="favorites" + :timeline="favorites" + /> </tab-switcher> </div> <div v-else class="panel user-profile-placeholder"> diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index be799f5d..719a9c0c 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -1,4 +1,4 @@ -import TabSwitcher from '../tab_switcher/tab_switcher.jsx' +import TabSwitcher from '../tab_switcher/tab_switcher.js' import StyleSwitcher from '../style_switcher/style_switcher.vue' import fileSizeFormatService from '../../services/file_size_format/file_size_format.js' diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue index 253bbd34..82e1e56c 100644 --- a/src/components/user_settings/user_settings.vue +++ b/src/components/user_settings/user_settings.vue @@ -41,6 +41,7 @@ </div> <div class="setting-item"> <h2>{{$t('settings.avatar')}}</h2> + <p class="visibility-notice">{{$t('settings.avatar_size_instruction')}}</p> <p>{{$t('settings.current_avatar')}}</p> <img :src="user.profile_image_url_original" class="old-avatar"></img> <p>{{$t('settings.set_new_avatar')}}</p> @@ -130,7 +131,7 @@ <div class="setting-item"> <h2>{{$t('settings.follow_import')}}</h2> <p>{{$t('settings.import_followers_from_a_csv_file')}}</p> - <form v-model="followImportForm"> + <form> <input type="file" ref="followlist" v-on:change="followListChange"></input> </form> <i class=" icon-spin4 animate-spin uploading" v-if="followListUploading"></i> @@ -179,5 +180,9 @@ font-size: 1.5em; margin: 0.25em; } + + .name-changer { + width: 100%; + } } </style> diff --git a/src/i18n/en.json b/src/i18n/en.json index b1356aaa..d3b0e407 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -118,6 +118,7 @@ "delete_account_description": "Permanently delete your account and all your messages.", "delete_account_error": "There was an issue deleting your account. If this persists please contact your instance administrator.", "delete_account_instructions": "Type your password in the input below to confirm account deletion.", + "avatar_size_instruction": "The recommended minimum size for avatar images is 150x150 pixels.", "export_theme": "Save preset", "filtering": "Filtering", "filtering_explanation": "All statuses containing these words will be muted, one per line", @@ -150,7 +151,7 @@ "lock_account_description": "Restrict your account to approved followers only", "loop_video": "Loop videos", "loop_video_silent_only": "Loop only videos without sound (i.e. Mastodon's \"gifs\")", - "play_videos_inline": "Play videos directly on timeline", + "play_videos_in_modal": "Play videos directly in the media viewer", "use_contain_fit": "Don't crop the attachment in thumbnails", "name": "Name", "name_bio": "Name & Bio", diff --git a/src/i18n/fi.json b/src/i18n/fi.json index 122016b0..0d62f295 100644 --- a/src/i18n/fi.json +++ b/src/i18n/fi.json @@ -150,7 +150,7 @@ "lock_account_description": "Vain erikseen hyväksytyt käyttäjät voivat seurata tiliäsi", "loop_video": "Uudelleentoista videot", "loop_video_silent_only": "Uudelleentoista ainoastaan äänettömät videot (Video-\"giffit\")", - "play_videos_inline": "Toista videot suoraan aikajanalla", + "play_videos_in_modal": "Toista videot modaalissa", "use_contain_fit": "Älä rajaa liitteitä esikatselussa", "name": "Nimi", "name_bio": "Nimi ja kuvaus", diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 97b0d16f..af774675 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -270,7 +270,7 @@ export const parseNotification = (data) => { } output.created_at = new Date(data.created_at) - output.id = String(data.id) + output.id = data.id return output } diff --git a/static/config.json b/static/config.json index aac93f70..24e26696 100644 --- a/static/config.json +++ b/static/config.json @@ -19,8 +19,5 @@ "loginMethod": "password", "webPushNotifications": false, "noAttachmentLinks": false, - "nsfwCensorImage": "", - "useOneClickNsfw": true, - "playVideosInline": false, - "useContainFit": false + "nsfwCensorImage": "" } |
