-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgview_template.html
More file actions
42 lines (38 loc) · 1.24 KB
/
gview_template.html
File metadata and controls
42 lines (38 loc) · 1.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
<html>
<script>
var totalLayers = %%TOTAL_LAYERS%%;
var currentLayer = 1;
var file_prefix = "%%FILE_PREFIX%%";
function change_layer(inc) {
if ( currentLayer + inc < totalLayers + 1 && currentLayer + inc > 0 )
currentLayer += inc;
document.getElementById('current_layer').value=currentLayer;
var content = document.getElementById('content');
var newFilePath = file_prefix + currentLayer + ".svg";
var embed = document.createElement('embed');
embed.setAttribute('width', "100%");
embed.setAttribute('height', "100%");
embed.setAttribute('src', newFilePath);
while ( content.childNodes.length >= 1 )
{
content.removeChild( content.firstChild );
}
content.appendChild(embed);
}
</script>
<body bgcolor="#C0C0C0" onload="change_layer(0);">
<table width="100%" height="100%" bgcolor="#C0C0C0">
<tr>
<td align="center">
<a href="#"><<</a> <a href="#" onclick="change_layer(-1);"><</a> Current Layer: <input type="text" id="current_layer" name="current_layer" value="1" size="3"> <a href="#" onclick="change_layer(1);">></a> <a href="#">>></a>
</td>
</tr>
<tr height="100%">
<td>
<div STYLE="height:100%" id="content">
</div>
</td>
</tr>
</table>
</body>
</html>