Skip to content

Commit e3353a1

Browse files
committed
got iframe working, i think
1 parent 8849053 commit e3353a1

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎v3/js/iframe-embed.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ $(document).ready(function() {
106106
textualMemoryLabels: textRefsBool,
107107
showOnlyOutputs: showOnlyOutputsBool,
108108
executeCodeWithRawInputFunc: executeCodeWithRawInput,
109-
updateOutputCallback: (resizeContainer ? resizeContainerNow : null)
109+
updateOutputCallback: (resizeContainer ? resizeContainerNow : null),
110110

111111
// undocumented experimental modes:
112112
pyCrazyMode: (pyState == '2crazy'),
113-
highlightLines: typeof $.bbq.getState("highlightLines") !== "undefined",
113+
highlightLines: typeof $.bbq.getState("highlightLines") !== "undefined"
114114
}
115115

116116
function executeCode(forceStartingInstr) {
@@ -149,5 +149,7 @@ $(document).ready(function() {
149149
myVisualizer.redrawConnectors();
150150
});
151151

152+
153+
executeCodeFromScratch(); // finally, execute code and display visualization
152154
});
153155

‎v3/js/opt-frontend-common.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ var python2crazy_backend_script = 'web_exec_py2-crazy.py';
5252
//var python2crazy_backend_script = 'exec';
5353

5454

55+
var domain = "http://pythontutor.com/"; // for deployment
56+
//var domain = "http://localhost:8080/"; // for Google App Engine local testing
57+
58+
5559
var rawInputLst = []; // a list of strings inputted by the user in response to raw_input or mouse_input events
5660

5761

‎v3/js/opt-frontend.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ $(document).ready(function() {
554554
curInstr: myVisualizer.curInstr,
555555
};
556556

557-
var embedUrlStr = $.param.fragment('http://pythontutor.com/iframe-embed.html', myArgs, 2 /* clobber all */);
557+
var embedUrlStr = $.param.fragment(domain + "iframe-embed.html", myArgs, 2 /* clobber all */);
558558
var iframeStr = '<iframe width="800" height="500" frameborder="0" src="' + embedUrlStr + '"> </iframe>';
559559
$('#embedCodeOutput').val(iframeStr);
560560
});

0 commit comments

Comments
 (0)