diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-11-21 19:34:19 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-11-21 19:34:19 +0000 |
| commit | 513b81a23bd3d6aa308f538a2705d690fe90dc40 (patch) | |
| tree | e4a815ae42241e2a6b02fbf4251db1f0bde65bf7 | |
| parent | 8a87d82b7baf6cd8c4d1f33ee04d9fa1a25ae825 (diff) | |
| parent | d30e39ca32caf33ccaef7ec1b1c2756456bdb0e0 (diff) | |
Merge branch 'from/develop/tusooa/remote-xact' into 'develop'
Remote interaction with posts: frontend part
See merge request pleroma/pleroma-fe!1419
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/components/favorite_button/favorite_button.js | 5 | ||||
| -rw-r--r-- | src/components/favorite_button/favorite_button.vue | 10 | ||||
| -rw-r--r-- | src/components/reply_button/reply_button.js | 3 | ||||
| -rw-r--r-- | src/components/reply_button/reply_button.vue | 10 | ||||
| -rw-r--r-- | src/components/retweet_button/retweet_button.js | 3 | ||||
| -rw-r--r-- | src/components/retweet_button/retweet_button.vue | 10 | ||||
| -rw-r--r-- | src/modules/instance.js | 14 |
8 files changed, 49 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b7eea727..f6e52978 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Enabled users to zoom and pan images in media viewer with mouse and touch - Timelines/panels and conversations have sticky headers now - Added frontend ui for account migration +- Implemented remote interaction with statuses ## [2.4.2] - 2022-01-09 diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js index c996cba2..cf3378c9 100644 --- a/src/components/favorite_button/favorite_button.js +++ b/src/components/favorite_button/favorite_button.js @@ -39,7 +39,10 @@ const FavoriteButton = { } }, computed: { - ...mapGetters(['mergedConfig']) + ...mapGetters(['mergedConfig']), + remoteInteractionLink () { + return this.$store.getters.remoteInteractionLink({ statusId: this.status.id }) + } } } diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue index 74a1dfbb..ea01720a 100644 --- a/src/components/favorite_button/favorite_button.vue +++ b/src/components/favorite_button/favorite_button.vue @@ -33,13 +33,19 @@ /> </FALayers> </button> - <span v-else> + <a + v-else + class="button-unstyled interactive" + target="_blank" + role="button" + :href="remoteInteractionLink" + > <FAIcon class="fa-scale-110 fa-old-padding" :title="$t('tool_tip.favorite')" :icon="['far', 'star']" /> - </span> + </a> <span v-if="!mergedConfig.hidePostStats && status.fave_num > 0" class="action-counter" diff --git a/src/components/reply_button/reply_button.js b/src/components/reply_button/reply_button.js index d6382982..543d25ac 100644 --- a/src/components/reply_button/reply_button.js +++ b/src/components/reply_button/reply_button.js @@ -17,6 +17,9 @@ const ReplyButton = { computed: { loggedIn () { return !!this.$store.state.users.currentUser + }, + remoteInteractionLink () { + return this.$store.getters.remoteInteractionLink({ statusId: this.status.id }) } } } diff --git a/src/components/reply_button/reply_button.vue b/src/components/reply_button/reply_button.vue index ea97fbaa..dada511b 100644 --- a/src/components/reply_button/reply_button.vue +++ b/src/components/reply_button/reply_button.vue @@ -26,13 +26,19 @@ /> </FALayers> </button> - <span v-else> + <a + v-else + class="button-unstyled interactive" + target="_blank" + role="button" + :href="remoteInteractionLink" + > <FAIcon icon="reply" class="fa-scale-110 fa-old-padding" :title="$t('tool_tip.reply')" /> - </span> + </a> <span v-if="status.replies_count > 0" class="action-counter" diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js index b7911814..4d92b5fa 100644 --- a/src/components/retweet_button/retweet_button.js +++ b/src/components/retweet_button/retweet_button.js @@ -36,6 +36,9 @@ const RetweetButton = { computed: { mergedConfig () { return this.$store.getters.mergedConfig + }, + remoteInteractionLink () { + return this.$store.getters.remoteInteractionLink({ statusId: this.status.id }) } } } diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue index 396d1200..240828e3 100644 --- a/src/components/retweet_button/retweet_button.vue +++ b/src/components/retweet_button/retweet_button.vue @@ -40,13 +40,19 @@ :title="$t('timeline.no_retweet_hint')" /> </span> - <span v-else> + <a + v-else + class="button-unstyled interactive" + target="_blank" + role="button" + :href="remoteInteractionLink" + > <FAIcon class="fa-scale-110 fa-old-padding" icon="retweet" :title="$t('tool_tip.repeat')" /> - </span> + </a> <span v-if="!mergedConfig.hidePostStats && status.repeat_num > 0" class="no-event" diff --git a/src/modules/instance.js b/src/modules/instance.js index b1bc9779..3b15e62e 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -36,6 +36,8 @@ const REGIONAL_INDICATORS = (() => { return res })() +const REMOTE_INTERACTION_URL = '/main/ostatus' + const defaultState = { // Stuff from apiConfig name: 'Pleroma FE', @@ -214,6 +216,18 @@ const instance = { }, instanceDomain (state) { return new URL(state.server).hostname + }, + remoteInteractionLink (state) { + const server = state.server.endsWith('/') ? state.server.slice(0, -1) : state.server + const link = server + REMOTE_INTERACTION_URL + + return ({ statusId, nickname }) => { + if (statusId) { + return `${link}?status_id=${statusId}` + } else { + return `${link}?nickname=${nickname}` + } + } } }, actions: { |
