hardlounge/client/components/Chat.vue

110 lines
2.4 KiB
Vue
Raw Normal View History

<template>
2018-07-08 13:42:54 +00:00
<div
id="chat-container"
class="window">
<div
id="chat"
2018-07-09 10:44:12 +00:00
:data-id="channel.id"
:class="{
'hide-motd': !settings.motd,
'colored-nicks': settings.coloredNicks,
2018-07-08 17:28:52 +00:00
'show-seconds': settings.showSeconds,
}"
>
<div
:id="'chan-' + channel.id"
:class="[channel.type, 'chan', 'active']"
:data-id="channel.id"
:data-type="channel.type"
:aria-label="channel.name"
role="tabpanel"
>
<div class="header">
<button
class="lt"
aria-label="Toggle channel list"/>
<span class="title">{{ channel.name }}</span>
<span
:title="channel.topic"
2018-07-12 08:41:40 +00:00
class="topic"><ParsedMessage
v-if="channel.topic"
:text="channel.topic"/></span>
<button
class="menu"
aria-label="Open the context menu"
/>
<span
v-if="channel.type === 'channel'"
class="rt-tooltip tooltipped tooltipped-w"
aria-label="Toggle user list">
<button
class="rt"
aria-label="Toggle user list"/>
</span>
</div>
2018-07-10 09:16:24 +00:00
<div
v-if="channel.type === 'special'"
class="chat-content">
<div class="chat">
<div class="messages">
<div class="msg">
<component
:is="specialComponent"
:channel="channel"/>
</div>
</div>
</div>
2018-07-10 09:16:24 +00:00
</div>
<div
v-else
class="chat-content">
<MessageList
:channel="channel"
:settings="settings"/>
<ChatUserList
v-if="channel.type === 'channel'"
:channel="channel"/>
</div>
</div>
</div>
<div id="connection-error"/>
2018-07-08 13:42:54 +00:00
<ChatInput
:network="network"
:channel="channel"/>
</div>
</template>
<script>
2018-07-12 08:41:40 +00:00
import ParsedMessage from "./ParsedMessage.vue";
import MessageList from "./MessageList.vue";
2018-07-08 13:42:54 +00:00
import ChatInput from "./ChatInput.vue";
import ChatUserList from "./ChatUserList.vue";
2018-07-10 09:16:24 +00:00
import ListBans from "./Special/ListBans.vue";
2018-07-10 09:37:48 +00:00
import ListChannels from "./Special/ListChannels.vue";
2018-07-11 07:54:32 +00:00
import ListIgnored from "./Special/ListIgnored.vue";
export default {
name: "Chat",
components: {
2018-07-12 08:41:40 +00:00
ParsedMessage,
MessageList,
2018-07-08 13:42:54 +00:00
ChatInput,
ChatUserList,
},
props: {
settings: Object,
network: Object,
channel: Object,
},
2018-07-10 09:16:24 +00:00
computed: {
specialComponent() {
2018-07-10 09:37:48 +00:00
switch (this.channel.special) {
case "list_bans": return ListBans;
case "list_channels": return ListChannels;
2018-07-11 07:54:32 +00:00
case "list_ignored": return ListIgnored;
2018-07-10 09:16:24 +00:00
}
},
},
};
</script>