You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configuration.htm 6.5 KiB

13 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Pannellum Embed Configuration</title>
  5. <meta charset="utf-8">
  6. <link type="text/css" rel="Stylesheet" href="css/pannellum.css" />
  7. <script>
  8. function processForm (form)
  9. {
  10. var id = 'pannellum_' + randomString();
  11. var embed_code = document.getElementById('embed_code');
  12. embed_code.innerHTML = '<iframe title="pannellum panorama viewer"' +
  13. ' width="' + escape(form.embed_width.value) +
  14. '" height="' + escape(form.embed_height.value) +
  15. '" webkitAllowFullScreen mozallowfullscreen allowFullScreen' +
  16. ' style="border-style:none;"' +
  17. ' id="' + escape(id) +
  18. '" src="' + escape(form.pannellum_url.value) +
  19. '?' +
  20. 'panorama=' + escape(form.pano_url.value);
  21. if(form.use_logo.checked) {
  22. embed_code.innerHTML += '&amp;amp;logo=yes';
  23. }
  24. if(form.pano_title.value != '') {
  25. embed_code.innerHTML += '&amp;amp;title=' + escape(form.pano_title.value);
  26. }
  27. if(form.pano_author.value != '') {
  28. embed_code.innerHTML += '&amp;amp;author=' + escape(form.pano_author.value);
  29. }
  30. if(form.autoload.checked) {
  31. embed_code.innerHTML += '&amp;amp;autoload=yes';
  32. }
  33. if(form.autorotate.value != 'none') {
  34. embed_code.innerHTML += '&amp;amp;autorotate=' + escape(form.autorotate.value);
  35. }
  36. if(form.license.value > -1) {
  37. embed_code.innerHTML += '&amp;amp;license=' + escape(form.license.value);
  38. }
  39. if(form.fallback_url.value != '') {
  40. embed_code.innerHTML += '&amp;amp;fallback=' + escape(form.fallback_url.value);
  41. }
  42. if(form.hfov.value != 0) {
  43. embed_code.innerHTML += '&amp;amp;hfov=' + escape(form.hfov.value);
  44. }
  45. if(form.pitch.value != 0) {
  46. embed_code.innerHTML += '&amp;amp;pitch=' + escape(form.pitch.value);
  47. }
  48. if(form.yaw.value != 0) {
  49. embed_code.innerHTML += '&amp;amp;yaw=' + escape(form.yaw.value);
  50. }
  51. if(form.preview_url.value != '') {
  52. embed_code.innerHTML += '&amp;amp;preview=' + escape(form.preview_url.value);
  53. }
  54. if(form.haov.value != 0) {
  55. embed_code.innerHTML += '&amp;amp;haov=' + escape(form.haov.value);
  56. }
  57. if(form.vaov.value != 0) {
  58. embed_code.innerHTML += '&amp;amp;vaov=' + escape(form.vaov.value);
  59. }
  60. if(form.voffset.value != 0) {
  61. embed_code.innerHTML += '&amp;amp;voffset=' + escape(form.voffset.value);
  62. }
  63. embed_code.innerHTML += '"></iframe>';
  64. return false;
  65. }
  66. function randomString()
  67. {
  68. var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
  69. var randomstring = '';
  70. for (var i=0;i<10;i++) {
  71. var rnum = Math.floor(Math.random() * chars.length);
  72. randomstring += chars.substring(rnum,rnum+1);
  73. }
  74. return randomstring;
  75. }
  76. </script>
  77. </head>
  78. <body>
  79. <form name="embed_gen_form" onsubmit="return processForm(embed_gen_form); return false;">
  80. Pannellum Location:<br>
  81. <input name="pannellum_url" placeholder="pannellum.htm Location" required><p>
  82. Panorama URL:<br>
  83. <input name="pano_url" placeholder="Image File" required><p>
  84. Panorama Preview URL (optional):<br>
  85. <input name="preview_url" placeholder="Image File"><p>
  86. Basic Information:<br>
  87. <input name="pano_title" placeholder="Title"> <input name="pano_author" placeholder="Author"><p>
  88. Partial Panorama (degrees) (optional):<br>
  89. <input name="haov" type="number" min="0" max="360" placeholder="Horizontal Angle of View"> <input name="vaov" type="number" min="0" max="180" placeholder="Vertical Angle of View"> <input name="voffset" type="number" min="-90" max="90" placeholder="Vertical Offset"><p>
  90. Embed Size:<br>
  91. <input name="embed_width" type="number" min="200" placeholder="Width" required> <input name="embed_height" type="number" min="150" placeholder="Height" required><p>
  92. Initial Parameters (degrees) (optional):<br>
  93. <input name="hfov" type="number" min="40" max="100" placeholder="Horizontal Field of View"> <input name="pitch" type="number" min="-85" max="85" placeholder="Pitch"> <input name="yaw" type="number" min="-180" max="180" placeholder="Yaw"><p>
  94. Include Pannellum Logo: <input name="use_logo" type="checkbox"><p>
  95. Auto Load: <input name="autoload" type="checkbox"><p>
  96. Auto Rotate:
  97. <select name="autorotate">
  98. <option value="none">None</option>
  99. <option value="cw">CW</option>
  100. <option value="ccw">CCW</option>
  101. </select><p>
  102. Creative Commons License:
  103. <select name="license">
  104. <option value="-1">None</option>
  105. <option value="0">CC BY 3.0</option>
  106. <option value="1">CC BY-SA 3.0</option>
  107. <option value="2">CC BY-ND 3.0</option>
  108. <option value="3">CC BY-NC 3.0</option>
  109. <option value="4">CC BY-NC-SA 3.0</option>
  110. <option value="5">CC BY-NC-ND 3.0</option>
  111. </select><p>
  112. URL to fall back to if WebGL is not supported:<br>
  113. <input name="fallback_url" placeholder="Fallback URL"><p>
  114. <input type="submit" value="Generate" onclick="document.getElementById('embed_code').innerHTML = ''"><p>
  115. </form>
  116. <textarea id="embed_code" style="resize: none; height:200px;" onclick="this.select()" cols="100" readonly></textarea>
  117. </body>
  118. </html>