mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-22 20:04:01 +00:00
iframe
This commit is contained in:
@@ -27,8 +27,6 @@ async function embedChatbot() {
|
|||||||
'transition: all 0.2s ease-in-out 0s; left: unset; transform: scale(1); :hover {transform: scale(1.1);} display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; z-index: 9999;';
|
'transition: all 0.2s ease-in-out 0s; left: unset; transform: scale(1); :hover {transform: scale(1.1);} display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; z-index: 9999;';
|
||||||
ChatBtnDiv.innerHTML = MessageIcon;
|
ChatBtnDiv.innerHTML = MessageIcon;
|
||||||
|
|
||||||
ChatBtn.appendChild(ChatBtnDiv);
|
|
||||||
|
|
||||||
const iframe = document.createElement('iframe');
|
const iframe = document.createElement('iframe');
|
||||||
iframe.allow = 'fullscreen;microphone';
|
iframe.allow = 'fullscreen;microphone';
|
||||||
iframe.title = 'FastGpt Chat Window';
|
iframe.title = 'FastGpt Chat Window';
|
||||||
@@ -40,10 +38,6 @@ async function embedChatbot() {
|
|||||||
|
|
||||||
document.body.appendChild(iframe);
|
document.body.appendChild(iframe);
|
||||||
|
|
||||||
iframe.onload = () => {
|
|
||||||
document.body.appendChild(ChatBtn);
|
|
||||||
};
|
|
||||||
|
|
||||||
ChatBtn.addEventListener('click', function () {
|
ChatBtn.addEventListener('click', function () {
|
||||||
const chatWindow = document.getElementById(chatWindowId);
|
const chatWindow = document.getElementById(chatWindowId);
|
||||||
|
|
||||||
@@ -57,5 +51,8 @@ async function embedChatbot() {
|
|||||||
ChatBtnDiv.innerHTML = MessageIcon;
|
ChatBtnDiv.innerHTML = MessageIcon;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ChatBtn.appendChild(ChatBtnDiv);
|
||||||
|
document.body.appendChild(ChatBtn);
|
||||||
}
|
}
|
||||||
document.body.onload = embedChatbot;
|
document.body.onload = embedChatbot;
|
||||||
|
Reference in New Issue
Block a user