WP VR – 360 Panorama and virtual tour creator for WordPress - Version 3.4.3

Version Description

  • Autorotation error fix
  • Ziparchive class error fix

=

Download this release

Release Info

Developer rextheme
Plugin Icon 128x128 WP VR – 360 Panorama and virtual tour creator for WordPress
Version 3.4.3
Comparing to
See all releases

Code changes from version 3.4.2 to 3.4.3

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://rextheme.com/wp-vr-360-panorama-and-virtual-tour-creator-fo
4
  Tags: virtual tour, real estate tour, panorama, panorama viewer, virtual tour, 360 panorama, interactive tour
5
  Requires at least: 4.0
6
  Tested up to: 5.2
7
- Stable tag: 3.4.2
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -271,5 +271,9 @@ Simply add "/plugins/wpvr" to exclusion field (or use the location where you sto
271
  * Gallery carousal design fix
272
  * Css and js restricted
273
 
 
 
 
 
274
  == Upgrade Notice ==
275
  Please do update the WP VR to the latest version. Each update makes it sure your plugin is supporting all tour features.  
4
  Tags: virtual tour, real estate tour, panorama, panorama viewer, virtual tour, 360 panorama, interactive tour
5
  Requires at least: 4.0
6
  Tested up to: 5.2
7
+ Stable tag: 3.4.3
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
271
  * Gallery carousal design fix
272
  * Css and js restricted
273
 
274
+ = 3.4.3 =
275
+ * Autorotation error fix
276
+ * Ziparchive class error fix
277
+
278
  == Upgrade Notice ==
279
  Please do update the WP VR to the latest version. Each update makes it sure your plugin is supporting all tour features.  
admin/class-wpvr-ajax.php CHANGED
@@ -62,6 +62,11 @@ class Wpvr_Ajax {
62
  $autorotationstopdelay = '';
63
  $autorotationstopdelay = sanitize_text_field($_POST['autorotationstopdelay']);
64
 
 
 
 
 
 
65
  $scene_fade_duration = '';
66
  $scene_fade_duration = sanitize_text_field($_POST['scenefadeduration']);
67
 
@@ -677,6 +682,11 @@ class Wpvr_Ajax {
677
  $autorotationstopdelay = '';
678
  $autorotationstopdelay = sanitize_text_field($_POST['autorotationstopdelay']);
679
 
 
 
 
 
 
680
  $scene_fade_duration = '';
681
  $scene_fade_duration = $_POST['scenefadeduration'];
682
 
@@ -972,7 +982,7 @@ class Wpvr_Ajax {
972
  $fileurl = $_POST['fileurl'];
973
  $attachment_id = $_POST['data_id'];
974
  $zip_file_path = get_attached_file( $attachment_id );
975
- $unzipfile = unzip_file($zip_file_path,$file_save_url['basedir'].'/wpvr/temp/');
976
 
977
  if ( is_wp_error( $unzipfile ) ) {
978
  wpvr_delete_temp_file();
@@ -1024,7 +1034,7 @@ class Wpvr_Ajax {
1024
  if ($new_data['panodata']) {
1025
 
1026
  if ($new_data['panodata']["scene-list"]) {
1027
-
1028
  foreach ($new_data['panodata']["scene-list"] as $key => $panoscenes) {
1029
  if ($panoscenes["scene-attachment-url"]) {
1030
  $scene_id = $panoscenes['scene-id'];
62
  $autorotationstopdelay = '';
63
  $autorotationstopdelay = sanitize_text_field($_POST['autorotationstopdelay']);
64
 
65
+ if (!empty($autorotationinactivedelay) && !empty($autorotationstopdelay)) {
66
+ wp_send_json_error('<p><span>Warning:</span> You can not apply both autorotation pause or stop delay. Please choose either autorotation inactive delay or autorotation stop delay</p>');
67
+ die();
68
+ }
69
+
70
  $scene_fade_duration = '';
71
  $scene_fade_duration = sanitize_text_field($_POST['scenefadeduration']);
72
 
682
  $autorotationstopdelay = '';
683
  $autorotationstopdelay = sanitize_text_field($_POST['autorotationstopdelay']);
684
 
685
+ if (!empty($autorotationinactivedelay) && !empty($autorotationstopdelay)) {
686
+ wp_send_json_error('<p><span>Warning:</span> You can not apply both autorotation pause or stop delay. Please choose either autorotation inactive delay or autorotation stop delay</p>');
687
+ die();
688
+ }
689
+
690
  $scene_fade_duration = '';
691
  $scene_fade_duration = $_POST['scenefadeduration'];
692
 
982
  $fileurl = $_POST['fileurl'];
983
  $attachment_id = $_POST['data_id'];
984
  $zip_file_path = get_attached_file( $attachment_id );
985
+ $unzipfile = unzip_file($zip_file_path,$file_save_url['basedir'].'/wpvr/temp/');
986
 
987
  if ( is_wp_error( $unzipfile ) ) {
988
  wpvr_delete_temp_file();
1034
  if ($new_data['panodata']) {
1035
 
1036
  if ($new_data['panodata']["scene-list"]) {
1037
+
1038
  foreach ($new_data['panodata']["scene-list"] as $key => $panoscenes) {
1039
  if ($panoscenes["scene-attachment-url"]) {
1040
  $scene_id = $panoscenes['scene-id'];
admin/css/owl.carousel.css CHANGED
File without changes
admin/css/owl.theme.default.css CHANGED
File without changes
admin/js/owl.carousel.js CHANGED
File without changes
admin/lib/pannellum/src/js/pannellum.js CHANGED
@@ -1,17 +1,17 @@
1
  /*
2
  * Pannellum - An HTML5 based Panorama Viewer
3
  * Copyright (c) 2011-2018 Matthew Petroff
4
- *
5
  * Permission is hereby granted, free of charge, to any person obtaining a copy
6
  * of this software and associated documentation files (the "Software"), to deal
7
  * in the Software without restriction, including without limitation the rights
8
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
  * copies of the Software, and to permit persons to whom the Software is
10
  * furnished to do so, subject to the following conditions:
11
- *
12
  * The above copyright notice and this permission notice shall be included in
13
  * all copies or substantial portions of the Software.
14
- *
15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -304,7 +304,7 @@ function init() {
304
  origPitch = config.pitch;
305
 
306
  var i, p;
307
-
308
  if (config.type == 'cubemap') {
309
  panoImage = [];
310
  for (i = 0; i < 6; i++) {
@@ -342,21 +342,21 @@ function init() {
342
  if (config.type == 'cubemap') {
343
  // Quick loading counter for synchronous loading
344
  var itemsToLoad = 6;
345
-
346
  var onLoad = function() {
347
  itemsToLoad--;
348
  if (itemsToLoad === 0) {
349
  onImageLoad();
350
  }
351
  };
352
-
353
  var onError = function(e) {
354
  var a = document.createElement('a');
355
  a.href = e.target.src;
356
  a.innerHTML = a.href;
357
  anError(config.strings.fileAccessError.replace('%s', a.outerHTML));
358
  };
359
-
360
  for (i = 0; i < panoImage.length; i++) {
361
  panoImage[i].onload = onLoad;
362
  panoImage[i].onerror = onError;
@@ -373,16 +373,16 @@ function init() {
373
  if (config.basePath) {
374
  p = config.basePath;
375
  }
376
-
377
  if (config.dynamic !== true) {
378
  // Still image
379
  p = absoluteURL(config.panorama) ? config.panorama : p + config.panorama;
380
-
381
  panoImage.onload = function() {
382
  window.URL.revokeObjectURL(this.src); // Clean up
383
  onImageLoad();
384
  };
385
-
386
  var xhr = new XMLHttpRequest();
387
  xhr.onloadend = function() {
388
  if (xhr.status != 200) {
@@ -434,7 +434,7 @@ function init() {
434
  xhr.send();
435
  }
436
  }
437
-
438
  if (config.draggable)
439
  uiContainer.classList.add('pnlm-grab');
440
  uiContainer.classList.remove('pnlm-grabbing');
@@ -523,7 +523,7 @@ function parseGPanoXMP(image) {
523
  var start = img.indexOf('<x:xmpmeta');
524
  if (start > -1 && config.ignoreGPanoXMP !== true) {
525
  var xmpData = img.substring(start, img.indexOf('</x:xmpmeta>') + 12);
526
-
527
  // Extract the requested tag from the XMP data
528
  var getTag = function(tag) {
529
  var result;
@@ -539,7 +539,7 @@ function parseGPanoXMP(image) {
539
  }
540
  return null;
541
  };
542
-
543
  // Relevant XMP data
544
  var xmp = {
545
  fullWidth: getTag('GPano:FullPanoWidthPixels'),
@@ -551,11 +551,11 @@ function parseGPanoXMP(image) {
551
  horizonPitch: getTag('GPano:PosePitchDegrees'),
552
  horizonRoll: getTag('GPano:PoseRollDegrees')
553
  };
554
-
555
  if (xmp.fullWidth !== null && xmp.croppedWidth !== null &&
556
  xmp.fullHeight !== null && xmp.croppedHeight !== null &&
557
  xmp.topPixels !== null) {
558
-
559
  // Set up viewer using GPano XMP data
560
  if (specifiedPhotoSphereExcludes.indexOf('haov') < 0)
561
  config.haov = xmp.croppedWidth / xmp.fullWidth * 360;
@@ -576,11 +576,11 @@ function parseGPanoXMP(image) {
576
  if (specifiedPhotoSphereExcludes.indexOf('horizonRoll') < 0)
577
  config.horizonRoll = xmp.horizonRoll;
578
  }
579
-
580
  // TODO: add support for initial view settings
581
  }
582
  }
583
-
584
  // Load panorama
585
  panoImage.src = window.URL.createObjectURL(image);
586
  });
@@ -664,12 +664,12 @@ function onDocumentMouseDown(event) {
664
  event.preventDefault();
665
  // But not all of it
666
  container.focus();
667
-
668
  // Only do something if the panorama is loaded
669
  if (!loaded || !config.draggable) {
670
  return;
671
  }
672
-
673
  // Calculate mouse position relative to top left of viewer container
674
  var pos = mousePosition(event);
675
 
@@ -693,16 +693,16 @@ function onDocumentMouseDown(event) {
693
 
694
  isUserInteracting = true;
695
  latestInteraction = Date.now();
696
-
697
  onPointerDownPointerX = pos.x;
698
  onPointerDownPointerY = pos.y;
699
-
700
  onPointerDownYaw = config.yaw;
701
  onPointerDownPitch = config.pitch;
702
-
703
  uiContainer.classList.add('pnlm-grabbing');
704
  uiContainer.classList.remove('pnlm-grab');
705
-
706
  fireEvent('mousedown', event);
707
  animateInit();
708
  }
@@ -764,9 +764,9 @@ function onDocumentMouseMove(event) {
764
  var yaw = ((Math.atan(onPointerDownPointerX / canvasWidth * 2 - 1) - Math.atan(pos.x / canvasWidth * 2 - 1)) * 180 / Math.PI * config.hfov / 90) + onPointerDownYaw;
765
  speed.yaw = (yaw - config.yaw) % 360 * 0.2;
766
  config.yaw = yaw;
767
-
768
  var vfov = 2 * Math.atan(Math.tan(config.hfov/360*Math.PI) * canvasHeight / canvasWidth) * 180 / Math.PI;
769
-
770
  var pitch = ((Math.atan(pos.y / canvasHeight * 2 - 1) - Math.atan(onPointerDownPointerY / canvasHeight * 2 - 1)) * 180 / Math.PI * vfov / 90) + onPointerDownPitch;
771
  speed.pitch = (pitch - config.pitch) * 0.2;
772
  config.pitch = pitch;
@@ -819,7 +819,7 @@ function onDocumentTouchStart(event) {
819
 
820
  onPointerDownPointerX = pos0.x;
821
  onPointerDownPointerY = pos0.y;
822
-
823
  if (event.targetTouches.length == 2) {
824
  // Down pointer is the center of the two fingers
825
  var pos1 = mousePosition(event.targetTouches[1]);
@@ -830,7 +830,7 @@ function onDocumentTouchStart(event) {
830
  }
831
  isUserInteracting = true;
832
  latestInteraction = Date.now();
833
-
834
  onPointerDownYaw = config.yaw;
835
  onPointerDownPitch = config.pitch;
836
 
@@ -858,7 +858,7 @@ function onDocumentTouchMove(event) {
858
  var pos0 = mousePosition(event.targetTouches[0]);
859
  var clientX = pos0.x;
860
  var clientY = pos0.y;
861
-
862
  if (event.targetTouches.length == 2 && onPointerDownPointerDist != -1) {
863
  var pos1 = mousePosition(event.targetTouches[1]);
864
  clientX += (pos1.x - pos0.x) * 0.5;
@@ -993,7 +993,7 @@ function onDocumentMouseWheel(event) {
993
  setHfov(config.hfov + event.detail * 1.5);
994
  speed.hfov = event.detail > 0 ? 1 : -1;
995
  }
996
-
997
  animateInit();
998
  }
999
 
@@ -1017,7 +1017,7 @@ function onDocumentKeyPress(event) {
1017
  if (usedKeyNumbers.indexOf(keynumber) < 0)
1018
  return
1019
  event.preventDefault();
1020
-
1021
  // If escape key is pressed
1022
  if (keynumber == 27) {
1023
  // If in fullscreen mode
@@ -1048,12 +1048,12 @@ function clearKeys() {
1048
  function onDocumentKeyUp(event) {
1049
  // Record key pressed
1050
  var keynumber = event.which || event.keycode;
1051
-
1052
  // Override default action for keys that are used
1053
  if (usedKeyNumbers.indexOf(keynumber) < 0)
1054
  return
1055
  event.preventDefault();
1056
-
1057
  // Change key
1058
  changeKey(keynumber, false);
1059
  }
@@ -1071,53 +1071,53 @@ function changeKey(keynumber, value) {
1071
  case 109: case 189: case 17: case 173:
1072
  if (keysDown[0] != value) { keyChanged = true; }
1073
  keysDown[0] = value; break;
1074
-
1075
  // If plus key is released
1076
  case 107: case 187: case 16: case 61:
1077
  if (keysDown[1] != value) { keyChanged = true; }
1078
  keysDown[1] = value; break;
1079
-
1080
  // If up arrow is released
1081
  case 38:
1082
  if (keysDown[2] != value) { keyChanged = true; }
1083
  keysDown[2] = value; break;
1084
-
1085
  // If "w" is released
1086
  case 87:
1087
  if (keysDown[6] != value) { keyChanged = true; }
1088
  keysDown[6] = value; break;
1089
-
1090
  // If down arrow is released
1091
  case 40:
1092
  if (keysDown[3] != value) { keyChanged = true; }
1093
  keysDown[3] = value; break;
1094
-
1095
  // If "s" is released
1096
  case 83:
1097
  if (keysDown[7] != value) { keyChanged = true; }
1098
  keysDown[7] = value; break;
1099
-
1100
  // If left arrow is released
1101
  case 37:
1102
  if (keysDown[4] != value) { keyChanged = true; }
1103
  keysDown[4] = value; break;
1104
-
1105
  // If "a" is released
1106
  case 65:
1107
  if (keysDown[8] != value) { keyChanged = true; }
1108
  keysDown[8] = value; break;
1109
-
1110
  // If right arrow is released
1111
  case 39:
1112
  if (keysDown[5] != value) { keyChanged = true; }
1113
  keysDown[5] = value; break;
1114
-
1115
  // If "d" is released
1116
  case 68:
1117
  if (keysDown[9] != value) { keyChanged = true; }
1118
  keysDown[9] = value;
1119
  }
1120
-
1121
  if (keyChanged && value) {
1122
  if (typeof performance !== 'undefined' && performance.now()) {
1123
  prevTime = performance.now();
@@ -1144,7 +1144,7 @@ function keyRepeat() {
1144
  var prevPitch = config.pitch;
1145
  var prevYaw = config.yaw;
1146
  var prevZoom = config.hfov;
1147
-
1148
  var newTime;
1149
  if (typeof performance !== 'undefined' && performance.now()) {
1150
  newTime = performance.now();
@@ -1156,40 +1156,40 @@ function keyRepeat() {
1156
  }
1157
  var diff = (newTime - prevTime) * config.hfov / 1700;
1158
  diff = Math.min(diff, 1.0);
1159
-
1160
  // If minus key is down
1161
  if (keysDown[0] && config.keyboardZoom === true) {
1162
  setHfov(config.hfov + (speed.hfov * 0.8 + 0.5) * diff);
1163
  isKeyDown = true;
1164
  }
1165
-
1166
  // If plus key is down
1167
  if (keysDown[1] && config.keyboardZoom === true) {
1168
  setHfov(config.hfov + (speed.hfov * 0.8 - 0.2) * diff);
1169
  isKeyDown = true;
1170
  }
1171
-
1172
  // If up arrow or "w" is down
1173
  if (keysDown[2] || keysDown[6]) {
1174
  // Pan up
1175
  config.pitch += (speed.pitch * 0.8 + 0.2) * diff;
1176
  isKeyDown = true;
1177
  }
1178
-
1179
  // If down arrow or "s" is down
1180
  if (keysDown[3] || keysDown[7]) {
1181
  // Pan down
1182
  config.pitch += (speed.pitch * 0.8 - 0.2) * diff;
1183
  isKeyDown = true;
1184
  }
1185
-
1186
  // If left arrow or "a" is down
1187
  if (keysDown[4] || keysDown[8]) {
1188
  // Pan left
1189
  config.yaw += (speed.yaw * 0.8 - 0.2) * diff;
1190
  isKeyDown = true;
1191
  }
1192
-
1193
  // If right arrow or "d" is down
1194
  if (keysDown[5] || keysDown[9]) {
1195
  // Pan right
@@ -1210,7 +1210,7 @@ function keyRepeat() {
1210
  yawDiff = (-config.autoRotate > 0 ? 1 : -1) * Math.min(Math.abs(config.autoRotate * timeDiff), Math.abs(yawDiff));
1211
  config.yaw += yawDiff;
1212
  }
1213
-
1214
  // Deal with stopping auto rotation after a set delay
1215
  if (config.autoRotateStopDelay) {
1216
  config.autoRotateStopDelay -= newTime - prevTime;
@@ -1240,7 +1240,7 @@ function keyRepeat() {
1240
  if (diff > 0 && !config.autoRotate) {
1241
  // "Friction"
1242
  var friction = 0.85;
1243
-
1244
  // Yaw
1245
  if (!keysDown[4] && !keysDown[5] && !keysDown[8] && !keysDown[9] && !animatedMove.yaw) {
1246
  config.yaw += speed.yaw * diff * friction;
@@ -1260,14 +1260,14 @@ function keyRepeat() {
1260
  speed.yaw = speed.yaw * 0.8 + (config.yaw - prevYaw) / diff * 0.2;
1261
  speed.pitch = speed.pitch * 0.8 + (config.pitch - prevPitch) / diff * 0.2;
1262
  speed.hfov = speed.hfov * 0.8 + (config.hfov - prevZoom) / diff * 0.2;
1263
-
1264
  // Limit speed
1265
  var maxSpeed = config.autoRotate ? Math.abs(config.autoRotate) : 5;
1266
  speed.yaw = Math.min(maxSpeed, Math.max(speed.yaw, -maxSpeed));
1267
  speed.pitch = Math.min(maxSpeed, Math.max(speed.pitch, -maxSpeed));
1268
  speed.hfov = Math.min(maxSpeed, Math.max(speed.hfov, -maxSpeed));
1269
  }
1270
-
1271
  // Stop movement if opposite controls are pressed
1272
  if (keysDown[0] && keysDown[0]) {
1273
  speed.hfov = 0;
@@ -1414,7 +1414,7 @@ function render() {
1414
  }
1415
  }
1416
  config.yaw = Math.max(minYaw, Math.min(maxYaw, config.yaw));
1417
-
1418
  // Check if we autoRotate in a limited by min and max yaw
1419
  // If so reverse direction
1420
  if (config.autoRotate !== false && tmpyaw != config.yaw) {
@@ -1437,11 +1437,11 @@ function render() {
1437
  if (isNaN(maxPitch))
1438
  maxPitch = 90;
1439
  config.pitch = Math.max(minPitch, Math.min(maxPitch, config.pitch));
1440
-
1441
  renderer.render(config.pitch * Math.PI / 180, config.yaw * Math.PI / 180, config.hfov * Math.PI / 180, {roll: config.roll * Math.PI / 180});
1442
-
1443
  renderHotSpots();
1444
-
1445
  // Update compass
1446
  if (config.compass) {
1447
  compass.style.transform = 'rotate(' + (-config.yaw - config.northOffset) + 'deg)';
@@ -1578,7 +1578,7 @@ function renderInit() {
1578
  }
1579
  } catch(event) {
1580
  // Panorama not loaded
1581
-
1582
  // Display error if there is a bad texture
1583
  if (event.type == 'webgl error' || event.type == 'no webgl') {
1584
  anError();
@@ -1609,17 +1609,17 @@ function renderInitCallback() {
1609
  fireEvent('scenechangefadedone');
1610
  }, config.sceneFadeDuration);
1611
  }
1612
-
1613
  // Show compass if applicable
1614
  if (config.compass) {
1615
  compass.style.display = 'inline';
1616
  } else {
1617
  compass.style.display = 'none';
1618
  }
1619
-
1620
  // Show hotspots
1621
  createHotSpots();
1622
-
1623
  // Hide loading display
1624
  infoDisplay.load.box.style.display = 'none';
1625
  if (preview !== undefined) {
@@ -1629,7 +1629,7 @@ function renderInitCallback() {
1629
  loaded = true;
1630
 
1631
  fireEvent('load');
1632
-
1633
  animateInit();
1634
  }
1635
 
@@ -1822,14 +1822,14 @@ function mergeConfig(sceneId) {
1822
  var k, s;
1823
  var photoSphereExcludes = ['haov', 'vaov', 'vOffset', 'northOffset', 'horizonPitch', 'horizonRoll'];
1824
  specifiedPhotoSphereExcludes = [];
1825
-
1826
  // Merge default config
1827
  for (k in defaultConfig) {
1828
  if (defaultConfig.hasOwnProperty(k)) {
1829
  config[k] = defaultConfig[k];
1830
  }
1831
  }
1832
-
1833
  // Merge default scene config
1834
  for (k in initialConfig.default) {
1835
  if (initialConfig.default.hasOwnProperty(k)) {
@@ -1847,7 +1847,7 @@ function mergeConfig(sceneId) {
1847
  }
1848
  }
1849
  }
1850
-
1851
  // Merge current scene config
1852
  if ((sceneId !== null) && (sceneId !== '') && (initialConfig.scenes) && (initialConfig.scenes[sceneId])) {
1853
  var scene = initialConfig.scenes[sceneId];
@@ -1869,7 +1869,7 @@ function mergeConfig(sceneId) {
1869
  }
1870
  config.scene = sceneId;
1871
  }
1872
-
1873
  // Merge initial config
1874
  for (k in initialConfig) {
1875
  if (initialConfig.hasOwnProperty(k)) {
@@ -1940,20 +1940,20 @@ function processOptions(isPreview) {
1940
  infoDisplay.title.innerHTML = escapeHTML(config[key]);
1941
  infoDisplay.container.style.display = 'inline';
1942
  break;
1943
-
1944
  case 'author':
1945
  infoDisplay.author.innerHTML = config.strings.bylineLabel.replace('%s', escapeHTML(config[key]));
1946
  infoDisplay.container.style.display = 'inline';
1947
  break;
1948
-
1949
  case 'fallback':
1950
  infoDisplay.errorMsg.innerHTML = '<p>Your browser does not support WebGL.<br><a href="' + encodeURI(config[key]) + '" target="_blank">Click here to view this panorama in an alternative viewer.</a></p>';
1951
  break;
1952
-
1953
  case 'hfov':
1954
  setHfov(Number(config[key]));
1955
  break;
1956
-
1957
  case 'autoLoad':
1958
  if (config[key] === true && renderer === undefined) {
1959
  // Show loading box
@@ -1964,7 +1964,7 @@ function processOptions(isPreview) {
1964
  init();
1965
  }
1966
  break;
1967
-
1968
  case 'showZoomCtrl':
1969
  if (config[key] && config.showControls != false) {
1970
  // Show zoom controls
@@ -1978,7 +1978,7 @@ function processOptions(isPreview) {
1978
  case 'showFullscreenCtrl':
1979
  if (config[key] && config.showControls != false && ('fullscreen' in document || 'mozFullScreen' in document ||
1980
  'webkitIsFullScreen' in document || 'msFullscreenElement' in document)) {
1981
-
1982
  // Show fullscreen control
1983
  controls.fullscreen.style.display = 'block';
1984
  } else {
@@ -2173,7 +2173,7 @@ function load() {
2173
  function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) {
2174
  loaded = false;
2175
  animatedMove = {};
2176
-
2177
  // Set up fade if specified
2178
  var fadeImg, workingPitch, workingYaw, workingHfov;
2179
  if (config.sceneFadeDuration && !fadeDone) {
@@ -2193,7 +2193,7 @@ function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) {
2193
  return;
2194
  }
2195
  }
2196
-
2197
  // Set new pointing
2198
  if (targetPitch === 'same') {
2199
  workingPitch = config.pitch;
@@ -2212,10 +2212,10 @@ function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) {
2212
  } else {
2213
  workingHfov = targetHfov;
2214
  }
2215
-
2216
  // Destroy hot spots from previous scene
2217
  destroyHotSpots();
2218
-
2219
  // Create the new config for the scene
2220
  mergeConfig(sceneId);
2221
 
1
  /*
2
  * Pannellum - An HTML5 based Panorama Viewer
3
  * Copyright (c) 2011-2018 Matthew Petroff
4
+ *
5
  * Permission is hereby granted, free of charge, to any person obtaining a copy
6
  * of this software and associated documentation files (the "Software"), to deal
7
  * in the Software without restriction, including without limitation the rights
8
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
  * copies of the Software, and to permit persons to whom the Software is
10
  * furnished to do so, subject to the following conditions:
11
+ *
12
  * The above copyright notice and this permission notice shall be included in
13
  * all copies or substantial portions of the Software.
14
+ *
15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
304
  origPitch = config.pitch;
305
 
306
  var i, p;
307
+
308
  if (config.type == 'cubemap') {
309
  panoImage = [];
310
  for (i = 0; i < 6; i++) {
342
  if (config.type == 'cubemap') {
343
  // Quick loading counter for synchronous loading
344
  var itemsToLoad = 6;
345
+
346
  var onLoad = function() {
347
  itemsToLoad--;
348
  if (itemsToLoad === 0) {
349
  onImageLoad();
350
  }
351
  };
352
+
353
  var onError = function(e) {
354
  var a = document.createElement('a');
355
  a.href = e.target.src;
356
  a.innerHTML = a.href;
357
  anError(config.strings.fileAccessError.replace('%s', a.outerHTML));
358
  };
359
+
360
  for (i = 0; i < panoImage.length; i++) {
361
  panoImage[i].onload = onLoad;
362
  panoImage[i].onerror = onError;
373
  if (config.basePath) {
374
  p = config.basePath;
375
  }
376
+
377
  if (config.dynamic !== true) {
378
  // Still image
379
  p = absoluteURL(config.panorama) ? config.panorama : p + config.panorama;
380
+
381
  panoImage.onload = function() {
382
  window.URL.revokeObjectURL(this.src); // Clean up
383
  onImageLoad();
384
  };
385
+
386
  var xhr = new XMLHttpRequest();
387
  xhr.onloadend = function() {
388
  if (xhr.status != 200) {
434
  xhr.send();
435
  }
436
  }
437
+
438
  if (config.draggable)
439
  uiContainer.classList.add('pnlm-grab');
440
  uiContainer.classList.remove('pnlm-grabbing');
523
  var start = img.indexOf('<x:xmpmeta');
524
  if (start > -1 && config.ignoreGPanoXMP !== true) {
525
  var xmpData = img.substring(start, img.indexOf('</x:xmpmeta>') + 12);
526
+
527
  // Extract the requested tag from the XMP data
528
  var getTag = function(tag) {
529
  var result;
539
  }
540
  return null;
541
  };
542
+
543
  // Relevant XMP data
544
  var xmp = {
545
  fullWidth: getTag('GPano:FullPanoWidthPixels'),
551
  horizonPitch: getTag('GPano:PosePitchDegrees'),
552
  horizonRoll: getTag('GPano:PoseRollDegrees')
553
  };
554
+
555
  if (xmp.fullWidth !== null && xmp.croppedWidth !== null &&
556
  xmp.fullHeight !== null && xmp.croppedHeight !== null &&
557
  xmp.topPixels !== null) {
558
+
559
  // Set up viewer using GPano XMP data
560
  if (specifiedPhotoSphereExcludes.indexOf('haov') < 0)
561
  config.haov = xmp.croppedWidth / xmp.fullWidth * 360;
576
  if (specifiedPhotoSphereExcludes.indexOf('horizonRoll') < 0)
577
  config.horizonRoll = xmp.horizonRoll;
578
  }
579
+
580
  // TODO: add support for initial view settings
581
  }
582
  }
583
+
584
  // Load panorama
585
  panoImage.src = window.URL.createObjectURL(image);
586
  });
664
  event.preventDefault();
665
  // But not all of it
666
  container.focus();
667
+
668
  // Only do something if the panorama is loaded
669
  if (!loaded || !config.draggable) {
670
  return;
671
  }
672
+
673
  // Calculate mouse position relative to top left of viewer container
674
  var pos = mousePosition(event);
675
 
693
 
694
  isUserInteracting = true;
695
  latestInteraction = Date.now();
696
+
697
  onPointerDownPointerX = pos.x;
698
  onPointerDownPointerY = pos.y;
699
+
700
  onPointerDownYaw = config.yaw;
701
  onPointerDownPitch = config.pitch;
702
+
703
  uiContainer.classList.add('pnlm-grabbing');
704
  uiContainer.classList.remove('pnlm-grab');
705
+
706
  fireEvent('mousedown', event);
707
  animateInit();
708
  }
764
  var yaw = ((Math.atan(onPointerDownPointerX / canvasWidth * 2 - 1) - Math.atan(pos.x / canvasWidth * 2 - 1)) * 180 / Math.PI * config.hfov / 90) + onPointerDownYaw;
765
  speed.yaw = (yaw - config.yaw) % 360 * 0.2;
766
  config.yaw = yaw;
767
+
768
  var vfov = 2 * Math.atan(Math.tan(config.hfov/360*Math.PI) * canvasHeight / canvasWidth) * 180 / Math.PI;
769
+
770
  var pitch = ((Math.atan(pos.y / canvasHeight * 2 - 1) - Math.atan(onPointerDownPointerY / canvasHeight * 2 - 1)) * 180 / Math.PI * vfov / 90) + onPointerDownPitch;
771
  speed.pitch = (pitch - config.pitch) * 0.2;
772
  config.pitch = pitch;
819
 
820
  onPointerDownPointerX = pos0.x;
821
  onPointerDownPointerY = pos0.y;
822
+
823
  if (event.targetTouches.length == 2) {
824
  // Down pointer is the center of the two fingers
825
  var pos1 = mousePosition(event.targetTouches[1]);
830
  }
831
  isUserInteracting = true;
832
  latestInteraction = Date.now();
833
+
834
  onPointerDownYaw = config.yaw;
835
  onPointerDownPitch = config.pitch;
836
 
858
  var pos0 = mousePosition(event.targetTouches[0]);
859
  var clientX = pos0.x;
860
  var clientY = pos0.y;
861
+
862
  if (event.targetTouches.length == 2 && onPointerDownPointerDist != -1) {
863
  var pos1 = mousePosition(event.targetTouches[1]);
864
  clientX += (pos1.x - pos0.x) * 0.5;
993
  setHfov(config.hfov + event.detail * 1.5);
994
  speed.hfov = event.detail > 0 ? 1 : -1;
995
  }
996
+
997
  animateInit();
998
  }
999
 
1017
  if (usedKeyNumbers.indexOf(keynumber) < 0)
1018
  return
1019
  event.preventDefault();
1020
+
1021
  // If escape key is pressed
1022
  if (keynumber == 27) {
1023
  // If in fullscreen mode
1048
  function onDocumentKeyUp(event) {
1049
  // Record key pressed
1050
  var keynumber = event.which || event.keycode;
1051
+
1052
  // Override default action for keys that are used
1053
  if (usedKeyNumbers.indexOf(keynumber) < 0)
1054
  return
1055
  event.preventDefault();
1056
+
1057
  // Change key
1058
  changeKey(keynumber, false);
1059
  }
1071
  case 109: case 189: case 17: case 173:
1072
  if (keysDown[0] != value) { keyChanged = true; }
1073
  keysDown[0] = value; break;
1074
+
1075
  // If plus key is released
1076
  case 107: case 187: case 16: case 61:
1077
  if (keysDown[1] != value) { keyChanged = true; }
1078
  keysDown[1] = value; break;
1079
+
1080
  // If up arrow is released
1081
  case 38:
1082
  if (keysDown[2] != value) { keyChanged = true; }
1083
  keysDown[2] = value; break;
1084
+
1085
  // If "w" is released
1086
  case 87:
1087
  if (keysDown[6] != value) { keyChanged = true; }
1088
  keysDown[6] = value; break;
1089
+
1090
  // If down arrow is released
1091
  case 40:
1092
  if (keysDown[3] != value) { keyChanged = true; }
1093
  keysDown[3] = value; break;
1094
+
1095
  // If "s" is released
1096
  case 83:
1097
  if (keysDown[7] != value) { keyChanged = true; }
1098
  keysDown[7] = value; break;
1099
+
1100
  // If left arrow is released
1101
  case 37:
1102
  if (keysDown[4] != value) { keyChanged = true; }
1103
  keysDown[4] = value; break;
1104
+
1105
  // If "a" is released
1106
  case 65:
1107
  if (keysDown[8] != value) { keyChanged = true; }
1108
  keysDown[8] = value; break;
1109
+
1110
  // If right arrow is released
1111
  case 39:
1112
  if (keysDown[5] != value) { keyChanged = true; }
1113
  keysDown[5] = value; break;
1114
+
1115
  // If "d" is released
1116
  case 68:
1117
  if (keysDown[9] != value) { keyChanged = true; }
1118
  keysDown[9] = value;
1119
  }
1120
+
1121
  if (keyChanged && value) {
1122
  if (typeof performance !== 'undefined' && performance.now()) {
1123
  prevTime = performance.now();
1144
  var prevPitch = config.pitch;
1145
  var prevYaw = config.yaw;
1146
  var prevZoom = config.hfov;
1147
+
1148
  var newTime;
1149
  if (typeof performance !== 'undefined' && performance.now()) {
1150
  newTime = performance.now();
1156
  }
1157
  var diff = (newTime - prevTime) * config.hfov / 1700;
1158
  diff = Math.min(diff, 1.0);
1159
+
1160
  // If minus key is down
1161
  if (keysDown[0] && config.keyboardZoom === true) {
1162
  setHfov(config.hfov + (speed.hfov * 0.8 + 0.5) * diff);
1163
  isKeyDown = true;
1164
  }
1165
+
1166
  // If plus key is down
1167
  if (keysDown[1] && config.keyboardZoom === true) {
1168
  setHfov(config.hfov + (speed.hfov * 0.8 - 0.2) * diff);
1169
  isKeyDown = true;
1170
  }
1171
+
1172
  // If up arrow or "w" is down
1173
  if (keysDown[2] || keysDown[6]) {
1174
  // Pan up
1175
  config.pitch += (speed.pitch * 0.8 + 0.2) * diff;
1176
  isKeyDown = true;
1177
  }
1178
+
1179
  // If down arrow or "s" is down
1180
  if (keysDown[3] || keysDown[7]) {
1181
  // Pan down
1182
  config.pitch += (speed.pitch * 0.8 - 0.2) * diff;
1183
  isKeyDown = true;
1184
  }
1185
+
1186
  // If left arrow or "a" is down
1187
  if (keysDown[4] || keysDown[8]) {
1188
  // Pan left
1189
  config.yaw += (speed.yaw * 0.8 - 0.2) * diff;
1190
  isKeyDown = true;
1191
  }
1192
+
1193
  // If right arrow or "d" is down
1194
  if (keysDown[5] || keysDown[9]) {
1195
  // Pan right
1210
  yawDiff = (-config.autoRotate > 0 ? 1 : -1) * Math.min(Math.abs(config.autoRotate * timeDiff), Math.abs(yawDiff));
1211
  config.yaw += yawDiff;
1212
  }
1213
+
1214
  // Deal with stopping auto rotation after a set delay
1215
  if (config.autoRotateStopDelay) {
1216
  config.autoRotateStopDelay -= newTime - prevTime;
1240
  if (diff > 0 && !config.autoRotate) {
1241
  // "Friction"
1242
  var friction = 0.85;
1243
+
1244
  // Yaw
1245
  if (!keysDown[4] && !keysDown[5] && !keysDown[8] && !keysDown[9] && !animatedMove.yaw) {
1246
  config.yaw += speed.yaw * diff * friction;
1260
  speed.yaw = speed.yaw * 0.8 + (config.yaw - prevYaw) / diff * 0.2;
1261
  speed.pitch = speed.pitch * 0.8 + (config.pitch - prevPitch) / diff * 0.2;
1262
  speed.hfov = speed.hfov * 0.8 + (config.hfov - prevZoom) / diff * 0.2;
1263
+
1264
  // Limit speed
1265
  var maxSpeed = config.autoRotate ? Math.abs(config.autoRotate) : 5;
1266
  speed.yaw = Math.min(maxSpeed, Math.max(speed.yaw, -maxSpeed));
1267
  speed.pitch = Math.min(maxSpeed, Math.max(speed.pitch, -maxSpeed));
1268
  speed.hfov = Math.min(maxSpeed, Math.max(speed.hfov, -maxSpeed));
1269
  }
1270
+
1271
  // Stop movement if opposite controls are pressed
1272
  if (keysDown[0] && keysDown[0]) {
1273
  speed.hfov = 0;
1414
  }
1415
  }
1416
  config.yaw = Math.max(minYaw, Math.min(maxYaw, config.yaw));
1417
+
1418
  // Check if we autoRotate in a limited by min and max yaw
1419
  // If so reverse direction
1420
  if (config.autoRotate !== false && tmpyaw != config.yaw) {
1437
  if (isNaN(maxPitch))
1438
  maxPitch = 90;
1439
  config.pitch = Math.max(minPitch, Math.min(maxPitch, config.pitch));
1440
+
1441
  renderer.render(config.pitch * Math.PI / 180, config.yaw * Math.PI / 180, config.hfov * Math.PI / 180, {roll: config.roll * Math.PI / 180});
1442
+
1443
  renderHotSpots();
1444
+
1445
  // Update compass
1446
  if (config.compass) {
1447
  compass.style.transform = 'rotate(' + (-config.yaw - config.northOffset) + 'deg)';
1578
  }
1579
  } catch(event) {
1580
  // Panorama not loaded
1581
+
1582
  // Display error if there is a bad texture
1583
  if (event.type == 'webgl error' || event.type == 'no webgl') {
1584
  anError();
1609
  fireEvent('scenechangefadedone');
1610
  }, config.sceneFadeDuration);
1611
  }
1612
+
1613
  // Show compass if applicable
1614
  if (config.compass) {
1615
  compass.style.display = 'inline';
1616
  } else {
1617
  compass.style.display = 'none';
1618
  }
1619
+
1620
  // Show hotspots
1621
  createHotSpots();
1622
+
1623
  // Hide loading display
1624
  infoDisplay.load.box.style.display = 'none';
1625
  if (preview !== undefined) {
1629
  loaded = true;
1630
 
1631
  fireEvent('load');
1632
+
1633
  animateInit();
1634
  }
1635
 
1822
  var k, s;
1823
  var photoSphereExcludes = ['haov', 'vaov', 'vOffset', 'northOffset', 'horizonPitch', 'horizonRoll'];
1824
  specifiedPhotoSphereExcludes = [];
1825
+
1826
  // Merge default config
1827
  for (k in defaultConfig) {
1828
  if (defaultConfig.hasOwnProperty(k)) {
1829
  config[k] = defaultConfig[k];
1830
  }
1831
  }
1832
+
1833
  // Merge default scene config
1834
  for (k in initialConfig.default) {
1835
  if (initialConfig.default.hasOwnProperty(k)) {
1847
  }
1848
  }
1849
  }
1850
+
1851
  // Merge current scene config
1852
  if ((sceneId !== null) && (sceneId !== '') && (initialConfig.scenes) && (initialConfig.scenes[sceneId])) {
1853
  var scene = initialConfig.scenes[sceneId];
1869
  }
1870
  config.scene = sceneId;
1871
  }
1872
+
1873
  // Merge initial config
1874
  for (k in initialConfig) {
1875
  if (initialConfig.hasOwnProperty(k)) {
1940
  infoDisplay.title.innerHTML = escapeHTML(config[key]);
1941
  infoDisplay.container.style.display = 'inline';
1942
  break;
1943
+
1944
  case 'author':
1945
  infoDisplay.author.innerHTML = config.strings.bylineLabel.replace('%s', escapeHTML(config[key]));
1946
  infoDisplay.container.style.display = 'inline';
1947
  break;
1948
+
1949
  case 'fallback':
1950
  infoDisplay.errorMsg.innerHTML = '<p>Your browser does not support WebGL.<br><a href="' + encodeURI(config[key]) + '" target="_blank">Click here to view this panorama in an alternative viewer.</a></p>';
1951
  break;
1952
+
1953
  case 'hfov':
1954
  setHfov(Number(config[key]));
1955
  break;
1956
+
1957
  case 'autoLoad':
1958
  if (config[key] === true && renderer === undefined) {
1959
  // Show loading box
1964
  init();
1965
  }
1966
  break;
1967
+
1968
  case 'showZoomCtrl':
1969
  if (config[key] && config.showControls != false) {
1970
  // Show zoom controls
1978
  case 'showFullscreenCtrl':
1979
  if (config[key] && config.showControls != false && ('fullscreen' in document || 'mozFullScreen' in document ||
1980
  'webkitIsFullScreen' in document || 'msFullscreenElement' in document)) {
1981
+
1982
  // Show fullscreen control
1983
  controls.fullscreen.style.display = 'block';
1984
  } else {
2173
  function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) {
2174
  loaded = false;
2175
  animatedMove = {};
2176
+
2177
  // Set up fade if specified
2178
  var fadeImg, workingPitch, workingYaw, workingHfov;
2179
  if (config.sceneFadeDuration && !fadeDone) {
2193
  return;
2194
  }
2195
  }
2196
+
2197
  // Set new pointing
2198
  if (targetPitch === 'same') {
2199
  workingPitch = config.pitch;
2212
  } else {
2213
  workingHfov = targetHfov;
2214
  }
2215
+
2216
  // Destroy hot spots from previous scene
2217
  destroyHotSpots();
2218
+
2219
  // Create the new config for the scene
2220
  mergeConfig(sceneId);
2221
 
public/css/owl.carousel.css CHANGED
File without changes
public/js/owl.carousel.js CHANGED
File without changes
public/lib/pannellum/src/js/pannellum.js CHANGED
@@ -1,17 +1,17 @@
1
  /*
2
  * Pannellum - An HTML5 based Panorama Viewer
3
  * Copyright (c) 2011-2018 Matthew Petroff
4
- *
5
  * Permission is hereby granted, free of charge, to any person obtaining a copy
6
  * of this software and associated documentation files (the "Software"), to deal
7
  * in the Software without restriction, including without limitation the rights
8
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
  * copies of the Software, and to permit persons to whom the Software is
10
  * furnished to do so, subject to the following conditions:
11
- *
12
  * The above copyright notice and this permission notice shall be included in
13
  * all copies or substantial portions of the Software.
14
- *
15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -303,7 +303,7 @@ function init() {
303
  origPitch = config.pitch;
304
 
305
  var i, p;
306
-
307
  if (config.type == 'cubemap') {
308
  panoImage = [];
309
  for (i = 0; i < 6; i++) {
@@ -341,21 +341,21 @@ function init() {
341
  if (config.type == 'cubemap') {
342
  // Quick loading counter for synchronous loading
343
  var itemsToLoad = 6;
344
-
345
  var onLoad = function() {
346
  itemsToLoad--;
347
  if (itemsToLoad === 0) {
348
  onImageLoad();
349
  }
350
  };
351
-
352
  var onError = function(e) {
353
  var a = document.createElement('a');
354
  a.href = e.target.src;
355
  a.innerHTML = a.href;
356
  anError(config.strings.fileAccessError.replace('%s', a.outerHTML));
357
  };
358
-
359
  for (i = 0; i < panoImage.length; i++) {
360
  panoImage[i].onload = onLoad;
361
  panoImage[i].onerror = onError;
@@ -372,16 +372,16 @@ function init() {
372
  if (config.basePath) {
373
  p = config.basePath;
374
  }
375
-
376
  if (config.dynamic !== true) {
377
  // Still image
378
  p = absoluteURL(config.panorama) ? config.panorama : p + config.panorama;
379
-
380
  panoImage.onload = function() {
381
  window.URL.revokeObjectURL(this.src); // Clean up
382
  onImageLoad();
383
  };
384
-
385
  var xhr = new XMLHttpRequest();
386
  xhr.onloadend = function() {
387
  if (xhr.status != 200) {
@@ -433,7 +433,7 @@ function init() {
433
  xhr.send();
434
  }
435
  }
436
-
437
  if (config.draggable)
438
  uiContainer.classList.add('pnlm-grab');
439
  uiContainer.classList.remove('pnlm-grabbing');
@@ -522,7 +522,7 @@ function parseGPanoXMP(image) {
522
  var start = img.indexOf('<x:xmpmeta');
523
  if (start > -1 && config.ignoreGPanoXMP !== true) {
524
  var xmpData = img.substring(start, img.indexOf('</x:xmpmeta>') + 12);
525
-
526
  // Extract the requested tag from the XMP data
527
  var getTag = function(tag) {
528
  var result;
@@ -538,7 +538,7 @@ function parseGPanoXMP(image) {
538
  }
539
  return null;
540
  };
541
-
542
  // Relevant XMP data
543
  var xmp = {
544
  fullWidth: getTag('GPano:FullPanoWidthPixels'),
@@ -550,11 +550,11 @@ function parseGPanoXMP(image) {
550
  horizonPitch: getTag('GPano:PosePitchDegrees'),
551
  horizonRoll: getTag('GPano:PoseRollDegrees')
552
  };
553
-
554
  if (xmp.fullWidth !== null && xmp.croppedWidth !== null &&
555
  xmp.fullHeight !== null && xmp.croppedHeight !== null &&
556
  xmp.topPixels !== null) {
557
-
558
  // Set up viewer using GPano XMP data
559
  if (specifiedPhotoSphereExcludes.indexOf('haov') < 0)
560
  config.haov = xmp.croppedWidth / xmp.fullWidth * 360;
@@ -575,11 +575,11 @@ function parseGPanoXMP(image) {
575
  if (specifiedPhotoSphereExcludes.indexOf('horizonRoll') < 0)
576
  config.horizonRoll = xmp.horizonRoll;
577
  }
578
-
579
  // TODO: add support for initial view settings
580
  }
581
  }
582
-
583
  // Load panorama
584
  panoImage.src = window.URL.createObjectURL(image);
585
  });
@@ -663,12 +663,12 @@ function onDocumentMouseDown(event) {
663
  event.preventDefault();
664
  // But not all of it
665
  container.focus();
666
-
667
  // Only do something if the panorama is loaded
668
  if (!loaded || !config.draggable) {
669
  return;
670
  }
671
-
672
  // Calculate mouse position relative to top left of viewer container
673
  var pos = mousePosition(event);
674
 
@@ -691,16 +691,16 @@ function onDocumentMouseDown(event) {
691
 
692
  isUserInteracting = true;
693
  latestInteraction = Date.now();
694
-
695
  onPointerDownPointerX = pos.x;
696
  onPointerDownPointerY = pos.y;
697
-
698
  onPointerDownYaw = config.yaw;
699
  onPointerDownPitch = config.pitch;
700
-
701
  uiContainer.classList.add('pnlm-grabbing');
702
  uiContainer.classList.remove('pnlm-grab');
703
-
704
  fireEvent('mousedown', event);
705
  animateInit();
706
  }
@@ -762,9 +762,9 @@ function onDocumentMouseMove(event) {
762
  var yaw = ((Math.atan(onPointerDownPointerX / canvasWidth * 2 - 1) - Math.atan(pos.x / canvasWidth * 2 - 1)) * 180 / Math.PI * config.hfov / 90) + onPointerDownYaw;
763
  speed.yaw = (yaw - config.yaw) % 360 * 0.2;
764
  config.yaw = yaw;
765
-
766
  var vfov = 2 * Math.atan(Math.tan(config.hfov/360*Math.PI) * canvasHeight / canvasWidth) * 180 / Math.PI;
767
-
768
  var pitch = ((Math.atan(pos.y / canvasHeight * 2 - 1) - Math.atan(onPointerDownPointerY / canvasHeight * 2 - 1)) * 180 / Math.PI * vfov / 90) + onPointerDownPitch;
769
  speed.pitch = (pitch - config.pitch) * 0.2;
770
  config.pitch = pitch;
@@ -817,7 +817,7 @@ function onDocumentTouchStart(event) {
817
 
818
  onPointerDownPointerX = pos0.x;
819
  onPointerDownPointerY = pos0.y;
820
-
821
  if (event.targetTouches.length == 2) {
822
  // Down pointer is the center of the two fingers
823
  var pos1 = mousePosition(event.targetTouches[1]);
@@ -828,7 +828,7 @@ function onDocumentTouchStart(event) {
828
  }
829
  isUserInteracting = true;
830
  latestInteraction = Date.now();
831
-
832
  onPointerDownYaw = config.yaw;
833
  onPointerDownPitch = config.pitch;
834
 
@@ -856,7 +856,7 @@ function onDocumentTouchMove(event) {
856
  var pos0 = mousePosition(event.targetTouches[0]);
857
  var clientX = pos0.x;
858
  var clientY = pos0.y;
859
-
860
  if (event.targetTouches.length == 2 && onPointerDownPointerDist != -1) {
861
  var pos1 = mousePosition(event.targetTouches[1]);
862
  clientX += (pos1.x - pos0.x) * 0.5;
@@ -991,7 +991,7 @@ function onDocumentMouseWheel(event) {
991
  setHfov(config.hfov + event.detail * 1.5);
992
  speed.hfov = event.detail > 0 ? 1 : -1;
993
  }
994
-
995
  animateInit();
996
  }
997
 
@@ -1015,7 +1015,7 @@ function onDocumentKeyPress(event) {
1015
  if (usedKeyNumbers.indexOf(keynumber) < 0)
1016
  return
1017
  event.preventDefault();
1018
-
1019
  // If escape key is pressed
1020
  if (keynumber == 27) {
1021
  // If in fullscreen mode
@@ -1046,12 +1046,12 @@ function clearKeys() {
1046
  function onDocumentKeyUp(event) {
1047
  // Record key pressed
1048
  var keynumber = event.which || event.keycode;
1049
-
1050
  // Override default action for keys that are used
1051
  if (usedKeyNumbers.indexOf(keynumber) < 0)
1052
  return
1053
  event.preventDefault();
1054
-
1055
  // Change key
1056
  changeKey(keynumber, false);
1057
  }
@@ -1069,53 +1069,53 @@ function changeKey(keynumber, value) {
1069
  case 109: case 189: case 17: case 173:
1070
  if (keysDown[0] != value) { keyChanged = true; }
1071
  keysDown[0] = value; break;
1072
-
1073
  // If plus key is released
1074
  case 107: case 187: case 16: case 61:
1075
  if (keysDown[1] != value) { keyChanged = true; }
1076
  keysDown[1] = value; break;
1077
-
1078
  // If up arrow is released
1079
  case 38:
1080
  if (keysDown[2] != value) { keyChanged = true; }
1081
  keysDown[2] = value; break;
1082
-
1083
  // If "w" is released
1084
  case 87:
1085
  if (keysDown[6] != value) { keyChanged = true; }
1086
  keysDown[6] = value; break;
1087
-
1088
  // If down arrow is released
1089
  case 40:
1090
  if (keysDown[3] != value) { keyChanged = true; }
1091
  keysDown[3] = value; break;
1092
-
1093
  // If "s" is released
1094
  case 83:
1095
  if (keysDown[7] != value) { keyChanged = true; }
1096
  keysDown[7] = value; break;
1097
-
1098
  // If left arrow is released
1099
  case 37:
1100
  if (keysDown[4] != value) { keyChanged = true; }
1101
  keysDown[4] = value; break;
1102
-
1103
  // If "a" is released
1104
  case 65:
1105
  if (keysDown[8] != value) { keyChanged = true; }
1106
  keysDown[8] = value; break;
1107
-
1108
  // If right arrow is released
1109
  case 39:
1110
  if (keysDown[5] != value) { keyChanged = true; }
1111
  keysDown[5] = value; break;
1112
-
1113
  // If "d" is released
1114
  case 68:
1115
  if (keysDown[9] != value) { keyChanged = true; }
1116
  keysDown[9] = value;
1117
  }
1118
-
1119
  if (keyChanged && value) {
1120
  if (typeof performance !== 'undefined' && performance.now()) {
1121
  prevTime = performance.now();
@@ -1142,7 +1142,7 @@ function keyRepeat() {
1142
  var prevPitch = config.pitch;
1143
  var prevYaw = config.yaw;
1144
  var prevZoom = config.hfov;
1145
-
1146
  var newTime;
1147
  if (typeof performance !== 'undefined' && performance.now()) {
1148
  newTime = performance.now();
@@ -1154,40 +1154,40 @@ function keyRepeat() {
1154
  }
1155
  var diff = (newTime - prevTime) * config.hfov / 1700;
1156
  diff = Math.min(diff, 1.0);
1157
-
1158
  // If minus key is down
1159
  if (keysDown[0] && config.keyboardZoom === true) {
1160
  setHfov(config.hfov + (speed.hfov * 0.8 + 0.5) * diff);
1161
  isKeyDown = true;
1162
  }
1163
-
1164
  // If plus key is down
1165
  if (keysDown[1] && config.keyboardZoom === true) {
1166
  setHfov(config.hfov + (speed.hfov * 0.8 - 0.2) * diff);
1167
  isKeyDown = true;
1168
  }
1169
-
1170
  // If up arrow or "w" is down
1171
  if (keysDown[2] || keysDown[6]) {
1172
  // Pan up
1173
  config.pitch += (speed.pitch * 0.8 + 0.2) * diff;
1174
  isKeyDown = true;
1175
  }
1176
-
1177
  // If down arrow or "s" is down
1178
  if (keysDown[3] || keysDown[7]) {
1179
  // Pan down
1180
  config.pitch += (speed.pitch * 0.8 - 0.2) * diff;
1181
  isKeyDown = true;
1182
  }
1183
-
1184
  // If left arrow or "a" is down
1185
  if (keysDown[4] || keysDown[8]) {
1186
  // Pan left
1187
  config.yaw += (speed.yaw * 0.8 - 0.2) * diff;
1188
  isKeyDown = true;
1189
  }
1190
-
1191
  // If right arrow or "d" is down
1192
  if (keysDown[5] || keysDown[9]) {
1193
  // Pan right
@@ -1208,7 +1208,7 @@ function keyRepeat() {
1208
  yawDiff = (-config.autoRotate > 0 ? 1 : -1) * Math.min(Math.abs(config.autoRotate * timeDiff), Math.abs(yawDiff));
1209
  config.yaw += yawDiff;
1210
  }
1211
-
1212
  // Deal with stopping auto rotation after a set delay
1213
  if (config.autoRotateStopDelay) {
1214
  config.autoRotateStopDelay -= newTime - prevTime;
@@ -1238,7 +1238,7 @@ function keyRepeat() {
1238
  if (diff > 0 && !config.autoRotate) {
1239
  // "Friction"
1240
  var friction = 0.85;
1241
-
1242
  // Yaw
1243
  if (!keysDown[4] && !keysDown[5] && !keysDown[8] && !keysDown[9] && !animatedMove.yaw) {
1244
  config.yaw += speed.yaw * diff * friction;
@@ -1258,14 +1258,14 @@ function keyRepeat() {
1258
  speed.yaw = speed.yaw * 0.8 + (config.yaw - prevYaw) / diff * 0.2;
1259
  speed.pitch = speed.pitch * 0.8 + (config.pitch - prevPitch) / diff * 0.2;
1260
  speed.hfov = speed.hfov * 0.8 + (config.hfov - prevZoom) / diff * 0.2;
1261
-
1262
  // Limit speed
1263
  var maxSpeed = config.autoRotate ? Math.abs(config.autoRotate) : 5;
1264
  speed.yaw = Math.min(maxSpeed, Math.max(speed.yaw, -maxSpeed));
1265
  speed.pitch = Math.min(maxSpeed, Math.max(speed.pitch, -maxSpeed));
1266
  speed.hfov = Math.min(maxSpeed, Math.max(speed.hfov, -maxSpeed));
1267
  }
1268
-
1269
  // Stop movement if opposite controls are pressed
1270
  if (keysDown[0] && keysDown[0]) {
1271
  speed.hfov = 0;
@@ -1371,7 +1371,7 @@ function animate() {
1371
  if (autoRotateStartTime > 0) {
1372
  autoRotateStart = setTimeout(function() {
1373
  config.autoRotate = autoRotateSpeed;
1374
- _this.lookAt(origPitch, undefined, origHfov, 3000);
1375
  animateInit();
1376
  }, autoRotateStartTime);
1377
  } else if (config.autoRotateInactivityDelay >= 0 && autoRotateSpeed) {
@@ -1412,7 +1412,7 @@ function render() {
1412
  }
1413
  }
1414
  config.yaw = Math.max(minYaw, Math.min(maxYaw, config.yaw));
1415
-
1416
  // Check if we autoRotate in a limited by min and max yaw
1417
  // If so reverse direction
1418
  if (config.autoRotate !== false && tmpyaw != config.yaw) {
@@ -1435,11 +1435,11 @@ function render() {
1435
  if (isNaN(maxPitch))
1436
  maxPitch = 90;
1437
  config.pitch = Math.max(minPitch, Math.min(maxPitch, config.pitch));
1438
-
1439
  renderer.render(config.pitch * Math.PI / 180, config.yaw * Math.PI / 180, config.hfov * Math.PI / 180, {roll: config.roll * Math.PI / 180});
1440
-
1441
  renderHotSpots();
1442
-
1443
  // Update compass
1444
  if (config.compass) {
1445
  compass.style.transform = 'rotate(' + (-config.yaw - config.northOffset) + 'deg)';
@@ -1576,7 +1576,7 @@ function renderInit() {
1576
  }
1577
  } catch(event) {
1578
  // Panorama not loaded
1579
-
1580
  // Display error if there is a bad texture
1581
  if (event.type == 'webgl error' || event.type == 'no webgl') {
1582
  anError();
@@ -1607,17 +1607,17 @@ function renderInitCallback() {
1607
  fireEvent('scenechangefadedone');
1608
  }, config.sceneFadeDuration);
1609
  }
1610
-
1611
  // Show compass if applicable
1612
  if (config.compass) {
1613
  compass.style.display = 'inline';
1614
  } else {
1615
  compass.style.display = 'none';
1616
  }
1617
-
1618
  // Show hotspots
1619
  createHotSpots();
1620
-
1621
  // Hide loading display
1622
  infoDisplay.load.box.style.display = 'none';
1623
  if (preview !== undefined) {
@@ -1627,7 +1627,7 @@ function renderInitCallback() {
1627
  loaded = true;
1628
 
1629
  fireEvent('load');
1630
-
1631
  animateInit();
1632
  }
1633
 
@@ -1820,14 +1820,14 @@ function mergeConfig(sceneId) {
1820
  var k, s;
1821
  var photoSphereExcludes = ['haov', 'vaov', 'vOffset', 'northOffset', 'horizonPitch', 'horizonRoll'];
1822
  specifiedPhotoSphereExcludes = [];
1823
-
1824
  // Merge default config
1825
  for (k in defaultConfig) {
1826
  if (defaultConfig.hasOwnProperty(k)) {
1827
  config[k] = defaultConfig[k];
1828
  }
1829
  }
1830
-
1831
  // Merge default scene config
1832
  for (k in initialConfig.default) {
1833
  if (initialConfig.default.hasOwnProperty(k)) {
@@ -1845,7 +1845,7 @@ function mergeConfig(sceneId) {
1845
  }
1846
  }
1847
  }
1848
-
1849
  // Merge current scene config
1850
  if ((sceneId !== null) && (sceneId !== '') && (initialConfig.scenes) && (initialConfig.scenes[sceneId])) {
1851
  var scene = initialConfig.scenes[sceneId];
@@ -1867,7 +1867,7 @@ function mergeConfig(sceneId) {
1867
  }
1868
  config.scene = sceneId;
1869
  }
1870
-
1871
  // Merge initial config
1872
  for (k in initialConfig) {
1873
  if (initialConfig.hasOwnProperty(k)) {
@@ -1938,20 +1938,20 @@ function processOptions(isPreview) {
1938
  infoDisplay.title.innerHTML = escapeHTML(config[key]);
1939
  infoDisplay.container.style.display = 'inline';
1940
  break;
1941
-
1942
  case 'author':
1943
  infoDisplay.author.innerHTML = config.strings.bylineLabel.replace('%s', escapeHTML(config[key]));
1944
  infoDisplay.container.style.display = 'inline';
1945
  break;
1946
-
1947
  case 'fallback':
1948
  infoDisplay.errorMsg.innerHTML = '<p>Your browser does not support WebGL.<br><a href="' + encodeURI(config[key]) + '" target="_blank">Click here to view this panorama in an alternative viewer.</a></p>';
1949
  break;
1950
-
1951
  case 'hfov':
1952
  setHfov(Number(config[key]));
1953
  break;
1954
-
1955
  case 'autoLoad':
1956
  if (config[key] === true && renderer === undefined) {
1957
  // Show loading box
@@ -1962,7 +1962,7 @@ function processOptions(isPreview) {
1962
  init();
1963
  }
1964
  break;
1965
-
1966
  case 'showZoomCtrl':
1967
  if (config[key] && config.showControls != false) {
1968
  // Show zoom controls
@@ -1976,7 +1976,7 @@ function processOptions(isPreview) {
1976
  case 'showFullscreenCtrl':
1977
  if (config[key] && config.showControls != false && ('fullscreen' in document || 'mozFullScreen' in document ||
1978
  'webkitIsFullScreen' in document || 'msFullscreenElement' in document)) {
1979
-
1980
  // Show fullscreen control
1981
  controls.fullscreen.style.display = 'block';
1982
  } else {
@@ -2171,7 +2171,7 @@ function load() {
2171
  function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) {
2172
  loaded = false;
2173
  animatedMove = {};
2174
-
2175
  // Set up fade if specified
2176
  var fadeImg, workingPitch, workingYaw, workingHfov;
2177
  if (config.sceneFadeDuration && !fadeDone) {
@@ -2191,7 +2191,7 @@ function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) {
2191
  return;
2192
  }
2193
  }
2194
-
2195
  // Set new pointing
2196
  if (targetPitch === 'same') {
2197
  workingPitch = config.pitch;
@@ -2210,10 +2210,10 @@ function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) {
2210
  } else {
2211
  workingHfov = targetHfov;
2212
  }
2213
-
2214
  // Destroy hot spots from previous scene
2215
  destroyHotSpots();
2216
-
2217
  // Create the new config for the scene
2218
  mergeConfig(sceneId);
2219
 
1
  /*
2
  * Pannellum - An HTML5 based Panorama Viewer
3
  * Copyright (c) 2011-2018 Matthew Petroff
4
+ *
5
  * Permission is hereby granted, free of charge, to any person obtaining a copy
6
  * of this software and associated documentation files (the "Software"), to deal
7
  * in the Software without restriction, including without limitation the rights
8
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
  * copies of the Software, and to permit persons to whom the Software is
10
  * furnished to do so, subject to the following conditions:
11
+ *
12
  * The above copyright notice and this permission notice shall be included in
13
  * all copies or substantial portions of the Software.
14
+ *
15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
303
  origPitch = config.pitch;
304
 
305
  var i, p;
306
+
307
  if (config.type == 'cubemap') {
308
  panoImage = [];
309
  for (i = 0; i < 6; i++) {
341
  if (config.type == 'cubemap') {
342
  // Quick loading counter for synchronous loading
343
  var itemsToLoad = 6;
344
+
345
  var onLoad = function() {
346
  itemsToLoad--;
347
  if (itemsToLoad === 0) {
348
  onImageLoad();
349
  }
350
  };
351
+
352
  var onError = function(e) {
353
  var a = document.createElement('a');
354
  a.href = e.target.src;
355
  a.innerHTML = a.href;
356
  anError(config.strings.fileAccessError.replace('%s', a.outerHTML));
357
  };
358
+
359
  for (i = 0; i < panoImage.length; i++) {
360
  panoImage[i].onload = onLoad;
361
  panoImage[i].onerror = onError;
372
  if (config.basePath) {
373
  p = config.basePath;
374
  }
375
+
376
  if (config.dynamic !== true) {
377
  // Still image
378
  p = absoluteURL(config.panorama) ? config.panorama : p + config.panorama;
379
+
380
  panoImage.onload = function() {
381
  window.URL.revokeObjectURL(this.src); // Clean up
382
  onImageLoad();
383
  };
384
+
385
  var xhr = new XMLHttpRequest();
386
  xhr.onloadend = function() {
387
  if (xhr.status != 200) {
433
  xhr.send();
434
  }
435
  }
436
+
437
  if (config.draggable)
438
  uiContainer.classList.add('pnlm-grab');
439
  uiContainer.classList.remove('pnlm-grabbing');
522
  var start = img.indexOf('<x:xmpmeta');
523
  if (start > -1 && config.ignoreGPanoXMP !== true) {
524
  var xmpData = img.substring(start, img.indexOf('</x:xmpmeta>') + 12);
525
+
526
  // Extract the requested tag from the XMP data
527
  var getTag = function(tag) {
528
  var result;
538
  }
539
  return null;
540
  };
541
+
542
  // Relevant XMP data
543
  var xmp = {
544
  fullWidth: getTag('GPano:FullPanoWidthPixels'),
550
  horizonPitch: getTag('GPano:PosePitchDegrees'),
551
  horizonRoll: getTag('GPano:PoseRollDegrees')
552
  };
553
+
554
  if (xmp.fullWidth !== null && xmp.croppedWidth !== null &&
555
  xmp.fullHeight !== null && xmp.croppedHeight !== null &&
556
  xmp.topPixels !== null) {
557
+
558
  // Set up viewer using GPano XMP data
559
  if (specifiedPhotoSphereExcludes.indexOf('haov') < 0)
560
  config.haov = xmp.croppedWidth / xmp.fullWidth * 360;
575
  if (specifiedPhotoSphereExcludes.indexOf('horizonRoll') < 0)
576
  config.horizonRoll = xmp.horizonRoll;
577
  }
578
+
579
  // TODO: add support for initial view settings
580
  }
581
  }
582
+
583
  // Load panorama
584
  panoImage.src = window.URL.createObjectURL(image);
585
  });
663
  event.preventDefault();
664
  // But not all of it
665
  container.focus();
666
+
667
  // Only do something if the panorama is loaded
668
  if (!loaded || !config.draggable) {
669
  return;
670
  }
671
+
672
  // Calculate mouse position relative to top left of viewer container
673
  var pos = mousePosition(event);
674
 
691
 
692
  isUserInteracting = true;
693
  latestInteraction = Date.now();
694
+
695
  onPointerDownPointerX = pos.x;
696
  onPointerDownPointerY = pos.y;
697
+
698
  onPointerDownYaw = config.yaw;
699
  onPointerDownPitch = config.pitch;
700
+
701
  uiContainer.classList.add('pnlm-grabbing');
702
  uiContainer.classList.remove('pnlm-grab');
703
+
704
  fireEvent('mousedown', event);
705
  animateInit();
706
  }
762
  var yaw = ((Math.atan(onPointerDownPointerX / canvasWidth * 2 - 1) - Math.atan(pos.x / canvasWidth * 2 - 1)) * 180 / Math.PI * config.hfov / 90) + onPointerDownYaw;
763
  speed.yaw = (yaw - config.yaw) % 360 * 0.2;
764
  config.yaw = yaw;
765
+
766
  var vfov = 2 * Math.atan(Math.tan(config.hfov/360*Math.PI) * canvasHeight / canvasWidth) * 180 / Math.PI;
767
+
768
  var pitch = ((Math.atan(pos.y / canvasHeight * 2 - 1) - Math.atan(onPointerDownPointerY / canvasHeight * 2 - 1)) * 180 / Math.PI * vfov / 90) + onPointerDownPitch;
769
  speed.pitch = (pitch - config.pitch) * 0.2;
770
  config.pitch = pitch;
817
 
818
  onPointerDownPointerX = pos0.x;
819
  onPointerDownPointerY = pos0.y;
820
+
821
  if (event.targetTouches.length == 2) {
822
  // Down pointer is the center of the two fingers
823
  var pos1 = mousePosition(event.targetTouches[1]);
828
  }
829
  isUserInteracting = true;
830
  latestInteraction = Date.now();
831
+
832
  onPointerDownYaw = config.yaw;
833
  onPointerDownPitch = config.pitch;
834
 
856
  var pos0 = mousePosition(event.targetTouches[0]);
857
  var clientX = pos0.x;
858
  var clientY = pos0.y;
859
+
860
  if (event.targetTouches.length == 2 && onPointerDownPointerDist != -1) {
861
  var pos1 = mousePosition(event.targetTouches[1]);
862
  clientX += (pos1.x - pos0.x) * 0.5;
991
  setHfov(config.hfov + event.detail * 1.5);
992
  speed.hfov = event.detail > 0 ? 1 : -1;
993
  }
994
+
995
  animateInit();
996
  }
997
 
1015
  if (usedKeyNumbers.indexOf(keynumber) < 0)
1016
  return
1017
  event.preventDefault();
1018
+
1019
  // If escape key is pressed
1020
  if (keynumber == 27) {
1021
  // If in fullscreen mode
1046
  function onDocumentKeyUp(event) {
1047
  // Record key pressed
1048
  var keynumber = event.which || event.keycode;
1049
+
1050
  // Override default action for keys that are used
1051
  if (usedKeyNumbers.indexOf(keynumber) < 0)
1052
  return
1053
  event.preventDefault();
1054
+
1055
  // Change key
1056
  changeKey(keynumber, false);
1057
  }
1069
  case 109: case 189: case 17: case 173:
1070
  if (keysDown[0] != value) { keyChanged = true; }
1071
  keysDown[0] = value; break;
1072
+
1073
  // If plus key is released
1074
  case 107: case 187: case 16: case 61:
1075
  if (keysDown[1] != value) { keyChanged = true; }
1076
  keysDown[1] = value; break;
1077
+
1078
  // If up arrow is released
1079
  case 38:
1080
  if (keysDown[2] != value) { keyChanged = true; }
1081
  keysDown[2] = value; break;
1082
+
1083
  // If "w" is released
1084
  case 87:
1085
  if (keysDown[6] != value) { keyChanged = true; }
1086
  keysDown[6] = value; break;
1087
+
1088
  // If down arrow is released
1089
  case 40:
1090
  if (keysDown[3] != value) { keyChanged = true; }
1091
  keysDown[3] = value; break;
1092
+
1093
  // If "s" is released
1094
  case 83:
1095
  if (keysDown[7] != value) { keyChanged = true; }
1096
  keysDown[7] = value; break;
1097
+
1098
  // If left arrow is released
1099
  case 37:
1100
  if (keysDown[4] != value) { keyChanged = true; }
1101
  keysDown[4] = value; break;
1102
+
1103
  // If "a" is released
1104
  case 65:
1105
  if (keysDown[8] != value) { keyChanged = true; }
1106
  keysDown[8] = value; break;
1107
+
1108
  // If right arrow is released
1109
  case 39:
1110
  if (keysDown[5] != value) { keyChanged = true; }
1111
  keysDown[5] = value; break;
1112
+
1113
  // If "d" is released
1114
  case 68:
1115
  if (keysDown[9] != value) { keyChanged = true; }
1116
  keysDown[9] = value;
1117
  }
1118
+
1119
  if (keyChanged && value) {
1120
  if (typeof performance !== 'undefined' && performance.now()) {
1121
  prevTime = performance.now();
1142
  var prevPitch = config.pitch;
1143
  var prevYaw = config.yaw;
1144
  var prevZoom = config.hfov;
1145
+
1146
  var newTime;
1147
  if (typeof performance !== 'undefined' && performance.now()) {
1148
  newTime = performance.now();
1154
  }
1155
  var diff = (newTime - prevTime) * config.hfov / 1700;
1156
  diff = Math.min(diff, 1.0);
1157
+
1158
  // If minus key is down
1159
  if (keysDown[0] && config.keyboardZoom === true) {
1160
  setHfov(config.hfov + (speed.hfov * 0.8 + 0.5) * diff);
1161
  isKeyDown = true;
1162
  }
1163
+
1164
  // If plus key is down
1165
  if (keysDown[1] && config.keyboardZoom === true) {
1166
  setHfov(config.hfov + (speed.hfov * 0.8 - 0.2) * diff);
1167
  isKeyDown = true;
1168
  }
1169
+
1170
  // If up arrow or "w" is down
1171
  if (keysDown[2] || keysDown[6]) {
1172
  // Pan up
1173
  config.pitch += (speed.pitch * 0.8 + 0.2) * diff;
1174
  isKeyDown = true;
1175
  }
1176
+
1177
  // If down arrow or "s" is down
1178
  if (keysDown[3] || keysDown[7]) {
1179
  // Pan down
1180
  config.pitch += (speed.pitch * 0.8 - 0.2) * diff;
1181
  isKeyDown = true;
1182
  }
1183
+
1184
  // If left arrow or "a" is down
1185
  if (keysDown[4] || keysDown[8]) {
1186
  // Pan left
1187
  config.yaw += (speed.yaw * 0.8 - 0.2) * diff;
1188
  isKeyDown = true;
1189
  }
1190
+
1191
  // If right arrow or "d" is down
1192
  if (keysDown[5] || keysDown[9]) {
1193
  // Pan right
1208
  yawDiff = (-config.autoRotate > 0 ? 1 : -1) * Math.min(Math.abs(config.autoRotate * timeDiff), Math.abs(yawDiff));
1209
  config.yaw += yawDiff;
1210
  }
1211
+
1212
  // Deal with stopping auto rotation after a set delay
1213
  if (config.autoRotateStopDelay) {
1214
  config.autoRotateStopDelay -= newTime - prevTime;
1238
  if (diff > 0 && !config.autoRotate) {
1239
  // "Friction"
1240
  var friction = 0.85;
1241
+
1242
  // Yaw
1243
  if (!keysDown[4] && !keysDown[5] && !keysDown[8] && !keysDown[9] && !animatedMove.yaw) {
1244
  config.yaw += speed.yaw * diff * friction;
1258
  speed.yaw = speed.yaw * 0.8 + (config.yaw - prevYaw) / diff * 0.2;
1259
  speed.pitch = speed.pitch * 0.8 + (config.pitch - prevPitch) / diff * 0.2;
1260
  speed.hfov = speed.hfov * 0.8 + (config.hfov - prevZoom) / diff * 0.2;
1261
+
1262
  // Limit speed
1263
  var maxSpeed = config.autoRotate ? Math.abs(config.autoRotate) : 5;
1264
  speed.yaw = Math.min(maxSpeed, Math.max(speed.yaw, -maxSpeed));
1265
  speed.pitch = Math.min(maxSpeed, Math.max(speed.pitch, -maxSpeed));
1266
  speed.hfov = Math.min(maxSpeed, Math.max(speed.hfov, -maxSpeed));
1267
  }
1268
+
1269
  // Stop movement if opposite controls are pressed
1270
  if (keysDown[0] && keysDown[0]) {
1271
  speed.hfov = 0;
1371
  if (autoRotateStartTime > 0) {
1372
  autoRotateStart = setTimeout(function() {
1373
  config.autoRotate = autoRotateSpeed;
1374
+ _this.lookAt(0, undefined, origHfov, 3000);
1375
  animateInit();
1376
  }, autoRotateStartTime);
1377
  } else if (config.autoRotateInactivityDelay >= 0 && autoRotateSpeed) {
1412
  }
1413
  }
1414
  config.yaw = Math.max(minYaw, Math.min(maxYaw, config.yaw));
1415
+
1416
  // Check if we autoRotate in a limited by min and max yaw
1417
  // If so reverse direction
1418
  if (config.autoRotate !== false && tmpyaw != config.yaw) {
1435
  if (isNaN(maxPitch))
1436
  maxPitch = 90;
1437
  config.pitch = Math.max(minPitch, Math.min(maxPitch, config.pitch));
1438
+
1439
  renderer.render(config.pitch * Math.PI / 180, config.yaw * Math.PI / 180, config.hfov * Math.PI / 180, {roll: config.roll * Math.PI / 180});
1440
+
1441
  renderHotSpots();
1442
+
1443
  // Update compass
1444
  if (config.compass) {
1445
  compass.style.transform = 'rotate(' + (-config.yaw - config.northOffset) + 'deg)';
1576
  }
1577
  } catch(event) {
1578
  // Panorama not loaded
1579
+
1580
  // Display error if there is a bad texture
1581
  if (event.type == 'webgl error' || event.type == 'no webgl') {
1582
  anError();
1607
  fireEvent('scenechangefadedone');
1608
  }, config.sceneFadeDuration);
1609
  }
1610
+
1611
  // Show compass if applicable
1612
  if (config.compass) {
1613
  compass.style.display = 'inline';
1614
  } else {
1615
  compass.style.display = 'none';
1616
  }
1617
+
1618
  // Show hotspots
1619
  createHotSpots();
1620
+
1621
  // Hide loading display
1622
  infoDisplay.load.box.style.display = 'none';
1623
  if (preview !== undefined) {
1627
  loaded = true;
1628
 
1629
  fireEvent('load');
1630
+
1631
  animateInit();
1632
  }
1633
 
1820
  var k, s;
1821
  var photoSphereExcludes = ['haov', 'vaov', 'vOffset', 'northOffset', 'horizonPitch', 'horizonRoll'];
1822
  specifiedPhotoSphereExcludes = [];
1823
+
1824
  // Merge default config
1825
  for (k in defaultConfig) {
1826
  if (defaultConfig.hasOwnProperty(k)) {
1827
  config[k] = defaultConfig[k];
1828
  }
1829
  }
1830
+
1831
  // Merge default scene config
1832
  for (k in initialConfig.default) {
1833
  if (initialConfig.default.hasOwnProperty(k)) {
1845
  }
1846
  }
1847
  }
1848
+
1849
  // Merge current scene config
1850
  if ((sceneId !== null) && (sceneId !== '') && (initialConfig.scenes) && (initialConfig.scenes[sceneId])) {
1851
  var scene = initialConfig.scenes[sceneId];
1867
  }
1868
  config.scene = sceneId;
1869
  }
1870
+
1871
  // Merge initial config
1872
  for (k in initialConfig) {
1873
  if (initialConfig.hasOwnProperty(k)) {
1938
  infoDisplay.title.innerHTML = escapeHTML(config[key]);
1939
  infoDisplay.container.style.display = 'inline';
1940
  break;
1941
+
1942
  case 'author':
1943
  infoDisplay.author.innerHTML = config.strings.bylineLabel.replace('%s', escapeHTML(config[key]));
1944
  infoDisplay.container.style.display = 'inline';
1945
  break;
1946
+
1947
  case 'fallback':
1948
  infoDisplay.errorMsg.innerHTML = '<p>Your browser does not support WebGL.<br><a href="' + encodeURI(config[key]) + '" target="_blank">Click here to view this panorama in an alternative viewer.</a></p>';
1949
  break;
1950
+
1951
  case 'hfov':
1952
  setHfov(Number(config[key]));
1953
  break;
1954
+
1955
  case 'autoLoad':
1956
  if (config[key] === true && renderer === undefined) {
1957
  // Show loading box
1962
  init();
1963
  }
1964
  break;
1965
+
1966
  case 'showZoomCtrl':
1967
  if (config[key] && config.showControls != false) {
1968
  // Show zoom controls
1976
  case 'showFullscreenCtrl':
1977
  if (config[key] && config.showControls != false && ('fullscreen' in document || 'mozFullScreen' in document ||
1978
  'webkitIsFullScreen' in document || 'msFullscreenElement' in document)) {
1979
+
1980
  // Show fullscreen control
1981
  controls.fullscreen.style.display = 'block';
1982
  } else {
2171
  function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) {
2172
  loaded = false;
2173
  animatedMove = {};
2174
+
2175
  // Set up fade if specified
2176
  var fadeImg, workingPitch, workingYaw, workingHfov;
2177
  if (config.sceneFadeDuration && !fadeDone) {
2191
  return;
2192
  }
2193
  }
2194
+
2195
  // Set new pointing
2196
  if (targetPitch === 'same') {
2197
  workingPitch = config.pitch;
2210
  } else {
2211
  workingHfov = targetHfov;
2212
  }
2213
+
2214
  // Destroy hot spots from previous scene
2215
  destroyHotSpots();
2216
+
2217
  // Create the new config for the scene
2218
  mergeConfig(sceneId);
2219
 
wpvr.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: WP VR
17
  * Plugin URI: https://rextheme.com/wpvr/
18
  * Description: WP VR - 360 Panorama and virtual tour creator for WordPress is a customized panaroma & virtual builder tool for WordPress Website.
19
- * Version: 3.4.2
20
  * Author: Rextheme
21
  * Author URI: http://rextheme.com/
22
  * License: GPL-2.0+
16
  * Plugin Name: WP VR
17
  * Plugin URI: https://rextheme.com/wpvr/
18
  * Description: WP VR - 360 Panorama and virtual tour creator for WordPress is a customized panaroma & virtual builder tool for WordPress Website.
19
+ * Version: 3.4.3
20
  * Author: Rextheme
21
  * Author URI: http://rextheme.com/
22
  * License: GPL-2.0+