-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
63 lines (56 loc) · 1.15 KB
/
example.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Compose Playground</title>
<style>
hr {
height: 0;
width: 260px;
margin: 22px auto;
padding: 0;
border: none;
visibility: hidden;
}
hr:before {
content: '';
width: 260px;
height: 1px;
background: #AAA;
display: block;
visibility: visible;
margin: 22px auto;
}
#editor {
margin: 40px auto;
width: 960px;
max-width: 100%;
height: 100%;
outline: none;
font-family: Georgia;
font-size: 20px;
}
#editor > section {
width: 720px;
margin: 0 auto;
}
section:first-child > hr {
display: none;
}
pre, code {
font-family: Consolas, monospace;
}
</style>
</head>
<body>
<div id="editor"><p><br></p></div>
<script src="./compose.js"></script>
<script>
window.editor = new Compose('#editor').init()
var view = editor.require('view')
var Selection = editor.require('selection')
view.setSelection(new Selection([0, 0]))
editor.use(Compose.defaultKeyBindings)
</script>
</body>
</html>