[mirotalksfu] - improve chat
هذا الالتزام موجود في:
@@ -1004,7 +1004,7 @@ function handleSelects() {
|
||||
|
||||
function handleInputs() {
|
||||
chatMessage.onkeyup = (e) => {
|
||||
if (e.keyCode === 13) {
|
||||
if (e.keyCode === 13 && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
chatSendButton.click();
|
||||
}
|
||||
|
||||
@@ -2053,17 +2053,21 @@ class RoomClient {
|
||||
}
|
||||
|
||||
formatMsg(message) {
|
||||
if (message == '\n') return;
|
||||
if (message.trim().length == 0) return;
|
||||
if (this.isHtml(message)) return this.stripHtml(message);
|
||||
if (this.isValidHttpURL(message)) {
|
||||
if (isImageURL(message)) return '<img src="' + message + '" alt="img" width="180" height="auto"/>';
|
||||
return '<a href="' + message + '" target="_blank">' + message + '</a>';
|
||||
}
|
||||
if (isChatMarkdownOn) return marked.parse(message);
|
||||
|
||||
let pre = '<pre>' + message + '</pre>';
|
||||
if (isChatPasteTxt) {
|
||||
isChatPasteTxt = false;
|
||||
return '<pre>' + message + '</pre>';
|
||||
return pre;
|
||||
}
|
||||
let numberOfLineBreaks = (message.match(/\n/g) || []).length;
|
||||
if (numberOfLineBreaks > 1) {
|
||||
return pre;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم