Skip to content

Commit ecf4d9b

Browse files
committed
activate all toggle options in live programming mode
1 parent 977a4f1 commit ecf4d9b

3 files changed

Lines changed: 25 additions & 23 deletions

File tree

‎v3/js/opt-live.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,15 +504,18 @@ function executeCode(forceStartingInstr, forceRawInputLst) {
504504

505505
var backend_script = langToBackendScript($('#pythonVersionSelector').val());
506506

507-
var backendOptionsObj = {cumulative_mode: false,
508-
heap_primitives: false,
507+
var backendOptionsObj = {cumulative_mode: ($('#cumulativeModeSelector').val() == 'true'),
508+
heap_primitives: ($('#heapPrimitivesSelector').val() == 'true'),
509509
show_only_outputs: false,
510510
py_crazy_mode: false,
511511
origin: originFrontendJsFile};
512512

513513
var startingInstruction = forceStartingInstr ? forceStartingInstr : 0;
514514
var frontendOptionsObj = {startingInstruction: startingInstruction,
515515
executeCodeWithRawInputFunc: executeCodeWithRawInput,
516+
// tricky tricky
517+
disableHeapNesting: ($('#heapPrimitivesSelector').val() == 'true'),
518+
textualMemoryLabels: ($('#textualMemoryLabelsSelector').val() == 'true'),
516519
hideCode: true,
517520
jumpToEnd: true,
518521
}
@@ -542,7 +545,7 @@ $(document).ready(function() {
542545
.attr('points', SVG_ARROW_POLYGON)
543546
.attr('fill', darkArrowColor);
544547

545-
$('#pythonVersionSelector').change(function() {
548+
$('#cumulativeModeSelector,#heapPrimitivesSelector,#textualMemoryLabelsSelector,#pythonVersionSelector').change(function() {
546549
setAceMode();
547550
// force a recompile on a toggle switch
548551
executeCode();

‎v3/live.html‎

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,6 @@
8484
</select>
8585
</div>
8686

87-
<!-- keep this here but hide so that opt-frontend-common.js stuff works -->
88-
<div id="optionsPane" style="margin-top: 18px; line-height: 150%; display: none;">
89-
<select id="cumulativeModeSelector">
90-
<option value="false">hide exited frames [default]</option>
91-
<option value="true">show exited frames (Python)</option>
92-
<!-- <option value="holistic">holistic mode (experimental)</option> -->
93-
</select>
94-
<select id="heapPrimitivesSelector">
95-
<option value="false">inline primitives &amp; nested objects [default]</option>
96-
<option value="true">render all objects on the heap</option>
97-
</select>
98-
<select id="textualMemoryLabelsSelector">
99-
<option value="false">draw pointers as arrows [default]</option>
100-
<option value="true">use text labels for pointers</option>
101-
</select>
102-
</div>
103-
10487
<div id="codeInputPane"></div>
10588
<div id="legendDiv"></div>
10689
<div id="executionSlider" style="margin-top: 10px;"></div>
@@ -116,6 +99,22 @@
11699

117100
<div id="footer">
118101

102+
<div id="optionsPane" style="margin-top: 10px; padding-bottom: 15px; line-height: 150%;">
103+
<select id="cumulativeModeSelector">
104+
<option value="false">hide exited frames [default]</option>
105+
<option value="true">show exited frames (Python)</option>
106+
<!-- <option value="holistic">holistic mode (experimental)</option> -->
107+
</select>
108+
<select id="heapPrimitivesSelector">
109+
<option value="false">inline primitives &amp; nested objects [default]</option>
110+
<option value="true">render all objects on the heap (Python)</option>
111+
</select>
112+
<select id="textualMemoryLabelsSelector">
113+
<option value="false">draw pointers as arrows [default]</option>
114+
<option value="true">use text labels for pointers</option>
115+
</select>
116+
</div>
117+
119118
<p>
120119
<button id="genUrlBtn" class="smallBtn" type="button">Generate permanent link</button> <input type="text" id="urlOutput" size="70"/>
121120
</p>

‎v3/visualize.html‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@
171171
</div>
172172

173173

174-
<div id="optionsPane" style="margin-top: 18px; line-height: 150%;">
174+
<div id="optionsPane" style="margin-top: 20px; line-height: 150%;">
175175
<select id="cumulativeModeSelector">
176176
<option value="false">hide exited frames [default]</option>
177-
<option value="true">show exited frames (Python)</option>
177+
<option value="true">show all frames (Python)</option>
178178
<!-- <option value="holistic">holistic mode (experimental)</option> -->
179179
</select>
180180
<select id="heapPrimitivesSelector">
181181
<option value="false">inline primitives &amp; nested objects [default]</option>
182-
<option value="true">render all objects on the heap</option>
182+
<option value="true">render all objects on the heap (Python/Java)</option>
183183
</select>
184184
<select id="textualMemoryLabelsSelector">
185185
<option value="false">draw pointers as arrows [default]</option>

0 commit comments

Comments
 (0)