87 lines
2.2 KiB
HTML
Executable File
87 lines
2.2 KiB
HTML
Executable File
<!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">
|
|
|
|
.ace_editor {
|
|
border: 1px solid lightgray;
|
|
margin: auto;
|
|
height: 200px;
|
|
width: 80%;
|
|
}
|
|
.scrollmargin {
|
|
height: 80px;
|
|
}
|
|
.scrollmargin2 {
|
|
height: 180px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre id="editor1">autoresizing editor</pre>
|
|
<div class="scrollmargin"></div>
|
|
<pre id="editor2">minHeight = 2 lines</pre>
|
|
<div class="scrollmargin"></div>
|
|
<pre id="editor3" style="width: 40%;"></pre>
|
|
<div class="scrollmargin"></div>
|
|
<pre id="editor"></pre>
|
|
<div class="scrollmargin2"></div>
|
|
<pre id="editor4" style="width: 40%;transform:scale(1.5)"></pre>
|
|
<div class="scrollmargin2"></div>
|
|
|
|
<script src="kitchen-sink/require.js"></script>
|
|
<script>
|
|
// setup paths
|
|
require.config({paths: { "ace" : "../src"}});
|
|
// load ace and extensions
|
|
require(["ace/ace", "ace/ext/language_tools"], function(ace) {
|
|
var editor1 = ace.edit("editor1", {
|
|
theme: "ace/theme/tomorrow_night_eighties",
|
|
mode: "ace/mode/javascript",
|
|
maxLines: 30,
|
|
wrap: true,
|
|
autoScrollEditorIntoView: true
|
|
});
|
|
|
|
var editor2 = ace.edit("editor2", {
|
|
theme: "ace/theme/tomorrow_night_blue",
|
|
mode: "ace/mode/css",
|
|
autoScrollEditorIntoView: true,
|
|
maxLines: 30,
|
|
minLines: 2
|
|
});
|
|
|
|
var editor = ace.edit("editor3");
|
|
editor.setOptions({
|
|
autoScrollEditorIntoView: true,
|
|
maxLines: 8
|
|
});
|
|
editor.renderer.setScrollMargin(10, 10, 10, 10);
|
|
|
|
var editor = ace.edit("editor");
|
|
editor.setTheme("ace/theme/tomorrow");
|
|
editor.session.setMode("ace/mode/html");
|
|
editor.setAutoScrollEditorIntoView(true);
|
|
editor.setOption("maxLines", 100);
|
|
window.editor = editor;
|
|
|
|
var editor4 = ace.edit("editor4", {
|
|
theme: "ace/theme/tomorrow_night_blue",
|
|
mode: "ace/mode/javascript",
|
|
autoScrollEditorIntoView: true,
|
|
maxLines: 30,
|
|
minLines: 100,
|
|
hasCssTransforms: true,
|
|
value: "transformed editor" + "\n".repeat(100)
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<script src="./show_own_source.js"></script>
|
|
|
|
</body>
|
|
</html>
|