You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
monaco-editor/test/index.html

72 lines
2.2 KiB
HTML

9 years ago
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" href="./index.css" />
</head>
<body>
<h2>Monaco Editor (running from multiple sources)</h2>
<a href="./index.html">[MULTIPLE SOURCES]</a>
&nbsp;|&nbsp;
<a href="./index-release.html">[RELEASED]</a>
&nbsp;|&nbsp;
<a href="./smoketest-release.html">[SMOKETEST]</a>
<br/><br/>
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="container" style="float:left;width:800px;height:450px;border: 1px solid grey"></div>
<div id="options" style="float:left;width:220px;height:450px;border: 1px solid grey"></div>
<div style="clear:both"></div>
<script src="../metadata.js"></script>
<script>
function getQueryStringValue (key) {
return unescape(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + escape(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));
}
9 years ago
// Resolve paths
// should run the editor and/or plugins from source? (or from the node module)
if (getQueryStringValue('editor') === 'dev') {
9 years ago
METADATA.CORE.path = METADATA.CORE.srcPath;
} else {
METADATA.CORE.path = '/monaco-editor/' + METADATA.CORE.path;
}
METADATA.PLUGINS.forEach(function(plugin) {
// should run the editor plugins from source? (or from node modules)
if (plugin.srcPath && getQueryStringValue(plugin.name) === 'dev') {
9 years ago
plugin.path = plugin.srcPath;
} else {
plugin.path = '/monaco-editor/' + plugin.path;
}
});
</script>
<script>document.write('<script src="' + METADATA.CORE.path + '/loader.js"><'+'/script>');</script>
<script>
var pathsConfig = {};
METADATA.PLUGINS.forEach(function(plugin) {
pathsConfig[plugin.modulePrefix] = plugin.path;
});
pathsConfig['vs'] = METADATA.CORE.path;
require.config({
paths: pathsConfig
});
require(['vs/editor/editor.main'], function() {
// At this point we've loaded the monaco-editor-core
require(METADATA.PLUGINS.map(function(plugin) { return plugin.contrib; }), function() {
// At this point we've loaded all the plugins
require(['./index'], function() {});
});
});
</script>
</body>
</html>