2019-08-14 09:48:44 +00:00
|
|
|
<template>
|
2021-09-14 06:25:48 +00:00
|
|
|
<div
|
|
|
|
class="message-text__wrap"
|
|
|
|
:class="{
|
|
|
|
'show--quoted': showQuotedContent,
|
|
|
|
'hide--quoted': !showQuotedContent,
|
|
|
|
}"
|
|
|
|
>
|
2021-01-15 09:10:50 +00:00
|
|
|
<div class="text-content" v-html="message"></div>
|
2021-09-14 06:25:48 +00:00
|
|
|
<button
|
|
|
|
v-if="displayQuotedButton"
|
|
|
|
class="quoted-text--button"
|
|
|
|
@click="toggleQuotedContent"
|
|
|
|
>
|
|
|
|
<span v-if="showQuotedContent">
|
|
|
|
<i class="ion-chevron-up" />
|
|
|
|
{{ $t('CHAT_LIST.HIDE_QUOTED_TEXT') }}
|
|
|
|
</span>
|
|
|
|
<span v-else>
|
|
|
|
<i class="ion-chevron-down" />
|
|
|
|
{{ $t('CHAT_LIST.SHOW_QUOTED_TEXT') }}
|
|
|
|
</span>
|
|
|
|
</button>
|
2021-01-06 12:26:29 +00:00
|
|
|
</div>
|
2019-08-14 09:48:44 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2020-08-01 15:26:47 +00:00
|
|
|
props: {
|
|
|
|
message: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
readableTime: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
isEmail: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
2021-09-14 06:25:48 +00:00
|
|
|
displayQuotedButton: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showQuotedContent: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggleQuotedContent() {
|
|
|
|
this.showQuotedContent = !this.showQuotedContent;
|
|
|
|
},
|
2020-08-01 15:26:47 +00:00
|
|
|
},
|
2019-08-14 09:48:44 +00:00
|
|
|
};
|
|
|
|
</script>
|
2021-08-26 06:28:56 +00:00
|
|
|
<style lang="scss">
|
2021-04-05 05:22:51 +00:00
|
|
|
.text-content {
|
|
|
|
overflow: auto;
|
2021-04-14 09:50:13 +00:00
|
|
|
|
|
|
|
&::v-deep {
|
|
|
|
ul,
|
|
|
|
ol {
|
|
|
|
margin-left: var(--space-normal);
|
|
|
|
}
|
|
|
|
}
|
2021-08-26 06:28:56 +00:00
|
|
|
table {
|
|
|
|
all: revert;
|
|
|
|
|
|
|
|
td {
|
|
|
|
all: revert;
|
|
|
|
}
|
|
|
|
|
|
|
|
tr {
|
|
|
|
all: revert;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
h1,
|
|
|
|
h2,
|
|
|
|
h3,
|
|
|
|
h4,
|
|
|
|
h5,
|
|
|
|
h6 {
|
|
|
|
font-size: var(--font-size-normal);
|
|
|
|
}
|
2021-04-05 05:22:51 +00:00
|
|
|
}
|
2021-09-14 06:25:48 +00:00
|
|
|
|
|
|
|
.show--quoted {
|
|
|
|
blockquote {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.hide--quoted {
|
|
|
|
blockquote {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.quoted-text--button {
|
|
|
|
color: var(--s-400);
|
|
|
|
cursor: pointer;
|
|
|
|
font-size: var(--font-size-mini);
|
|
|
|
padding-bottom: var(--space-small);
|
|
|
|
padding-top: var(--space-small);
|
|
|
|
}
|
2021-04-05 05:22:51 +00:00
|
|
|
</style>
|