-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
220 lines (183 loc) · 9.89 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
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<style>
@font-face {
font-family: "Antinoou";
src: url("./fonts/Antinoou.ttf") format("TrueType"),
url("./fonts/AntinoouItalic.ttf") format("TrueType");
}
.coptic{
font-family: Antinoou, "Times New Roman", Times, serif;
}
</style>
<title>Query PAThs colophons</title>
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1>Query PAThs colophons</h1>
<span class="text-secondary">A visual tool to easily query texts form
Coptic colophons published on
<a href="https://github.com/paths-erc/coptic-texts/tree/master/colophons" target="_blank">
PAThs' official repository on GitHub</a>.
</span>
<hr>
</div>
<div id="msg"></div>
<form style="display:none" id="form">
<hr>
<div class="form-row align-items-center">
<div class="col-auto">
<strong>Search for:</strong>
</div>
<div class="col">
<!-- <input type="text" class="form-control mb-2" placeholder="xpath" id="xpath" value="//p:placeName"> -->
<select class="form-control mb-2" id="xpath">
<option value="//p:placeName">placeName</option>
<optgroup label="Place types">
<option value="//p:placeName[@type='country']">placeName, type: country</option>
<option value="//p:placeName[@type='region']">placeName, type: region</option>
<option value="//p:placeName[@type='district_nomos']">placeName, type: district_nomos</option>
<option value="//p:placeName[@type='city_village']">placeName, type: city_village</option>
<option value="//p:placeName[@type='topos_ma']">placeName, type: topos_ma</option>
<option value="//p:placeName[@type='monastery']">placeName, type: monastery</option>
<option value="//p:placeName[@type='church_basilica']">placeName, type: church_basilica</option>
<option value="//p:placeName[@type='episkopeion']">placeName, type: episkopeion</option>
<option value="//p:placeName[@type='chapel']">placeName, type: chapel</option>
<option value="//p:placeName[@type='oratory']">placeName, type: oratory</option>
<option value="//p:placeName[@type='martyr_shrine']">placeName, type: martyr_shrine</option>
<option value="//p:placeName[@type='temple']">placeName, type: temple</option>
<option value="//p:placeName[@type='hermitage']">placeName, type: hermitage</option>
<option value="//p:placeName[@type='tomb']">placeName, type: tomb</option>
<option value="//p:placeName[@type='mount']">placeName, type: mount</option>
<option value="//p:placeName[@type='river']">placeName, type: river</option>
<option value="//p:placeName[@type='lake']">placeName, type: lake</option>
<option value="//p:placeName[@type='harbour']">placeName, type: harbour</option>
<option value="//p:placeName[@type='biblical']">placeName, type: biblical</option>
</optgroup>
<option value="//p:persName">persName</option>
<optgroup label="Person types">
<option value="//p:persName[@type='saint']">persName, type: saint</option>
<option value="//p:persName[@type='martyr']">persName, type: martyr</option>
<option value="//p:persName[@type='apostle']">persName, type: apostle</option>
<option value="//p:persName[@type='bishop']">persName, type: bishop</option>
<option value="//p:persName[@type='archi_bishop']">persName, type: archi_bishop</option>
<option value="//p:persName[@type='monk']">persName, type: monk</option>
<option value="//p:persName[@type='arch_angel']">persName, type: arch_angel</option>
<option value="//p:persName[@type='daemon']">persName, type: daemon</option>
<option value="//p:persName[@type='emperor_king']">persName, type: emperor_king</option>
<option value="//p:persName[@type='civil']">persName, type: civil</option>
<option value="//p:persName[@type='military']">persName, type: military</option>
<option value="//p:persName[@type='ecclesiastical']">persName, type: ecclesiastical</option>
<option value="//p:persName[@type='biblical']">persName, type: biblical</option>
<option value="//p:persName[@type='pagan_deity']">persName, type: pagan_deity</option>
<option value="//p:persName[@type='donor']">persName, type: donor</option>
<option value="//p:persName[@type='copyist']">persName, type: copyist</option>
<option value="//p:persName[@type='restorer']">persName, type: restorer</option>
</optgroup>
<option value="//p:roleName">roleName</option>
<optgroup label="Role types">
<option value="//p:roleName[@type='religious']">roleName, type: religious</option>
<option value="//p:roleName[@type='ecclesiastical']">roleName, type: ecclesiastical</option>
<option value="//p:roleName[@type='civil']">roleName, type: civil</option>
<option value="//p:roleName[@type='military']">roleName, type: military</option>
</optgroup>
<option value="//p:org">org</option>
<optgroup label="Organization types">
<option value="//p:org[@type='religious']">org, type: religious</option>
<option value="//p:org[@type='ethnic']">org, type: ethnic</option>
</optgroup>
<option value="//p:quote">org</option>
<optgroup label="Quote types">
<option value="//p:quote[@type='religious']">biblical, type: religious</option>
<option value="//p:quote[@type='ethnic']">classical, type: ethnic</option>
</optgroup>
<option value="//p:rs">org</option>
<optgroup label="Quote types">
<option value="//p:rs[@type='object']">rs, type: object</option>
<option value="//p:rs[@type='furniture']">rs, type: furniture</option>
<option value="//p:rs[@type='service']">rs, type: service</option>
</optgroup>
</select>
</div>
<div class="col-auto">
<button type="submit" class="btn btn-primary mb-2">Submit</button>
</div>
</div>
<hr>
</form>
<div id="text" class="bg-light p-5"></div>
<div class="my-5">
<h2>How to cite</h2>
<p>This software is archived in Zenodo. Please cite it by referring the DOI:<br />
<a href="https://zenodo.org/badge/latestdoi/158960513"><img src="https://zenodo.org/badge/158960513.svg" alt="DOI"></a></p>
</div>
<div class="footer mt-5 border-top py-5 bg-light">
<div class="text-center">
Copyright (c) 2018 Julian Bogdani, <a href="http://paths.uniroma1.it" target="_blank">PAThs</a>
<br>
<a href="https://github.com/paths-erc/queryColophons/blob/master/LICENSE" target="_blank">
MIT License
</a>
<br>
Archived in Zenodo <a href="https://zenodo.org/badge/latestdoi/158960513"><img src="https://zenodo.org/badge/158960513.svg" alt="DOI"></a>
<p>
<a href="https://github.com/paths-erc/queryColophons/issues" target="_blank">
Report issues with this page
</a>
|
<a href="https://github.com/paths-erc/coptic-texts/issues" target="_blank">
Report issues with colophons’ texts
</a>
|
<a href="https://github.com/paths-erc/queryColophons" target="_blank">
View on GitHub
</a>
</p>
</div>
</div>
</div>
<script type="text/javascript" src="./queryColophons.js"></script>
<script type="text/javascript">
let d = [];
function paginateQuery(d, xpath){
if (d.length < 1){
document.getElementById('msg').innerHTML = 'No data to query';
return false;
} else {
html = RunQuery(d, xpath);
}
if(html.length < 10){
document.getElementById('text').innerHTML = `Sorry! No result found for <code>${xpath}</code>`;
} else {
document.getElementById('text').innerHTML = html;
}
}
document.getElementById('form').addEventListener('submit', (e)=>{
e.preventDefault();
const xpath = document.getElementById('xpath').value;
history.replaceState(null,null, window.location.pathname + `?xpath=${encodeURI(xpath)}`)
paginateQuery(d, xpath);
});
getAllColophons(() => {
document.getElementById('msg').innerHTML = '<div class="bg-warning p-3 text-white">Loading colophons from GitHub...</div>';
}).then(
array => {
document.getElementById('msg').innerHTML = `<div class="bg-success p-3 text-white"><big>✓</big> ${array.length} colophons loaded. Ready to start</div>`;
d = array;
let qs = document.location.search;
if(qs){
paginateQuery(d, decodeURI(qs.replace('?xpath=', '')));
}
document.getElementById('form').style.display = "block"
}
);
</script>
</body>
</html>