Skip to content

Commit 1ae4855

Browse files
author
Philip Guo
committed
more cleanups of dubious quality
1 parent 4e81c38 commit 1ae4855

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

‎v3/js/opt-frontend.js‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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
});

‎v3/visualize.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
</select>
7474
and
7575
<select id="cumulativeModeSelector">
76-
<option value="no">don't display exited functions (default).</option>
77-
<option value="yes">display frames of exited functions.</option>
76+
<option value="false">don't display exited functions (default).</option>
77+
<option value="true">display frames of exited functions.</option>
7878
</select>
7979
</p>
8080

0 commit comments

Comments
 (0)