forked from mathewthe2/Game2Text
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
780 lines (716 loc) · 40.9 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
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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
<!DOCTYPE html>
<html>
<head>
<title>Game2Text</title>
<!-- Icon -->
<link rel="shortcut icon" href="static/favicon.ico">
<!-- MDL Material Design Lite -->
<link rel="stylesheet" href="static/icon.css">
<link rel="stylesheet" href="static/material.min.css">
<script src="static/material.min.js"></script>
<!-- MDL Select -->
<link rel="stylesheet" href="static/getmdl-select.min.css">
<script src="static/getmdl-select.min.js"></script>
<!-- Browser Compatibility -->
<script src="static/dialog-polyfill.js"></script>
<!-- Tippy -->
<script src="static/popper.min.js"></script>
<script src="static/tippy-bundle.umd.min.js"></script>
<link rel="stylesheet" href="static/tippy.css">
<link rel="stylesheet" href="static/shift-away.css">
<!-- eel -->
<script type="text/javascript" src="/eel.js"></script>
<!-- similiar kanji -->
<script src="static/similar_kanji.json"></script>
</head>
<link rel="stylesheet" href="index.css">
<body onresize="browserOnResize()">
<!-- <h4>Game2Text</h4> -->
<div class="container">
<video id="video" class="streamVideo" autoplay onplay="videoOnLoad(this)"></video>
<canvas class="canvas" id="cv1"></canvas>
<canvas class="canvas" id="previewCanvas"></canvas>
<canvas class="canvas" id="croppedVideoCanvas"></canvas>
<div hidden id="canvasContextMenuContainer">
<div id="canvasContextMenu" class="canvasContextMenu">
<span class="profileSelectLabel">Profile</span>
<select onchange="selectProfile(this)" class="profileSelect">
<option>None</option>
</select>
<!-- Icon button -->
<button class="profileSelectImport mdl-button mdl-js-button mdl-button--icon">
<i onclick="loadImageFilterFromFile()" class="material-icons">folder</i>
</button>
<img class="canvasContextSelectionImage" src="static/image-not-found.jpg" alt="image-not-found">
<!-- <canvas class="canvasContextSelectionCanvas"></canvas> -->
<div class="checkBoxContainer">
<span class="mdl-checkbox__label">Binarize</span>
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="binarizeCheckbox">
<input onchange="binarize(this)" type="checkbox" id="binarizeCheckbox" class="mdl-checkbox__input">
</label>
</div>
<input disabled onchange="changeBinarizeThreshold(this)" id="binarizeSlider" class="mdl-slider mdl-js-slider" type="range"
min="0" max="100" value="50" tabindex="0">
<br>
<span class="blurSliderLabel">Gaussian Blur</span>
<input onchange="blurImage(this)" id="blurSlider" class="mdl-slider mdl-js-slider" type="range"
min="0" max="100" value="0" tabindex="0">
<br>
<div class="checkBoxContainer">
<span class="mdl-checkbox__label">Dilate</span>
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="dilateCheckbox">
<input onchange="dilateImage(this)" type="checkbox" id="dilateCheckbox" class="mdl-checkbox__input">
</label>
</div>
<div class="checkBoxContainer">
<span class="mdl-checkbox__label">Invert Color</span>
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="invertColorCheckbox">
<input onchange="invertColor(this)" type="checkbox" id="invertColorCheckbox" class="mdl-checkbox__input">
</label>
</div>
<hr>
<div class="canvasMenuActionsContainer">
<button onclick="exportProfile()" class="mdl-button mdl-js-button mdl-button--accent">
Export
</button>
<button class="profileSelectImport mdl-button mdl-js-button mdl-button--icon">
<i onclick="resetImageFilters()" class="material-icons">restart_alt</i>
</button>
</div>
<!-- <ul class="canvasContextMenu mdl-list"></ul>
<li class="canvasContextMenuItem mdl-list__item">
<span onclick="copyImageToClipboard()" class="mdl-list__item-primary-content">
<i class="material-icons mdl-list__item-icon">content_copy</i>
Copy image
</span>
</li> -->
<!-- <li class="canvasContextMenuItem mdl-list__item">
<span onclick="toggleCropVideo()" class="mdl-list__item-primary-content">
<i class="material-icons mdl-list__item-icon">person</i>
Crop stream
</span>
</li> -->
<!-- <ul> -->
</div>
</div>
<div id=startMessage>
<div class="welcome-card-wide mdl-card mdl-shadow--2dp">
<div class="mdl-card__title">
<!-- <h2 class="mdl-card__title-text">Welcome</h2> -->
</div>
<div class="mdl-card__supporting-text">
Welcome to <b>Game2Text</b> - a simple tool for learning languages with games! <br/> Click <b>Select Application</b> to get started.
</div>
<div class="mdl-card__actions mdl-card--border">
<a id="selectAppButton" onclick="selectApplication()" class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect">
Select Application
</a>
</div>
</div>
</div>
<div id="gameToolbar">
<div style="background: #2e2e2e; color: white; width: 100%">
<button disabled id="minimizeButton" onclick="toggleCollapseVideo()" style="margin-left: 12px" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">keyboard_arrow_down</i>
</button>
<div class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="minimizeButton">Hide Game</div>
<button hidden id="maximizeButton" onclick="toggleCollapseVideo()" style="margin-left: 12px" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">keyboard_arrow_right</i>
</button>
<div class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="maximizeButton">Show Game</div>
<button disabled id="showSelectionButton" onclick="toggleShowSelection()" class="mdl-button mdl-js-button mdl-button--icon mdl-button--colored">
<i class="material-icons">filter_center_focus</i>
</button>
<div id="showSelectionTooltip" class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="showSelectionButton">Hide Selection</div>
<!-- <button id="cropVideoButton" onclick="toggleCropVideo()" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">crop</i>
</button>
<div id="cropVideoTooltip" class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="cropVideoButton">Crop Video</div> -->
</div>
</div>
<div id="outputToolbar">
<div style="background: #2e2e2e; color: white; width: 100%">
<button disabled id="refreshButton" onclick="refreshOCR()" style="margin-left: 12px" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">refresh</i>
</button>
<div class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="refreshButton">Refresh</div>
<button disabled id="autoModeButton" onclick="toggleAutoMode()" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">autorenew</i>
</button>
<div class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="autoModeButton">Auto Mode</div>
<button disabled id="showTranslationButton" onclick="toggleTranslation()" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">translate</i>
</button>
<div id="showTranslationTooltip" class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="showTranslationButton">Enable Translation</div>
<button id="texthookerButton" onclick="openTexthookerSettings()" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">menu_book</i>
</button>
<div id="texthookerTooltip" class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="texthookerButton">Visual Novel Hooker</div>
<button id="clipboardButton" onclick="openClipboardSettings()" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">content_paste</i>
</button>
<div id="clipboardTooltip" class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="clipboardButton">Clipboard</div>
<button id="AnkiSettingsButton" onclick="openAnkiSettingsDialog()" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">style</i>
</button>
<div id="texthookerTooltip" class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="AnkiSettingsButton">Anki</div>
<button id="settingsButton" onclick="openSettings()" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">settings</i>
</button>
<div id="settingsTooltip" class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="settingsButton">Settings</div>
<button style="float: right; margin-right: 12px" id="toggleLogsButton" onclick="openLogWindow()" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">view_list</i>
</button>
<div id="logsTooltip" class="mdl-tooltip mdl-tooltip--large mdl-tooltip--bottom" data-mdl-for="toggleLogsButton">Logs</div>
</div>
</div>
<!-- Settings Dialog -->
<dialog hidden id="settingsDialog" class="mdl-dialog" style="width: 600px">
<h4 class="mdl-dialog__title">Settings</h4>
<div class="mdl-dialog__content">
<div>
<div class="mdl-tabs mdl-js-tabs mdl-js-ripple-effect">
<div class="mdl-tabs__tab-bar">
<a href="#general" class="mdl-tabs__tab is-active">General</a>
<a href="#audio" class="mdl-tabs__tab">Audio</a>
<a href="#picture" class="mdl-tabs__tab">Picture</a>
<a href="#translation" class="mdl-tabs__tab">Translation</a>
<!-- <a href="#clipboard" class="mdl-tabs__tab">Clipboard</a> -->
<a href="#hotkeys" class="mdl-tabs__tab">Hotkeys</a>
</div>
<div class="mdl-tabs__panel is-active" id="general">
<div class="settingsCard mdl-card mdl-shadow--2dp">
<ul class="mdl-list">
<li class="sectionTitle mdl-list__item">
Appearance
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">format_size</i>
<span>Font Size</span>
</span>
<span class="mdl-list__item-secondary-action">
<input id="font-size-slider" class="mdl-slider mdl-js-slider" type="range"
min="7" max="60" value="24" tabindex="0" onchange="updateFontSizeAndPersist(this.value)">
</span>
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">invert_colors</i>
<span>Dark Theme</span>
</span>
<span class="mdl-list__item-secondary-action">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="dark-theme-switch">
<input type="checkbox" onclick="toggleDarkThemeAndPersist()" id="dark-theme-switch" class="mdl-switch__input" />
</label>
</span>
</li>
</ul>
</div>
<!-- <div class="tab_section_label">Text Recognition</div> -->
<div class="settingsCard mdl-card mdl-shadow--2dp">
<ul class="mdl-list">
<li class="sectionTitle mdl-list__item">
Text Recognition
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">remove_red_eye</i>
<div id="ocr_engine_select_container" class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label getmdl-select getmdl-select__foix-height">
<input onchange="updateOCREngineAndPersist()" style="padding-top: 8px" type="text" value="" class="mdl-textfield__input" id="ocr_engine_select" readonly>
<input type="hidden" value="" name="ocr_engine_select">
<i class="mdl-icon-toggle__label material-icons">keyboard_arrow_down</i>
<label for="ocr_engine_select" class="mdl-textfield__label">OCR Engine</label>
<ul for="ocr_engine_select" class="mdl-menu mdl-menu--bottom-left mdl-js-menu">
<li class="mdl-menu__item" data-val="tesseract_default">Tesseract Default</li>
<li class="mdl-menu__item" data-val="tesseract_lstm">Tesseract LSTM</li>
<li class="mdl-menu__item" data-val="tesseract_legacy">Tesseract Legacy</li>
<li class="mdl-menu__item" data-val="ocr_space_na">OCR Space NA</li>
<li class="mdl-menu__item" data-val="ocr_space_eu">OCR Space EU</li>
</ul>
</div>
</span>
</li>
<li class="mdl-list__item mdl-list__item--two-line">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">text_rotate_vertical</i>
<span>Detect Vertical Text</span>
<span class="mdl-list__item-sub-title">Detect vertical text in books and manga</span>
</span>
<span class="mdl-list__item-secondary-action">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="text-orientation-switch">
<input type="checkbox" onclick="toggleTextOrientation()" id="text-orientation-switch" class="mdl-switch__input" />
</label>
</span>
</li>
</ul>
</div>
<ul class="mdl-list">
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
Select New Application Window
</span>
<span class="mdl-list__item-secondary-action">
<button onclick="selectApplication()" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">keyboard_arrow_right</i>
</button>
</span>
</li>
</ul>
</div>
<div class="mdl-tabs__panel" id="hotkeys">
<ul class="mdl-list">
<li class="mdl-list__item">
<table id="hotkey_table" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp">
<thead>
<tr>
<th class="mdl-data-table__cell--non-numeric">Action</th>
<th class="mdl-data-table__cell--non-numeric">Hotkey</th>
</tr>
</thead>
<tbody>
<tr id="refreshHotkeyTuple">
<td class="mdl-data-table__cell--non-numeric tuple_label">Refresh OCR</td>
<td>
<input onchange="changeRefreshHotkey(this)" id="refreshHotkeyInput"></input>
</td>
</tr>
<tr id="addToAnkiHotkeyTuple">
<td class="mdl-data-table__cell--non-numeric tuple_label">Add to Anki</td>
<td>
<input onchange="changeAddToAnkiHotkey(this)" id="addToAnkiHotkeyInput"></input>
</td>
</tr>
<tr id="recordAudioHotkeyTuple">
<td class="mdl-data-table__cell--non-numeric tuple_label">Record Audio</td>
<td>
<input onchange="changeRecordAudioHotkey(this)" id="recordAudioHotkeyInput"></input>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<div class="tab_section_label">Restarting Game2Text is required for hotkey changes to take effect.</div>
</div>
<div class="mdl-tabs__panel" id="translation">
<ul class="mdl-list">
<li class="mdl-list__item" >
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">g_translate</i>
<div id="translation_select_container" class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label getmdl-select getmdl-select__foix-height">
<input onchange="updateTranslationServiceAndPersist()" style="padding-top: 8px" type="text" value="" class="mdl-textfield__input" id="translation_select" readonly>
<input type="hidden" value="" name="translation_select">
<i class="mdl-icon-toggle__label material-icons">keyboard_arrow_down</i>
<label for="translation_select" class="mdl-textfield__label">Translation Service</label>
<ul for="translation_select" class="mdl-menu mdl-menu--bottom-left mdl-js-menu">
<li class="mdl-menu__item" data-val="tesseract_default">Papago</li>
<li class="mdl-menu__item" data-val="tesseract_lstm">DeepL Translate</li>
<li class="mdl-menu__item" data-val="tesseract_legacy">Google Translate</li>
</ul>
</div>
</span>
</li>
<li class="mdl-list__item" >
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">translate</i>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input onchange="changeSourceLanguage()" class="mdl-textfield__input" type="text" id="source_language_input">
<label class="mdl-textfield__label" for="sample4">Source Language</label>
</div>
</span>
</li>
<li class="mdl-list__item" >
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">language</i>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input onchange="changeTargetLanguage()" class="mdl-textfield__input" type="text" id="target_language_input">
<label class="mdl-textfield__label" for="sample4">Target Language</label>
</div>
</span>
</li>
</ul>
</div>
<div class="mdl-tabs__panel" id="audio">
<div class="settingsCard mdl-card mdl-shadow--2dp">
<ul class="mdl-list">
<li class="sectionTitle mdl-list__item">
Audio Device
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">graphic_eq</i>
<div id="audio_host_select_container" class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label getmdl-select getmdl-select__foix-height">
<input onchange="changeAudioHost()" style="padding-top: 8px" type="text" value="" class="mdl-textfield__input" id="audio_host_select" readonly>
<input type="hidden" value="" name="audio_host_select">
<i class="mdl-icon-toggle__label material-icons">keyboard_arrow_down</i>
<label for="audio_host_select" class="mdl-textfield__label">Audio Host</label>
<ul id="audio_host_selector" for="audio_host_select" class="mdl-menu mdl-menu--bottom-left mdl-js-menu">
</ul>
</div>
</span>
</li>
<!-- Audio Device Selection -->
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">headphones</i>
<div id="audio_device_select_container" class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label getmdl-select getmdl-select__foix-height">
<input onchange="changeAudioDevice()" style="padding-top: 8px" type="text" value="" class="mdl-textfield__input" id="audio_device_select" readonly>
<input type="hidden" value="" name="audio_device_select">
<i class="mdl-icon-toggle__label material-icons">keyboard_arrow_down</i>
<label for="audio_device_select" class="mdl-textfield__label">Audio Device</label>
<ul id="audio_device_selector" for="audio_device_select" class="mdl-menu mdl-menu--bottom-left mdl-js-menu">
</ul>
</div>
</span>
</li>
</ul>
</div>
<div class="settingsCard mdl-card mdl-shadow--2dp">
<ul class="mdl-list">
<li class="sectionTitle mdl-list__item">
Automatic Recording
</li>
<li class="mdl-list__item mdl-list__item--two-line">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">video_library</i>
<span>Automatic recording</span>
<span class="mdl-list__item-sub-title" >Audio files are saved to <a onclick="openFolder('logs/audio')" href="#"><b>logs/audio/</b></a> directory</span>
</span>
<span class="mdl-list__item-secondary-content">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="log-audio-switch">
<input type="checkbox" onclick="toggleLogAudioAndPersist()" id="log-audio-switch" class="mdl-switch__input" />
</label>
</span>
</li>
<li class="mdl-list__item mdl-list__item--two-line">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">timelapse</i>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input onchange="changeAudioDuration()" class="mdl-textfield__input" type="text" pattern="-?[0-9]*(\.[0-9]+)?" id="audio_duration_input">
<label class="mdl-textfield__label" for="sample4">Duration (seconds)</label>
<span class="mdl-textfield__error">Input is not a number!</span>
</div>
</span>
</li>
<!-- end of list -->
</ul>
</div>
</div>
<div class="mdl-tabs__panel" id="picture">
<div class="settingsCard mdl-card mdl-shadow--2dp">
<ul class="mdl-list">
<li class="sectionTitle mdl-list__item">
Screenshots
</li>
<li class="mdl-list__item mdl-list__item--two-line">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">photo_library</i>
<span>Save screenshots</span>
<span class="mdl-list__item-sub-title" >Images are saved to <a onclick="openFolder('logs/images')" href="#"><b>logs/images/</b></a> directory</span>
</span>
<span class="mdl-list__item-secondary-content">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="log-images-switch">
<input type="checkbox" onclick="toggleLogImagesAndPersist()" id="log-images-switch" class="mdl-switch__input" />
</label>
</span>
</li>
<li class="mdl-list__item mdl-list__item--two-line">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">image</i>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input onchange="changeImageType()" class="mdl-textfield__input" type="text" id="image_type_input">
<label class="mdl-textfield__label" for="image_type_input">Image Type</label>
</div>
</span>
</li>
</ul>
</div>
<div class="settingsCard mdl-card mdl-shadow--2dp">
<ul class="mdl-list">
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">aspect_ratio</i>
<span>Resize Screenshot</span>
</span>
<span class="mdl-list__item-secondary-action">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="resizeScreenshotSwitch">
<input type="checkbox" onclick="toggleResizeScreenshotSwitchAndPersist()" id="resizeScreenshotSwitch" class="mdl-switch__input" />
</label>
</span>
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<span style="padding-right: 50px;">Max Width</span>
<input onchange="changeScreenshotMaxWidth(this)" disabled id="screenshotMaxWidthInput"></input>
</span>
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<span style="padding-right: 44px;">Max Height</span>
<input onchange="changeScreenshotMaxHeight(this)" disabled id="screenshotMaxHeightInput"></input>
</span>
</li>
</ul>
</div>
<!-- next item -->
</div>
</div>
<!-- extra settings here-->
<hr>
</div>
</div>
<div class="mdl-dialog__actions">
<button id="dialogCloseButton" onclick="closeSettings()" type="button" class="mdl-button close">Close</button>
</div>
</dialog>
<!-- Clipboard Dialog -->
<dialog hidden id="clipboardDialog" class="mdl-dialog" style="width: 600px">
<h4 class="mdl-dialog__title">Clipboard</h4>
<div class="mdl-dialog__content">
<ul class="mdl-list">
<li class="mdl-list__item mdl-list__item--two-line">
<span class="mdl-list__item-primary-content">
<i style="color: #2e2e2e; background: white" class="material-icons mdl-list__item-avatar">content_paste</i>
<span> Clipboard Inserter</span>
<span class="mdl-list__item-sub-title">Use with 3rd party texthookers</span>
</span>
<span class="mdl-list__item-secondary-content">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="clipboard-mode-switch">
<input type="checkbox" onclick="toggleClipboardMode()" id="clipboard-mode-switch" class="mdl-switch__input" />
</label>
</span>
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<i style="color: #2e2e2e; background: white" class="material-icons mdl-list__item-avatar">content_copy</i>
<span> Text to Clipboard</span>
</span>
<span class="mdl-list__item-secondary-content">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="output-to-clipboard-mode-switch">
<input type="checkbox" onclick="toggleOutputToClipboard()" id="output-to-clipboard-mode-switch" class="mdl-switch__input" />
</label>
</span>
</li>
</ul>
</div>
<div class="mdl-dialog__actions">
<button id="clipboardDialogCloseButton" onclick="closeClipboardSettingsDialog()" type="button" class="mdl-button close">Close</button>
</div>
</dialog>
<!-- Anki Settings Dialog -->
<dialog hidden id="ankiSettingsDialog" class="mdl-dialog" style="width: 600px">
<h4 class="mdl-dialog__title">Anki</h4>
<div style="padding-bottom: 0px" class="mdl-dialog__content">
<div>
<div class="mdl-tabs mdl-js-tabs mdl-js-ripple-effect">
<div class="mdl-tabs__tab-bar">
<a href="#ankiconnect" class="mdl-tabs__tab is-active">AnkiConnect</a>
<a href="#anki_dictionaries" class="mdl-tabs__tab">Dictionaries</a>
</div>
<div class="mdl-tabs__panel is-active" id="ankiconnect">
<ul class="mdl-list">
<div class="tab_select_wrapper">
Make sure <a href="https://ankiweb.net/shared/info/2055492159" target="_blank" alt="anki_connect_link">AnkiConnect</a> is installed and Anki is running.
</div>
<li class="mdl-list__item mdl-list__item--two-line">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">local_offer</i>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input onchange="changeAnkiTags()" class="mdl-textfield__input" type="text" id="anki_tags_input">
<label class="mdl-textfield__label" for="sample4">Card tags (space-separated)</label>
</div>
</span>
</li>
<div class="settingsCard mdl-card mdl-shadow--2dp">
<ul class="mdl-list">
<li class="mdl-list__item">
<label for="deck">Deck</label>
<input onchange="changeDeck()" style="width: 100%;margin-left: 28px;" list="decks" name="deck" id="deckSelect">
<datalist id="decks">
</datalist>
</li>
<li class="mdl-list__item">
<label for="card_model">Model</label>
<input onchange="changeCardModel()" style="width: 100%;margin-left: 20px;" list="card_models" name="card_model" id="cardModelSelect">
<datalist id="card_models">
</datalist>
</li>
</ul>
</div>
<!-- Fields and Values -->
<table style="margin-top: 12px; width: 100%" hidden id="field_values_table" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp">
<thead>
<tr>
<th class="mdl-data-table__cell--non-numeric">Field</th>
<th class="mdl-data-table__cell--non-numeric">Value</th>
</tr>
</thead>
<tbody>
<tr hidden id="field_values_tuple_template">
<td class="mdl-data-table__cell--non-numeric tuple_label"></td>
<td>
<select style="width: 100%" onchange="updateFieldValue()" class="field_value_select"></select>
</td>
</tr>
</tbody>
</table>
<button style="width: 100%; margin-top: 12px;" onclick="reloadAnki()" class="mdl-button mdl-js-button mdl-button--primary">
Reload
</button>
<!-- list ends here-->
</ul>
</div>
<div class="mdl-tabs__panel" id="anki_dictionaries">
<div>
<ul class="mdl-list">
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<i class="settingsIcon material-icons mdl-list__item-avatar">book</i>
<span style="padding-right: 50px">Dictionary</span>
<select style="width: 200px" onchange="selectDictionary(this)" id="dictionarySelect" name="dictionary">
</select>
</span>
</span>
<li>
</ul>
</div>
</div>
</div>
</div>
</div>
<hr>
<div class="mdl-dialog__actions">
<button id="ankiSettingsDialogCloseButton" onclick="closeAnkiSettingsDialog()" type="button" class="mdl-button close">Close</button>
</div>
</dialog>
<!-- Texthooker Dialog -->
<dialog hidden id="texthookerSettingsDialog" class="mdl-dialog" style="width: 600px">
<h4 class="mdl-dialog__title">Visual Novel Hooker</h4>
<div class="mdl-dialog__content">
<div>
<div class="mdl-tabs mdl-js-tabs mdl-js-ripple-effect">
<div class="mdl-tabs__tab-bar">
<a href="#texthookers_general" class="mdl-tabs__tab is-active">General</a>
<a href="#texthookers_advanced" class="mdl-tabs__tab">Advanced</a>
</div>
<div class="mdl-tabs__panel is-active" id="texthookers_general">
<ul class="mdl-list">
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<i style="color: #2e2e2e; background: white" class="material-icons mdl-list__item-avatar">sports_esports</i>
<span>Application</span>
<span class="tab_select_wrapper" >
<input style="margin-left: 10px; width: 355px" onkeyup="handleInputApplication()" onchange="selectTextHookerApplication(this)" type="text" name="application" list="pidNameSelect" placeholder="Select Application">
<datalist id="pidNameSelect">
</datalist>
</span>
<!-- <button class="refreshPIDsButton mdl-button mdl-js-button mdl-button--icon">
<i onclick="refreshPIDs()" class="material-icons">refresh</i>
</button> -->
</span>
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<i style="color: #2e2e2e; background: white" class="material-icons mdl-list__item-avatar">add_task</i>
<span>Hooks</span>
<span style="padding-left: 63px" >
<select style="width: 360px" size="6" onchange="selectHook(this)" onfocus="this.selectedIndex=-1;this.blur()" id="hookSelect" name="hooks">
</select>
</span>
</span>
<li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<span>Hook Code</span>
<span style="padding-left: 80px; width: 350px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" >
<span id="currentHookLabel"></span>
</span>
</span>
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<span>Textractor Log</span>
<span style="padding-left: 55px; text-overflow: ellipsis;white-space: nowrap;width: 350px;overflow: hidden;" >
<span id="textractorLogLabel"></span>
</span>
</span>
</li>
</ul>
</div>
<div class="mdl-tabs__panel" id="texthookers_advanced">
<ul class="mdl-list">
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<span>Custom Hooks</span>
<span style="padding-left: 50px" >
<input style="width: 300px" placeholder="Enter Hook Code" id="customHookCodeInput"></input>
<button onclick="addCustomHook()">Add</button>
</span>
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<span>TextractorCLI.exe</span>
<span style="padding-left: 25px" >
<input disabled style="width: 300px" id="textractorPathInput"></input>
<button id="selectTextractorExecutableButton" onclick="changeTextractorExecutablePath()" class="mdl-button mdl-js-button mdl-button--icon mdl-button--colored">
<i class="material-icons">folder</i>
</button>
</span>
</li>
</ul>
<div class="settingsCard mdl-card mdl-shadow--2dp">
<ul class="mdl-list">
<li class="sectionTitle mdl-list__item">
Text Parsing
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<span>Remove Repeat Sentences</span>
</span>
<span class="mdl-list__item-secondary-action">
<label style="margin-right: 20px" class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="removeRepeatSentencesSwitch">
<input type="checkbox" onclick="toggleRemoveRepeatedSentencesAndPersist()" id="removeRepeatSentencesSwitch" class="mdl-switch__input" />
</label>
</span>
</li>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<span>Remove White Spaces</span>
</span>
<span class="mdl-list__item-secondary-action">
<label style="margin-right: 20px" class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="removeWhiteSpacesSwitch">
<input type="checkbox" onclick="toggleRemoveWhiteSpacesAndPersist()" id="removeWhiteSpacesSwitch" class="mdl-switch__input" />
</label>
</span>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<hr>
<div class="mdl-dialog__actions">
<button id="texthookerSettingsDialogCloseButton" onclick="closeTexthookerSettingsDialog()" type="button" class="mdl-button close">Close</button>
</div>
</dialog>
<!-- Output -->
<span class="results" id="results">
<span id="output" contenteditable oninput="changeOutputText(this)">
</span>
<br><span id="translatedOutput" hidden></span>
</span>
<div aria-live="assertive" aria-atomic="true" aria-relevant="text" class="mdl-snackbar mdl-js-snackbar">
<div class="mdl-snackbar__text"></div>
<button type="button" class="mdl-snackbar__action"></button>
</div>
<span id ="similarKanjiTooltip" class="tooltiptext"></span>
<script src="ankisettings.js"></script>
<script src="texthookersettings.js"></script>
<script src="settings.js"></script>
<script src="index.js"></script>
<script src="similarkanji.js"></script>
<script src="image.js"></script>
</body>
</html>