You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use observersConfig to send chatbot's response in previous block.
Chatbot.init({observersConfig: {// The bot message stack has changedobserveMessages: (messages)=>{console.log("observeMessages",{ messages });document.getElementById("chatbot-info").innerHTML=messages[messages.length-1].message;},},}
French translate & Tab ordering
document.addEventListener('DOMContentLoaded',function(){// Code to execute when the DOM is fully loadedconsole.log("DOM fully loaded and parsed");constshadowFlowiseChatbot=document.querySelector("flowise-chatbot").shadowRoot;constbtnToggleChatbot=shadowFlowiseChatbot.querySelector("button");btnToggleChatbot.setAttribute("aria-label","Ouvrir le chatbot");btnToggleChatbot.setAttribute("aria-expanded","false");btnToggleChatbot.setAttribute("aria-controls","flowise-chatbot");btnToggleChatbot.addEventListener("click",function(){btnToggleChatbot.setAttribute("aria-expanded",btnToggleChatbot.getAttribute("aria-expanded")==="true" ? "false" : "true");btnToggleChatbot.setAttribute("aria-label",btnToggleChatbot.getAttribute("aria-expanded")==="true" ? "Fermer le chatbot" : "Ouvrir le chatbot");});constdivContentBotDialog=shadowFlowiseChatbot.querySelector("div[part=bot]");letfirstLoadingChatbot=trueconstobserver=newMutationObserver((mutations)=>{if(!firstLoadingChatbot){return}firstLoadingChatbot=falseconstbtnSendMessage=shadowFlowiseChatbot.querySelector("button.chatbot-button:has(svg.send-icon)");constbtnRefresh=shadowFlowiseChatbot.querySelector("button.chatbot-button:has(svg.icon-tabler-refresh)");constbtnClose=shadowFlowiseChatbot.querySelector("button[title=Close\\ Chat]");//On mets en français avec un libellé clair le bouton d'envoie du messageif(btnSendMessage){btnSendMessage.setAttribute("aria-label","Envoyer le message");}//On mets en français avec un libellé clair le bouton de réinitialisation de la discussionif(btnRefresh){btnRefresh.setAttribute("title","Réinitialiser la discussion");}//On mets en français le bouton de fermeture du chatbotif(btnClose){btnClose.setAttribute("title","Fermer le chatbot");}//On déplace le bouton de fermeture après le bouton de réinitialisation pour une logique de tabulationif(btnRefresh&&btnClose){btnRefresh.after(btnClose)};});observer.observe(divContentBotDialog,{childList: true,subtree: true});});
Describe
We want integrate embed module in website with french accessibility constraints (RGAA). The module is not accessibility compliance.
Code adaptation
We want integrate embed module in website with french accessibility constraints (RGAA). The module is not accessibility compliance
Add html block
We have added an HTML
<div>block (not visible) to receive the chatbot's responses.Use observersConfig
Use
observersConfigto send chatbot's response in previous block.French translate & Tab ordering