[mirotalksfu] - add chat markdown
هذا الالتزام موجود في:
@@ -82,6 +82,7 @@ let isAudioVideoAllowed = false;
|
|||||||
let isParticipantsListOpen = false;
|
let isParticipantsListOpen = false;
|
||||||
let isVideoControlsOn = false;
|
let isVideoControlsOn = false;
|
||||||
let isChatPasteTxt = false;
|
let isChatPasteTxt = false;
|
||||||
|
let isChatMarkdownOn = false;
|
||||||
let joinRoomWithoutAudioVideo = true;
|
let joinRoomWithoutAudioVideo = true;
|
||||||
let initAudioButton = null;
|
let initAudioButton = null;
|
||||||
let initVideoButton = null;
|
let initVideoButton = null;
|
||||||
@@ -148,6 +149,7 @@ function initClient() {
|
|||||||
setTippy('chatSpeechStartButton', 'Start speech recognition', 'top');
|
setTippy('chatSpeechStartButton', 'Start speech recognition', 'top');
|
||||||
setTippy('chatSpeechStopButton', 'Stop speech recognition', 'top');
|
setTippy('chatSpeechStopButton', 'Stop speech recognition', 'top');
|
||||||
setTippy('chatEmojiButton', 'Emoji', 'top');
|
setTippy('chatEmojiButton', 'Emoji', 'top');
|
||||||
|
setTippy('chatMarkdownButton', 'Markdown', 'top');
|
||||||
setTippy('chatShareFileButton', 'Share file', 'top');
|
setTippy('chatShareFileButton', 'Share file', 'top');
|
||||||
setTippy('chatCleanButton', 'Clean', 'bottom');
|
setTippy('chatCleanButton', 'Clean', 'bottom');
|
||||||
setTippy('chatSaveButton', 'Save', 'bottom');
|
setTippy('chatSaveButton', 'Save', 'bottom');
|
||||||
@@ -619,6 +621,7 @@ function roomIsReady() {
|
|||||||
BUTTONS.main.chatButton && show(chatButton);
|
BUTTONS.main.chatButton && show(chatButton);
|
||||||
show(chatSendButton);
|
show(chatSendButton);
|
||||||
show(chatEmojiButton);
|
show(chatEmojiButton);
|
||||||
|
show(chatMarkdownButton);
|
||||||
show(chatShareFileButton);
|
show(chatShareFileButton);
|
||||||
if (isWebkitSpeechRecognitionSupported) {
|
if (isWebkitSpeechRecognitionSupported) {
|
||||||
show(chatSpeechStartButton);
|
show(chatSpeechStartButton);
|
||||||
@@ -795,6 +798,10 @@ function handleButtons() {
|
|||||||
chatEmojiButton.onclick = () => {
|
chatEmojiButton.onclick = () => {
|
||||||
rc.toggleChatEmoji();
|
rc.toggleChatEmoji();
|
||||||
};
|
};
|
||||||
|
chatMarkdownButton.onclick = () => {
|
||||||
|
isChatMarkdownOn = !isChatMarkdownOn;
|
||||||
|
setColor(chatMarkdownButton, isChatMarkdownOn ? 'lime' : 'white');
|
||||||
|
};
|
||||||
chatShareFileButton.onclick = () => {
|
chatShareFileButton.onclick = () => {
|
||||||
fileShareButton.click();
|
fileShareButton.click();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2059,8 +2059,12 @@ class RoomClient {
|
|||||||
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>';
|
||||||
}
|
}
|
||||||
message = isChatPasteTxt ? '<pre>' + message + '</pre>' : message;
|
if (isChatMarkdownOn) return marked.parse(message);
|
||||||
isChatPasteTxt = false;
|
|
||||||
|
if (isChatPasteTxt) {
|
||||||
|
isChatPasteTxt = false;
|
||||||
|
return '<pre>' + message + '</pre>';
|
||||||
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@
|
|||||||
<script defer src="../js/RoomClient.js"></script>
|
<script defer src="../js/RoomClient.js"></script>
|
||||||
<script defer src="../js/SpeechRec.js"></script>
|
<script defer src="../js/SpeechRec.js"></script>
|
||||||
<script defer src="../js/VideoGrid.js"></script>
|
<script defer src="../js/VideoGrid.js"></script>
|
||||||
|
<script defer src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||||
<script defer src="https://cdn.jsdelivr.net/npm/detectrtc@1.4.1/DetectRTC.min.js"></script>
|
<script defer src="https://cdn.jsdelivr.net/npm/detectrtc@1.4.1/DetectRTC.min.js"></script>
|
||||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.min.js"></script>
|
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.min.js"></script>
|
||||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/521/fabric.min.js"></script>
|
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/521/fabric.min.js"></script>
|
||||||
@@ -368,6 +369,9 @@
|
|||||||
<button id="chatEmojiButton" class="hidden">
|
<button id="chatEmojiButton" class="hidden">
|
||||||
<i class="fas fa-smile"></i>
|
<i class="fas fa-smile"></i>
|
||||||
</button>
|
</button>
|
||||||
|
<button id="chatMarkdownButton" class="hidden">
|
||||||
|
<i class="fab fa-markdown"></i>
|
||||||
|
</button>
|
||||||
<button id="chatShareFileButton" class="hidden">
|
<button id="chatShareFileButton" class="hidden">
|
||||||
<i class="fas fa-paperclip"></i>
|
<i class="fas fa-paperclip"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم