Last active
October 27, 2016 08:12
-
-
Save WarFox/6473534 to your computer and use it in GitHub Desktop.
Ace Editor Embedding in Bootstrap 3 container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>ACE in Action</title> | |
<style type="text/css" media="screen"> | |
#editor { | |
height: 300px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h3 class="panel-title">Editor</h3> | |
</div> | |
<div class="panel-body"> | |
<div id="editor">function foo(items) { | |
var x = "All this is syntax highlighted"; | |
return x; | |
}</div> | |
</div> | |
</div> | |
<div class="text-center">---End of editor---</div> | |
</div> | |
<script src="/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script> | |
<script> | |
var editor = ace.edit("editor"); | |
editor.setTheme("ace/theme/monokai"); | |
editor.getSession().setMode("ace/mode/javascript"); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Read here
http://tech.deepumohan.com/2013/09/javascript-ace-editor-positioning-bootstrap.html