diff options
| author | shpuld <shp@cock.li> | 2019-01-20 15:52:35 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-01-20 15:52:35 +0200 |
| commit | 8761e039d04ff26944c87339ef55d2951a42696c (patch) | |
| tree | 69a1d49f724d99fb49c72bd7d2f6bb1a73e8f066 /src/components | |
| parent | 485a061287149fe0ff5c4a188d21d775ff271f6d (diff) | |
| parent | 7651290e2be72ed35d7582757251eb151fdce953 (diff) | |
Merge dev fix conflicts
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/attachment/attachment.js | 3 | ||||
| -rw-r--r-- | src/components/attachment/attachment.vue | 2 | ||||
| -rw-r--r-- | src/components/side_drawer/side_drawer.js | 3 | ||||
| -rw-r--r-- | src/components/side_drawer/side_drawer.vue | 9 | ||||
| -rw-r--r-- | src/components/status/status.js | 14 | ||||
| -rw-r--r-- | src/components/status/status.vue | 2 | ||||
| -rw-r--r-- | src/components/who_to_follow/who_to_follow.js | 48 | ||||
| -rw-r--r-- | src/components/who_to_follow/who_to_follow.vue | 15 | ||||
| -rw-r--r-- | src/components/who_to_follow_panel/who_to_follow_panel.js | 8 | ||||
| -rw-r--r-- | src/components/who_to_follow_panel/who_to_follow_panel.vue | 2 |
10 files changed, 80 insertions, 26 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 2698fb67..d16e5086 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -26,6 +26,9 @@ const Attachment = { usePlaceHolder () { return this.size === 'hide' || this.type === 'unknown' }, + referrerpolicy () { + return this.$store.state.instance.mediaProxyAvailable ? '' : 'no-referrer' + }, type () { return fileTypeService.fileType(this.attachment.mimetype) }, diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 74993fd9..ad5120c0 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -19,7 +19,7 @@ :href="attachment.url" target="_blank" :title="attachment.description" > - <StillImage :class="{'small': isSmall}" referrerpolicy="no-referrer" :mimetype="attachment.mimetype" :src="attachment.large_thumb_url || attachment.url"/> + <StillImage :class="{'small': isSmall}" referrerpolicy="referrerPolicy" :mimetype="attachment.mimetype" :src="attachment.large_thumb_url || attachment.url"/> </a> <a class="video-container" diff --git a/src/components/side_drawer/side_drawer.js b/src/components/side_drawer/side_drawer.js index 538b919d..754a57e0 100644 --- a/src/components/side_drawer/side_drawer.js +++ b/src/components/side_drawer/side_drawer.js @@ -23,6 +23,9 @@ const SideDrawer = { }, unseenNotificationsCount () { return this.unseenNotifications.length + }, + suggestionsEnabled () { + return this.$store.state.instance.suggestionsEnabled } }, methods: { diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue index 7c792deb..386fff6a 100644 --- a/src/components/side_drawer/side_drawer.vue +++ b/src/components/side_drawer/side_drawer.vue @@ -62,12 +62,17 @@ </ul> <ul> <li @click="toggleDrawer"> - <router-link :to="{ name: 'user-search'}"> + <router-link :to="{ name: 'user-search' }"> {{ $t("nav.user_search") }} </router-link> </li> + <li v-if="currentUser && suggestionsEnabled" @click="toggleDrawer"> + <router-link :to="{ name: 'who-to-follow' }"> + {{ $t("nav.who_to_follow") }} + </router-link> + </li> <li @click="toggleDrawer"> - <router-link :to="{ name: 'settings'}"> + <router-link :to="{ name: 'settings' }"> {{ $t("settings.settings") }} </router-link> </li> diff --git a/src/components/status/status.js b/src/components/status/status.js index 8058e1bb..6e82307a 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -118,19 +118,7 @@ const Status = { return lengthScore > 20 }, isReply () { - if (this.status.in_reply_to_status_id) { - return true - } - // For private replies where we can't see the OP, in_reply_to_status_id will be null. - // So instead, check that the post starts with a @mention. - if (this.status.visibility === 'private') { - var textBody = this.status.text - if (this.status.summary !== null) { - textBody = textBody.substring(this.status.summary.length, textBody.length) - } - return textBody.startsWith('@') - } - return false + return !!this.status.in_reply_to_status_id }, hideReply () { if (this.$store.state.config.replyVisibility === 'all') { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index f88b5afb..d7cab15b 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -88,7 +88,7 @@ <div :class="{'tall-status': hideTallStatus}" class="status-content-wrapper"> <a class="tall-status-hider" :class="{ 'tall-status-hider_focused': isFocused }" v-if="hideTallStatus" href="#" @click.prevent="toggleShowMore">Show more</a> <div @click.prevent="linkClicked" class="status-content media-body" v-html="status.statusnet_html" v-if="!hideSubjectStatus"></div> - <div @click.prevent="linkClicked" class="status-content media-body" v-html="status.summary" v-else></div> + <div @click.prevent="linkClicked" class="status-content media-body" v-html="status.summary_html" v-else></div> <a v-if="hideSubjectStatus" href="#" class="cw-status-hider" @click.prevent="toggleShowMore">Show more</a> <a v-if="showingMore" href="#" class="status-unhider" @click.prevent="toggleShowMore">Show less</a> </div> diff --git a/src/components/who_to_follow/who_to_follow.js b/src/components/who_to_follow/who_to_follow.js new file mode 100644 index 00000000..82098fc2 --- /dev/null +++ b/src/components/who_to_follow/who_to_follow.js @@ -0,0 +1,48 @@ +import apiService from '../../services/api/api.service.js' +import UserCard from '../user_card/user_card.vue' + +const WhoToFollow = { + components: { + UserCard + }, + data () { + return { + users: [] + } + }, + mounted () { + this.getWhoToFollow() + }, + methods: { + showWhoToFollow (reply) { + reply.forEach((i, index) => { + const user = { + id: 0, + name: i.display_name, + screen_name: i.acct, + profile_image_url: i.avatar || '/images/avi.png' + } + this.users.push(user) + + this.$store.state.api.backendInteractor.externalProfile(user.screen_name) + .then((externalUser) => { + if (!externalUser.error) { + this.$store.commit('addNewUsers', [externalUser]) + user.id = externalUser.id + } + }) + }) + }, + getWhoToFollow () { + const credentials = this.$store.state.users.currentUser.credentials + if (credentials) { + apiService.suggestions({credentials: credentials}) + .then((reply) => { + this.showWhoToFollow(reply) + }) + } + } + } +} + +export default WhoToFollow diff --git a/src/components/who_to_follow/who_to_follow.vue b/src/components/who_to_follow/who_to_follow.vue new file mode 100644 index 00000000..df2e03c8 --- /dev/null +++ b/src/components/who_to_follow/who_to_follow.vue @@ -0,0 +1,15 @@ +<template> + <div class="panel panel-default"> + <div class="panel-heading"> + {{$t('who_to_follow.who_to_follow')}} + </div> + <div class="panel-body"> + <user-card v-for="user in users" :key="user.id" :user="user" :showFollows="true"></user-card> + </div> + </div> +</template> + +<script src="./who_to_follow.js"></script> + +<style lang="scss"> +</style> diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js index fddc7c7d..5e204001 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.js +++ b/src/components/who_to_follow_panel/who_to_follow_panel.js @@ -50,14 +50,6 @@ const WhoToFollowPanel = { user: function () { return this.$store.state.users.currentUser.screen_name }, - moreUrl: function () { - const host = window.location.hostname - const user = this.user - const suggestionsWeb = this.$store.state.instance.suggestionsWeb - const url = suggestionsWeb.replace(/{{host}}/g, encodeURIComponent(host)) - .replace(/{{user}}/g, encodeURIComponent(user)) - return url - }, suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled } diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.vue b/src/components/who_to_follow_panel/who_to_follow_panel.vue index 272c41d3..25e3a9f6 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.vue +++ b/src/components/who_to_follow_panel/who_to_follow_panel.vue @@ -13,7 +13,7 @@ {{user.name}} </router-link><br /> </span> - <img v-bind:src="$store.state.instance.logo"> <a v-bind:href="moreUrl" target="_blank">{{$t('who_to_follow.more')}}</a> + <img v-bind:src="$store.state.instance.logo"> <router-link :to="{ name: 'who-to-follow' }">{{$t('who_to_follow.more')}}</router-link> </div> </div> </div> |
