Skip to content

Commit 66306f1

Browse files
committed
make iframe-embed work
1 parent 8ea6020 commit 66306f1

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎v3/iframe-embed.html‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
<script type="text/javascript" src="js/opt-frontend-common.js"></script>
2222
<script type="text/javascript" src="js/iframe-embed.js"></script>
2323

24-
<!-- include this AFTER opt-frontend.js so that configuration
25-
global variables are already defined at load time -->
26-
<script type="text/javascript" src="js/togetherjs/togetherjs-min.js"></script>
27-
2824
</head>
2925

3026
<body>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,8 @@ function executePythonCode(pythonSourceCode,
914914
return;
915915
}
916916

917-
if (TogetherJS.running && !executeCodeSignalFromRemote) {
917+
if (typeof TogetherJS !== 'undefined' &&
918+
TogetherJS.running && !executeCodeSignalFromRemote) {
918919
TogetherJS.send({type: "executeCode",
919920
myAppState: getAppState(),
920921
forceStartingInstr: frontendOptionsObj.startingInstruction,
@@ -976,7 +977,7 @@ function executePythonCode(pythonSourceCode,
976977

977978
// VERY SUBTLE -- reinitialize TogetherJS so that it can detect
978979
// and sync any new elements that are now inside myVisualizer
979-
if (TogetherJS.running) {
980+
if (typeof TogetherJS !== 'undefined' && TogetherJS.running) {
980981
TogetherJS.reinitialize();
981982
}
982983
}

0 commit comments

Comments
 (0)