Repository navigation
Expand file tree
/
Copy pathrender.html
More file actions
96 lines (86 loc) · 2.24 KB
/
Copy pathrender.html
File metadata and controls
96 lines (86 loc) · 2.24 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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html>
<head>
<title>Embeded Groove</title>
<script src="./js/abc2svg-1.js"></script>
<script src="./js/groove_utils.js"></script>
<script defer id="mainScript" src="./js/groove_display.js"></script>
<!-- <script defer id="mainScript" src="./js/groove_display_utils.min.js"></script> -->
<script>
function parseQuery(queryString) {
var query = {};
var pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&');
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i].split('=');
query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || '');
}
return query;
}
mainScript.addEventListener('load', function () {
var grooveDisplay = null;
if (typeof e !== 'undefined') {
// Refer to GrooveDisplay as e with minified JS.
grooveDisplay = e;
} else {
grooveDisplay = GrooveDisplay;
}
GrooveDisplay.AddGrooveDisplayToElementId(location.search, /* linkToEditor= */ true);
const textE = document.getElementById("subText");
const text = parseQuery(window.location.search).subText;
const tempoTimeSigE = document.getElementById("tempoTimeSig");
const embedTempoTimeSig = parseQuery(window.location.search).EmbedTempoTimeSig;
if (text === undefined && embedTempoTimeSig === undefined) {
document.getElementById("topDiv").remove();
} else if (text !== undefined) {
textE.innerText = text;
textE.style.float = 'left';
tempoTimeSigE.style.float = 'right';
// TempoTimeSig element content is set from groove_display.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 id="topDiv">
<span id="subText"></span>
<span id="tempoTimeSig"></span>
</div>
<!-- groove displays here -->
<div id="GrooveDisplayId">
<div class="Printable">
<div id="svgTarget" class="svgTarget"></div>
</div>
</div>
</body>
</html>