mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-07-05 11:00:50 +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)
|
}, 2000)
|
||||||
},
|
},
|
||||||
|
|
||||||
resize(event) {
|
resize(event) {
|
||||||
let input = this.$refs["input-box"];
|
let input = this.$refs["input-box"];
|
||||||
|
|
||||||
|
|
@ -371,19 +370,23 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.keyCode === 38){ //38 = up arrow
|
if (event.keyCode === 38){ //38 = up arrow
|
||||||
if (this.message !== "") return;
|
if (this.message !== "") return;
|
||||||
if (this.editMessage) return;
|
if (this.editMessage) return;
|
||||||
const messagesFiltered = this.selectedChannelMessages.filter(m => m.creator.uniqueID === this.user.uniqueID);
|
const messagesFiltered = this.selectedChannelMessages.filter(m => m.creator.uniqueID === this.user.uniqueID);
|
||||||
|
|
||||||
if (!messagesFiltered.length) return;
|
if (!messagesFiltered.length) return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const lastMessage = messagesFiltered[messagesFiltered.length - 1];
|
const lastMessage = messagesFiltered[messagesFiltered.length - 1];
|
||||||
this.$store.dispatch("setEditMessage", {
|
this.$store.dispatch("setEditMessage", {
|
||||||
messageID: lastMessage.messageID,
|
messageID: lastMessage.messageID,
|
||||||
channelID: lastMessage.channelID
|
channelID: lastMessage.channelID,
|
||||||
|
message: lastMessage.message
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
invertScroll(event) {
|
invertScroll(event) {
|
||||||
if (event.deltaY) {
|
if (event.deltaY) {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ export default {
|
||||||
if (emoji) return emoji.unicode
|
if (emoji) return emoji.unicode
|
||||||
|
|
||||||
const customEmoji = customEmojis.find(e => e.name === x.substr(1).slice(0, -1))
|
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
|
return x
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,18 @@ const markdown = new MarkdownIt({
|
||||||
}).use(chatPlugin)
|
}).use(chatPlugin)
|
||||||
.use(customEmoji);
|
.use(customEmoji);
|
||||||
|
|
||||||
function owo (text) {
|
|
||||||
const split = text.split('&');
|
//add attributes to link tag
|
||||||
if (!split || split.length <= 1) return `:${text}:`;
|
const defaultRender = markdown.renderer.rules.link_open || function(tokens, idx, options, env, self) {
|
||||||
const url = split[split.length - 1].slice(4);
|
return self.renderToken(tokens, idx, options);
|
||||||
return `<img class="emoji" draggable="false" alt=":${split[0]}:" src="${config.domain + "/files/" + url}">`
|
};
|
||||||
}
|
|
||||||
|
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) => {
|
export default (message) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue