Repository navigation
Expand file tree
/
Copy pathviewer.html
More file actions
452 lines (449 loc) · 18.2 KB
/
Copy pathviewer.html
File metadata and controls
452 lines (449 loc) · 18.2 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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
(() => {
// Mirror of the early-theme inline script in index.html. The literal
// here must stay in sync with APP_THEME_STORAGE_KEY in src/app-theme.ts.
const key = "riida.appTheme";
const theme = localStorage.getItem(key);
if (!theme) {
return;
}
const root = document.documentElement;
root.dataset.theme = theme;
root.style.colorScheme = theme === "night-city" || theme === "navy-blue" ? "dark" : "light";
})();
</script>
<link rel="stylesheet" href="/src/styles.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>riida viewer</title>
<script type="module" src="/src/main-viewer.ts" defer></script>
</head>
<body data-startup="loading" data-window-role="viewer">
<main class="app-shell viewer-only">
<section class="main-pane" id="main-pane">
<div class="viewer-navigation-overlay">
<div class="navigation-controls" aria-label="History">
<button id="nav-back" class="navigation-button" type="button" aria-label="Back" disabled>
<i class="fa-solid fa-chevron-left" aria-hidden="true"></i>
</button>
<button
id="nav-forward"
class="navigation-button"
type="button"
aria-label="Forward"
disabled
>
<i class="fa-solid fa-chevron-right" aria-hidden="true"></i>
</button>
</div>
<div id="viewer-page-jump" class="viewer-page-jump" hidden>
<form id="viewer-page-jump-form" class="viewer-page-jump-form">
<input
id="viewer-page-jump-input"
class="viewer-page-jump-input"
type="text"
inputmode="numeric"
autocomplete="off"
spellcheck="false"
aria-label="Page number"
/>
<span
id="viewer-page-jump-total"
class="viewer-page-jump-total"
aria-hidden="true"
></span>
<button id="viewer-page-jump-go" class="viewer-page-jump-go" type="submit">Go</button>
</form>
</div>
</div>
<button id="epub-toc-toggle" class="epub-toc-toggle" type="button" aria-label="目次" hidden>
<i class="fa-solid fa-list-ol" aria-hidden="true"></i>
</button>
<div id="epub-toc-panel" class="epub-toc-panel" hidden>
<div id="epub-toc-list" class="epub-toc-list"></div>
</div>
<div id="viewer-overlay-controls" class="viewer-overlay-controls" hidden>
<button id="viewer-tags-open" class="viewer-tags-button" type="button" hidden>
<i class="fa-solid fa-tags" aria-hidden="true"></i>
<span>Tags</span>
</button>
<button id="viewer-metadata-open" class="viewer-tags-button" type="button" hidden>
<i class="fa-solid fa-pen-to-square" aria-hidden="true"></i>
<span>Metadata</span>
</button>
<button
id="viewer-settings-toggle"
class="viewer-settings-toggle"
type="button"
aria-label="Open viewer settings"
>
<i class="fa-solid fa-bars" aria-hidden="true"></i>
</button>
</div>
<section id="viewer-settings-panel" class="viewer-settings-panel" hidden>
<div class="viewer-setting-tabs" role="tablist" aria-label="設定対象">
<button
id="viewer-settings-scope-global"
class="viewer-setting-tab"
type="button"
role="tab"
aria-selected="true"
data-scope="global"
>
全体
</button>
<button
id="viewer-settings-scope-file"
class="viewer-setting-tab"
type="button"
role="tab"
aria-selected="false"
data-scope="file"
>
ファイル
</button>
</div>
<p id="viewer-settings-source-label" class="viewer-settings-source-label">PDF</p>
<div id="viewer-settings-reader-fields">
<label class="viewer-setting">
<span>ページ表示</span>
<select id="viewer-page-mode">
<option value="spread">2ページ</option>
<option value="single">単ページ</option>
</select>
</label>
<label class="viewer-setting">
<span>綴じ方向</span>
<select id="viewer-binding-direction">
<option value="auto">自動判定</option>
<option value="left">左綴じ</option>
<option value="right">右綴じ</option>
</select>
</label>
<label class="viewer-setting pdf-only">
<span>ズーム</span>
<select id="viewer-zoom-mode">
<option value="fit-width">幅に合わせる</option>
<option value="fit-height">高さに合わせる</option>
<option value="original">オリジナル</option>
</select>
</label>
<label class="viewer-setting epub-only">
<span>文字サイズ</span>
<div class="viewer-font-size-control">
<input
type="range"
id="viewer-epub-font-size"
min="50"
max="200"
step="10"
value="100"
/>
<output id="viewer-epub-font-size-output" for="viewer-epub-font-size">100%</output>
</div>
</label>
<label class="viewer-setting">
<span>表示位置</span>
<select id="viewer-align-mode">
<option value="left">左寄せ</option>
<option value="center">中央</option>
<option value="right">右寄せ</option>
</select>
</label>
<label class="viewer-setting">
<span>スクロール</span>
<select id="viewer-scroll-mode">
<option value="continuous">連続スクロール</option>
<option value="paged">ページ単位</option>
</select>
</label>
<label class="viewer-setting">
<span>上下余白</span>
<select id="viewer-vertical-gap-mode">
<option value="wide">広い</option>
<option value="compact">狭い</option>
<option value="none">ゼロ</option>
</select>
</label>
<section class="viewer-setting viewer-setting-swatches">
<span>背景色</span>
<div
id="viewer-background-mode"
class="viewer-background-swatches"
role="radiogroup"
aria-label="Viewer background color"
>
<label class="viewer-background-option">
<input
type="radio"
name="viewer-background-mode"
value="default"
aria-label="Default"
/>
<span
class="viewer-background-swatch"
data-background-mode="default"
aria-hidden="true"
></span>
</label>
<label class="viewer-background-option">
<input
type="radio"
name="viewer-background-mode"
value="snow-white"
aria-label="Snow White"
/>
<span
class="viewer-background-swatch"
data-background-mode="snow-white"
aria-hidden="true"
></span>
</label>
<label class="viewer-background-option">
<input
type="radio"
name="viewer-background-mode"
value="night-city"
aria-label="Night City"
/>
<span
class="viewer-background-swatch"
data-background-mode="night-city"
aria-hidden="true"
></span>
</label>
<label class="viewer-background-option">
<input
type="radio"
name="viewer-background-mode"
value="navy-blue"
aria-label="Navy Blue"
/>
<span
class="viewer-background-swatch"
data-background-mode="navy-blue"
aria-hidden="true"
></span>
</label>
</div>
<label class="viewer-background-inherit">
<input id="viewer-background-inherit" type="checkbox" />
<span>アプリケーション設定を反映</span>
</label>
</section>
<div class="viewer-settings-divider" aria-hidden="true"></div>
<label class="viewer-setting viewer-checkbox">
<input id="viewer-cover-mode" type="checkbox" checked />
<span>1ページ目を表紙にする</span>
</label>
<label class="viewer-setting viewer-checkbox pdf-only">
<input id="viewer-deskew-mode" type="checkbox" />
<span>スキャンの傾きを補正する</span>
</label>
<label class="viewer-setting viewer-checkbox pdf-only">
<input id="viewer-trim-mode" type="checkbox" />
<span>余白をトリミングする</span>
</label>
</div>
</section>
<div id="viewer-window-status" class="viewer-window-status">
<p id="viewer-window-target" class="viewer-window-target">
<!-- main-viewer.ts fills this with the requested book path -->
</p>
</div>
<div id="pdfjs-viewer" class="pdfjs-viewer viewer-window-pdfjs" hidden></div>
<div id="epub-viewer" class="epub-viewer viewer-window-epub" hidden></div>
<button id="note-toggle" class="note-toggle-button" type="button" hidden>
<i class="fa-solid fa-note-sticky" aria-hidden="true"></i>
<span>Notes</span>
</button>
<aside id="note-panel" class="note-panel" hidden>
<div class="note-panel-header" id="note-drag-handle">
<p class="note-panel-label">Notes</p>
<button
id="note-close"
class="note-close-button"
type="button"
aria-label="Close notes"
>
×
</button>
</div>
<div id="note-editor" class="note-editor"></div>
<div class="note-resize-handle note-resize-handle-n" data-resize="n"></div>
<div class="note-resize-handle note-resize-handle-e" data-resize="e"></div>
<div class="note-resize-handle note-resize-handle-s" data-resize="s"></div>
<div class="note-resize-handle note-resize-handle-w" data-resize="w"></div>
<div class="note-resize-handle note-resize-handle-ne" data-resize="ne"></div>
<div class="note-resize-handle note-resize-handle-se" data-resize="se"></div>
<div class="note-resize-handle note-resize-handle-sw" data-resize="sw"></div>
<div class="note-resize-handle note-resize-handle-nw" data-resize="nw"></div>
</aside>
</section>
<div id="tag-editor-modal" class="app-settings-modal" hidden>
<div id="tag-editor-backdrop" class="app-settings-backdrop"></div>
<section
class="app-settings-dialog tag-editor-dialog"
role="dialog"
aria-modal="true"
aria-labelledby="tag-editor-title"
>
<div class="app-settings-header">
<div>
<p class="app-settings-kicker">Book tags</p>
<h2 id="tag-editor-title">Tags</h2>
</div>
<button
id="tag-editor-close"
class="app-settings-close"
type="button"
aria-label="Close tags"
>
×
</button>
</div>
<div class="app-settings-body">
<p id="tag-editor-book" class="app-settings-path"></p>
<div id="tag-editor-list" class="tag-editor-list"></div>
<label class="app-settings-field">
<span>Add tag</span>
<div class="tag-editor-add-row">
<input id="tag-editor-input" type="text" maxlength="200" />
<button id="tag-editor-add" class="app-settings-secondary" type="button">
Add
</button>
</div>
<small>
Tags can contain any non-empty text. Use <code>/</code> to create nested labels
such as <code>language/lean</code>.
</small>
</label>
<p id="tag-editor-status" class="app-settings-status" hidden></p>
</div>
<div class="app-settings-actions">
<button id="tag-editor-cancel" class="app-settings-secondary" type="button">
Cancel
</button>
<button id="tag-editor-save" class="app-settings-primary" type="button">
Save and close
</button>
</div>
</section>
</div>
<div id="book-metadata-modal" class="app-settings-modal" hidden>
<div id="book-metadata-backdrop" class="app-settings-backdrop"></div>
<section
class="app-settings-dialog metadata-editor-dialog"
role="dialog"
aria-modal="true"
aria-labelledby="book-metadata-title-heading"
>
<div class="app-settings-header">
<div>
<p class="app-settings-kicker">Book metadata</p>
<h2 id="book-metadata-title-heading">Metadata</h2>
</div>
<button
id="book-metadata-close"
class="app-settings-close"
type="button"
aria-label="Close metadata"
>
×
</button>
</div>
<div class="app-settings-body">
<div class="metadata-book-row">
<p id="book-metadata-book" class="app-settings-path"></p>
</div>
<label class="app-settings-field">
<span>Title</span>
<input id="book-metadata-title" type="text" maxlength="300" />
</label>
<label class="app-settings-field">
<span>Authors</span>
<textarea
id="book-metadata-authors"
rows="4"
placeholder="One author per line"
></textarea>
</label>
<label class="app-settings-field">
<span>Description</span>
<textarea id="book-metadata-description" rows="5"></textarea>
</label>
<div class="metadata-editor-grid">
<label class="app-settings-field">
<span>Publisher</span>
<input id="book-metadata-publisher" type="text" maxlength="200" />
</label>
<label class="app-settings-field">
<span>Release date</span>
<input id="book-metadata-release-date" type="text" placeholder="YYYY-MM-DD" />
</label>
</div>
<div class="metadata-editor-grid">
<label class="app-settings-field">
<span>Language</span>
<input id="book-metadata-language" type="text" maxlength="32" placeholder="ja" />
</label>
<label class="app-settings-field">
<span>ASIN</span>
<input id="book-metadata-asin" type="text" maxlength="32" />
</label>
</div>
<label class="app-settings-field">
<span>URL</span>
<input id="book-metadata-url" type="url" maxlength="500" />
</label>
<label class="app-settings-field">
<span>Cover URL</span>
<input id="book-metadata-cover-url" type="url" maxlength="500" />
</label>
<section class="metadata-import-block">
<div class="metadata-import-header">
<h3>Import JSON</h3>
<button
id="book-metadata-import-apply"
class="app-settings-secondary"
type="button"
>
Apply JSON
</button>
</div>
<p class="metadata-import-help">
Missing keys keep the current value. <code>null</code> clears that field.
</p>
<details class="metadata-import-details">
<summary>Show JSON example</summary>
<pre id="book-metadata-import-example" class="metadata-import-example"></pre>
</details>
<label class="app-settings-field">
<span>JSON patch</span>
<textarea id="book-metadata-import" rows="8"></textarea>
</label>
</section>
<p id="book-metadata-status" class="app-settings-status" hidden></p>
<div class="metadata-editor-danger-zone">
<button id="book-metadata-delete" class="app-settings-danger" type="button">
<i class="fa-solid fa-trash-can" aria-hidden="true"></i>
<span>Clear metadata</span>
</button>
</div>
</div>
<div class="app-settings-actions">
<button id="book-metadata-cancel" class="app-settings-secondary" type="button">
Cancel
</button>
<button id="book-metadata-save" class="app-settings-primary" type="button">
Save and close
</button>
</div>
</section>
</div>
</main>
</body>
</html>