@@ -508,26 +508,24 @@ HTMLActiveCode.prototype.runProg = function () {
508508 $ ( this . codeDiv ) . switchClass ( "col-md-12" , "col-md-6" , { duration :500 , queue :false } ) ;
509509 $ ( this . outDiv ) . show ( { duration :700 , queue :false } ) ;
510510
511- $ ( this . output ) . html ( prog )
511+ this . output . srcdoc = prog ;
512512} ;
513513
514514HTMLActiveCode . prototype . init = function ( opts ) {
515515 ActiveCode . prototype . init . apply ( this , arguments )
516- this . code = $ ( this . origElem ) . html ( ) ;
516+ this . code = $ ( '<textarea />' ) . html ( orig . innerHTML ) . text ( ) ;
517517 this . editor . setValue ( this . code ) ;
518518 } ;
519519
520520HTMLActiveCode . prototype . createOutput = function ( ) {
521- // Create a parent div with two elements: pre for standard output and a div
522- // to hold turtle graphics output. We use a div in case the turtle changes from
523- // using a canvas to using some other element like svg in the future.
524- console . log ( "creating html output" )
525521 var outDiv = document . createElement ( "div" ) ;
526522 $ ( outDiv ) . addClass ( "ac_output col-md-6" ) ;
527523 this . outDiv = outDiv ;
528- this . output = document . createElement ( 'div ' ) ;
524+ this . output = document . createElement ( 'iframe ' ) ;
529525 $ ( this . output ) . css ( "background-color" , "white" ) ;
530-
526+ $ ( this . output ) . css ( "position" , "relative" ) ;
527+ $ ( this . output ) . css ( "height" , "400px" ) ;
528+ $ ( this . output ) . css ( "width" , "100%" ) ;
531529 outDiv . appendChild ( this . output ) ;
532530 this . outerDiv . appendChild ( outDiv ) ;
533531
0 commit comments