@@ -75,9 +75,24 @@ $(document).ready(function() {
7575 preseededCode = $ . bbq . getState ( 'code' ) ; // yuck, global!
7676 var preseededMode = $ . bbq . getState ( 'mode' ) ;
7777
78+
79+ // ugh, ugly tristate due to the possibility of being undefined :)
7880 if ( $ . bbq . getState ( 'cumulative_mode' ) == 'true' ) {
79- $ ( '#cumulativeMode' ) . prop ( 'checked' , true ) ;
81+ $ ( '#cumulativeModeSelector' ) . val ( 'yes' ) ;
82+ }
83+ else if ( $ . bbq . getState ( 'cumulative_mode' ) == 'false' ) {
84+ $ ( '#cumulativeModeSelector' ) . val ( 'no' ) ;
85+ }
86+ // else if it's undefined, don't do anything ...
87+
88+ if ( $ . bbq . getState ( 'python_version' ) == '3' ) {
89+ $ ( '#pythonVersionSelector' ) . val ( '3' ) ;
90+ }
91+ else if ( $ . bbq . getState ( 'python_version' ) == '2' ) {
92+ $ ( '#pythonVersionSelector' ) . val ( '2' ) ;
8093 }
94+ // else if it's undefined, don't do anything ...
95+
8196
8297 // only bother with curInstr when we're visualizing ...
8398 if ( ! preseededCurInstr && preseededMode == 'visualize' ) { // TODO: kinda gross hack
@@ -149,7 +164,7 @@ $(document).ready(function() {
149164
150165 $ . get ( backend_script ,
151166 { user_script : pyInputCodeMirror . getValue ( ) ,
152- cumulative_mode : $ ( '#cumulativeMode ' ) . prop ( 'checked ') } ,
167+ cumulative_mode : ( $ ( '#cumulativeModeSelector ' ) . val ( ) == 'yes ') } ,
153168 function ( dataFromBackend ) {
154169 var trace = dataFromBackend . trace ;
155170
@@ -436,7 +451,8 @@ $(document).ready(function() {
436451 { code : pyInputCodeMirror . getValue ( ) ,
437452 curInstr : ( appMode == 'visualize' ) ? myVisualizer . curInstr : 0 ,
438453 mode : appMode ,
439- cumulative_mode : $ ( '#cumulativeMode' ) . prop ( 'checked' )
454+ cumulative_mode : ( $ ( '#cumulativeModeSelector' ) . val ( ) == 'yes' ) ,
455+ python_version : $ ( '#pythonVersionSelector' ) . val ( )
440456 } ,
441457 2 ) ;
442458 $ ( '#urlOutput' ) . val ( urlStr ) ;
0 commit comments