@@ -90,10 +90,10 @@ $(document).ready(function() {
9090
9191 // ugh, ugly tristate due to the possibility of being undefined :)
9292 if ( $ . bbq . getState ( 'cumulative' ) == 'true' ) {
93- $ ( '#cumulativeModeSelector' ) . val ( 'yes ' ) ;
93+ $ ( '#cumulativeModeSelector' ) . val ( 'true ' ) ;
9494 }
9595 else if ( $ . bbq . getState ( 'cumulative' ) == 'false' ) {
96- $ ( '#cumulativeModeSelector' ) . val ( 'no ' ) ;
96+ $ ( '#cumulativeModeSelector' ) . val ( 'false ' ) ;
9797 }
9898 // else if it's undefined, don't do anything ...
9999
@@ -125,7 +125,7 @@ $(document).ready(function() {
125125 // punt for now ...
126126 }
127127 else {
128- // $.bbq.pushState({ mode: 'edit' }, 2 /* completely override other hash strings to keep URL clean */);
128+ $ . bbq . pushState ( { mode : 'edit' } , 2 /* completely override other hash strings to keep URL clean */ ) ;
129129 }
130130 }
131131
@@ -187,7 +187,7 @@ $(document).ready(function() {
187187
188188 $ . get ( backend_script ,
189189 { user_script : pyInputCodeMirror . getValue ( ) ,
190- cumulative_mode : ( $ ( '#cumulativeModeSelector' ) . val ( ) == 'yes' ) } ,
190+ cumulative_mode : ( $ ( '#cumulativeModeSelector' ) . val ( ) == 'true' ) /* ugh types! */ } ,
191191 function ( dataFromBackend ) {
192192 var trace = dataFromBackend . trace ;
193193
@@ -516,14 +516,16 @@ $(document).ready(function() {
516516 } ) ;
517517
518518 $ ( '#genUrlBtn' ) . bind ( 'click' , function ( ) {
519- var urlStr = $ . param . fragment ( window . location . href ,
520- { code : pyInputCodeMirror . getValue ( ) ,
521- curInstr : ( appMode == 'display' ) ? myVisualizer . curInstr : 0 ,
522- mode : appMode ,
523- cumulative : ( $ ( '#cumulativeModeSelector' ) . val ( ) == 'yes' ) ,
524- py : $ ( '#pythonVersionSelector' ) . val ( )
525- } ,
526- 2 /* clobber all */ ) ;
519+ var myArgs = { code : pyInputCodeMirror . getValue ( ) ,
520+ mode : appMode ,
521+ cumulative : $ ( '#cumulativeModeSelector' ) . val ( ) ,
522+ py : $ ( '#pythonVersionSelector' ) . val ( ) } ;
523+
524+ if ( appMode == 'display' ) {
525+ myArgs . curInstr = myVisualizer . curInstr ;
526+ }
527+
528+ var urlStr = $ . param . fragment ( window . location . href , myArgs , 2 /* clobber all */ ) ;
527529 $ ( '#urlOutput' ) . val ( urlStr ) ;
528530 } ) ;
529531} ) ;
0 commit comments