MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / getOrCreateTextBlock

Function getOrCreateTextBlock

web/js/chat.js:711–730  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

709}
710
711function getOrCreateTextBlock() {
712 const children = Array.from(currentAssistantMsg.children).filter(
713 (c) => !c.classList.contains("loading-indicator")
714 );
715 let lastChild = children[children.length - 1];
716
717 if (!lastChild || !lastChild.classList.contains("text-block")) {
718 lastChild = document.createElement("div");
719 lastChild.className = "content text-block markdown-body";
720 lastChild.dataset.mdContent = "";
721
722 const indicator = currentAssistantMsg.querySelector(".loading-indicator");
723 if (indicator) {
724 currentAssistantMsg.insertBefore(lastChild, indicator);
725 } else {
726 currentAssistantMsg.appendChild(lastChild);
727 }
728 }
729 return lastChild;
730}
731
732function enableInput() {
733 const sendBtn = document.getElementById("send-btn");

Callers 1

handleAgentEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected