mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	add #send_textarea mirror to QR debugger
This commit is contained in:
		| @@ -145,6 +145,7 @@ | ||||
| 			<div title="Minimize" id="qr--modal-minimize" class="qr--modal-debugButton menu_button fa-solid fa-minimize"></div> | ||||
| 			<div title="Maximize" id="qr--modal-maximize" class="qr--modal-debugButton menu_button fa-solid fa-maximize"></div> | ||||
| 		</div> | ||||
| 		<textarea rows="1" id="qr--modal-send_textarea" placeholder="Chat input" title="Chat input"></textarea> | ||||
| 		<div id="qr--modal-debugState"></div> | ||||
| 	</div> | ||||
| </div> | ||||
|   | ||||
| @@ -984,6 +984,24 @@ export class QuickReply { | ||||
|                 this.abortController?.abort('Stop button clicked'); | ||||
|             }); | ||||
|  | ||||
|             /**@type {HTMLTextAreaElement} */ | ||||
|             const inputOg = document.querySelector('#send_textarea'); | ||||
|             const inputMirror = dom.querySelector('#qr--modal-send_textarea'); | ||||
|             inputMirror.value = inputOg.value; | ||||
|             const inputOgMo = new MutationObserver(muts=>{ | ||||
|                 if (muts.find(it=>[...it.removedNodes].includes(inputMirror) || [...it.removedNodes].find(n=>n.contains(inputMirror)))) { | ||||
|                     inputOg.removeEventListener('input', inputOgListener); | ||||
|                 } | ||||
|             }); | ||||
|             inputOgMo.observe(document.body, { childList:true }); | ||||
|             const inputOgListener = ()=>{ | ||||
|                 inputMirror.value = inputOg.value; | ||||
|             }; | ||||
|             inputOg.addEventListener('input', inputOgListener); | ||||
|             inputMirror.addEventListener('input', ()=>{ | ||||
|                 inputOg.value = inputMirror.value; | ||||
|             }); | ||||
|  | ||||
|             /**@type {HTMLElement}*/ | ||||
|             const resumeBtn = dom.querySelector('#qr--modal-resume'); | ||||
|             resumeBtn.addEventListener('click', ()=>{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user