@@ -656,6 +656,21 @@ ActiveCode.prototype.runProg = function() {
656656
657657 } ;
658658
659+ ActiveCode . addActiveCodeToDiv = function ( outerdiv , acdiv , sid , initialcode , language ) {
660+ var acdiv , thepre , newac ;
661+ thepre = document . createElement ( "pre" ) ;
662+ thepre [ 'data-component' ] = "activecode" ;
663+ thepre . id = acdiv ;
664+ thepre [ 'data-lang' ] = language ;
665+ $ ( "#" + acdiv ) . append ( thepre ) ;
666+ var opts = { 'orig' : thepre , 'useRunestoneServices' : true } ;
667+ newac = new ActiveCode ( opts )
668+ savediv = newac . divid ;
669+ newac . divid = outerdiv ;
670+ newac . loadEditor ( ) ;
671+ newac . divid = savediv ;
672+
673+ } ;
659674
660675ActiveCode . createScratchActivecode = function ( ) {
661676 /* set up the scratch Activecode editor in the search menu */
@@ -729,6 +744,7 @@ JSActiveCode.prototype.init = function(opts) {
729744 }
730745
731746JSActiveCode . prototype . outputfun = function ( a ) {
747+ $ ( this . output ) . css ( "visibility" , "visible" ) ;
732748 var str = "[" ;
733749 if ( typeof ( a ) == "object" && a . length ) {
734750 for ( var i = 0 ; i < a . length ; i ++ )
@@ -1393,6 +1409,7 @@ LiveCode.prototype.runProg = function() {
13931409 $ ( this . codeDiv ) . switchClass ( "col-md-12" , "col-md-6" , { duration :500 , queue :false } ) ;
13941410 $ ( this . outDiv ) . show ( { duration :700 , queue :false } ) ;
13951411 $ ( this . errDiv ) . remove ( ) ;
1412+ $ ( this . output ) . css ( "visibility" , "visible" ) ;
13961413
13971414 xhr . open ( "POST" , host , true ) ;
13981415 xhr . setRequestHeader ( 'Content-type' , 'application/json; charset=utf-8' ) ;
0 commit comments