mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-06-16 13:01:09 +00:00
fixed bugs
This commit is contained in:
parent
1c6fe08fcb
commit
cbe0f8ac7d
3 changed files with 18 additions and 9 deletions
|
|
@ -247,7 +247,6 @@ export default {
|
|||
}
|
||||
}, 2000)
|
||||
},
|
||||
|
||||
resize(event) {
|
||||
let input = this.$refs["input-box"];
|
||||
|
||||
|
|
@ -371,19 +370,23 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.keyCode === 38){ //38 = up arrow
|
||||
if (this.message !== "") return;
|
||||
if (this.editMessage) return;
|
||||
const messagesFiltered = this.selectedChannelMessages.filter(m => m.creator.uniqueID === this.user.uniqueID);
|
||||
|
||||
if (!messagesFiltered.length) return;
|
||||
event.preventDefault();
|
||||
const lastMessage = messagesFiltered[messagesFiltered.length - 1];
|
||||
this.$store.dispatch("setEditMessage", {
|
||||
messageID: lastMessage.messageID,
|
||||
channelID: lastMessage.channelID
|
||||
channelID: lastMessage.channelID,
|
||||
message: lastMessage.message
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
invertScroll(event) {
|
||||
if (event.deltaY) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ export default {
|
|||
if (emoji) return emoji.unicode
|
||||
|
||||
const customEmoji = customEmojis.find(e => e.name === x.substr(1).slice(0, -1))
|
||||
if (customEmoji) return `:${customEmoji.name}&${customEmoji.emojiID}:`
|
||||
if (customEmoji) return `<:${customEmoji.name}:${customEmoji.emojiID}>`
|
||||
return x
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -26,12 +26,18 @@ const markdown = new MarkdownIt({
|
|||
}).use(chatPlugin)
|
||||
.use(customEmoji);
|
||||
|
||||
function owo (text) {
|
||||
const split = text.split('&');
|
||||
if (!split || split.length <= 1) return `:${text}:`;
|
||||
const url = split[split.length - 1].slice(4);
|
||||
return `<img class="emoji" draggable="false" alt=":${split[0]}:" src="${config.domain + "/files/" + url}">`
|
||||
}
|
||||
|
||||
//add attributes to link tag
|
||||
const defaultRender = markdown.renderer.rules.link_open || function(tokens, idx, options, env, self) {
|
||||
return self.renderToken(tokens, idx, options);
|
||||
};
|
||||
|
||||
markdown.renderer.rules.link_open = function (tokens, idx, options, env, self) {
|
||||
tokens[idx].attrPush(['target', '_blank']); // add new attribute
|
||||
tokens[idx].attrPush(['class', 'msg-link']);
|
||||
// pass token to default renderer.
|
||||
return defaultRender(tokens, idx, options, env, self);
|
||||
};
|
||||
|
||||
|
||||
export default (message) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue