Skip to content

Commit 08afc3b

Browse files
committed
LAUNCED live programming mode
1 parent 5077982 commit 08afc3b

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

‎v3/css/opt-live.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
#liveModeHeader {
3838
margin-left: 3px;
39-
margin-bottom: 12px;
39+
margin-bottom: 15px;
4040
color: #888;
4141
}
4242

‎v3/js/opt-frontend.js‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,19 @@ function experimentalPopUpSyntaxErrorSurvey() {
426426

427427

428428
function initAceAndOptions() {
429-
if ($('#pythonVersionSelector').val() === 'java') {
429+
var v = $('#pythonVersionSelector').val();
430+
if (v === 'java') {
430431
$("#javaOptionsPane").show();
431432
} else {
432433
$("#javaOptionsPane").hide();
433434
}
434435
setAceMode(); // update syntax highlighting mode
436+
437+
if (v === 'js' || v == '2' || v == '3') {
438+
$("#liveModeBtn").show();
439+
} else {
440+
$("#liveModeBtn").hide();
441+
}
435442
}
436443

437444

@@ -701,4 +708,11 @@ $(document).ready(function() {
701708
$(this).hide();
702709
return false;
703710
});
711+
712+
$("#liveModeBtn").click(function() {
713+
var myArgs = getAppState();
714+
var urlStr = $.param.fragment('live.html', myArgs, 2 /* clobber all */);
715+
//window.location = urlStr; // open in same tab
716+
window.open(urlStr); // open in new tab (TODO: what about pop-up blockers?)
717+
});
704718
});

‎v3/visualize.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162

163163
<p>
164164
<button id="executeBtn" class="bigBtn" type="button">Visualize Execution</button>
165+
<button style="margin-left: 20px;" id="liveModeBtn" class="bigBtn" type="button">Live Programming Mode <font color="#e93f34">(NEW!)</font></button>
165166
</p>
166167

167168

0 commit comments

Comments
 (0)