forked from mpetroff/pannellum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.htm
84 lines (82 loc) · 3.33 KB
/
configuration.htm
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
<!DOCTYPE HTML>
<html>
<head>
<title>Pannellum Embed Configuration</title>
<meta charset="utf-8">
<link type="text/css" rel="Stylesheet" href="css/pannellum.css" />
<script>
function processForm (form)
{
var id = 'pannellum_' + randomString();
var embed_code = document.getElementById('embed_code');
embed_code.innerHTML = '<iframe title="pannellum panorama viewer"' +
' width="' + escape(form.embed_width.value) +
'" height="' + escape(form.embed_height.value) +
'" webkitAllowFullScreen mozallowfullscreen allowFullScreen' +
' style="border-style:none;"' +
' id="' + escape(id) +
'" src="' + escape(form.pannellum_url.value) +
'?' +
'panorama=' + escape(form.pano_url.value);
if(form.use_logo.checked) {
embed_code.innerHTML += '&amp;logo=yes';
}
if(form.pano_title.value != '') {
embed_code.innerHTML += '&amp;title=' + escape(form.pano_title.value);
}
if(form.pano_author.value != '') {
embed_code.innerHTML += '&amp;author=' + escape(form.pano_author.value);
}
if(form.autoload.checked) {
embed_code.innerHTML += '&amp;autoload=yes';
}
if(form.license.value > -1) {
embed_code.innerHTML += '&amp;license=' + escape(form.license.value);
}
if(form.fallback_url.value != '') {
embed_code.innerHTML += '&amp;fallback=' + escape(form.fallback_url.value);
}
embed_code.innerHTML += '"></iframe>';
return false;
}
function randomString()
{
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var randomstring = '';
for (var i=0;i<10;i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
return randomstring;
}
</script>
</head>
<body>
<form name="embed_gen_form" onsubmit="return processForm(embed_gen_form); return false;">
Pannellum Location:<br>
<input name="pannellum_url" placeholder="pannellum.htm Location" required><p>
Panorama URL:<br>
<input name="pano_url" placeholder="Image File" required><p>
Basic Information:<br>
<input name="pano_title" placeholder="Title"> <input name="pano_author" placeholder="Author"><p>
Embed Size:<br>
<input name="embed_width" type="number" min="200" placeholder="Width" required> <input name="embed_height" type="number" min="150" placeholder="Height" required><p>
Include Pannellum Logo: <input name="use_logo" type="checkbox"><p>
Auto Load: <input name="autoload" type="checkbox"><p>
Creative Commons License:
<select name="license">
<option value="-1">None</option>
<option value="0">CC BY 3.0</option>
<option value="1">CC BY-SA 3.0</option>
<option value="2">CC BY-ND 3.0</option>
<option value="3">CC BY-NC 3.0</option>
<option value="4">CC BY-NC-SA 3.0</option>
<option value="5">CC BY-NC-ND 3.0</option>
</select><p>
URL to fall back to if WebGL is not supported:<br>
<input name="fallback_url" placeholder="Fallback URL"><p>
<input type="submit" value="Generate" onclick="document.getElementById('embed_code').innerHTML = ''"><p>
</form>
<textarea id="embed_code" style="resize: none; height:200px;" onclick="this.select()" cols="100" readonly></textarea>
</body>
</html>