-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
36 lines (34 loc) · 1.37 KB
/
index.html
File metadata and controls
36 lines (34 loc) · 1.37 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
<!DOCTYPE html>
<html lang="fr" dir="ltr" style="font-family: sans-serif; height: 100vh; width: 100vw;">
<head>
<meta charset="utf-8"/>
<title>JsGEDCOM</title>
<meta content="ie=edge" http-equiv="x-ua-compatible"/>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="initial-scale=1" name="viewport"/>
<meta name="description" content="TODO">
</head>
<body style="align-items: center; display: flex; height: 100vh; justify-content: center; margin: 0; width: 100vw;">
<div style="background-color: rgba(0, 0, 0, .1); border-radius: 6pt; padding: 24px; text-align: center;">
<h1 style="margin: 0; margin-bottom: 24px;">JsGEDCOM</h1>
<input type="file" id="file-input">
<button id="export-gedcom">Exporter</button>
</div>
<script type="text/javascript" src="./dist/JsGEDCOM.bundle.js"></script>
<script type="text/javascript">
window.GEDCOM = new JsGEDCOM();
document.getElementById('file-input').addEventListener('change', e => {
const reader = new FileReader();
reader.onload = () => {
GEDCOM.loadGedcom(reader.result);
};
if (e.target.files[0]) {
reader.readAsText(e.target.files[0], 'windows-1252'); // Special char proper encoding
}
});
document.getElementById('export-gedcom').addEventListener('click', () => {
GEDCOM.exportGedcom();
})
</script>
</body>
</html>