emile 9 months ago
parent 73e1eb7a0a
commit ca8bbe1429

Binary file not shown.

@ -58,10 +58,10 @@ function openConversation(chatId) {
function appendTextAreaScript(domain, conversationContainer) { function appendTextAreaScript(domain, conversationContainer) {
// Check if the script is already appended // Check if the script is already appended
if (!document.querySelector('script[src="http://' + domain + '/static/js/osichat-admin/textarea.js"]')) { if (!document.querySelector('script[src="https://' + domain + '/static/js/osichat-admin/textarea.js"]')) {
const textareaScript = document.createElement('script'); const textareaScript = document.createElement('script');
textareaScript.type = 'text/javascript'; textareaScript.type = 'text/javascript';
textareaScript.src = `http://${domain}/static/js/osichat-admin/textarea.js`; textareaScript.src = `https://${domain}/static/js/osichat-admin/textarea.js`;
conversationContainer.appendChild(textareaScript); conversationContainer.appendChild(textareaScript);
} }
} }

@ -49,7 +49,7 @@ function hideLoader() {
function appendTextAreaScript(domain, chatDiv) { function appendTextAreaScript(domain, chatDiv) {
const textareaScript = document.createElement('script'); const textareaScript = document.createElement('script');
textareaScript.type = 'text/javascript'; textareaScript.type = 'text/javascript';
textareaScript.src = `http://${domain}/static/js/osichat/textarea.js`; textareaScript.src = `https://${domain}/static/js/osichat/textarea.js`;
chatDiv.appendChild(textareaScript); chatDiv.appendChild(textareaScript);
} }
@ -91,10 +91,10 @@ function handleLoadChatEvent(data, osichatSocket) {
} }
if (!document.querySelector('script[src="http://' + domain + '/static/js/osichat/chat-toggle.js"]')) { if (!document.querySelector('script[src="https://' + domain + '/static/js/osichat/chat-toggle.js"]')) {
const script = document.createElement('script'); const script = document.createElement('script');
script.type = 'text/javascript'; script.type = 'text/javascript';
script.src = `http://${domain}/static/js/osichat/chat-toggle.js`; script.src = `https://${domain}/static/js/osichat/chat-toggle.js`;
chatDiv.appendChild(script); chatDiv.appendChild(script);
} }
@ -110,12 +110,12 @@ function handleLoadChatEvent(data, osichatSocket) {
const uploadScript = document.createElement('script'); const uploadScript = document.createElement('script');
uploadScript.type = 'text/javascript'; uploadScript.type = 'text/javascript';
uploadScript.src = `http://${domain}/static/js/osichat/upload-file.js`; uploadScript.src = `https://${domain}/static/js/osichat/upload-file.js`;
chatDiv.appendChild(uploadScript); chatDiv.appendChild(uploadScript);
const endChatScript = document.createElement('script'); const endChatScript = document.createElement('script');
endChatScript.type = 'text/javascript'; endChatScript.type = 'text/javascript';
endChatScript.src = `http://${domain}/static/js/osichat/end-chat.js`; endChatScript.src = `https://${domain}/static/js/osichat/end-chat.js`;
chatDiv.appendChild(endChatScript); chatDiv.appendChild(endChatScript);
const endChatButton = document.getElementById('endChat'); const endChatButton = document.getElementById('endChat');
@ -126,7 +126,7 @@ function handleLoadChatEvent(data, osichatSocket) {
if (sendReviewContainer) { if (sendReviewContainer) {
const sendReviewScript = document.createElement('script'); const sendReviewScript = document.createElement('script');
sendReviewScript.type = 'text/javascript'; sendReviewScript.type = 'text/javascript';
sendReviewScript.src = `http://${domain}/static/js/osichat/send-review.js`; sendReviewScript.src = `https://${domain}/static/js/osichat/send-review.js`;
chatDiv.appendChild(sendReviewScript); chatDiv.appendChild(sendReviewScript);
} }
} }
@ -202,7 +202,7 @@ async function initializeChatWebSocket() {
unreadMessages.classList.remove('hidden'); unreadMessages.classList.remove('hidden');
unreadMessages.innerHTML = data.html; unreadMessages.innerHTML = data.html;
const script = document.createElement('script'); const script = document.createElement('script');
script.src = `http://${domain}/static/js/osichat/chat-toggle.js`; script.src = `https://${domain}/static/js/osichat/chat-toggle.js`;
document.body.appendChild(script); document.body.appendChild(script);
} else { } else {
unreadMessages.classList.add('hidden'); unreadMessages.classList.add('hidden');
@ -218,7 +218,7 @@ async function initializeChatWebSocket() {
document.getElementById(`endChat`).classList.add('hidden'); document.getElementById(`endChat`).classList.add('hidden');
const sendReviewScript = document.createElement('script'); const sendReviewScript = document.createElement('script');
sendReviewScript.type = 'text/javascript'; sendReviewScript.type = 'text/javascript';
sendReviewScript.src = `http://${domain}/static/js/osichat/send-review.js`; sendReviewScript.src = `https://${domain}/static/js/osichat/send-review.js`;
currentChat.appendChild(sendReviewScript); currentChat.appendChild(sendReviewScript);
break; break;
case 'submit_review': case 'submit_review':
@ -228,7 +228,7 @@ async function initializeChatWebSocket() {
} }
const reviewScript = document.createElement('script'); const reviewScript = document.createElement('script');
reviewScript.type = 'text/javascript'; reviewScript.type = 'text/javascript';
reviewScript.src = `http://${domain}/static/js/osichat/send-review.js`; reviewScript.src = `https://${domain}/static/js/osichat/send-review.js`;
submitReview.appendChild(reviewScript); submitReview.appendChild(reviewScript);
break; break;
default: default:

Loading…
Cancel
Save