update
Former-commit-id: bdede6ed1b6f578f2ef046c338caf02d0b29d453 [formerly 7187de361b53e9c8ec121df379b762f2db736ea2] Former-commit-id: 447d58460fbbfd05ffe08428a1288e392637561d
This commit is contained in:
64
_embed/public/ace/demo/autoresize.html
Normal file
64
_embed/public/ace/demo/autoresize.html
Normal file
@@ -0,0 +1,64 @@
|
||||
<!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;
|
||||
text-align: center;
|
||||
}
|
||||
</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>
|
||||
|
||||
<!-- load ace -->
|
||||
<script src="../src/ace.js"></script>
|
||||
<script>
|
||||
|
||||
var editor1 = ace.edit("editor1");
|
||||
editor1.setTheme("ace/theme/tomorrow_night_eighties");
|
||||
editor1.session.setMode("ace/mode/html");
|
||||
editor1.setAutoScrollEditorIntoView(true);
|
||||
editor1.setOption("maxLines", 30);
|
||||
|
||||
var editor2 = ace.edit("editor2");
|
||||
editor2.setTheme("ace/theme/tomorrow_night_blue");
|
||||
editor2.session.setMode("ace/mode/html");
|
||||
editor2.setAutoScrollEditorIntoView(true);
|
||||
editor2.setOption("maxLines", 30);
|
||||
editor2.setOption("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);
|
||||
</script>
|
||||
|
||||
<script src="./show_own_source.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user