/
annotReader.html
71 lines (69 loc) · 2.69 KB
/
annotReader.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
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Annot Reader</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto&display=swap">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.7.0/dropzone.min.css" />
<style media="screen">
html, body {height: 100%;padding: 0;margin:0;}
.center {text-align: center;}
.dz-clickable{width: 100%; height: 10em; border : 3px dashed #9b4dca;}
.dz-success-mark, .dz-error-mark, #results {display: none;}
#up{display: flex; align-items: center; justify-content: center;}
body {display: flex;flex-direction: column;}
.content {flex: 1 0 auto;}
footer{background: #F5F5FF;padding: 10px; flex-shrink: 0;}
</style>
</head>
<body>
<div class="content">
<div class="center container">
<h1>Annot Reader</h1>
<p><strong>Annot Reader</strong> is a small tool to extract annotation from your Kobo / Kindle or another eReader. Just drop your <em>.annot</em> file into the area below, & <strong>Annot Reader</strong> extract and display them.</p>
<form id="up" action="" method="">
<div class="dz-message">Drop your <code>.annot</code> file here.</div>
<div class="fallback">
<input name="file" type="file" />
</div>
</form>
</div>
<hr>
<div id="results" class="container">
<h2>Results :</h2>
<div id="export"></div>
</div>
</div>
<footer>
<div class="container"><a target="_blank" href="">Annot Reader</a> - Made with love by <a target="_blank" href="https://florent-kosmala.fr">Florent Kosmala</a> on an original idea from <a target="_blank" href="https://www.bejiines.fr/">Bejiines</a></div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.7.0/dropzone.min.js"></script>
<script>
$(function() {
Dropzone.autoDiscover = false;
annotDrop = $("#up").dropzone({
autoProcessQueue: false,
url : "#",
accept: function(file, done) {
$('.dz-preview').empty();
$('#export').empty();
var reader = new FileReader();
reader.addEventListener("loadend", function(event) {
result = event.target.result;
xmlDoc = $.parseXML(result);
$xml = $(xmlDoc);
$('#results').show();
$($xml).find('text').each(function(){
$('#export').append('<p>'+$(this).text()+'</p>')
});
});
reader.readAsText(file);
}
});
});
</script>
</body>
</html>