-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
42 lines (33 loc) · 1019 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<html>
<head>
<script type="text/javascript" src="lib/ace/ace.js"></script>
<script type="text/javascript" src="lib/knockout-2.2.0.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="knockout-ace.js"></script>
<style type="text/css">
.editor {
height: 250px;
width: 500px;
}
.editor-container{
height: 250px;
}
</style>
</head>
<body>
<div class="editor-container">
<div class="editor" data-bind="ace: markup1, aceOptions: { mode: 'javascript', theme: 'solarized_light' }"></div>
</div>
<div class="editor-container">
<div class="editor" data-bind="ace: markup2"></div>
</div>
<textarea data-bind="value: markup1"></textarea>
<textarea data-bind="value: markup2"></textarea>
<script>
var viewModel = {
markup1: ko.observable("foo = function(){ return 'love'; };"),
markup2: ko.observable("two"),
};
ko.applyBindings(viewModel)
</script>
</body>