mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-06-13 11:31:41 +00:00
fixed emoji bugs when editing
This commit is contained in:
parent
12e6621f37
commit
0d70eb6b3c
8 changed files with 52 additions and 10 deletions
|
|
@ -1,12 +1,14 @@
|
|||
<template>
|
||||
<div class="edit-panel" v-if="selectedChannelID === data.channelID">
|
||||
<div class="title">Edit Message:</div>
|
||||
<div class="message">{{data.message}}</div>
|
||||
<div class="message" v-html="message"></div>
|
||||
<div class="close-button" @click="close">Cancel</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import messageFormatter from "@/utils/messageFormatter.js";
|
||||
|
||||
export default {
|
||||
props: ['data'],
|
||||
methods: {
|
||||
|
|
@ -26,6 +28,9 @@ export default {
|
|||
document.removeEventListener('keydown', this.keyDownEvent)
|
||||
},
|
||||
computed: {
|
||||
message() {
|
||||
return messageFormatter(this.data.message)
|
||||
},
|
||||
selectedChannelID() {
|
||||
return this.$store.getters.selectedChannelID;
|
||||
},
|
||||
|
|
@ -70,5 +75,6 @@ export default {
|
|||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -519,7 +519,7 @@ export default {
|
|||
if (!editMessage) {
|
||||
this.message = ""
|
||||
} else {
|
||||
this.message = editMessage.message
|
||||
this.message = emojiParser.emojiToShortcode(editMessage.message)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -408,11 +408,11 @@ export default {
|
|||
word-wrap: break-word;
|
||||
word-break: break-word;
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
font-size: 14px;
|
||||
overflow: hidden;
|
||||
max-width: 100%;
|
||||
color: white;
|
||||
overflow-wrap: anywhere;
|
||||
margin-top: 3px;
|
||||
}
|
||||
.other-information {
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@
|
|||
</div>
|
||||
|
||||
|
||||
<div class="survey-warning" v-if="surveyErrorMessage">{{ surveyErrorMessage }}</div>
|
||||
<div class="survey-valid" v-if="surveyValidMessage">{{ surveyValidMessage }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="survey-warning" v-if="surveyErrorMessage">{{ surveyErrorMessage }}</div>
|
||||
<div class="survey-valid" v-if="surveyValidMessage">{{ surveyValidMessage }}</div>
|
||||
<div class="button" v-if="loaded" @click="surveySubmitButton">Save</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -58,9 +58,6 @@ export default {
|
|||
},
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
async mounted() {
|
||||
const { ok, error, result } = await userService.getSurvey();
|
||||
|
|
@ -141,6 +138,7 @@ export default {
|
|||
.survey {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
.survey-inner {
|
||||
display: flex;
|
||||
|
|
@ -154,6 +152,7 @@ export default {
|
|||
flex-direction: column;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.survey-content {
|
||||
|
|
@ -164,11 +163,13 @@ export default {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
|
|
|
|||
|
|
@ -154,10 +154,10 @@ const actions = {
|
|||
this._vm.$socket.emit('notification:dismiss', {channelID: data.message.channelID});
|
||||
} else {
|
||||
bus.$emit('title:change', data.message.creator.username + " sent a message.");
|
||||
// send notification if other users message the recipient
|
||||
if (data.message.creator.uniqueID === context.getters.user.uniqueID) return;
|
||||
desktopNotification();
|
||||
}
|
||||
// send notification if other users message the recipient
|
||||
if (data.message.creator.uniqueID === context.getters.user.uniqueID) return;
|
||||
const notification = {
|
||||
channelID: data.message.channelID,
|
||||
lastMessageID: data.message.messageID,
|
||||
|
|
|
|||
|
|
@ -19,4 +19,14 @@ module.exports = {
|
|||
icon: require('twemoji/2/svg/2764.svg'),
|
||||
color: '#dd2e44'
|
||||
},
|
||||
4: {
|
||||
name: 'Idea Queen',
|
||||
icon: require('twemoji/2/svg/1f4a0.svg'),
|
||||
color: '#78d4ff'
|
||||
},
|
||||
5: {
|
||||
name: 'Bug Catcher',
|
||||
icon: require('twemoji/2/svg/1f41b.svg'),
|
||||
color: '#e234eb'
|
||||
},
|
||||
}
|
||||
|
|
@ -14,6 +14,20 @@
|
|||
|
||||
const config = [
|
||||
|
||||
{
|
||||
version: 5.8,
|
||||
title: "Bug fixes",
|
||||
shortTitle: "",
|
||||
date: "04/08/2019",
|
||||
headColor: "rgba(79, 38, 50, 0.77)",
|
||||
new: [
|
||||
"Added more badges (Bug Catcher, Idea Queen)",
|
||||
],
|
||||
fix: [
|
||||
"Fixed a bug where desktop notifications would show for your own messages.",
|
||||
"Fixed a bug where editing custom emojis would break.",
|
||||
]
|
||||
},
|
||||
{
|
||||
version: 5.7,
|
||||
title: "Redesigned survey + user pop-out",
|
||||
|
|
|
|||
|
|
@ -26,6 +26,17 @@ export default {
|
|||
return x
|
||||
});
|
||||
},
|
||||
emojiToShortcode: message => {
|
||||
// replace default emojis
|
||||
for (let emoji of emojis) {
|
||||
const search = emoji.unicode;
|
||||
const replace = `:${emoji.shortcodes[0]}:`
|
||||
message = message.split(search).join(replace)
|
||||
}
|
||||
// replace custom emojis
|
||||
message = message.replace(/<:([-\w]+):[-\w]+>/g, ':$1:')
|
||||
return message
|
||||
},
|
||||
replaceEmojis: (string) => {
|
||||
|
||||
return twemoji.parse(string,
|
||||
|
|
|
|||
Loading…
Reference in a new issue