pxt-core
Version:
Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors
45 lines (36 loc) • 1.23 kB
JavaScript
(function() {
if (window.ksRunnerInit) return;
// This line gets patched up by the cloud
var pxtConfig = null;
var scripts = [
"/blb/highlight.js/highlight.pack.js",
"/blb/marked/marked.min.js",
]
if (typeof jQuery == "undefined")
scripts.unshift("/doccdn/jquery.js")
if (typeof jQuery == "undefined" || !jQuery.prototype.sidebar)
scripts.push("/doccdn/semantic.js")
if (!window.pxtTargetBundle)
scripts.push("/blb/target.js");
scripts.push("/blb/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.setInitCallbacks(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);
})
} ())