createChat(thisChatType).then((r) => { if(r.ok) talk = r.obj; }); /**重写重置聊天到初始状态函数 */ function reSetStartChatMessage(type) { chat.innerHTML = ``; isSpeaking = false; } /**重写函数 */ function isSpeakingStart(chatWithMagic, sendText) { isSpeaking = true; } //重写 function isSpeakingFinish() { isSpeaking = false; } //重写send函数 oldSend = send; send = (text) => { reSetStartChatMessage(); oldSend(text); } //重写porserTextBlock函数 /* 解析TextBlock body.type==TextBlock */ function porserTextBlock(body, father) { if (!body.size) { let div = getByClass('textBlock', 'div', father, 'markdown-body'); div.innerHTML = marked.marked(completeCodeBlock(body.text)); renderMathInElement(div,renderMathInElementOptions); let aaas = div.getElementsByTagName('a'); //将超链接在新页面打开 for(let i=0;i { let text = input_text.value; send(text); };