Rename legacy PleromaFE Chat functionality to "Shout"

This commit is contained in:
Mark Felder 2020-08-03 18:44:35 -05:00 committed by Mark Felder
parent 7bd18cda64
commit 0604b1d5b7
15 changed files with 52 additions and 53 deletions

View file

@ -2,7 +2,7 @@ import fileSizeFormatService from '../../services/file_size_format/file_size_for
const FeaturesPanel = {
computed: {
chat: function () { return this.$store.state.instance.chatAvailable },
shout: function () { return this.$store.state.instance.shoutAvailable },
pleromaChatMessages: function () { return this.$store.state.instance.pleromaChatMessagesAvailable },
gopher: function () { return this.$store.state.instance.gopherAvailable },
whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled },

View file

@ -8,8 +8,8 @@
</div>
<div class="panel-body features-panel">
<ul>
<li v-if="chat">
{{ $t('features_panel.chat') }}
<li v-if="shout">
{{ $t('features_panel.shout') }}
</li>
<li v-if="pleromaChatMessages">
{{ $t('features_panel.pleroma_chat_messages') }}

View file

@ -10,7 +10,7 @@ library.add(
faTimes
)
const chatPanel = {
const shoutPanel = {
props: [ 'floating' ],
data () {
return {
@ -21,12 +21,12 @@ const chatPanel = {
},
computed: {
messages () {
return this.$store.state.chat.messages
return this.$store.state.shout.messages
}
},
methods: {
submit (message) {
this.$store.state.chat.channel.push('new_msg', { text: message }, 10000)
this.$store.state.shout.channel.push('new_msg', { text: message }, 10000)
this.currentMessage = ''
},
togglePanel () {
@ -50,4 +50,4 @@ const chatPanel = {
}
}
export default chatPanel
export default shoutPanel

View file

@ -1,12 +1,12 @@
<template>
<div
v-if="!collapsed || !floating"
class="chat-panel"
class="shout-panel"
>
<div class="panel panel-default">
<div
class="panel-heading timeline-heading"
:class="{ 'chat-heading': floating }"
:class="{ 'shout-heading': floating }"
@click.stop.prevent="togglePanel"
>
<div class="title">
@ -18,33 +18,33 @@
/>
</div>
</div>
<div class="chat-window">
<div class="shout-window">
<div
v-for="message in messages"
:key="message.id"
class="chat-message"
class="shout-message"
>
<span class="chat-avatar">
<span class="shout-avatar">
<img :src="message.author.avatar">
</span>
<div class="chat-content">
<div class="shout-content">
<router-link
class="chat-name"
class="shout-name"
:to="userProfileLink(message.author)"
>
{{ message.author.username }}
</router-link>
<br>
<span class="chat-text">
<span class="shout-text">
{{ message.text }}
</span>
</div>
</div>
</div>
<div class="chat-input">
<div class="shout-input">
<textarea
v-model="currentMessage"
class="chat-input-textarea"
class="shout-input-textarea"
rows="1"
@keyup.enter="submit(currentMessage)"
/>
@ -53,11 +53,11 @@
</div>
<div
v-else
class="chat-panel"
class="shout-panel"
>
<div class="panel panel-default">
<div
class="panel-heading stub timeline-heading chat-heading"
class="panel-heading stub timeline-heading shout-heading"
@click.stop.prevent="togglePanel"
>
<div class="title">
@ -72,12 +72,12 @@
</div>
</template>
<script src="./chat_panel.js"></script>
<script src="./shout_panel.js"></script>
<style lang="scss">
@import '../../_variables.scss';
.floating-chat {
.floating-shout {
position: fixed;
right: 0px;
bottom: 0px;
@ -85,8 +85,8 @@
max-width: 25em;
}
.chat-panel {
.chat-heading {
.shout-panel {
.shout-heading {
cursor: pointer;
.icon {
@ -102,22 +102,22 @@
}
}
.chat-window {
.shout-window {
overflow-y: auto;
overflow-x: hidden;
max-height: 20em;
}
.chat-window-container {
.shout-window-container {
height: 100%;
}
.chat-message {
.shout-message {
display: flex;
padding: 0.2em 0.5em
}
.chat-avatar {
.shout-avatar {
img {
height: 24px;
width: 24px;
@ -128,7 +128,7 @@
}
}
.chat-input {
.shout-input {
display: flex;
textarea {
flex: 1;
@ -138,7 +138,7 @@
}
}
.chat-panel {
.shout-panel {
.title {
display: flex;
justify-content: space-between;

View file

@ -49,7 +49,7 @@ const SideDrawer = {
currentUser () {
return this.$store.state.users.currentUser
},
chat () { return this.$store.state.chat.channel.state === 'joined' },
shout () { return this.$store.state.shout.channel.state === 'joined' },
unseenNotifications () {
return unseenNotificationsFromStore(this.$store)
},