-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
75 lines (66 loc) · 3.98 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Monoco-Editor Knockout Binding Handler</title>
<meta name="author" content="Tommy Simper">
<meta name="description" content="An example use of a monaco-editor knockout binding handler.">
<meta name="date" content="2017-10-31">
<link href="https://microsoft.github.io/monaco-editor/lib/bootstrap-cosmo.css" rel="stylesheet" type="text/css">
<link href="https://microsoft.github.io/monaco-editor/lib/bootstrap-responsive.min.css" rel="stylesheet" type="text/css">
<link href="https://microsoft.github.io/monaco-editor/all.css" rel="stylesheet" type="text/css">
<link href="https://microsoft.github.io/monaco-editor/index/index.css" rel="stylesheet" type="text/css">
<link type="text/css" href="https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/min/vs/editor/editor.main.css"
rel="stylesheet">
<!-- knockout -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.2/knockout-min.js" type="text/javascript"></script>
<!-- jquery -->
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<!-- monaco-editor -->
<script src="https://microsoft.github.io/monaco-editor/lib/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="https://microsoft.github.io/monaco-editor/lib/bootstrap.min.js" type="text/javascript"></script>
<script src="https://microsoft.github.io/monaco-editor/lib/bootstrap-select.min.js" type="text/javascript"></script>
<style>
.me-editor {
width: 100%;
min-height: 300px;
border: 1px solid rgba(17, 129, 235, 0.849);
}
</style>
</head>
<body>
<div>
<h1>Knockout & Monaco Editor</h1>
<div class="me-editor" data-bind="koMonacoEditor: mainEditorText,
meOptions: {
language: 'javascript',
theme: 'vs-dark',
lineNumbers: 'on',
roundedSelection: true,
scrollBeyondLastLine: true,
fontSize: 20,
autoIndent: true,
folding: true,
mouseWheelZoom: true,
readOnly: false,
minimap: { enabled: false, showSlider: 'mouseover' }
}"></div>
<div>
<button data-bind="click: evalCode">Try It</button>
</div>
</div>
<!-- monaco loader and config -->
<script src="https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/min/vs/loader.js" type="text/javascript"></script>
<script type="text/javascript">
require.config(
{
baseUrl: 'https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/min/'
} );
</script>
<!-- editor binding handler -->
<script src="./out/monacoEditorBindingHandler.js" type="text/javascript"></script>
<script src="./out/IndexViewModel.js" type="text/javascript"></script>
</body>
</html>