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