-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPreview.html
89 lines (85 loc) · 2.43 KB
/
Preview.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ticha-magic Preview</title>
<style>
html {
width: 100%;
height: 100%;
}
body {
height: auto;
font-family: "Open Sans", sans-serif;
}
iframe {
width: 700px;
height: 85vh;
border: 2px #ac2a13 solid;
}
header {
margin-bottom: .5em;
}
main {
display: grid;
column-gap: 15px;
row-gap: 0px;
flex-wrap: wrap;
}
section.page {
grid-column-start: 1;
grid-column-end: 2;
}
section.explainer {
min-width: 250px;
grid-column-start: 2;
grid-column-end: 3;
}
@media (max-width: 977px) {
section.page {
grid-column-start: 1;
grid-column-end: 3;
}
section.explainer {
min-width: unset;
grid-column-start: 1;
grid-column-end: 3;
}
iframe {
width: calc(100% - 8px);
height: 68vh;
}
}
</style>
</head>
<body>
<h1>ticha-magic output Preview</h1>
<header>
<input type="radio" id="orig" name="page" value="previews/orig_preview.html" checked="checked">
<label for="orig">Original transcription</label>
<input type="radio" id="reg" name="page" value="previews/reg_preview.html">
<label for="reg">Regularized transcription</label>
<input type="radio" id="outline" name="page" value="previews/outline_preview.html">
<label for="outline">Outline</label>
</header>
<main>
<section class="page">
<iframe id="page-frame" src="previews/orig_preview.html">
<p>Make sure iframes are supported in your browser</p>
</iframe>
</section>
<section class="explainer">
<p>Showing previews of the last output from <code>tei_to_html.py</code>. Use the buttons above to choose which output file to preview</p>
<p>If the preview shows "File not found", make sure you've successfully run <code>tei_to_html.py</code> on a document.</p>
</main>
<script>
var radios = document.querySelectorAll('input[type=radio][name="page"]')
for (const radio of radios) {
radio.addEventListener('change', () => updateShown(radio.value))
}
function updateShown(page) {
document.getElementById('page-frame').src = page
}
</script>
</body>
</html>