-
Notifications
You must be signed in to change notification settings - Fork 1
/
index-meta.html
61 lines (54 loc) · 2.17 KB
/
index-meta.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
<!doctype html>
<html lang="en">
<head>
<title>Chopin Etude</title>
<meta charset="utf-8">
<meta name="description" content="My project">
<meta name="author" content="Me">
<link rel="stylesheet" href="css/style.css" media="all" />
<script src="js/verovio-toolkit.js"></script>
<script src="js/utils.js"></script>
</head>
<body>
<div id="content">
<!-- ADD YOUR HTML CONTENT HERE! -->
<h1>My project</h1>
<h2>Metadata</h2>
<p>Clara Schuman, “Sie lieben sich beide”, Op. 13, No. 2</p>
<p id="meta"></p>
</div>
<!-- **** DO NO EDIT BELOW THIS LINE **** -->
<!-- * **** **** **** **** **** **** **** -->
<div id="controls">
<button id="prev"> < </button>
<button id="next"> > </button>
</div>
<div id="score">
<!-- THIS IS WHERE THE SCORE GOES AUTOMATICALLY -->
</div>
<!-- THIS CALLS THE SCRIPT THAT GETS THE MEI SCORE -->
<script src="js/Sie_liebten.js"></script>
<script>
var xhr = new XMLHttpRequest()
xhr.open('GET', 'data/Sie_liebten.mei') // <-- change this to the right file
xhr.send(null)
/* Deal with the response */
xhr.onreadystatechange = function () {
var DONE = 4
var OK = 200
if (xhr.readyState === DONE) {
if (xhr.status === OK) {
var parser = new DOMParser()
var meiDoc = parser.parseFromString(xhr.responseText,"text/xml")
/* If your element has an authURI attribute, copy the folloiwng line, being sure to replace the "MY-XML-ID" with your element's actual xml:id.
document.querySelector("#meta").innerHTML += "<a href=\"" + meiDoc.querySelector("[*|id='MY-XML-ID']").getAttribute('authURI') +"\"><p>" + meiDoc.querySelector("[*|id='MY-XML-ID']").textContent + "</p></a>"
*/
/* If your element does not have an authURI attribute, copy the following line, being sure to replace the "MY-XML-ID" with your element's actual xml:id.
document.querySelector("#meta").innerHTML += "<p>" + meiDoc.querySelector("[*|id='m-8']").textContent + "</p>"
*/
}
}
}
</script>
</body>
</html>