@@ -48,14 +48,14 @@ function TogetherjsReadyHandler() {
4848}
4949
5050function TogetherjsCloseHandler ( ) {
51- if ( optCommon . appMode == "display" ) {
51+ if ( optCommon . getAppMode ( ) == "display" ) {
5252 $ ( "#surveyHeader" ) . show ( ) ;
5353 }
5454}
5555
5656function executeCode ( forceStartingInstr , forceRawInputLst ) {
5757 if ( forceRawInputLst !== undefined ) {
58- rawInputLst = forceRawInputLst ; // UGLY global across modules, FIXME
58+ optCommon . setRawInputLst ( forceRawInputLst ) ; // UGLY global across modules, FIXME
5959 }
6060
6161 var backend_script = optCommon . langToBackendScript ( $ ( '#pythonVersionSelector' ) . val ( ) ) ;
@@ -139,6 +139,7 @@ function experimentalPopUpSyntaxErrorSurvey() {
139139 }
140140
141141 // make sure jquery.qtip has been imported
142+ var myVisualizer = optCommon . getVisualizer ( ) ;
142143
143144 var codelineIDs = [ ] ;
144145 $ . each ( myVisualizer . domRoot . find ( '#pyCodeOutput .cod' ) , function ( i , e ) {
@@ -556,6 +557,7 @@ $(document).ready(function() {
556557
557558 $ ( "#hideHeaderLink" ) . click ( function ( ) {
558559 $ ( "#experimentalHeader" ) . hide ( ) ;
560+ var myVisualizer = optCommon . getVisualizer ( ) ;
559561 if ( myVisualizer ) {
560562 myVisualizer . updateOutput ( ) ; // redraw arrows
561563 }
@@ -613,6 +615,7 @@ $(document).ready(function() {
613615 // very subtle! for TogetherJS to sync #pythonVersionSelector
614616 // properly, we must manually send a sync request event:
615617 if ( TogetherJS && TogetherJS . running ) {
618+ var myVisualizer = optCommon . getVisualizer ( ) ;
616619 TogetherJS . send ( { type : "syncAppState" ,
617620 myAppState : optCommon . getAppState ( ) ,
618621 codeInputScrollTop : optCommon . pyInputGetScrollTop ( ) ,
@@ -628,12 +631,14 @@ $(document).ready(function() {
628631
629632
630633 $ ( '#genEmbedBtn' ) . bind ( 'click' , function ( ) {
631- assert ( optCommon . appMode == 'display' || optCommon . appMode == 'visualize' /* 'visualize' is deprecated */ ) ;
634+ assert ( optCommon . getAppMode ( ) == 'display' || optCommon . getAppMode ( ) == 'visualize' /* 'visualize' is deprecated */ ) ;
632635 var myArgs = optCommon . getAppState ( ) ;
633636 delete myArgs . mode ;
637+ var myVisualizer = optCommon . getVisualizer ( ) ;
634638 myArgs . codeDivWidth = myVisualizer . DEFAULT_EMBEDDED_CODE_DIV_WIDTH ;
635639 myArgs . codeDivHeight = myVisualizer . DEFAULT_EMBEDDED_CODE_DIV_HEIGHT ;
636640
641+ var domain = "http://pythontutor.com/" ; // for deployment
637642 var embedUrlStr = $ . param . fragment ( domain + "iframe-embed.html" , myArgs , 2 /* clobber all */ ) ;
638643 embedUrlStr = embedUrlStr . replace ( / \) / g, '%29' ) // replace ) with %29 so that links embed well in Markdown
639644 var iframeStr = '<iframe width="800" height="500" frameborder="0" src="' + embedUrlStr + '"> </iframe>' ;
0 commit comments