-
Notifications
You must be signed in to change notification settings - Fork 1
/
chopin.html
62 lines (55 loc) · 2.22 KB
/
chopin.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
<!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>Chopin Etude</h1>
<div align="right"><a href="index.html">Home</a></div>
<h2>Metadata</h2>
<p>Frédéric Chopin, “Etude in F Minor”, Op. 10, No. 9</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/chopin.js"></script>
<script>
var xhr = new XMLHttpRequest()
xhr.open('GET', 'data/example.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>