-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.html
More file actions
53 lines (48 loc) · 1.83 KB
/
Copy pathmain.html
File metadata and controls
53 lines (48 loc) · 1.83 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0">
<title>system</title>
<link rel="icon" href="data:image/x-icon;base64,">
<link rel="stylesheet" type="text/css" href="./main.css"/>
<script type="module">
import { make_bus } from './main.js'
import { make_system } from './main.js'
import { capture_event } from './main.js'
import { history } from './main.js'
let bus = make_bus()
bus.on('keydown-keyz-control-shift', event => capture_event(() => history.redo(), event))
bus.on('keydown-keyz-control', event => capture_event(() => history.undo(), event))
bus.on('keydown-tab', event => capture_event(() => console.log('indent'), event))
bus.on('keydown-tab-shift', event => capture_event(() => console.log('dedent'), event))
bus.on('list-created', list => {
const { invoke, show, dismiss } = list
bus.on('keydown-tab-control-shift', event => capture_event(() => invoke(-1), event))
bus.on('keydown-space-control-shift', event => capture_event(() => invoke(-1), event))
bus.on('keydown-tab-control', event => capture_event(() => invoke(1), event))
bus.on('keydown-space-control', event => capture_event(() => invoke(1), event))
bus.on('keydown-escape', event => capture_event(() => show(false), event))
bus.on('keyup-controlleft', event => capture_event(() => dismiss(), event))
bus.on('keyup-controlright', event => capture_event(() => dismiss(), event))
})
make_system(bus).start()
// undo is incorrect when adding newlines, moving selection, adding newlines
// and then undo, then redo
</script>
</head>
<body>
<div class="cards">
<div class="card edits"></div>
<div class="card display">
<button>DISPLAY</button>
</div>
<div class="card list">
<ul class="off"></ul>
</div>
<div class="card register">
<button>select</button>
</div>
</div>
</body>
</html>