refs #1452 Emojify quoted contents

This commit is contained in:
AkiraFukushima 2020-05-24 22:15:18 +09:00
parent 99049b0cdf
commit 3fcc526893
3 changed files with 26 additions and 18 deletions

View File

@ -63,8 +63,19 @@ export default {
}
.contents {
.header {
.emojione {
width: 20px;
height: 20px;
}
}
.body {
margin-top: 4px;
.emojione {
width: 20px;
height: 20px;
}
}
}
}

View File

@ -44,7 +44,7 @@
</div>
<div class="content-wrapper">
<div class="spoiler" v-show="spoilered(message.status)">
<span v-html="spoilerText(message.status)"></span>
<span v-html="emojiText(message.status.spoiler_text, message.status.emojis)"></span>
<el-button
v-if="!isShowContent(message.status)"
plain
@ -62,7 +62,7 @@
<div
class="content"
v-show="isShowContent(message.status)"
v-html="status(message.status)"
v-html="emojiText(message.status.content, message.status.emojis)"
@click.capture.prevent="tootClick"
></div>
</div>
@ -98,7 +98,7 @@
:icon="message.status.reblog.account.avatar"
:username="username(message.status.reblog.account)"
:accountName="''"
:body="message.status.reblog.content"
:body="emojiText(message.status.reblog.content, message.status.reblog.emojis)"
@select="openDetail(message.status.reblog)"
/>
<LinkPreview
@ -259,11 +259,8 @@ export default {
isShowAttachments(message) {
return !this.sensitive(message) || this.showAttachments
},
status(message) {
return emojify(message.content, message.emojis)
},
spoilerText(message) {
return emojify(message.spoiler_text, message.emojis)
emojiText(content, emojis) {
return emojify(content, emojis)
},
handleStatusControl(event) {
switch (event.srcKey) {

View File

@ -51,7 +51,7 @@
</div>
<div class="content-wrapper">
<div class="spoiler" v-show="spoilered">
<span v-html="spoilerText()"></span>
<span v-html="emojiText(originalMessage.spoiler_text, originalMessage.emojis)"></span>
<el-button v-if="!isShowContent" plain type="primary" size="medium" class="spoil-button" @click="showContent = true">
{{ $t('cards.toot.show_more') }}
</el-button>
@ -59,7 +59,12 @@
{{ $t('cards.toot.hide') }}
</el-button>
</div>
<div class="content" v-show="isShowContent" v-html="status()" @click.capture.prevent="tootClick"></div>
<div
class="content"
v-show="isShowContent"
v-html="emojiText(originalMessage.content, originalMessage.emojis)"
@click.capture.prevent="tootClick"
></div>
<Poll v-show="isShowContent" v-if="poll" :poll="poll" @vote="vote" @refresh="refresh"></Poll>
</div>
<div class="attachments">
@ -94,7 +99,7 @@
:icon="message.reblog.account.avatar"
:username="username(message.reblog.account)"
:accountName="accountName(message.reblog.account)"
:body="message.reblog.content"
:body="emojiText(message.reblog.content, message.reblog.emojis)"
@select="openDetail(message.reblog)"
/>
<LinkPreview
@ -578,13 +583,8 @@ export default {
})
})
},
status() {
const original = this.originalMessage
return emojify(original.content, original.emojis)
},
spoilerText() {
const original = this.originalMessage
return emojify(original.spoiler_text, original.emojis)
emojiText(content, emojis) {
return emojify(content, emojis)
},
handleTootControl(event) {
switch (event.srcKey) {