-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_abc.html
79 lines (68 loc) · 1.45 KB
/
test_abc.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
<!DOCTYPE html>
<html>
<head>
<title>Test Render ABC</title>
<script src="./js/abc2svg-1.js"></script>
<script src="./js/groove_utils.js"></script>
<style>
body {
overflow: hidden; /* hide scrollbars */
}
.Printable {
display: block;
}
.nonPrintable {
display: block;
}
.svgTarget {
width: 100%;
display: inline-block;
}
.svgTarget svg {
width: 100%;
height: auto;
}
#tempoTimeSig {
margin-left: 5%;
margin-right: 5%;
float: 'left';
}
#text {
margin-left: 5%;
margin-left: 5%;
}
#topDiv {
width: 100%;
}
</style>
</head>
<body>
<div>
<textarea id="abcNotation" rows="30" cols="150"></textarea>
<br>
<button type="button" id="convertBtn">Render</button>
</div>
<div id="topDiv">
<span id="text"></span>
<span id="tempoTimeSig"></span>
</div>
<!-- groove displays here -->
<div id="GrooveDisplayId">
<div class="Printable">
<div id="svgTarget" class="svgTarget"></div>
</div>
</div>
<script>
function render() {
var abcNotation = document.getElementById("abcNotation").value;
var myGrooveUtils = new GrooveUtils();
var svgTarget = document.getElementById("svgTarget");
// var renderWidth = svgTarget.offsetWidth;
var renderWidth = 600;
var svgReturn = myGrooveUtils.renderABCtoSVG(abcNotation);
svgTarget.innerHTML = svgReturn.svg;
}
document.getElementById("convertBtn").addEventListener("click", render);
</script>
</body>
</html>