-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathoptions.html
341 lines (318 loc) · 12 KB
/
options.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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>vx</title>
<style>
@import 'tailwind.css';
</style>
</head>
<body class="bg-353433 text-e9e8e7 p-8 text-base">
<div id="app">
<h1 class="text-8b8685 text-4xl">
vx options
</h1>
<template v-if="store">
<div class="max-w-xl">
<div
class="mb-4 text-xl bg-yellow-900 rounded p-4 text-white border border-yellow-400"
v-if="source === 'audio-capture-err'"
>
<strong class="text-bbeeff">Hey there!</strong>
It seems like Google Chrome did not detect any microphone on your
machine. Make make sure your device has been set up properly!
</div>
<h2 class="text-2xl text-d7fc70 mt-6 mb-4">Microphone permission</h2>
<div
class="mb-4 text-xl bg-yellow-900 rounded p-4 text-white border border-yellow-400"
v-if="source === 'not-allowed-err'"
>
<strong class="text-bbeeff">Hey there!</strong>
It seems like you need to grant vx access to the microphone first.
Just click the button below...
</div>
<div class="flex items-center mb-4">
<div class="w-1/3 flex-none"></div>
<div>
<button
@click="grantMic"
type="button"
class="block shadow bg-blue-500 text-white focus:shadow-outline focus:outline-none font-bold py-2 px-4 rounded"
>
Grant microphone permission
</button>
<div
class="mt-2 text-teal-300"
v-if="grantStatus && grantStatus.ok === 'pending'"
>
Asking for permission...
</div>
<div
class="mt-2 text-green-300"
v-else-if="grantStatus && grantStatus.ok"
>
Grant successful! Try using the extension by clicking on the
microphone button.
</div>
<div
class="mt-2 text-red-300"
v-else-if="grantStatus && !grantStatus.ok"
>
Grant unsuccessful... {{grantStatus.message}}
</div>
</div>
</div>
<h2 class="text-2xl text-d7fc70 mt-6 mb-4">Language settings</h2>
<p class="text-8b8685 mb-4">
Enter a BCP 47 language tag, such as <em>en-US</em> or
<em>en-GB</em>. The first language is the language that will be
listened to when you click on the
<span class="inline-block h-0 w-6 align-middle">
<img
src="icon.png"
class="absolute w-6 h-6"
style="transform: translateY(-50%)"
/>
</span>
Mic button. You can activate other languages via keyboard shortcuts.
</p>
<div class="flex items-baseline mb-4">
<div class="w-1/3">
<label
class="block font-bold md:text-right mb-1 md:mb-0 pr-4"
for="first_language"
>
First language
</label>
</div>
<div class="w-2/3">
<input
class="block w-full form-input bg-090807 border-454443 hover:border-656463 shadow placeholder-8b8685"
id="first_language"
type="text"
placeholder="Enter second language"
v-model="store.settings.language1"
/>
</div>
</div>
<div class="flex items-baseline mb-4">
<div class="w-1/3">
<label
class="block font-bold md:text-right mb-1 md:mb-0 pr-4"
for="second_language"
>
Second language
</label>
</div>
<div class="w-2/3">
<input
class="block w-full form-input bg-090807 border-454443 hover:border-656463 shadow placeholder-8b8685"
id="second_language"
type="text"
placeholder="Enter second language"
v-model="store.settings.language2"
/>
</div>
</div>
<save-button :store="store"></save-button>
<h2 class="text-2xl text-d7fc70 mt-6 mb-4">Keyboard shortcuts</h2>
<p class="text-8b8685 mb-4">
<strong>Tip:</strong> Set these keyboard shortcuts to “Global” to
use them outside Google Chrome.
</p>
<div class="flex items-center mb-4">
<div class="w-1/3"></div>
<div>
<a
@click="shortcuts"
class="block shadow bg-blue-500 text-white focus:shadow-outline focus:outline-none font-bold py-2 px-4 rounded"
>
Customize keyboard shortcuts
</a>
</div>
</div>
<h2 class="text-2xl text-d7fc70 mt-6 mb-4">
Output settings
</h2>
<div class="flex items-baseline mb-4">
<div class="w-1/3">
<h3 class="block font-bold md:text-right mb-1 md:mb-0 pr-4">
Overlay / Popup
</h3>
</div>
<div class="w-2/3">
<boolean-flag
:store="store"
setting-key="outputPopup"
title="Display an overlay or popup"
>
When this is turned on, an overlay will be displayed when you
activate this extension inside a web page. Otherwise, a pop-up
dialog is displayed.
</boolean-flag>
<boolean-flag
:store="store"
setting-key="outputPopupAutoFocus"
title="Auto-focus popup"
>
If unchecked, the popup window may appear below other windows.
Enabling this option ensures that the text being recognized is
displayed, but can also be annoying.
</boolean-flag>
</div>
</div>
<div class="flex items-baseline mb-4">
<div class="w-1/3">
<h3 class="block font-bold md:text-right mb-1 md:mb-0 pr-4">
Sound
</h3>
</div>
<div class="w-2/3">
<boolean-flag
:store="store"
setting-key="outputSound"
title="Enable sound"
>
When this is turned on, a sound will be played when recognition
is started, when recognition is stopped, and each time text is
copied to the clipboard.
</boolean-flag>
</div>
</div>
<div class="flex items-baseline mb-4">
<div class="w-1/3">
<h3 class="block font-bold md:text-right mb-1 md:mb-0 pr-4">
Notification
</h3>
</div>
<div class="w-2/3">
<boolean-flag
:store="store"
setting-key="outputNotificationSession"
title="Show session notification"
>
When this is turned on, a single notification will be displayed
when a speech recognition session is active. How well this works
depends on the OS.
</boolean-flag>
<boolean-flag
:store="store"
setting-key="outputNotificationTranscript"
title="Show transcript notifications"
>
When this is turned on, a separate notification will be sent
each time text is copied to the clipboard.
</boolean-flag>
</div>
</div>
<div class="flex items-baseline mb-4">
<div class="w-1/3">
<h3 class="block font-bold md:text-right mb-1 md:mb-0 pr-4">
Clipboard
</h3>
</div>
<div class="w-2/3">
<boolean-flag
:store="store"
setting-key="outputClipboard"
title="Copy to clipboard"
>
You can uncheck this… but isn't it why you installed this
extension?
</boolean-flag>
</div>
</div>
<save-button :store="store"></save-button>
<h2 class="text-2xl text-d7fc70 mt-6 mb-4">
For advanced users only
</h2>
<p class="text-red-400 mb-4">
Changing any of these settings may break the extension. Any code you
enter here will be run on the extension’s behalf. It may cause the
extension to crash. Running untrusted code can lead to your
browser’s security being compromised.
</p>
<div class="flex items-baseline mb-4">
<div class="w-1/3">
<label
class="block font-bold md:text-right mb-1 md:mb-0 pr-4"
for="transcript_filter"
>
Transcript filter
</label>
</div>
<div class="w-2/3">
<textarea
class="block w-full form-textarea bg-090807 border-454443 hover:border-656463 shadow placeholder-8b8685 font-mono"
id="transcript_filter"
type="text"
placeholder="return text"
rows="5"
v-model="store.settings.customTranscriptFilterCode"
></textarea>
<span class="block text-8b8685 italic mb-2">
This lets you write arbitrary code to tweak the resulting
transcript. Input variable: "text".
</span>
</div>
</div>
<div class="flex items-baseline mb-4">
<div class="w-1/3">
<label
class="block font-bold md:text-right mb-1 md:mb-0 pr-4"
for="transcript_filter"
>
Custom output
</label>
</div>
<div class="w-2/3">
<textarea
class="block w-full form-textarea bg-090807 border-454443 hover:border-656463 shadow placeholder-8b8685 font-mono"
id="transcript_filter"
type="text"
placeholder="console.log('>>', state) /* Try this out and inspect the extension background page. */"
rows="5"
v-model="store.settings.customOutputModuleCode"
></textarea>
<span class="block text-8b8685 italic mb-2">
This lets you send the output elsewhere. Input variable: "state"
</span>
</div>
</div>
<save-button :store="store"></save-button>
<p class="text-8b8685 mt-8">
Source code available at
<a
href="https://github.com/dtinth/vxchrome"
target="_blank"
class="text-8b8685 underline"
rel="noopener noreferrer"
>github.com/dtinth/vxchrome</a
>.<br />
You can
<a
href="https://dt.in.th/go/coffee"
target="_blank"
class="text-8b8685 underline"
rel="noopener noreferrer"
>buy me a coffee</a
>, if you feel like doing it ;).
</p>
</div>
<div class="h-24"></div>
<div
class="fixed inset-x-0 bottom-0 px-8 bg-090807"
v-show="store.changed"
>
<div class="max-w-xl pt-4">
<save-button :store="store">
<div class="text-yellow-300 font-bold">Unsaved changes</div>
</save-button>
</div>
</div>
</template>
</div>
<script src="vendor/vue-2.6.11.js"></script>
<script src="options.js"></script>
</body>
</html>