@@ -73,6 +73,28 @@ function getAppState() {
7373 py : $ ( '#pythonVersionSelector' ) . val ( ) } ;
7474}
7575
76+ function setToggleOptions ( dat ) {
77+ // ugh, ugly tristate due to the possibility of each being undefined
78+ if ( dat . py !== undefined ) {
79+ $ ( '#pythonVersionSelector' ) . val ( dat . py ) ;
80+ }
81+ if ( dat . cumulative !== undefined ) {
82+ $ ( '#cumulativeModeSelector' ) . val ( dat . cumulative ) ;
83+ }
84+ if ( dat . heapPrimitives !== undefined ) {
85+ $ ( '#heapPrimitivesSelector' ) . val ( dat . heapPrimitives ) ;
86+ }
87+ if ( dat . drawParentPointers !== undefined ) {
88+ $ ( '#drawParentPointerSelector' ) . val ( dat . drawParentPointers ) ;
89+ }
90+ if ( dat . textReferences !== undefined ) {
91+ $ ( '#textualMemoryLabelsSelector' ) . val ( dat . textReferences ) ;
92+ }
93+ if ( dat . showOnlyOutputs !== undefined ) {
94+ $ ( '#showOnlyOutputsSelector' ) . val ( dat . showOnlyOutputs ) ;
95+ }
96+ }
97+
7698$ ( document ) . ready ( function ( ) {
7799 setSurveyHTML ( ) ;
78100
@@ -526,6 +548,7 @@ $(document).ready(function() {
526548
527549
528550 var queryStrOptions = getQueryStringOptions ( ) ;
551+ setToggleOptions ( queryStrOptions ) ;
529552
530553 if ( queryStrOptions . preseededCode ) {
531554 setCodeMirrorVal ( queryStrOptions . preseededCode ) ;
@@ -535,27 +558,6 @@ $(document).ready(function() {
535558 $ ( "#aliasExampleLink" ) . trigger ( 'click' ) ;
536559 }
537560
538- // ugh, ugly tristate due to the possibility of each being undefined
539- if ( queryStrOptions . pyState !== undefined ) {
540- $ ( '#pythonVersionSelector' ) . val ( queryStrOptions . pyState ) ;
541- }
542- if ( queryStrOptions . cumulativeState !== undefined ) {
543- $ ( '#cumulativeModeSelector' ) . val ( queryStrOptions . cumulativeState ) ;
544- }
545- if ( queryStrOptions . heapPrimitives !== undefined ) {
546- $ ( '#heapPrimitivesSelector' ) . val ( queryStrOptions . heapPrimitives ) ;
547- }
548- if ( queryStrOptions . drawParentPointers !== undefined ) {
549- $ ( '#drawParentPointerSelector' ) . val ( queryStrOptions . drawParentPointers ) ;
550- }
551- if ( queryStrOptions . textRefs !== undefined ) {
552- $ ( '#textualMemoryLabelsSelector' ) . val ( queryStrOptions . textRefs ) ;
553- }
554- if ( queryStrOptions . showOnlyOutputs !== undefined ) {
555- $ ( '#showOnlyOutputsSelector' ) . val ( queryStrOptions . showOnlyOutputs ) ;
556- }
557-
558-
559561 appMode = $ . bbq . getState ( 'mode' ) ; // assign this to the GLOBAL appMode
560562 if ( ( appMode == 'display' || appMode == 'visualize' /* 'visualize' is deprecated */ ) &&
561563 queryStrOptions . preseededCode /* jump to display only with pre-seeded code */ ) {
0 commit comments