monaco-editor/website/playground/playground-runner.html

81 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html style="height:100%">
<head>
<link rel="stylesheet" href="./spinner.css" />
<style type="text/css">
body { margin: 0; padding: 0; border: 0; }
.monaco-editor { overflow: hidden; }
</style>
<script type="text/javascript" src="../../release/dev/vs/loader.js"></script>
<script type="text/javascript">
var geval = eval;
var receivedCall = null;
window.load = function (js, html, css) {
receivedCall = {
js: js,
html: html,
css: css
};
};
require.config({
paths: {
vs: "../../release/dev/vs"
}
});
require(['require', 'vs/editor/editor.main'], function (require) {
"use strict";
var loading = document.getElementById('loading');
loading.parentNode.removeChild(loading);
document.body.style.height = '100%';
// Switch `automaticLayout` property to true by default
//TODO: var config = require('vs/editor/common/config/config');
//config.getActiveEditor().automaticLayout = true;
window.load = function (js, html, css) {
if (css) {
var style = document.createElement("style");
style.type = "text/css";
style.innerHTML = css;
document.body.appendChild(style);
}
if (html) {
document.body.innerHTML += html;
}
if (js) {
try {
geval(js);
} catch (err) {
var pre = document.createElement("pre");
pre.appendChild(document.createTextNode(err));
document.body.insertBefore(pre, document.body.firstChild);
}
}
};
if (receivedCall) {
window.load(receivedCall.js, receivedCall.html, receivedCall.css);
}
});
</script>
</head>
<body>
<div id="loading">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
</div>
</body>
</html>