-
Notifications
You must be signed in to change notification settings - Fork 1
/
embed.js
70 lines (62 loc) · 2.31 KB
/
embed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
(function() {
if (window.ksRunnerInit) return;
// This line gets patched up by the cloud
var pxtConfig = {
"relprefix": "/pxt-microbit-test/",
"verprefix": "",
"workerjs": "/pxt-microbit-test/worker.js",
"monacoworkerjs": "/pxt-microbit-test/monacoworker.js",
"gifworkerjs": "/pxt-microbit-test/gifjs/gif.worker.js",
"serviceworkerjs": "/pxt-microbit-test/serviceworker.js",
"pxtVersion": "5.37.42",
"pxtRelId": "",
"pxtCdnUrl": "/pxt-microbit-test/",
"commitCdnUrl": "/pxt-microbit-test/",
"blobCdnUrl": "/pxt-microbit-test/",
"cdnUrl": "/pxt-microbit-test/",
"targetVersion": "0.0.0",
"targetRelId": "",
"targetUrl": "",
"targetId": "microbit",
"simUrl": "/pxt-microbit-test/simulator.html",
"simserviceworkerUrl": "/pxt-microbit-test/simulatorserviceworker.js",
"simworkerconfigUrl": "/pxt-microbit-test/workerConfig.js",
"partsUrl": "/pxt-microbit-test/siminstructions.html",
"runUrl": "/pxt-microbit-test/run.html",
"docsUrl": "/pxt-microbit-test/docs.html",
"multiUrl": "/pxt-microbit-test/multi.html",
"isStatic": true
};
var scripts = [
"/pxt-microbit-test/highlight.js/highlight.pack.js",
"/pxt-microbit-test/bluebird.min.js",
"/pxt-microbit-test/marked/marked.min.js",
]
if (typeof jQuery == "undefined")
scripts.unshift("/pxt-microbit-test/jquery.js")
if (typeof jQuery == "undefined" || !jQuery.prototype.sidebar)
scripts.push("/pxt-microbit-test/semantic.js")
if (!window.pxtTargetBundle)
scripts.push("/pxt-microbit-test/target.js");
scripts.push("/pxt-microbit-test/pxtembed.js");
var pxtCallbacks = []
window.ksRunnerReady = function(f) {
if (pxtCallbacks == null) f()
else pxtCallbacks.push(f)
}
window.ksRunnerWhenLoaded = function() {
pxt.docs.requireHighlightJs = function() { return hljs; }
pxt.setupWebConfig(pxtConfig || window.pxtWebConfig)
pxt.runner.initCallbacks = pxtCallbacks
pxtCallbacks.push(function() {
pxtCallbacks = null
})
pxt.runner.init();
}
scripts.forEach(function(src) {
var script = document.createElement('script');
script.src = src;
script.async = false;
document.head.appendChild(script);
})
} ())