-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgui.html
309 lines (300 loc) · 14 KB
/
gui.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
<title>Audio annotation</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css" />
<!-- TODO This is not a CDN! -->
<link
rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.1.0/css/bootstrap2/bootstrap-switch.css"
/>
<link rel="stylesheet" href="bootstro.min.css" />
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-url-parser/2.3.1/purl.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/d3/3.4.1/d3.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/jquery.hotkeys.min.js"></script>
<script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<!-- TODO This is not a CDN -->
<script
type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.1.0/js/bootstrap-switch.js"
></script>
<script type="text/javascript" src="bootstro.min.js"></script>
<link href="gui.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- https://waveform.prototyping.bbc.co.uk/waveform-data-issue-63/ -->
<div id="firefoxisbad" class="display-none">
<div id="firefoxisbadInner">Please use Chrome. Firefox has a bug with mp3s in decodeAudioData.</div>
</div>
<div class="toplevel">
<div style="display: flex; flex-direction: row;">
<div style="align-self: flex-start;flex: 1;">
<button type="button" class="annotation-gui btn btn-warning btn-lg button-spacing" id="reset">
Reset
</button>
</div>
<div style="align-items: stretch;flex: 1;">
<div id="loading">
<h3></h3>
</div>
</div>
<div id="submit-button" style="align-self: flex-start;flex: 1;">
<button type="button" class="annotation-gui btn btn-success btn-lg button-spacing" id="submit">
Submit
</button>
</div>
</div>
<div class="annotation-gui">
<div class="panel panel-default">
<div id="help-panel" class="panel-body">
<div class="center">
<button type="button" id="intro" class="btn btn-danger">
Show me how to annotate words
</button>
<div class="btn-group">
<button
type="button"
id="intro"
class="btn btn-danger dropdown-toggle"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Show shortcuts
</button>
<div class="dropdown-menu">
<div class="dropdown-item dropdown-item-kbd"><kbd>click</kbd> Place red marker</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>shift-click</kbd> Play to end of segment</div>
<div class="dropdown-divider"></div>
<div class="dropdown-item dropdown-item-kbd"><kbd>s</kbd> Save annnotations</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>u</kbd> Use reference to fill remainder</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>p</kbd> Play clip</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>t</kbd> Stop playing</div>
<div class="dropdown-divider"></div>
<div class="dropdown-item dropdown-item-kbd"><kbd>d</kbd> Delete selection</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>y</kbd> Play selection</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>t</kbd> Edit transcript, at word if selected</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>c</kbd> Clear selection</div>
<div class="dropdown-divider"></div>
<div class="dropdown-item dropdown-item-kbd"><kbd>w</kbd> Start word at marker</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>W</kbd> Start word after selected word</div>
<div class="dropdown-divider"></div>
<div class="dropdown-item dropdown-item-kbd"><kbd>a</kbd> Toggle audio speed</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>m</kbd> Mute audio</div>
<div class="dropdown-divider"></div>
<div class="dropdown-item dropdown-item-kbd"><kbd>f</kbd> Save & forward 2s</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>b</kbd> Save & backard 2s</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>F</kbd> Save & forward 4s</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>B</kbd> Save & backard 4s</div>
<div class="dropdown-divider"></div>
<div class="dropdown-item dropdown-item-kbd"><kbd>left</kbd> Select word on the left</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>right</kbd> Select word on the right</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>shift-left</kbd> Word starts earlier</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>shift-right</kbd> Word starts later</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>ctrl-left</kbd> Word ends earlier</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>ctrl-right</kbd> Word ends later</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>shift-up</kbd> Shift word earlier</div>
<div class="dropdown-item dropdown-item-kbd"><kbd>shift-down</kbd> Shift word later</div>
</div>
</div>
</div>
</div>
</div>
<div id="container-wrapper">
<div id="container">
<img class="img" id="spectrogram" alt="" style="height: 90%; width: 100%;" />
<canvas id="waveform"></canvas>
<canvas id="canvas"></canvas>
<svg id="d3" preserveAspectRatio="none">
<defs>
<filter id="blackOutlineEffect">
<feMorphology in="SourceAlpha" result="MORPH" operator="dilate" radius="2" />
<feColorMatrix
in="MORPH"
result="DARKEN"
type="matrix"
values="0 0 0 0 0, 0 0 0 0 0, 0 0 0 0 0, 0 0 0 0.6 0"
/>
<feMerge>
<feMergeNode in="DARKEN" />
<feMergeNode in="SourceGraphic" />
</feMerge>
</filter>
</defs>
</svg>
</div>
</div>
<div class="btn-toolbar center" id="controls" role="toolbar">
<div class="btn-group">
<button type="button" class="btn btn-default" id="play">
<span class="shortcut">P</span>lay from beginning
</button>
<button type="button" class="btn btn-default" id="stop">S<span class="shortcut">t</span>op</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default" id="start-next-word">
Start next <span class="shortcut">w</span>ord
</button>
<button type="button" class="btn btn-default" id="start-next-word-after-current-word">
Start next <span class="shortcut">W</span>ord after word
</button>
</div>
</div>
<div class="btn-toolbar center" id="controls-2" role="toolbar">
<div class="btn-group">
<button type="button" class="btn btn-default" id="play-selection">
Play <span class="shortcut">s</span>election
</button>
<button type="button" class="btn btn-default" id="delete-selection">
<span class="shortcut">D</span>elete selection
</button>
</div>
<div class="btn-group" id="replace-reference">
<button type="button" class="btn btn-default" id="replace-with-reference-annotation">
Replace with reference
</button>
<button type="button" class="btn btn-default" id="fill-with-reference">
<span class="shortcut">U</span>se reference to fill remainder
</button>
</div>
</div>
<div class="btn-toolbar center" id="controls-seeking" role="toolbar">
<div class="btn-group" id="save-and-seek">
<button type="button" class="btn btn-success" id="back-save-4-sec">
- 4s
</button>
<button type="button" class="btn btn-success" id="back-save-2-sec">
2s <span class="shortcut">b</span>ack
</button>
<button type="button" class="btn btn-success" id="forward-save-2-sec">
2s <span class="shortcut">f</span>orward
</button>
<button type="button" class="btn btn-success" id="forward-save-4-sec">
+ 4s
</button>
</div>
</div>
<div style="clear: both;" id="transcript-panel">
<button type="button" class="btn btn-primary" id="edit-transcript" style="display: inline;">
Edit transcript
</button>
<h3 id="words" class="display-inline"></h3>
<div id="transcript-entry" class="display-none">
<input
type="text"
autocomplete="off"
style="width: 50%; display: inline;"
class="form-control"
id="transcript-input"
placeholder="Enter new transcript"
/>
</div>
</div>
<div class="row">
<div class="center" style="padding: 4px;">
<span class="legend">Special cases:</span>
<span class="label label-default legend-label"
>If you can't make out a word or someone is not speaking English use '#' as a placeholder.</span
>
<span class="label label-default legend-label"
>If multiple speakers are overlapping, annotate the whole region with '%'.</span
>
</div>
</div>
<div class="row">
<div class="center" style="padding: 4px;">
<span class="legend">Legend:</span>
<span class="label label-success legend-label">Your annotation</span>
<span class="label label-warning legend-label">Your selected annotation</span>
<span class="label label-danger legend-label">Unannotated word</span>
<span class="label label-info legend-label">
Reference annotations
</span>
</div>
</div>
<div class="row">
<div class="center">
<div style="display: inline-block;">
<button type="button" class="btn btn-primary" id="go-to-location" style="display: inline;">
Go to
</button>
<input
type="text"
autocomplete="off"
style="width: 8em; display: inline; text-align: right;"
class="form-control"
id="location-input"
placeholder="Seconds"
type="number"
/>
<button
type="button"
class="btn btn-primary"
style="margin-right: 30px;"
id="go-to-last"
style="display: inline;"
>
Go to last
</button>
</div>
<div style="display: inline-block;">
<input type="checkbox" id="toggle-audio" checked data-size="large" data-label-text="Audio" />
<div id="toggle-speed-div" style="display: inline;">
<input
type="checkbox"
id="toggle-speed"
unchecked
data-size="large"
data-label-text="Speed"
data-on-text="0.5x"
data-off-text="1x"
/>
</div>
</div>
<div style="display: inline-block;">
<span class="legend" style="vertical-align: middle; margin-left: 30px; font-size: 110%;">
Reference annotations:</span
>
<div class="btn-group" id="annotations"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="center">
<div style="display: inline-block;">
<button type="button" class="btn btn-primary" id="change-user" style="display: inline;">
Change user
</button>
<!-- NB Don't make this id username, it triggers password completion tools like lastpass -->
<input
type="text"
autocomplete="off"
style="width: 8em; display: inline; text-align: right;"
class="form-control"
id="worker-name"
placeholder="USERNAME"
type="number"
/>
</div>
<button type="button" class="btn btn-primary" id="edit-references" style="display: inline;">
Edit references
</button>
<input
type="text"
autocomplete="off"
style="width: 50%; display: inline;"
class="form-control"
id="references-input"
placeholder="Enter references"
/>
</div>
</div>
<script type="text/javascript" src="gui.js"></script>
</div>
</body>
</html>