File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6363 margin : 0px ;
6464 }
6565
66+ # messages {
67+ height : 5vh ;
68+ overflow : scroll;
69+ }
70+
71+ # messages > p {
72+ margin : 0 ;
73+ font-family : monospace;
74+ }
75+
6676 </ style >
6777
6878 < script >
290300 display . querySelector ( "#UserState_Elapsed" ) . textContent = msg . Values . Elapsed ;
291301 }
292302
303+ function ClearMessages ( ) {
304+ let messageOut = document . getElementById ( "messages" ) ;
305+ while ( child = messageOut . firstChild ) {
306+ child . remove ( ) ;
307+ }
308+ }
309+
293310 // This function is invoked when the iframe posts a message back.
294311
295312 function receiveMessage ( event ) {
300317 }
301318
302319 let messageOut = document . getElementById ( "messages" ) ;
303- messageOut . textContent = messageOut . textContent + JSON . stringify ( msg ) + "\n" ;
320+ let line = document . createElement ( "p" ) ;
321+ line . textContent = JSON . stringify ( msg ) ;
322+ messageOut . append ( line ) ;
304323
305324 if ( msg . MessageId == 'App_LoadingStatus' ) {
306325 if ( msg . Values ) {
@@ -588,9 +607,9 @@ <h3>Send a message</h3>
588607
589608 < div class ="framed hbox ">
590609 < div class ="vbox ">
591- < h3 > Messages from editor</ h3 >
610+ < h3 > Messages from editor < button onclick =" ClearMessages(); " > Clear </ button > </ h3 >
592611
593- < pre id ="messages "> </ pre >
612+ < div id ="messages "> </ div >
594613 </ div >
595614 </ div >
596615
You can’t perform that action at this time.
0 commit comments