cloudformationTemplates/asyncCustomerChatUX/website/index.html [298:485]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $('#firstName').blur(); $('#username').blur(); document.getElementById("startChat").disabled = true; document.getElementById("firstName").disabled = true; document.getElementById("username").disabled = true; $("#nav").css("width", "1063"); $('#chatWrapper').hide(); $("#section-chat").show("slide"); $("#section-chat").draggable({ handle: ".header-wrapper" }); $("#divSpinner").delay(310).fadeIn(); } }); }); //Chat Management function successHandler(chatSession) { window.chatSession = chatSession; // chat connected $("#divSpinner").fadeOut(200); $('#chatWrapper').fadeIn(400); //Change the incoming data set chatSession.incomingItemDecorator = function (item) { if (["SYSTEM_MESSAGE"].indexOf(item.displayName) !== -1) { item.displayName = "System Message"; } if (chatSession.transcript.length > 0) { var transcriptItem = chatSession.transcript[chatSession.transcript.length - 1]; if (transcriptItem.transportDetails.direction === "Incoming") { var chatDescription = "This is a demo of a customer chat experience."; var name = transcriptItem.displayName; if (["prod", "$LATEST", "AI Assistant", "SYSTEM_MESSAGE", "System Message"].indexOf(name) === -1) { chatDescription = "You are now chatting with " + name; } document.getElementById("chatDescription").innerHTML = chatDescription; } } return item; } chatSession.onIncoming(function (data) { console.log("incoming message:|| " + JSON.stringify(data)); }); chatSession.onOutgoing(function (data) { // console.log("outgoing message: " + JSON.stringify(data)); }); chatSession.onChatDisconnected(function (data) { resetForm(); }); connect.ChatInterface.init({ containerId: 'root', headerConfig: { isHTML: true, render: () => { return (`
You can modify this header or use the default.