kopia lustrzana https://github.com/c9/core
50 wiersze
1.1 KiB
HTML
50 wiersze
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<title>Editor</title>
|
|
<style type="text/css" media="screen">
|
|
body {
|
|
overflow: hidden;
|
|
}
|
|
|
|
#editor {
|
|
margin: 0;
|
|
position: absolute;
|
|
top: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<pre id="editor">function foo(items) {
|
|
var i;
|
|
for (i = 0; i < items.length; i++) {
|
|
alert("Ace Rocks " + items[i]);
|
|
}
|
|
}</pre>
|
|
|
|
<script src="../demo/kitchen-sink/require.js"></script>
|
|
<script>
|
|
require.config({paths: {ace: "../build/src"}})
|
|
define('testace', ['ace/ace'],
|
|
function(ace, langtools) {
|
|
console.log("This is the testace module");
|
|
var editor = ace.edit("editor");
|
|
editor.setTheme("ace/theme/twilight");
|
|
editor.session.setMode("ace/mode/javascript");
|
|
require(["ace/requirejs/text!src/ace"], function(e){
|
|
editor.setValue(e);
|
|
})
|
|
}
|
|
);
|
|
require(['testace'])
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|