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

Version Description

(25-7-2020) = * Submit restriction to control gyro for SSL * Add-on compatibility added * Mobile notice added * License input type changed to password * On click content container responsive issue fixed

=

Download this release

Release Info

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

Code changes from version 5.7.0 to 5.8.0

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.4.2
7
- Stable tag: 5.7.0
8
  Requires PHP: 7.0.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -404,5 +404,12 @@ Simply add "/plugins/wpvr" to exclusion field (or use the location where you sto
404
  * Gallery scene ids replaced with scene title
405
  * Plugin rollback feature added
406
 
 
 
 
 
 
 
 
407
  == Upgrade Notice ==
408
  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.4.2
7
+ Stable tag: 5.8.0
8
  Requires PHP: 7.0.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
404
  * Gallery scene ids replaced with scene title
405
  * Plugin rollback feature added
406
 
407
+ = 5.8.0 (25-7-2020) =
408
+ * Submit restriction to control gyro for SSL
409
+ * Add-on compatibility added
410
+ * Mobile notice added
411
+ * License input type changed to password
412
+ * On click content container responsive issue fixed
413
+
414
  == Upgrade Notice ==
415
  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-admin-pages.php CHANGED
@@ -17,7 +17,7 @@ class Wpvr_Admin_Pages {
17
  */
18
  function wpvr_add_admin_pages() {
19
 
20
- add_menu_page( 'WP VR', 'WP VR', 'manage_options', 'wpvr', array( $this, 'wpvr_admin_doc'),plugins_url(). '/wpvr/images/icon.png' , 110);
21
 
22
  add_submenu_page( 'wpvr', 'WP VR', 'Get Started','manage_options', 'wpvr', array( $this, 'wpvr_admin_doc'));
23
 
17
  */
18
  function wpvr_add_admin_pages() {
19
 
20
+ add_menu_page( 'WP VR', 'WP VR', 'manage_options', 'wpvr', array( $this, 'wpvr_admin_doc'),plugins_url(). '/wpvr/images/icon.png' , 25);
21
 
22
  add_submenu_page( 'wpvr', 'WP VR', 'Get Started','manage_options', 'wpvr', array( $this, 'wpvr_admin_doc'));
23
 
admin/class-wpvr-admin.php CHANGED
@@ -85,15 +85,16 @@ class Wpvr_Admin {
85
  wp_enqueue_style( 'materialize-css', plugin_dir_url( __FILE__ ) . 'css/materialize.min.css', array(), $this->version, 'all' );
86
  wp_enqueue_style( 'materialize-icons', plugin_dir_url( __FILE__ ) . 'lib/materializeicon.css', array(), $this->version, 'all' );
87
  wp_enqueue_style( 'owl-css', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css', array(), $this->version, 'all' );
88
-
89
  wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpvr-admin.css', array(), $this->version, 'all' );
90
  }
91
 
92
  if ($screen->id=="wpvr_item") {
 
93
  wp_enqueue_style( $this->plugin_name . 'fontawesome', plugin_dir_url( __FILE__ ) . 'lib/fontawesome/css/all.css', array(), $this->version, 'all' );
94
  wp_enqueue_style( 'icon-picker-css', plugin_dir_url( __FILE__ ) . 'css/jquery.fonticonpicker.min.css', array(), $this->version, 'all' );
95
  wp_enqueue_style( 'icon-picker-css-theme', plugin_dir_url( __FILE__ ) . 'css/jquery.fonticonpicker.grey.min.css', array(), $this->version, 'all' );
96
- wp_enqueue_style( 'owl-css', plugin_dir_url( __FILE__ ) . 'css/owl.carousel.css', array(), $this->version, 'all' );
97
  wp_enqueue_style('panellium-css', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/css/pannellum.css', array(), true);
98
  wp_enqueue_style('videojs-css', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/css/video-js.css', array(), true);
99
  wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpvr-admin.css', array(), $this->version, 'all' );
@@ -131,7 +132,7 @@ class Wpvr_Admin {
131
  wp_enqueue_script( 'jquery-repeater', plugin_dir_url( __FILE__ ) .'js/jquery.repeater.min.js', array('jquery'), true);
132
  wp_enqueue_script('icon-picker', plugin_dir_url( __FILE__ ) . 'lib/jquery.fonticonpicker.min.js', array(), true);
133
  wp_enqueue_script( 'owl', plugin_dir_url( __FILE__ ) . 'js/owl.carousel.js', array( 'jquery' ), false );
134
- wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wpvr-admin.js', array( 'jquery' ), $this->version, false );
135
  wp_localize_script( $this->plugin_name, 'wpvr_obj', array(
136
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
137
  'ajax_nonce' => wp_create_nonce('wpvr'),
@@ -149,7 +150,37 @@ class Wpvr_Admin {
149
  ) );
150
  }
151
 
152
- /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  * Init the edit screen of the plugin post type item
154
  *
155
  * @since 1.0.0
@@ -160,6 +191,7 @@ class Wpvr_Admin {
160
  */
161
 
162
  add_meta_box(
 
163
  $this->post_type . '_builder__box',
164
  __('Tour Preview', $this->plugin_name),
165
  array($this, 'wpvr_display_meta_box_builder'),
@@ -167,16 +199,9 @@ class Wpvr_Admin {
167
  'side',
168
  'high'
169
  );
170
-
171
- // add_meta_box(
172
- // $this->post_type . '_shortcode_box',
173
- // __('Using this VR', $this->plugin_name),
174
- // array($this, 'wpvr_display_meta_box_shortcode'),
175
- // $this->post_type,
176
- // 'side'
177
- // );
178
  }
179
 
 
180
  /**
181
  * Register the custom post type
182
  *
@@ -293,7 +318,8 @@ class Wpvr_Admin {
293
  * Custom Metabox
294
  */
295
  public function wpvr_add_setup_metabox(){
296
- add_meta_box( 'setup', __( 'Setup' ), array($this, 'wpvr_setup'), 'wpvr_item', 'normal', 'low' );
 
297
  }
298
  public function wpvr_setup($post) {
299
 
@@ -355,40 +381,64 @@ class Wpvr_Admin {
355
 
356
  $html = '';
357
 
 
 
358
  $html .= '<div class="pano-setup">';
359
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  $html .= '<div class="pano-alert scene-alert">';
361
  $html .= '<span class="destroy"><i class="fa fa-times"></i></span>';
362
  $html .= '<p></p>';
363
  $html .= '</div>';
364
 
365
  $html .='<div class="rex-pano-tabs">';
366
- $html .='<nav class="rex-pano-tab-nav rex-pano-nav-menu main-nav">';
367
  $html .='<ul>';
368
  $html .='<li class="logo"><img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/logo.png'.'" alt="logo" /></li>';
369
 
370
- $html .='<li class="general active">';
371
  $html .='<span data-href="#general">';
372
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/general-regular.png'.'" alt="icon" class="regular" />';
373
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/general-hover.png'.'" alt="icon" class="hover" />';
374
  $html .=''.__('General','wpvr').'</span>';
375
  $html .='</li>';
376
 
377
- $html .='<li class="scene">';
378
  $html .='<span data-href="#scenes">';
379
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/scenes-regular.png'.'" alt="icon" class="regular" />';
380
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/scenes-hover.png'.'" alt="icon" class="hover" />';
381
  $html .=''.__('Scenes','wpvr').'</span>';
382
  $html .='</li>';
383
 
384
- $html .='<li class="hotspot">';
385
  $html .='<span data-href="#scenes">';
386
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/hotspot-regular.png'.'" alt="icon" class="regular" />';
387
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/hotspot-hover.png'.'" alt="icon" class="hover" />';
388
  $html .=''.__('Hotspot','wpvr').'</span>';
389
  $html .='</li>';
390
 
391
- $html .='<li class="video">';
392
  $html .='<span data-href="#video">';
393
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/video-regular.png'.'" alt="icon" class="regular" />';
394
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/video-hover.png'.'" alt="icon" class="hover" />';
@@ -397,9 +447,9 @@ class Wpvr_Admin {
397
  $html .='</ul>';
398
  $html .='</nav>';
399
 
400
- $html .='<div class="rex-pano-tab-content">';
401
  $html .='<div class="rex-pano-tab general active" id="general">';
402
-
403
  //=start inner tab=
404
  $html .= '<div class="general-inner-tab">';
405
  //=start inner nav=
@@ -516,7 +566,7 @@ class Wpvr_Admin {
516
  $html .= '<input id="wpvr_controls" class="vr-switcher-check" value="off" name="controls" type="checkbox" />';
517
  $html .= '<label for="wpvr_controls"></label>';
518
  $html .= '</span>';
519
-
520
  $html .= '<div class="field-tooltip">';
521
  $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
522
  $html .= '<span>'.__('This option will display Zoom In, Zoom Out and Full Screen buttons on the tour.','wpvr').'</span>';
@@ -596,7 +646,7 @@ class Wpvr_Admin {
596
  $html .= '<div class="single-settings autorotationdata" >';
597
  $html .= '<span>'.__('Resume Auto-rotation after: ','wpvr').'</span>';
598
  $html .= '<input type="number" name="auto-rotation-inactive-delay" value="'.$autorotationinactivedelay.'" placeholder="2000" />';
599
-
600
  $html .= '<div class="field-tooltip">';
601
  $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
602
  $html .= '<span>'.__('When someone clicks on the tour, auto-rotation stops. Here, set a time after which auto rotation will start again. Assign in milliseconds, where 1000 milliseconds = 1 second.','wpvr').'</span>';
@@ -608,7 +658,7 @@ class Wpvr_Admin {
608
  $html .= '<div class="single-settings autorotationdata" >';
609
  $html .= '<span>'.__('Stop Auto-rotation after: ','wpvr').'</span>';
610
  $html .= '<input type="number" name="auto-rotation-stop-delay" value="'.$autorotationstopdelay.'" placeholder="2000" />';
611
-
612
  $html .= '<div class="field-tooltip">';
613
  $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
614
  $html .= '<span>'.__('Set a time after which auto rotation will stop. Assign in milliseconds, where 1000 milliseconds = 1 second.','wpvr').'</span>';
@@ -627,7 +677,7 @@ class Wpvr_Admin {
627
  $html .= '<div class="advanced-settings-content inner-single-content" id="gen-advanced">';
628
  $html .= '<div class="content-wrapper">';
629
  $html .= '<div class="left">';
630
-
631
  //=Keyboard Movement Control=//
632
  $html .= '<div class="single-settings compass">';
633
  $html .= '<span>'.__('Keyboard Movement Control: ','wpvr').'</span>';
@@ -767,7 +817,7 @@ class Wpvr_Admin {
767
  $html .= '</span>';
768
  $html .= '</div>';
769
  //===Company logo end===//
770
-
771
  $html .= '</div>';
772
  //===end right===//
773
 
@@ -785,7 +835,7 @@ class Wpvr_Admin {
785
  $html .= '<div class="color-icon">';
786
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-up.jpg'.'" alt="icon" />';
787
  $html .= '</div>';
788
-
789
  $html .= '<span class="wpvr-switcher">';
790
  $html .= '<input id="wpvr_panupControl" class="vr-switcher-check" value="off" name="panupControl" type="checkbox" disabled />';
791
  $html .= '<label for="wpvr_panupControl" title="Pro Feature"></label>';
@@ -797,7 +847,7 @@ class Wpvr_Admin {
797
  //=====Move Down====//
798
  $html .= '<div class="single-settings controls custom-data-set">';
799
  $html .= '<span>'.__('Move Down: ','wpvr').'</span>';
800
-
801
  $html .= '<div class="color-icon">';
802
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-down.jpg'.'" alt="icon" />';
803
  $html .= '</div>';
@@ -816,7 +866,7 @@ class Wpvr_Admin {
816
  $html .= '<div class="color-icon">';
817
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-left.jpg'.'" alt="icon" />';
818
  $html .= '</div>';
819
-
820
  $html .= '<span class="wpvr-switcher">';
821
  $html .= '<input id="wpvr_panLeftControl" class="vr-switcher-check" value="off" name="panLeftControl" type="checkbox" disabled />';
822
  $html .= '<label for="wpvr_panLeftControl" title="Pro Feature"></label>';
@@ -842,7 +892,7 @@ class Wpvr_Admin {
842
  //=====Zoom In====//
843
  $html .= '<div class="single-settings controls custom-data-set">';
844
  $html .= '<span>'.__('Zoom In: ','wpvr').'</span>';
845
-
846
  $html .= '<div class="color-icon">';
847
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/zoom-in.jpg'.'" alt="icon" />';
848
  $html .= '</div>';
@@ -874,7 +924,7 @@ class Wpvr_Admin {
874
 
875
  $html .= '</div>';
876
  //=====Zoom Out End====//
877
-
878
  //===== Full Screen====//
879
  $html .= '<div class="single-settings controls custom-data-set">';
880
  $html .= '<span>'.__('Full Screen: ','wpvr').'</span>';
@@ -882,7 +932,7 @@ class Wpvr_Admin {
882
  $html .= '<div class="color-icon">';
883
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/full-screen.jpg'.'" alt="icon" />';
884
  $html .= '</div>';
885
-
886
  $html .= '<span class="wpvr-switcher">';
887
  $html .= '<input id="wpvr_panFullscreenControl" class="vr-switcher-check" value="off" name="panFullscreenControl" type="checkbox" disabled />';
888
  $html .= '<label for="wpvr_panFullscreenControl" title="Pro Feature"></label>';
@@ -898,7 +948,7 @@ class Wpvr_Admin {
898
  $html .= '<div class="color-icon">';
899
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/gryscop.jpg'.'" alt="icon" />';
900
  $html .= '</div>';
901
-
902
  $html .= '<span class="wpvr-switcher">';
903
  $html .= '<input id="wpvr_gyroscope" class="vr-switcher-check" value="off" name="gyroscope" type="checkbox" disabled />';
904
  $html .= '<label for="wpvr_gyroscope" title="Pro Feature"></label>';
@@ -914,7 +964,7 @@ class Wpvr_Admin {
914
  $html .= '<div class="color-icon">';
915
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/home.jpg'.'" alt="icon" />';
916
  $html .= '</div>';
917
-
918
  $html .= '<span class="wpvr-switcher">';
919
  $html .= '<input id="wpvr_backToHome" class="vr-switcher-check" value="off" name="backToHome" type="checkbox" disabled />';
920
  $html .= '<label for="wpvr_backToHome" title="Pro Feature"></label>';
@@ -949,11 +999,13 @@ class Wpvr_Admin {
949
 
950
  $html .= '<div class="shortcode-field">';
951
  $html .= '<p class="copycode" id="copy-shortcode">[wpvr id="'.$id.'"]</p>';
 
952
  $html .= '<span id="wpvr-copy-shortcode" class="wpvr-copy-shortcode">';
953
  $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/copy.png'.'" alt="icon" />';
954
  $html .= '</span>';
955
  $html .= '</div>';
956
 
 
957
  $html .= '<span id="wpvr-copied-notice" class="wpvr-copied-notice"></span>';
958
 
959
  $html .= '</div>';
@@ -977,6 +1029,7 @@ class Wpvr_Admin {
977
  $html .= '</div>';
978
  //=end inner tab=
979
 
 
980
  $html .= '<script>';
981
  $html .= '
982
 
@@ -1077,7 +1130,7 @@ class Wpvr_Admin {
1077
  $html .= '</select>';
1078
  $html .= '</div>';
1079
  //==Set Default Scene end==//
1080
-
1081
  $html .= '<div class=scene-setting>';
1082
  $html .= '<label for="scene-id">'.__('Scene ID : ','wpvr').'</label>';
1083
  $html .= '<input class="sceneid" type="text" name="scene-id"/>';
@@ -1475,7 +1528,7 @@ class Wpvr_Admin {
1475
 
1476
  $html .= '<div class="scene-content">';
1477
  $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1478
-
1479
  $html .= '<div class="scene-left">';
1480
  //==Set Default Scene==//
1481
  if ($dscene == 'on') {
@@ -1518,7 +1571,7 @@ class Wpvr_Admin {
1518
  $html .= '</div>';
1519
  $html .= '</div>';
1520
  // ---end scene left---
1521
-
1522
  $html .= '</div>';
1523
 
1524
  if (!empty($pano_hotspots)) {
@@ -1927,7 +1980,7 @@ class Wpvr_Admin {
1927
  $html .= '</div>';
1928
  $html .= '</div>';
1929
  //--end scene left----
1930
-
1931
  $html .= '</div>';
1932
 
1933
  if (!empty($pano_hotspots)) {
@@ -2522,4 +2575,5 @@ class Wpvr_Admin {
2522
  }
2523
  }
2524
 
 
2525
  }
85
  wp_enqueue_style( 'materialize-css', plugin_dir_url( __FILE__ ) . 'css/materialize.min.css', array(), $this->version, 'all' );
86
  wp_enqueue_style( 'materialize-icons', plugin_dir_url( __FILE__ ) . 'lib/materializeicon.css', array(), $this->version, 'all' );
87
  wp_enqueue_style( 'owl-css', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css', array(), $this->version, 'all' );
88
+
89
  wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpvr-admin.css', array(), $this->version, 'all' );
90
  }
91
 
92
  if ($screen->id=="wpvr_item") {
93
+
94
  wp_enqueue_style( $this->plugin_name . 'fontawesome', plugin_dir_url( __FILE__ ) . 'lib/fontawesome/css/all.css', array(), $this->version, 'all' );
95
  wp_enqueue_style( 'icon-picker-css', plugin_dir_url( __FILE__ ) . 'css/jquery.fonticonpicker.min.css', array(), $this->version, 'all' );
96
  wp_enqueue_style( 'icon-picker-css-theme', plugin_dir_url( __FILE__ ) . 'css/jquery.fonticonpicker.grey.min.css', array(), $this->version, 'all' );
97
+ wp_enqueue_style( 'owl-css', plugin_dir_url( __FILE__ ) . 'css/owl.carousel.css', array(), $this->version, 'all' );
98
  wp_enqueue_style('panellium-css', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/css/pannellum.css', array(), true);
99
  wp_enqueue_style('videojs-css', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/css/video-js.css', array(), true);
100
  wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpvr-admin.css', array(), $this->version, 'all' );
132
  wp_enqueue_script( 'jquery-repeater', plugin_dir_url( __FILE__ ) .'js/jquery.repeater.min.js', array('jquery'), true);
133
  wp_enqueue_script('icon-picker', plugin_dir_url( __FILE__ ) . 'lib/jquery.fonticonpicker.min.js', array(), true);
134
  wp_enqueue_script( 'owl', plugin_dir_url( __FILE__ ) . 'js/owl.carousel.js', array( 'jquery' ), false );
135
+ wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wpvr-admin.js', array( 'jquery' ), $this->version, true );
136
  wp_localize_script( $this->plugin_name, 'wpvr_obj', array(
137
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
138
  'ajax_nonce' => wp_create_nonce('wpvr'),
150
  ) );
151
  }
152
 
153
+
154
+ /**
155
+ * Plugin action links
156
+ *
157
+ * @param $links
158
+ * @return array
159
+ */
160
+ public function plugin_action_links_wpvr( $actions, $plugin_file, $plugin_data, $context ) {
161
+ $actions['get_started'] = sprintf(
162
+ '<a href="%s">%s</a>',
163
+ esc_url( admin_url( 'admin.php?page=wpvr' ) ),
164
+ esc_html__( 'Get Started', 'wpvr' )
165
+ );
166
+ $actions['documentation'] = sprintf(
167
+ '<a href="%s" target="_blank">%s</a>',
168
+ esc_url( 'https://rextheme.com/docs-category/wp-vr/' ),
169
+ esc_html__( 'Documentation', 'wpvr' )
170
+ );
171
+
172
+ if(!apply_filters('is_wpvr_pro_active', false)) {
173
+ $actions['go-pro'] = sprintf(
174
+ '<a href="%s" target="_blank" style="color: #201cfe; font-weight: bold;">%s</a>',
175
+ esc_url( 'https://rextheme.com/wpvr/#pricing' ),
176
+ esc_html__( 'Go Pro', 'wpvr' )
177
+ );
178
+ }
179
+ return $actions;
180
+ }
181
+
182
+
183
+ /**
184
  * Init the edit screen of the plugin post type item
185
  *
186
  * @since 1.0.0
191
  */
192
 
193
  add_meta_box(
194
+
195
  $this->post_type . '_builder__box',
196
  __('Tour Preview', $this->plugin_name),
197
  array($this, 'wpvr_display_meta_box_builder'),
199
  'side',
200
  'high'
201
  );
 
 
 
 
 
 
 
 
202
  }
203
 
204
+
205
  /**
206
  * Register the custom post type
207
  *
318
  * Custom Metabox
319
  */
320
  public function wpvr_add_setup_metabox(){
321
+
322
+ add_meta_box( 'setup', __( 'Setup' ), array($this, 'wpvr_setup'), 'wpvr_item', 'normal', 'high' );
323
  }
324
  public function wpvr_setup($post) {
325
 
381
 
382
  $html = '';
383
 
384
+
385
+
386
  $html .= '<div class="pano-setup">';
387
 
388
+ // active tab variables
389
+ $active_tab = 'general';
390
+ $scene_active_tab = 1;
391
+ $hotspot_active_tab = 1;
392
+ if(isset($_GET['active_tab'])) {
393
+ $active_tab = $_GET['active_tab'];
394
+ }
395
+ if(isset($_GET['scene'])) {
396
+ $scene_active_tab = $_GET['scene'];
397
+ }
398
+ if(isset($_GET['hotspot'])) {
399
+ $hotspot_active_tab = $_GET['hotspot'];
400
+ }
401
+
402
+ $html = '';
403
+
404
+ $html .= '<div class="pano-setup">';
405
+
406
+ $html .= '<input type="hidden" value="'.$active_tab.'" name="wpvr_active_tab" id="wpvr_active_tab"/>';
407
+ $html .= '<input type="hidden" value="'.$scene_active_tab.'" name="wpvr_active_scenes" id="wpvr_active_scenes"/>';
408
+ $html .= '<input type="hidden" value="'.$hotspot_active_tab.'" name="wpvr_active_hotspot" id="wpvr_active_hotspot"/>';
409
+
410
  $html .= '<div class="pano-alert scene-alert">';
411
  $html .= '<span class="destroy"><i class="fa fa-times"></i></span>';
412
  $html .= '<p></p>';
413
  $html .= '</div>';
414
 
415
  $html .='<div class="rex-pano-tabs">';
416
+ $html .='<nav class="rex-pano-tab-nav rex-pano-nav-menu main-nav" id="wpvr-main-nav">';
417
  $html .='<ul>';
418
  $html .='<li class="logo"><img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/logo.png'.'" alt="logo" /></li>';
419
 
420
+ $html .='<li class="general active" data-screen="general">';
421
  $html .='<span data-href="#general">';
422
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/general-regular.png'.'" alt="icon" class="regular" />';
423
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/general-hover.png'.'" alt="icon" class="hover" />';
424
  $html .=''.__('General','wpvr').'</span>';
425
  $html .='</li>';
426
 
427
+ $html .='<li class="scene" data-screen="scene">';
428
  $html .='<span data-href="#scenes">';
429
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/scenes-regular.png'.'" alt="icon" class="regular" />';
430
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/scenes-hover.png'.'" alt="icon" class="hover" />';
431
  $html .=''.__('Scenes','wpvr').'</span>';
432
  $html .='</li>';
433
 
434
+ $html .='<li class="hotspot" data-screen="hotspot">';
435
  $html .='<span data-href="#scenes">';
436
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/hotspot-regular.png'.'" alt="icon" class="regular" />';
437
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/hotspot-hover.png'.'" alt="icon" class="hover" />';
438
  $html .=''.__('Hotspot','wpvr').'</span>';
439
  $html .='</li>';
440
 
441
+ $html .='<li class="video" data-screen="video">';
442
  $html .='<span data-href="#video">';
443
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/video-regular.png'.'" alt="icon" class="regular" />';
444
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/video-hover.png'.'" alt="icon" class="hover" />';
447
  $html .='</ul>';
448
  $html .='</nav>';
449
 
450
+ $html .='<div class="rex-pano-tab-content" id="wpvr-main-tab-contents">';
451
  $html .='<div class="rex-pano-tab general active" id="general">';
452
+
453
  //=start inner tab=
454
  $html .= '<div class="general-inner-tab">';
455
  //=start inner nav=
566
  $html .= '<input id="wpvr_controls" class="vr-switcher-check" value="off" name="controls" type="checkbox" />';
567
  $html .= '<label for="wpvr_controls"></label>';
568
  $html .= '</span>';
569
+
570
  $html .= '<div class="field-tooltip">';
571
  $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
572
  $html .= '<span>'.__('This option will display Zoom In, Zoom Out and Full Screen buttons on the tour.','wpvr').'</span>';
646
  $html .= '<div class="single-settings autorotationdata" >';
647
  $html .= '<span>'.__('Resume Auto-rotation after: ','wpvr').'</span>';
648
  $html .= '<input type="number" name="auto-rotation-inactive-delay" value="'.$autorotationinactivedelay.'" placeholder="2000" />';
649
+
650
  $html .= '<div class="field-tooltip">';
651
  $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
652
  $html .= '<span>'.__('When someone clicks on the tour, auto-rotation stops. Here, set a time after which auto rotation will start again. Assign in milliseconds, where 1000 milliseconds = 1 second.','wpvr').'</span>';
658
  $html .= '<div class="single-settings autorotationdata" >';
659
  $html .= '<span>'.__('Stop Auto-rotation after: ','wpvr').'</span>';
660
  $html .= '<input type="number" name="auto-rotation-stop-delay" value="'.$autorotationstopdelay.'" placeholder="2000" />';
661
+
662
  $html .= '<div class="field-tooltip">';
663
  $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
664
  $html .= '<span>'.__('Set a time after which auto rotation will stop. Assign in milliseconds, where 1000 milliseconds = 1 second.','wpvr').'</span>';
677
  $html .= '<div class="advanced-settings-content inner-single-content" id="gen-advanced">';
678
  $html .= '<div class="content-wrapper">';
679
  $html .= '<div class="left">';
680
+
681
  //=Keyboard Movement Control=//
682
  $html .= '<div class="single-settings compass">';
683
  $html .= '<span>'.__('Keyboard Movement Control: ','wpvr').'</span>';
817
  $html .= '</span>';
818
  $html .= '</div>';
819
  //===Company logo end===//
820
+
821
  $html .= '</div>';
822
  //===end right===//
823
 
835
  $html .= '<div class="color-icon">';
836
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-up.jpg'.'" alt="icon" />';
837
  $html .= '</div>';
838
+
839
  $html .= '<span class="wpvr-switcher">';
840
  $html .= '<input id="wpvr_panupControl" class="vr-switcher-check" value="off" name="panupControl" type="checkbox" disabled />';
841
  $html .= '<label for="wpvr_panupControl" title="Pro Feature"></label>';
847
  //=====Move Down====//
848
  $html .= '<div class="single-settings controls custom-data-set">';
849
  $html .= '<span>'.__('Move Down: ','wpvr').'</span>';
850
+
851
  $html .= '<div class="color-icon">';
852
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-down.jpg'.'" alt="icon" />';
853
  $html .= '</div>';
866
  $html .= '<div class="color-icon">';
867
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-left.jpg'.'" alt="icon" />';
868
  $html .= '</div>';
869
+
870
  $html .= '<span class="wpvr-switcher">';
871
  $html .= '<input id="wpvr_panLeftControl" class="vr-switcher-check" value="off" name="panLeftControl" type="checkbox" disabled />';
872
  $html .= '<label for="wpvr_panLeftControl" title="Pro Feature"></label>';
892
  //=====Zoom In====//
893
  $html .= '<div class="single-settings controls custom-data-set">';
894
  $html .= '<span>'.__('Zoom In: ','wpvr').'</span>';
895
+
896
  $html .= '<div class="color-icon">';
897
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/zoom-in.jpg'.'" alt="icon" />';
898
  $html .= '</div>';
924
 
925
  $html .= '</div>';
926
  //=====Zoom Out End====//
927
+
928
  //===== Full Screen====//
929
  $html .= '<div class="single-settings controls custom-data-set">';
930
  $html .= '<span>'.__('Full Screen: ','wpvr').'</span>';
932
  $html .= '<div class="color-icon">';
933
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/full-screen.jpg'.'" alt="icon" />';
934
  $html .= '</div>';
935
+
936
  $html .= '<span class="wpvr-switcher">';
937
  $html .= '<input id="wpvr_panFullscreenControl" class="vr-switcher-check" value="off" name="panFullscreenControl" type="checkbox" disabled />';
938
  $html .= '<label for="wpvr_panFullscreenControl" title="Pro Feature"></label>';
948
  $html .= '<div class="color-icon">';
949
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/gryscop.jpg'.'" alt="icon" />';
950
  $html .= '</div>';
951
+
952
  $html .= '<span class="wpvr-switcher">';
953
  $html .= '<input id="wpvr_gyroscope" class="vr-switcher-check" value="off" name="gyroscope" type="checkbox" disabled />';
954
  $html .= '<label for="wpvr_gyroscope" title="Pro Feature"></label>';
964
  $html .= '<div class="color-icon">';
965
  $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/home.jpg'.'" alt="icon" />';
966
  $html .= '</div>';
967
+
968
  $html .= '<span class="wpvr-switcher">';
969
  $html .= '<input id="wpvr_backToHome" class="vr-switcher-check" value="off" name="backToHome" type="checkbox" disabled />';
970
  $html .= '<label for="wpvr_backToHome" title="Pro Feature"></label>';
999
 
1000
  $html .= '<div class="shortcode-field">';
1001
  $html .= '<p class="copycode" id="copy-shortcode">[wpvr id="'.$id.'"]</p>';
1002
+
1003
  $html .= '<span id="wpvr-copy-shortcode" class="wpvr-copy-shortcode">';
1004
  $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/copy.png'.'" alt="icon" />';
1005
  $html .= '</span>';
1006
  $html .= '</div>';
1007
 
1008
+
1009
  $html .= '<span id="wpvr-copied-notice" class="wpvr-copied-notice"></span>';
1010
 
1011
  $html .= '</div>';
1029
  $html .= '</div>';
1030
  //=end inner tab=
1031
 
1032
+
1033
  $html .= '<script>';
1034
  $html .= '
1035
 
1130
  $html .= '</select>';
1131
  $html .= '</div>';
1132
  //==Set Default Scene end==//
1133
+
1134
  $html .= '<div class=scene-setting>';
1135
  $html .= '<label for="scene-id">'.__('Scene ID : ','wpvr').'</label>';
1136
  $html .= '<input class="sceneid" type="text" name="scene-id"/>';
1528
 
1529
  $html .= '<div class="scene-content">';
1530
  $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1531
+
1532
  $html .= '<div class="scene-left">';
1533
  //==Set Default Scene==//
1534
  if ($dscene == 'on') {
1571
  $html .= '</div>';
1572
  $html .= '</div>';
1573
  // ---end scene left---
1574
+
1575
  $html .= '</div>';
1576
 
1577
  if (!empty($pano_hotspots)) {
1980
  $html .= '</div>';
1981
  $html .= '</div>';
1982
  //--end scene left----
1983
+
1984
  $html .= '</div>';
1985
 
1986
  if (!empty($pano_hotspots)) {
2575
  }
2576
  }
2577
 
2578
+
2579
  }
admin/class-wpvr-ajax.php CHANGED
@@ -411,51 +411,30 @@ class Wpvr_Ajax {
411
 
412
  if (!empty($hotspot_data["hotspot-title"])) {
413
 
414
- $hotspot_type = 'info';
415
  $hotspot_content = '';
416
 
417
- if($hotspot_data["hotspot-type"] === 'wc_product') {
418
- $hotspot_type = 'info';
419
- $product_id = $hotspot_data['hotspot-product-id'];
420
- if ( class_exists( 'WooCommerce' ) ) {
421
- $product = wc_get_product($product_id);
422
- if (is_object($product)) {
423
- $post_thumbnail_id = $product->get_image_id();
424
- $html = wc_get_gallery_image_html($post_thumbnail_id, true);
425
- ob_start(); ?>
426
- <div class="wpvr-product-container">
427
- <div class="wpvr-pr-left-block">
428
- <?php echo apply_filters('woocommerce_single_product_image_thumbnail_html', $html, $post_thumbnail_id); ?>
429
- </div>
430
- <div class="wpvr-pr-right-block">
431
- <a href="<?php echo $product->get_permalink(); ?>">
432
- <h2><?php echo $product->get_title(); ?></h2>
433
- </a>
434
- <?php echo do_shortcode('[add_to_cart id="'.$product_id.'"]'); ?>
435
- </div>
436
- </div>
437
- <?php
438
- $hotspot_content = ob_get_clean();
439
- }
440
- }
441
- }
442
- else {
443
- $hotspot_type = $hotspot_data["hotspot-type"];
444
- $hotspot_content = $hotspot_data["hotspot-content"];
445
- }
446
 
447
 
448
  $hotspot_info = array(
449
  "text"=>$hotspot_data["hotspot-title"],
450
  "pitch"=>$hotspot_data["hotspot-pitch"],
451
  "yaw"=>$hotspot_data["hotspot-yaw"],
452
- "type"=>$hotspot_data["hotspot-type"],
453
  "URL"=>$hotspot_data["hotspot-url"],
454
  "clickHandlerArgs"=>$hotspot_content,
455
  "createTooltipArgs"=>$hotspot_data["hotspot-hover"],
456
  "sceneId"=>$hotspot_data["hotspot-scene"],
457
  "targetPitch"=>(float)$hotspot_data["hotspot-scene-pitch"],
458
- "targetYaw"=>(float)$hotspot_data["hotspot-scene-yaw"]);
 
 
459
  array_push($hotspots, $hotspot_info);
460
  if (empty($hotspot_data["hotspot-scene"])) {
461
  unset($hotspot_info['targetPitch']);
@@ -681,6 +660,7 @@ class Wpvr_Ajax {
681
  }
682
 
683
  function wpvr_save_data() {
 
684
  $panoid ='';
685
  $postid = sanitize_text_field($_POST['postid']);
686
  $post_type = get_post_type( $postid );
@@ -701,6 +681,33 @@ class Wpvr_Ajax {
701
  die();
702
  }
703
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
704
  $pnovideo = $_POST['panovideo'];
705
  if ($pnovideo == "on") {
706
 
@@ -735,7 +742,8 @@ class Wpvr_Ajax {
735
  $html = '';
736
  $html .= '<iframe width="600" height="400" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
737
 
738
- } elseif (strpos($videourl, 'youtu.be') > 0) {
 
739
  $vidtype = 'youtube';
740
  $explodeid = '';
741
  $explodeid = explode("/",$videourl);
@@ -785,7 +793,8 @@ class Wpvr_Ajax {
785
  $html = '';
786
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="600" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
787
 
788
- } else {
 
789
  $vidtype = 'selfhost';
790
  $vidautoplay = '';
791
  $vidautoplay = sanitize_text_field($_POST['vidautoplay']);
@@ -855,6 +864,10 @@ class Wpvr_Ajax {
855
  $deviceorientationcontrol = sanitize_text_field($_POST['deviceorientationcontrol']);
856
 
857
  if ($gyro == 'on') {
 
 
 
 
858
  $gyro = true;
859
  if ($deviceorientationcontrol == 'on') {
860
  $deviceorientationcontrol = true;
@@ -932,6 +945,8 @@ class Wpvr_Ajax {
932
  $autorotationstopdelay = '';
933
  $autorotationstopdelay = sanitize_text_field($_POST['autorotationstopdelay']);
934
 
 
 
935
  if (!empty($autorotationinactivedelay) && !empty($autorotationstopdelay)) {
936
  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>');
937
  die();
@@ -1119,6 +1134,19 @@ class Wpvr_Ajax {
1119
  }
1120
  }
1121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1122
  if ($hotspot_type_validate == "scene") {
1123
  if (empty($hotspot_scene_validate)) {
1124
  wp_send_json_error('<p><span>Warning:</span> Target scene id is required for scene type hotspot where scene id: '.$scene_id_validate.' and hotspot id : '.$hotspot_title_validate.'</p>');
@@ -1245,6 +1273,9 @@ class Wpvr_Ajax {
1245
  if (empty($autorotationstopdelay)) {
1246
  unset($pano_array['autoRotateStopDelay']);
1247
  }
 
 
 
1248
 
1249
  update_post_meta( $postid, 'panodata', $pano_array );
1250
  die();
@@ -1374,6 +1405,9 @@ class Wpvr_Ajax {
1374
  $high_res_image = sanitize_text_field($_POST['high_res_image']);
1375
  $wpvr_script_control = sanitize_text_field($_POST['wpvr_script_control']);
1376
  $wpvr_script_list = sanitize_text_field($_POST['wpvr_script_list']);
 
 
 
1377
  $wpvr_script_list = str_replace(' ', '', $wpvr_script_list);
1378
 
1379
  update_option('wpvr_editor_active', $editor);
@@ -1382,6 +1416,9 @@ class Wpvr_Ajax {
1382
  update_option('high_res_image', $high_res_image);
1383
  update_option('wpvr_script_control', $wpvr_script_control);
1384
  update_option('wpvr_script_list', $wpvr_script_list);
 
 
 
1385
  $response = array(
1386
  'status' => 'success',
1387
  'message' => 'Successfully saved',
411
 
412
  if (!empty($hotspot_data["hotspot-title"])) {
413
 
414
+ $hotspot_type = $hotspot_data["hotspot-type"] !== 'scene' ? 'info' : $hotspot_data["hotspot-type"];
415
  $hotspot_content = '';
416
 
417
+ ob_start();
418
+ do_action('wpvr_hotspot_content_admin', $hotspot_data);
419
+ $hotspot_content = ob_get_clean();
420
+
421
+
422
+ if(!$hotspot_content) $hotspot_content = $hotspot_data["hotspot-content"];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
423
 
424
 
425
  $hotspot_info = array(
426
  "text"=>$hotspot_data["hotspot-title"],
427
  "pitch"=>$hotspot_data["hotspot-pitch"],
428
  "yaw"=>$hotspot_data["hotspot-yaw"],
429
+ "type"=>$hotspot_type,
430
  "URL"=>$hotspot_data["hotspot-url"],
431
  "clickHandlerArgs"=>$hotspot_content,
432
  "createTooltipArgs"=>$hotspot_data["hotspot-hover"],
433
  "sceneId"=>$hotspot_data["hotspot-scene"],
434
  "targetPitch"=>(float)$hotspot_data["hotspot-scene-pitch"],
435
+ "targetYaw"=>(float)$hotspot_data["hotspot-scene-yaw"],
436
+ 'hotspot_type' => $hotspot_data['hotspot-type']
437
+ );
438
  array_push($hotspots, $hotspot_info);
439
  if (empty($hotspot_data["hotspot-scene"])) {
440
  unset($hotspot_info['targetPitch']);
660
  }
661
 
662
  function wpvr_save_data() {
663
+
664
  $panoid ='';
665
  $postid = sanitize_text_field($_POST['postid']);
666
  $post_type = get_post_type( $postid );
681
  die();
682
  }
683
 
684
+ // if the type is flat image?
685
+ // $is_flat_image = 'no';
686
+ // $is_flat_image = sanitize_text_field($_POST['is_flat_image']);
687
+ // $flat_image_url = esc_url_raw($_POST['flat_image_url']);
688
+ // $hotspot_list = sanitize_text_field($_POST['flat_image_hotspot_list']);
689
+ //
690
+ //
691
+ // if ($is_flat_image === 'yes') {
692
+ // $hotspot_list = stripslashes($hotspot_list);
693
+ // $hotspot_list = (array) json_decode($hotspot_list);
694
+ // $flat_image_hotspot_list = array();
695
+ //
696
+ // foreach ($hotspot_list['flat-image-hotspot-list'] as $hotspot) {
697
+ // $flat_image_hotspot_list[] = (array) $hotspot;
698
+ // }
699
+ //
700
+ // $flat_image_array = array(
701
+ // "panoid" => $panoid,
702
+ // 'flat_image' => $is_flat_image,
703
+ // 'flat_image_url' => $flat_image_url,
704
+ // 'hotspot_list' => $flat_image_hotspot_list,
705
+ // );
706
+ //
707
+ // update_post_meta( $postid, 'panodata', $flat_image_array );
708
+ // die();
709
+ // }
710
+
711
  $pnovideo = $_POST['panovideo'];
712
  if ($pnovideo == "on") {
713
 
742
  $html = '';
743
  $html .= '<iframe width="600" height="400" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
744
 
745
+ }
746
+ elseif (strpos($videourl, 'youtu.be') > 0) {
747
  $vidtype = 'youtube';
748
  $explodeid = '';
749
  $explodeid = explode("/",$videourl);
793
  $html = '';
794
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="600" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
795
 
796
+ }
797
+ else {
798
  $vidtype = 'selfhost';
799
  $vidautoplay = '';
800
  $vidautoplay = sanitize_text_field($_POST['vidautoplay']);
864
  $deviceorientationcontrol = sanitize_text_field($_POST['deviceorientationcontrol']);
865
 
866
  if ($gyro == 'on') {
867
+ if (!is_ssl()) {
868
+ wp_send_json_error('<p><span>Warning:</span> Please add SSL to enable Gyroscope for WP VR. </p>');
869
+ die();
870
+ }
871
  $gyro = true;
872
  if ($deviceorientationcontrol == 'on') {
873
  $deviceorientationcontrol = true;
945
  $autorotationstopdelay = '';
946
  $autorotationstopdelay = sanitize_text_field($_POST['autorotationstopdelay']);
947
 
948
+
949
+
950
  if (!empty($autorotationinactivedelay) && !empty($autorotationstopdelay)) {
951
  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>');
952
  die();
1134
  }
1135
  }
1136
 
1137
+
1138
+
1139
+ if ($hotspot_type_validate == "shortcode_editor") {
1140
+ if ( substr( $hotspot_val['hotspot-shortcode'], 0, 1 ) === '[' ) {
1141
+ $pattern = get_shortcode_regex();
1142
+ preg_match('/'.$pattern.'/s', $hotspot_val['hotspot-shortcode'], $matches);
1143
+ if(is_array($matches) && !isset($matches[2])) {
1144
+ wp_send_json_error('<p><span>Warning:</span> This is not a valid shortcode where scene id: '.$scene_id_validate.' and hotspot id : '.$hotspot_title_validate.'</p>');
1145
+ die();
1146
+ }
1147
+ }
1148
+ }
1149
+
1150
  if ($hotspot_type_validate == "scene") {
1151
  if (empty($hotspot_scene_validate)) {
1152
  wp_send_json_error('<p><span>Warning:</span> Target scene id is required for scene type hotspot where scene id: '.$scene_id_validate.' and hotspot id : '.$hotspot_title_validate.'</p>');
1273
  if (empty($autorotationstopdelay)) {
1274
  unset($pano_array['autoRotateStopDelay']);
1275
  }
1276
+ if (empty($autorotationstopdelay)) {
1277
+ unset($pano_array['autoRotateStopDelay']);
1278
+ }
1279
 
1280
  update_post_meta( $postid, 'panodata', $pano_array );
1281
  die();
1405
  $high_res_image = sanitize_text_field($_POST['high_res_image']);
1406
  $wpvr_script_control = sanitize_text_field($_POST['wpvr_script_control']);
1407
  $wpvr_script_list = sanitize_text_field($_POST['wpvr_script_list']);
1408
+
1409
+ // $enable_woocommerce = sanitize_text_field($_POST['woocommerce']);
1410
+
1411
  $wpvr_script_list = str_replace(' ', '', $wpvr_script_list);
1412
 
1413
  update_option('wpvr_editor_active', $editor);
1416
  update_option('high_res_image', $high_res_image);
1417
  update_option('wpvr_script_control', $wpvr_script_control);
1418
  update_option('wpvr_script_list', $wpvr_script_list);
1419
+
1420
+ // update_option('wpvr_enable_woocommerce', $enable_woocommerce);
1421
+
1422
  $response = array(
1423
  'status' => 'success',
1424
  'message' => 'Successfully saved',
admin/css/wpvr-admin.css CHANGED
@@ -1,4 +1,4 @@
1
- preview-upload/**
2
  * All of the CSS for your admin-specific functionality should be
3
  * included in this file.
4
  */
@@ -246,11 +246,15 @@ div.custom-tooltip:hover span:after {
246
 
247
  #custom-ifram {
248
  position: absolute;
249
- top: 12%;
250
  left: 50%;
251
- transform: translateX(-50%);
252
  z-index: 99;
253
- width: 90%;
 
 
 
 
254
  }
255
  .icons-selector .selector {
256
  width: 100%;
@@ -286,20 +290,21 @@ div.custom-tooltip:hover span:after {
286
 
287
  .iframe-wrapper #cross {
288
  background: #fff;
289
- width: 30px;
290
- height: 30px;
291
  color: red;
292
- line-height: 30px;
293
  position: absolute;
294
  top: 6px;
295
- z-index: 99;
296
- text-align: center;
297
  right: 6px;
 
 
 
298
  border-radius: 100%;
299
  cursor: pointer;
300
  opacity: 0;
301
  visibility: hidden;
302
- transition: all 0.4s linear;
303
  }
304
  .iframe-wrapper.show-modal #cross {
305
  opacity: 1;
@@ -332,8 +337,6 @@ div.custom-tooltip:hover span:after {
332
  text-align: center;
333
  font-size: 15px;
334
  line-height: 24px;
335
- overflow-y: auto;
336
- max-height: 250px;
337
  }
338
 
339
  .custom-tooltip p {
@@ -344,13 +347,12 @@ div.custom-tooltip:hover span:after {
344
  width: 500px;
345
  font-size: 16px;
346
  line-height: 26px;
347
- max-height: 250px;
348
- overflow: auto;
349
  }
350
 
351
 
352
  #custom-ifram img {
353
  max-width: 100%;
 
354
  margin: 0 auto;
355
  display: block;
356
  }
@@ -476,6 +478,14 @@ div.custom-tooltip:hover span:after {
476
 
477
  }
478
 
 
 
 
 
 
 
 
 
479
 
480
  /*------------------------------panolens layout style-----------------------------*/
481
  .post-type-wpvr_item #poststuff #post-body {
@@ -835,6 +845,7 @@ div.custom-tooltip:hover span:after {
835
  .rex-pano-tab-content .general .inner-nav-content .inner-single-content .content-wrapper {
836
  display: flex;
837
  flex-flow: row wrap;
 
838
  }
839
  .rex-pano-tab-content .general .inner-nav-content .inner-single-content .content-wrapper .left {
840
  width: 50%;
@@ -913,9 +924,9 @@ div.custom-tooltip:hover span:after {
913
  align-items: center;
914
  justify-content: space-between;
915
  }
916
- .rex-pano-tab-content .general .inner-nav-content .single-settings:not(.preview-setting):last-child {
917
  margin-bottom: 0;
918
- }
919
 
920
  .rex-pano-tab-content .general .inner-nav-content .single-settings .wpvr-switcher {
921
  min-width: auto;
@@ -946,6 +957,7 @@ div.custom-tooltip:hover span:after {
946
  background-color: #ffffff;
947
  display: none;
948
  margin-top: -18px;
 
949
  }
950
  .rex-pano-tab-content .general .inner-nav-content .autorotationdata-wrapper .single-settings {
951
  padding: 0;
@@ -1175,6 +1187,7 @@ div.custom-tooltip:hover span:after {
1175
  background: #fff;
1176
  border-radius: 5px;
1177
  margin-top: 20px;
 
1178
  }
1179
  .wpvr-use-shortcode .area-title {
1180
  width: 100%;
@@ -1187,21 +1200,17 @@ div.custom-tooltip:hover span:after {
1187
  }
1188
  .wpvr-use-shortcode .shortcode-wrapper {
1189
  padding: 0 20px 20px 20px;
1190
- display: flex;
1191
- flex-flow: row wrap;
1192
  }
1193
  .wpvr-use-shortcode .single-shortcode {
1194
- width: calc(50% - 10px);
1195
  background: #f6f6f8;
1196
  padding: 12px 15px 15px 15px;
1197
  border-radius: 5px;
1198
  margin-top: 20px;
1199
  }
1200
- .wpvr-use-shortcode .single-shortcode.classic {
1201
- margin-right: 10px;
1202
- }
1203
  .wpvr-use-shortcode .single-shortcode.gutenberg {
1204
- margin-left: 10px;
1205
  }
1206
  .wpvr-use-shortcode .shortcode-title {
1207
  font-size: 16px;
@@ -1222,7 +1231,7 @@ div.custom-tooltip:hover span:after {
1222
  padding: 8px 10px;
1223
  border-radius: 5px;
1224
  margin-top: 10px;
1225
- min-width: 140px;
1226
 
1227
  }
1228
  .wpvr-use-shortcode .single-shortcode .shortcode-field p {
@@ -1646,6 +1655,9 @@ div.custom-tooltip:hover span:after {
1646
  color: #454545;
1647
  border-radius: 3px;
1648
  }
 
 
 
1649
  .rex-pano-tab .streetview-setting .form-group input{
1650
  max-width: 100%;
1651
  }
@@ -1912,6 +1924,85 @@ button.delete-hotspot{
1912
  }
1913
 
1914
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1915
  /*-----------------responsive style------------------*/
1916
  @media (max-width: 1760px) and (min-width: 1701px){
1917
  .rex-pano-tab-content .general .inner-nav-content .inner-single-content .color-icon img {
@@ -2112,6 +2203,7 @@ button.delete-hotspot{
2112
  .preview-btn-area #panolenspreview {
2113
  float: none;
2114
  }
 
2115
 
2116
  }
2117
 
@@ -2201,9 +2293,6 @@ button.delete-hotspot{
2201
  }
2202
 
2203
  @media only screen and (max-width: 991px) {
2204
- #custom-ifram p {
2205
- max-height: 230px;
2206
- }
2207
 
2208
  .rex-pano-tab-content .general .inner-nav-content .inner-single-content .content-wrapper {
2209
  display: block;
@@ -2797,6 +2886,7 @@ button.delete-hotspot{
2797
  }
2798
 
2799
 
 
2800
  /* ----------- */
2801
  .rex-onboarding .wpvr-settings .upgrade-pro {
2802
  border: 1px solid #201cfe;
1
+ /**
2
  * All of the CSS for your admin-specific functionality should be
3
  * included in this file.
4
  */
246
 
247
  #custom-ifram {
248
  position: absolute;
249
+ top: 50%;
250
  left: 50%;
251
+ transform: translate(-50%, -50%);
252
  z-index: 99;
253
+ width: 80%;
254
+ max-height: 80%;
255
+ overflow: auto;
256
+ background: #fff;
257
+ border-radius: 5px;
258
  }
259
  .icons-selector .selector {
260
  width: 100%;
290
 
291
  .iframe-wrapper #cross {
292
  background: #fff;
293
+ width: 24px;
294
+ height: 24px;
295
  color: red;
296
+ line-height: 26px;
297
  position: absolute;
298
  top: 6px;
 
 
299
  right: 6px;
300
+ text-align: center;
301
+ z-index: 99;
302
+ font-size: 13px;
303
  border-radius: 100%;
304
  cursor: pointer;
305
  opacity: 0;
306
  visibility: hidden;
307
+ transition: all 0.4s ease;
308
  }
309
  .iframe-wrapper.show-modal #cross {
310
  opacity: 1;
337
  text-align: center;
338
  font-size: 15px;
339
  line-height: 24px;
 
 
340
  }
341
 
342
  .custom-tooltip p {
347
  width: 500px;
348
  font-size: 16px;
349
  line-height: 26px;
 
 
350
  }
351
 
352
 
353
  #custom-ifram img {
354
  max-width: 100%;
355
+ height: auto;
356
  margin: 0 auto;
357
  display: block;
358
  }
478
 
479
  }
480
 
481
+ @media (max-width: 575px){
482
+ .pano-wrap .cross {
483
+ top: 2px;
484
+ right: 1px;
485
+ }
486
+
487
+ }
488
+
489
 
490
  /*------------------------------panolens layout style-----------------------------*/
491
  .post-type-wpvr_item #poststuff #post-body {
845
  .rex-pano-tab-content .general .inner-nav-content .inner-single-content .content-wrapper {
846
  display: flex;
847
  flex-flow: row wrap;
848
+ border-bottom: 1px solid #e4e4e4;
849
  }
850
  .rex-pano-tab-content .general .inner-nav-content .inner-single-content .content-wrapper .left {
851
  width: 50%;
924
  align-items: center;
925
  justify-content: space-between;
926
  }
927
+ /* .rex-pano-tab-content .general .inner-nav-content .single-settings:not(.preview-setting):last-child {
928
  margin-bottom: 0;
929
+ } */
930
 
931
  .rex-pano-tab-content .general .inner-nav-content .single-settings .wpvr-switcher {
932
  min-width: auto;
957
  background-color: #ffffff;
958
  display: none;
959
  margin-top: -18px;
960
+ margin-bottom: 20px;
961
  }
962
  .rex-pano-tab-content .general .inner-nav-content .autorotationdata-wrapper .single-settings {
963
  padding: 0;
1187
  background: #fff;
1188
  border-radius: 5px;
1189
  margin-top: 20px;
1190
+ width: 50%;
1191
  }
1192
  .wpvr-use-shortcode .area-title {
1193
  width: 100%;
1200
  }
1201
  .wpvr-use-shortcode .shortcode-wrapper {
1202
  padding: 0 20px 20px 20px;
 
 
1203
  }
1204
  .wpvr-use-shortcode .single-shortcode {
1205
+ width: 100%;
1206
  background: #f6f6f8;
1207
  padding: 12px 15px 15px 15px;
1208
  border-radius: 5px;
1209
  margin-top: 20px;
1210
  }
1211
+
 
 
1212
  .wpvr-use-shortcode .single-shortcode.gutenberg {
1213
+ display: none;
1214
  }
1215
  .wpvr-use-shortcode .shortcode-title {
1216
  font-size: 16px;
1231
  padding: 8px 10px;
1232
  border-radius: 5px;
1233
  margin-top: 10px;
1234
+ width: 200px;
1235
 
1236
  }
1237
  .wpvr-use-shortcode .single-shortcode .shortcode-field p {
1655
  color: #454545;
1656
  border-radius: 3px;
1657
  }
1658
+ .single-hotspot .hotspot-setting select {
1659
+ padding: 0px 20px;
1660
+ }
1661
  .rex-pano-tab .streetview-setting .form-group input{
1662
  max-width: 100%;
1663
  }
1924
  }
1925
 
1926
 
1927
+ /* ---------woocomerce product hotspot style--------- */
1928
+ .wpvr-product-container {
1929
+ display: flex;
1930
+ align-items: center;
1931
+ background: #fff;
1932
+ padding: 15px;
1933
+ border-radius: 5px;
1934
+ }
1935
+ .wpvr-product-container .wpvr-pr-left-block {
1936
+ width: 50%;
1937
+ box-sizing: border-box;
1938
+ }
1939
+ .wpvr-product-container .wpvr-pr-left-block .woocommerce-product-gallery__image img {
1940
+ margin: 0;
1941
+ max-width: 500px;
1942
+ width: 100%;
1943
+ height: auto;
1944
+ }
1945
+ .wpvr-product-container .wpvr-pr-right-block {
1946
+ width: 50%;
1947
+ padding-left: 15px;
1948
+ box-sizing: border-box;
1949
+ text-align: left;
1950
+ }
1951
+ .wpvr-product-container .wpvr-pr-right-block a {
1952
+ text-decoration: none!important;
1953
+ display: inline-block;
1954
+ }
1955
+ .wpvr-product-container .wpvr-pr-right-block a h2 {
1956
+ line-height: 1.4!important;
1957
+ margin: 0 0 15px 0!important;
1958
+ text-align: left;
1959
+ padding: 0!important;
1960
+ font-size: 23px!important;
1961
+ color: #201cfe;
1962
+ }
1963
+ .wpvr-product-container .wpvr-pr-right-block a:focus {
1964
+ outline: none;
1965
+ box-shadow: none;
1966
+ }
1967
+ .wpvr-product-container .wpvr-pr-right-block a:hover h2 {
1968
+ text-decoration: underline;
1969
+ }
1970
+ .wpvr-product-container .wpvr-pr-right-block a h2:before {
1971
+ display: none;
1972
+ }
1973
+ .wpvr-product-container .wpvr-pr-right-block .add_to_cart_inline {
1974
+ border: none!important;
1975
+ padding: 0!important;
1976
+ overflow: auto;
1977
+ text-align: left!important;
1978
+ border-radius: 0!important;
1979
+ }
1980
+ .wpvr-product-container .wpvr-pr-right-block .add_to_cart_inline .amount {
1981
+ display: inline-block;
1982
+ margin-bottom: 7px;
1983
+ }
1984
+ .wpvr-product-container .wpvr-pr-right-block .add_to_cart_inline del .amount {
1985
+ text-decoration: line-through;
1986
+ opacity: 0.5;
1987
+ }
1988
+ .wpvr-product-container .wpvr-pr-right-block .add_to_cart_inline .add_to_cart_button {
1989
+ width: 170px;
1990
+ font-size: 16px;
1991
+ text-align: center;
1992
+ border-radius: 5px;
1993
+ background-color: rgb(32, 28, 254);
1994
+ height: 46px;
1995
+ line-height: 46px;
1996
+ color: #fff;
1997
+ display: block;
1998
+ padding: 0 20px;
1999
+ box-shadow: none;
2000
+ margin-top: auto;
2001
+ transition: all 0.3s ease;
2002
+ text-decoration: none;
2003
+ }
2004
+
2005
+
2006
  /*-----------------responsive style------------------*/
2007
  @media (max-width: 1760px) and (min-width: 1701px){
2008
  .rex-pano-tab-content .general .inner-nav-content .inner-single-content .color-icon img {
2203
  .preview-btn-area #panolenspreview {
2204
  float: none;
2205
  }
2206
+
2207
 
2208
  }
2209
 
2293
  }
2294
 
2295
  @media only screen and (max-width: 991px) {
 
 
 
2296
 
2297
  .rex-pano-tab-content .general .inner-nav-content .inner-single-content .content-wrapper {
2298
  display: block;
2886
  }
2887
 
2888
 
2889
+
2890
  /* ----------- */
2891
  .rex-onboarding .wpvr-settings .upgrade-pro {
2892
  border: 1px solid #201cfe;
admin/js/wpvr-admin.js CHANGED
@@ -1,7 +1,7 @@
1
- (function( $ ) {
2
  'use strict';
3
- var j= 1;
4
- var color='#00b4ff';
5
 
6
  /**
7
  * All of the code for your admin-facing JavaScript source
@@ -31,194 +31,282 @@
31
  * practising this, we should strive to set a better example in our own work.
32
  */
33
 
34
- $(document).ready(function(){
35
  $(".vrowl-carousel").owlCarousel({
36
- margin:10,
37
- autoWidth:true,
38
  });
39
- });
40
 
41
 
42
- $(document).on("change","input.vr-switcher-check",function(event) {
43
- if( this.checked ) {
44
- $(this).val('on');
45
- }else{
46
- $(this).val('off');
47
- }
48
- });
 
 
 
 
 
 
 
 
 
49
 
50
- jQuery(document).ready(function($){
51
 
52
 
53
- j= $('#scene-1').find('.hotspot-nav li').eq(-2).find('span').attr('data-index');
54
- var ajaxurl = wpvr_obj.ajaxurl;
55
- $('#panolenspreview').on('click', function(e){
56
  e.preventDefault();
57
  $('.wpvr-loading').show();
58
  var postid = $("#post_ID").val();
59
- var autoload = $("input[name='autoload']").val();
60
  var compass = $("input[name='compass']:checked").val();
61
- var control = $("input[name='controls']").val();
62
- var rotation = $("input[name='autorotation']").val();
63
  var defaultscene = $("input[name='default-scene-id']").val();
64
  var preview = $("input[name='preview-attachment-url']").val();
65
  var scenefadeduration = $("input[name='scene-fade-duration']").val();
66
- console.log(rotation);
67
  var autorotation = $("input[name='auto-rotation']").val();
68
  var autorotationinactivedelay = $("input[name='auto-rotation-inactive-delay']").val();
69
  var autorotationstopdelay = $("input[name='auto-rotation-stop-delay']").val();
70
 
71
  var panodata = $('.scene-setup').repeaterVal();
72
  var panolist = JSON.stringify(panodata);
73
- jQuery.ajax({
74
- type: "POST",
75
- url: ajaxurl,
76
- data: {
77
- action: "wpvr_preview",
78
- postid: postid,
79
- compass: compass,
80
- control: control,
81
- autoload: autoload,
82
- panodata: panolist,
83
- defaultscene: defaultscene,
84
- rotation: rotation,
85
- autorotation: autorotation,
86
- autorotationinactivedelay: autorotationinactivedelay,
87
- autorotationstopdelay: autorotationstopdelay,
88
-
89
- preview: preview,
90
- scenefadeduration: scenefadeduration,
91
- },
92
-
93
- success: function( response ){
94
- $('.wpvr-loading').hide();
95
- if (response.success == true) {
96
- $('#error_occured').hide();
97
- $('#error_occuredpub').hide();
98
- $('#'+response.data[0]["panoid"]).empty();
99
- var scenes = response.data[1];
100
-
101
- if (scenes) {
102
- $.each(scenes.scenes, function (i) {
103
- $.each(scenes.scenes[i]['hotSpots'], function (key, val) {
104
- if (val["clickHandlerArgs"] != "") {
105
- val["clickHandlerFunc"] = wpvrhotspot;
106
- }
107
- if (val["createTooltipArgs"] != "") {
108
- val["createTooltipFunc"] = wpvrtooltip;
109
- }
110
- });
111
  });
112
- }
113
- if (scenes) {
114
- $('.scene-gallery').trigger('destroy.owl.carousel');
115
- $('.scene-gallery').empty();
116
- $.each(scenes.scenes, function (key, val) {
117
- $('.scene-gallery').append('<ul style="width:150px;"><li>'+key+'</li><li title="Double click to view scene"><img class="scctrl" id="'+key+'_gallery" src="'+val.panorama+'"></li></ul>');
118
- });
119
- $(".vrowl-carousel").owlCarousel({
120
- margin:10,
121
- autoWidth:true,
122
  });
123
- }
124
- var panoshow = pannellum.viewer(response.data[0]["panoid"], scenes);
125
- if (scenes.autoRotate) {
126
- panoshow.on('load', function (){
127
- setTimeout(function(){ panoshow.startAutoRotate(scenes.autoRotate, 0); }, 3000);
128
- });
129
- panoshow.on('scenechange', function (){
130
- setTimeout(function(){ panoshow.startAutoRotate(scenes.autoRotate, 0); }, 3000);
131
- });
132
- }
133
- var touchtime = 0;
134
- if (scenes) {
135
- $.each(scenes.scenes, function (key, val) {
136
- document.getElementById(''+key+'_gallery').addEventListener('click', function(e) {
137
- if (touchtime == 0) {
138
- touchtime = new Date().getTime();
139
- }
140
- else {
141
- if (((new Date().getTime()) - touchtime) < 800) {
142
- panoshow.loadScene(key);
143
- touchtime = 0;
144
- }
145
- else {
146
- touchtime = new Date().getTime();
147
- }
148
- }
149
- });
150
- });
151
- }
152
- $('html, body').animate({
153
- scrollTop: $("#wpvr_item_builder__box").offset().top
154
- }, 500);
155
- }
156
- else {
157
- $('#error_occured').show();
158
- $('#error_occured').html(response.data);
159
- $('#error_occuredpub').show();
160
- $('#error_occuredpub').html(response.data);
161
- $('body').addClass('error-overlay');
162
- $('html, body').animate({
163
- scrollTop: $("#error_occured").offset().top
164
- }, 500);
165
- }
166
- }
 
167
  });
168
  });
169
  });
170
 
171
- jQuery(document).ready(function($){
172
- var ajaxurl = wpvr_obj.ajaxurl;
173
- $('#videopreview').on('click', function(e){
174
  e.preventDefault();
175
  $('.wpvr-loading').show();
176
  var postid = $("#post_ID").val();
177
  var videourl = $("input[name='video-attachment-url']").val();
178
  var vidautoplay = $("input[name='playvideo']:checked").val();
179
  var vidcontrol = $("input[name='playcontrol']:checked").val();
180
- jQuery.ajax({
181
- type: "POST",
182
- url: ajaxurl,
183
- data: {
184
- action: "wpvrvideo_preview",
185
- postid: postid,
186
- videourl: videourl,
187
- vidautoplay: vidautoplay,
188
- vidcontrol: vidcontrol,
189
- },
190
-
191
- success: function( response ){
192
- $('.wpvr-loading').hide();
193
- if (response.success == true) {
194
- $('#'+response.data["panoid"]).empty();
195
- $('#'+response.data["panoid"]).html(response.data["panodata"]);
196
- if (response.data['vidtype'] == 'selfhost') {
197
- videojs(response.data["vidid"], {
198
- plugins: {
199
- pannellum: {}
200
- }
201
  });
202
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  $('html, body').animate({
204
- scrollTop: $("#wpvr_item_builder__box").offset().top
205
  }, 500);
206
- }
207
- else {
 
 
 
 
 
 
 
208
 
209
- }
210
- }
211
- });
 
 
 
 
 
212
  });
213
  });
214
 
215
- jQuery(document).ready(function($){
216
 
217
  var flag_ok = false;
218
- $('#publish').on('click', function(e){
219
- var x = $(this).val();
220
- if ( ! flag_ok ) {
221
- e.preventDefault();
222
  $('.wpvr-loading').show();
223
  var postid = $("#post_ID").val();
224
  var panovideo = $("input[name='panovideo']:checked").val();
@@ -236,636 +324,540 @@
236
  var scenefadeduration = $("input[name='scene-fade-duration']").val();
237
 
238
  if ($('.scene-setup')[0]) {
239
- var panodata = $('.scene-setup').repeaterVal();
240
- var panolist = JSON.stringify(panodata);
241
  } else {
242
  var panodata = '';
243
  var panolist = '';
244
  }
245
 
246
- jQuery.ajax({
247
-
248
- type: "POST",
249
- url: ajaxurl,
250
- data: {
251
- action: "wpvr_save",
252
- postid: postid,
253
- panovideo: panovideo,
254
- videourl: videourl,
255
- control: control,
256
- compass: compass,
257
- autoload: autoload,
258
- panodata: panolist,
259
- defaultscene: defaultscene,
260
- preview: preview,
261
- rotation: rotation,
262
- autorotation: autorotation,
263
- autorotationinactivedelay: autorotationinactivedelay,
264
- autorotationstopdelay: autorotationstopdelay,
265
- scenefadeduration: scenefadeduration,
266
- },
267
-
268
- success: function( response ){
269
- $('.wpvr-loading').hide();
270
- if (response.success == false) {
271
- $('#error_occured').show();
272
- $('#error_occured').html(response.data);
273
- $('#error_occuredpub').show();
274
- $('#error_occuredpub').html(response.data);
275
-
276
- $('body').addClass('error-overlay');
277
- $('html, body').animate({
278
- scrollTop: $("#error_occured").offset().top
279
- }, 500);
280
- }
281
- else {
282
- flag_ok = true;
283
- $('#publish').trigger('click');
284
- }
285
- }
286
- });
287
- }
288
- });
289
- });
290
-
291
- jQuery(document).ready(function($){
292
- $("body").on("click", function(e){
293
- $("#error_occured").hide();
294
- $('body').removeClass('error-overlay');
295
- });
296
-
297
- $("#panolenspreview, #error_occured").on("click", function(e){
298
- e.stopPropagation();
299
- });
300
- });
301
-
302
- jQuery(document).ready(function($){
303
-
304
- var flag_ok = false;
305
- $('#save-post').on('click', function(e){
306
- var x = $(this).val();
307
- if ( ! flag_ok ) {
308
- e.preventDefault();
309
- $('.wpvr-loading').show();
310
- var postid = $("#post_ID").val();
311
- var panovideo = $("input[name='panovideo']:checked").val();
312
- var videourl = $("input[name='video-attachment-url']").val();
313
- var autoload = $("input[name='autoload']").val();
314
- var control = $("input[name='controls']").val();
315
- var compass = $("input[name='compass']:checked").val();
316
- var defaultscene = $("input[name='default-scene-id']").val();
317
- var preview = $("input[name='preview-attachment-url']").val();
318
- var rotation = $("input[name='autorotation']").val();
319
- var autorotation = $("input[name='auto-rotation']").val();
320
- var autorotationinactivedelay = $("input[name='auto-rotation-inactive-delay']").val();
321
- var autorotationstopdelay = $("input[name='auto-rotation-stop-delay']").val();
322
-
323
- var scenefadeduration = $("input[name='scene-fade-duration']").val();
324
-
325
- if ($('.scene-setup')[0]) {
326
- var panodata = $('.scene-setup').repeaterVal();
327
- var panolist = JSON.stringify(panodata);
328
- } else {
329
- var panodata = '';
330
- var panolist = '';
331
- }
332
 
333
- jQuery.ajax({
334
-
335
- type: "POST",
336
- url: ajaxurl,
337
- data: {
338
- action: "wpvr_save",
339
- postid: postid,
340
- panovideo: panovideo,
341
- videourl: videourl,
342
- control: control,
343
- compass: compass,
344
- autoload: autoload,
345
- panodata: panolist,
346
- defaultscene: defaultscene,
347
- preview: preview,
348
- rotation: rotation,
349
- autorotation: autorotation,
350
- autorotationinactivedelay: autorotationinactivedelay,
351
- autorotationstopdelay: autorotationstopdelay,
352
- scenefadeduration: scenefadeduration,
353
- },
354
-
355
- success: function( response ){
356
- $('.wpvr-loading').hide();
357
- if (response.success == false) {
358
- $('#error_occured').show();
359
- $('#error_occured').html(response.data);
360
- $('#error_occuredpub').show();
361
- $('#error_occuredpub').html(response.data);
362
-
363
- $('body').addClass('error-overlay');
364
- $('html, body').animate({
365
- scrollTop: $("#error_occured").offset().top
366
- }, 500);
367
- }
368
- else {
369
- flag_ok = true;
370
- $('#save-post').trigger('click');
371
- }
372
- }
373
- });
374
  }
375
- });
376
- });
 
 
377
 
378
- function wpvrhotspot(hotSpotDiv, args) {
379
- var argst = args.replace(/\\/g, '');
380
- $("#custom-ifram").html(argst);
381
- $("#custom-ifram").fadeToggle();
382
- $(".iframe-wrapper").toggleClass("show-modal");
383
  }
384
 
385
  function wpvrtooltip(hotSpotDiv, args) {
386
- hotSpotDiv.classList.add('custom-tooltip');
387
- var span = document.createElement('span');
388
- args = args.replace(/\\/g, "");
389
- span.innerHTML = args;
390
- hotSpotDiv.appendChild(span);
391
- span.style.marginLeft = -(span.scrollWidth - hotSpotDiv.offsetWidth) / 2 + 'px';
392
- span.style.marginTop = -span.scrollHeight - 12 + 'px';
393
  }
394
 
395
- jQuery(document).ready(function($){
396
- $("#cross").on("click", function(e){
397
- e.preventDefault();
398
- $("#custom-ifram").fadeOut();
399
- $(".iframe-wrapper").removeClass("show-modal");
400
- $('iframe').attr('src', $('iframe').attr('src'));
401
- });
402
- });
403
 
404
- jQuery(document).ready(function($){
405
 
406
- var i = $('.scene-nav li').eq(-2).find('span').attr('data-index');
407
- i = parseInt(i);
408
 
409
  $('.scene-setup').repeater({
410
 
411
- defaultValues: {
412
- 'scene-type': 'equirectangular',
413
  'dscene': 'off',
414
  'ptyscene': 'off',
415
  'cvgscene': 'off',
416
  'chgscene': 'off',
417
  'czscene': 'off',
418
- },
419
- show: function () {
420
 
421
- if( $(this).parents(".scene-setup").attr("data-limit").length > 0 ){
422
 
423
- if( $(this).parents(".scene-setup").find("div[data-repeater-item]:not(.hotspot-setup div[data-repeater-item])").length <= $(this).parents(".scene-setup").attr("data-limit") ){
424
 
425
  $(this).slideDown();
426
  $(this).removeClass('active');
427
 
428
- i=i+1;
429
- var scene = 'scene-'+i;
430
 
431
- $(this).find(".title .scene-num").html(i);
432
 
433
- $('<li><span data-index="'+ i +'" data-href="#'+ scene +'"><i class="fa fa-image"></i></span></li>').insertBefore($(this).parent().parent('.scene-setup').find('.scene-nav ul li:last-child'));
434
 
435
- $(this).attr('id', scene);
436
- changehotspotid(i);
437
- $(this).siblings('.active').removeClass('active');
438
- $(this).addClass('active');
439
- setTimeout(changeicon, 1000);
440
  } else {
441
- $('.pano-alert > p').html('You can only add 5 scenes in free version');
442
- $('.pano-alert').show();
443
  $(this).remove();
444
  }
445
  } else {
446
  jQuery(this).slideDown();
447
- $(this).removeClass('active');
448
-
449
- i=i+1;
450
- var scene = 'scene-'+i;
451
-
452
-
453
- $(this).find(".title .scene-num").html(i);
454
-
455
- $('<li><span data-index="'+ i +'" data-href="#'+ scene +'"><i class="fa fa-image"></i></span></li>').insertBefore($(this).parent().parent('.scene-setup').find('.scene-nav ul li:last-child'));
456
-
457
- $(this).attr('id', scene);
458
- changehotspotid(i);
459
  }
460
 
461
  $(this).hide();
462
- },
463
- hide: function (deleteElement) {
464
 
465
- var hide_id = $(this).attr("id");
466
- hide_id = "#"+hide_id;
 
 
 
 
 
 
467
 
468
- var current = $(this).attr('id');
469
- var fchild = $('.single-scene:nth-child(2)').attr('id');
470
 
471
- var elementcontains = $(this).attr("id");
472
  var str1 = 'scene';
473
  var str2 = 'hotspot';
474
- if(elementcontains.indexOf(str1) != -1 && elementcontains.indexOf(str2) == -1){
475
- if(confirm('Are you sure you want to delete?')) {
476
- jQuery(this).slideUp(deleteElement);
477
- if(current == fchild){
478
- $(this).next().addClass("active");
479
- $(this).parent().parent('.scene-setup').find('.scene-nav li span[data-href="'+hide_id+'"]').parent("li").next().addClass("active");
480
- $(this).parent().parent('.scene-setup').find('.scene-nav li span[data-href="'+hide_id+'"]').parent("li").next().children("span").trigger( "click" );
481
-
482
- }
483
- else {
484
- $(this).prev().addClass("active");
485
- $(this).parent().parent('.scene-setup').find('.scene-nav li span[data-href="'+hide_id+'"]').parent("li").prev().addClass("active");
486
- $(this).parent().parent('.scene-setup').find('.scene-nav li span[data-href="'+hide_id+'"]').parent("li").prev().children("span").trigger( "click" );
487
- }
488
- $(this).parent().parent('.scene-setup').find('.scene-nav li span[data-href="'+hide_id+'"]').parent("li").remove();
489
- setTimeout(deleteinfodata, 1000);
490
- }
491
- }
492
- },
493
-
494
- repeaters: [{
495
- selector: '.hotspot-setup',
496
- defaultValues: {
497
- 'hotspot-type': 'info',
498
- 'hotspot-customclass-pro': 'none',
499
- },
500
- show: function () {
501
 
502
- if( $(this).parents(".hotspot-setup").attr("data-limit").length > 0 ){
 
 
 
 
 
 
 
503
 
504
- if( $(this).parents(".hotspot-setup").find("div[data-repeater-item]").length <= $(this).parents(".hotspot-setup").attr("data-limit") ){
 
 
 
 
 
 
 
 
 
 
 
505
 
506
  $(this).slideDown();
507
  $(this).removeClass('active');
508
  $(this).siblings('.active').removeClass('active');
509
- $(this).addClass('active');
510
- j = parseInt(j);
511
- j=j+1;
512
- var parent_scene = $(this).parent().parent().parent('.single-scene.active').attr('id');
513
- var hotspot = parent_scene+'-hotspot-'+ j;
514
 
515
- var replace_string =parent_scene.replace("scene-", "");
516
 
517
- $(this).find(".title .hotspot-num").html(j);
518
- $(this).find(".title .scene-num").html(replace_string);
519
 
520
- $('<li><span data-index="'+ j +'" data-href="#'+ hotspot +'"><i class="far fa-dot-circle"></i></span></li>').insertBefore($(this).parent().parent('.hotspot-setup').find('.hotspot-nav ul li:last-child'));
521
 
522
- $(this).attr('id', hotspot);
523
 
524
- setTimeout(changeicon, 1000);
525
  } else {
526
- $('.pano-alert > p').html('You can only add 5 hotspots in free version');
527
- $('.pano-alert').show();
528
  $(this).remove();
529
  }
530
  } else {
531
  jQuery(this).slideDown();
532
- $(this).removeClass('active');
533
- j = parseInt(j);
534
- j=j+1;
535
- var parent_scene = $(this).parent().parent().parent('.single-scene.active').attr('id');
536
- var hotspot = parent_scene+'-hotspot-'+ j;
537
 
538
- var replace_string =parent_scene.replace("scene-", "");
539
 
540
- $(this).find(".title .hotspot-num").html(j);
541
- $(this).find(".title .scene-num").html(replace_string);
542
 
543
- $('<li><span data-index="'+ j +'" data-href="#'+ hotspot +'"><i class="far fa-dot-circle"></i></span></li>').insertBefore($(this).parent().parent('.hotspot-setup').find('.hotspot-nav ul li:last-child'));
544
 
545
- $(this).attr('id', hotspot);
546
  }
547
- },
548
- hide: function (deleteElement) {
549
-
550
- var hotspot_hide_id = $(this).attr("id");
551
- hotspot_hide_id = "#"+hotspot_hide_id;
552
-
553
- var hotspot_current = $(this).attr('id');
554
- var hotspot_fchild = $(this).parent().children(":first").attr('id');
555
-
556
- var hpelementcontains = $(this).attr("id");
557
  var hpstr1 = 'scene';
558
  var hpstr2 = 'hotspot';
559
- if(hpelementcontains.indexOf(hpstr1) != -1 && hpelementcontains.indexOf(hpstr2) != -1){
560
- if(confirm('Are you sure you want to delete?')) {
561
  jQuery(this).slideUp(deleteElement);
562
- if(hotspot_current == hotspot_fchild){
563
- $(this).next().addClass("active");
564
- $(this).parent().parent('.hotspot-setup').find('.hotspot-nav li span[data-href="'+hotspot_hide_id+'"]').parent("li").next().addClass("active");
565
 
566
- }
567
- else {
568
- $(this).prev().addClass("active");
569
- $(this).parent().parent('.hotspot-setup').find('.hotspot-nav li span[data-href="'+hotspot_hide_id+'"]').parent("li").prev().addClass("active");
570
- }
 
571
 
572
- $(this).parent().parent('.hotspot-setup').find('.hotspot-nav li:not(:last-child) span[data-href="'+hotspot_hide_id+'"]').parent("li").remove();
 
 
 
 
 
573
  }
574
  }
575
- },
576
 
577
- }]
578
- });
579
  });
580
 
581
 
582
  var file_frame;
583
  var parent;
584
- $(document).on("click",".scene-upload",function(event) {
585
  event.preventDefault();
586
- parent = $(this).parent( '.form-group' );
587
-
588
- if ( file_frame ) {
589
- file_frame.open();
590
- return;
591
- }
592
-
593
- file_frame = wp.media.frames.file_frame = wp.media({
594
- title: $( this ).data( 'uploader_title' ),
595
- button: {
596
- text: $( this ).data( 'uploader_button_text' ),
597
- },
598
- library: {
599
- type: [ 'image']
600
- },
601
- multiple: false
602
- });
603
-
604
- file_frame.on( 'select', function() {
605
-
606
- var attachment = file_frame.state().get('selection').first().toJSON();
607
- parent.find('.scene-attachment-url').val(attachment.url);
608
- parent.find( 'img' ).attr( 'src', attachment.url).show();
609
- });
610
-
611
- file_frame.open();
612
- });
613
-
614
- var file_frames;
615
- $(document).on("click",".video-upload",function(event) {
616
  event.preventDefault();
617
 
618
- parent = $(this).parent( '.form-group' );
619
 
620
- if ( file_frames ) {
621
- file_frames.open();
622
- return;
623
- }
624
 
625
- file_frames = wp.media.frames.file_frames = wp.media({
626
- title: $( this ).data( 'uploader_title' ),
627
- button: {
628
- text: $( this ).data( 'uploader_button_text' ),
629
- },
630
- library: {
631
- type: [ 'video/mp4']
632
- },
633
- multiple: false
634
- });
635
 
636
- file_frames.on( 'select', function() {
637
- var attachment = file_frames.state().get('selection').first().toJSON();
638
- parent.find('.video-attachment-url').val(attachment.url);
639
- });
640
 
641
- file_frames.open();
642
- });
643
 
644
- var file_fram;
645
 
646
- $(document).on("click",".preview-upload",function(event) {
647
  event.preventDefault();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
648
 
 
 
 
 
 
 
649
 
650
- parent = $(this).parent( '.form-group' );
651
-
652
- if ( file_fram ) {
653
- file_fram.open();
654
- return;
655
- }
656
-
657
- file_fram = wp.media.frames.file_fram = wp.media({
658
- title: $( this ).data( 'uploader_title' ),
659
- button: {
660
- text: $( this ).data( 'uploader_button_text' ),
661
- },
662
- library: {
663
- type: [ 'image']
664
- },
665
- multiple: false
666
- });
667
-
668
- file_fram.on( 'select', function() {
669
- var attachment = file_fram.state().get('selection').first().toJSON();
670
- parent.find('.preview-attachment-url').val(attachment.url);
671
- parent.find( '.img-upload-frame' ).css( 'background-image', 'url('+attachment.url+')');
672
- parent.find( '.img-upload-frame' ).addClass( 'img-uploaded');
673
- });
674
-
675
- file_fram.open();
676
- });
677
-
678
-
679
- $(document).on("change","select[name*=hotspot-type]",function(event) {
680
-
681
- var getparent = $(this).parent();
682
-
683
- var getvalue = $(this).val();
684
- if (getvalue == 'info') {
685
- getparent.find('.hotspot-scene').hide();
686
- getparent.find('.hotspot-url').show();
687
- getparent.find('.hotspot-content').show();
688
- }
689
- else {
690
- getparent.find('.hotspot-scene').show();
691
- getparent.find('.hotspot-url').hide();
692
- getparent.find('.hotspot-content').hide();
693
- }
694
  });
695
 
696
- $(document).on("change","input[type=radio][name=panovideo]",function(event) {
697
- var getvalue = $(this).val();
698
- if (getvalue == 'on') {
699
- $(".video-setting").show();
700
- $("li.general").hide();
701
- $("li.scene").hide();
702
- $("li.hotspot").hide();
703
- }
704
- else {
705
- $(".video-setting").hide();
706
- $("li.general").show();
707
- $("li.scene").show();
708
- $("li.hotspot").show();
709
- }
 
 
 
710
  });
711
 
712
- jQuery(document).ready(function($){
713
- var viddata = $("input[name='panovideo']:checked").val();
714
- if (viddata == 'on') {
715
- $("li.general").removeClass('active');
716
- $(".rex-pano-tab.general").removeClass('active');
717
- $("li.video").addClass('active');
718
- $(".rex-pano-tab.video").addClass('active');
719
- $(".video-setting").show();
720
- $("li.general").hide();
721
- $("li.scene").hide();
722
- $("li.hotspot").hide();
723
- }
724
- else {
725
- $(".video-setting").hide();
726
- $("li.general").show();
727
- $("li.scene").show();
728
- $("li.hotspot").show();
729
- }
730
- });
731
-
732
- $(document).on("change","select[name*=hotspot-customclass-pro]",function(event) {
733
- var getval = $(this).val();
734
- $(this).parent('.hotspot-setting').children('span.change-icon').html('<i class="'+getval+'"></i>');
735
 
736
  });
737
 
738
- $(document).on("change",".hotspot-customclass-color",function(event) {
739
- var getcolor = $(this).val();
740
- color = getcolor;
741
- $('.hotspot-customclass-color-icon-value').val(getcolor);
742
- $('.hotspot-customclass-color').val(getcolor);
743
  });
744
 
745
- jQuery(document).ready(function($){
746
- if ($(".icon-found-value")[0]){
747
- color = $('.hotspot-customclass-color-icon-value.icon-found-value').val();
748
  } else {
749
- color = '#00b4ff';
750
  }
751
- });
752
 
753
- function changeicon(){
754
- $('.hotspot-customclass-color-icon-value').val(color);
755
- $('.hotspot-customclass-color').val(color);
756
  }
757
 
758
- //------------panolens tab js------------------
759
-
760
 
761
- $(document).on("click",".scene-nav ul li:not(:last-child) span",function() {
762
 
763
- var scene_id = $(this).data('index');
764
- scene_id = '#scene-'+ scene_id;
765
 
766
- j = $(scene_id).find('.hotspot-nav li').eq(-2).find('span').attr('data-index');
 
767
 
768
- $([$(this).parent()[0], $($(this).data('href'))[0]]).addClass('active').siblings('.active').removeClass('active');
769
 
770
- });
 
 
771
 
772
- //add click
773
- $(document).on("click",".scene-nav ul li:last-child span",function() {
774
- var scene_id = $(this).parent('li').prev().children("span").data('index');
775
- scene_id = '#scene-'+ scene_id;
776
- j = $(scene_id).find('.hotspot-nav li').eq(-2).find('span').attr('data-index');
777
- $('.scene-nav ul li.active').removeClass('active');
778
- $(this).parent('li').prev().addClass('active');
779
- var sceneinfo = $('.scene-setup').repeaterVal();
780
  var infodata = sceneinfo['scene-list'];
781
  $('.hotspotscene').find('option').remove();
782
  $('.hotspotscene').append("<option value='none'>None</option>");
783
  for (var i in infodata) {
784
  var optiondata = infodata[i]['scene-id'];
785
  if (optiondata != '') {
786
- $('.hotspotscene').append("<option value='" + optiondata + "'>"+optiondata+"</option>");
787
  }
788
  }
789
  $('.hotspot-customclass-pro-select').fontIconPicker();
790
  $('span.change-icon').hide();
791
- });
792
-
793
- //end add click
794
-
795
- $(document).on("click",".hotspot-nav ul li:not(:last-child) span",function() {
796
- $([$(this).parent()[0], $($(this).data('href'))[0]]).addClass('active').siblings('.active').removeClass('active');
797
 
798
- });
 
 
 
 
799
 
800
- $(document).on("click",".hotspot-nav ul li:last-child span",function() {
801
  $(this).parent('li').siblings('.active').removeClass('active');
802
- $(this).parent('li').prev().addClass('active');
803
- var sceneinfo = $('.scene-setup').repeaterVal();
804
  var infodata = sceneinfo['scene-list'];
805
  $('.hotspotscene').find('option').remove();
806
  $('.hotspotscene').append("<option value='none'>None</option>");
807
  for (var i in infodata) {
808
  var optiondata = infodata[i]['scene-id'];
809
  if (optiondata != '') {
810
- $('.hotspotscene').append("<option value='" + optiondata + "'>"+optiondata+"</option>");
811
  }
812
  }
813
- $('.trtr').trigger('change');
814
- $('.hotspot-customclass-pro-select').fontIconPicker();
815
- $('span.change-icon').hide();
816
-
817
- });
818
-
819
- function changehotspotid(id){
820
- var scene_id = '#scene-'+ id;
821
- var hotspot_id = 'scene-'+ id +'-hotspot-1';
822
- $(scene_id).find('.hotspot-nav li span').attr('data-href', '#'+hotspot_id+'');
823
- $(scene_id).find('.single-hotspot').attr('id', hotspot_id);
824
-
825
- }
826
-
827
- $(document).on("click",".rex-pano-nav-menu.main-nav ul li span",function() {
828
- $([$(this).parent()[0], $($(this).data('href'))[0]]).addClass('active').siblings('.active').removeClass('active');
829
- });
830
-
831
- //----------alert dismiss--------//
832
- $(document).on("click","body",function() {
833
- $('.pano-alert').hide();
834
- });
835
- $(document).on("click",".pano-alert > .destroy",function() {
836
- $('.pano-alert').hide();
837
- });
838
- $(document).on("click",".pano-alert, .rex-pano-sub-tabs .rex-pano-tab-nav li.add",function(e) {
839
- e.stopPropagation();
840
- });
841
-
842
-
843
- $(document).on("click",".main-nav li.hotspot span",function() {
844
- $(".hotspot-setup.rex-pano-sub-tabs").show();
845
- $(".scene-setup > nav.scene-nav").hide();
846
- $(".scene-setup .single-scene > .scene-content").hide();
847
- $(".scene-setup .delete-scene").hide();
848
- });
849
-
850
- $(document).on("click",".main-nav li.scene span",function() {
851
- $(".hotspot-setup.rex-pano-sub-tabs").hide();
852
- $(".scene-setup > nav.scene-nav").show();
853
- $(".scene-setup .single-scene > .scene-content").show();
854
- $(".scene-setup .delete-scene").show();
855
- });
856
-
857
- $(document).on("change",".dscen",function() {
858
- var dscene = $(this).val();
859
- $(".dscen").not(this).each(function() {
860
- var oth_scene = $(this).val();
861
- if (dscene == 'on' && oth_scene == 'on') {
862
- alert('Default scene updated.');
863
- $(this).val('off');
864
- }
 
 
865
  });
866
  });
867
 
868
- $(document).on("change",".sceneid",function() {
869
  var sceneinfo = $('.scene-setup').repeaterVal();
870
  var infodata = sceneinfo['scene-list'];
871
  $('.hotspotscene').find('option').remove();
@@ -873,11 +865,12 @@ $(document).on("change","input[type=radio][name=panovideo]",function(event) {
873
  for (var i in infodata) {
874
  var optiondata = infodata[i]['scene-id'];
875
  if (optiondata != '') {
876
- $('.hotspotscene').append("<option value='" + optiondata + "'>"+optiondata+"</option>");
877
  }
878
  }
879
  });
880
- function deleteinfodata(){
 
881
  var sceneinfo = $('.scene-setup').repeaterVal();
882
  var infodata = sceneinfo['scene-list'];
883
  $('.hotspotscene').find('option').remove();
@@ -885,53 +878,52 @@ $(document).on("change","input[type=radio][name=panovideo]",function(event) {
885
  for (var i in infodata) {
886
  var optiondata = infodata[i]['scene-id'];
887
  if (optiondata != '') {
888
- $('.hotspotscene').append("<option value='" + optiondata + "'>"+optiondata+"</option>");
889
  }
890
  }
891
  }
892
 
893
- $(document).on("change",".hotspotscene",function() {
894
 
895
  var chanheghtptpval = $(this).val();
896
- if(chanheghtptpval != "none") {
897
  $(this).parent('.hotspot-scene').siblings('.hotspot-scene').children('.hotspotsceneinfodata').val(chanheghtptpval);
898
- }
899
- else {
900
  $(this).parent('.hotspot-scene').siblings('.hotspot-scene').children('.hotspotsceneinfodata').val('');
901
  }
902
  });
903
 
904
- $(document).on("click",".hotpitch",function(event) {
905
  var datacoords = $('#panodata').text().split(',');
906
  var pitchsplit = datacoords[0];
907
  var pitch = pitchsplit.split(':');
908
  $(this).parent().parent('.hotspot-setting').children('.hotspot-pitch').val(pitch[1]);
909
  });
910
 
911
- $(document).on("click",".hotyaw",function(event) {
912
  var datacoords = $('#panodata').text().split(',');
913
  var yawsplit = datacoords[1];
914
  var yaw = yawsplit.split(':');
915
  $(this).parent().parent('.hotspot-setting').children('.hotspot-yaw').val(yaw[1]);
916
  });
917
 
918
- jQuery(document).ready(function($){
919
 
920
  if ($(".scene-setup").length > 0) {
921
- var sceneinfo = $('.scene-setup').repeaterVal();
922
  var infodata = sceneinfo['scene-list'];
923
  $('.hotspotscene').find('option').remove();
924
  $('.hotspotscene').append("<option value='none'>None</option>");
925
  for (var i in infodata) {
926
  var optiondata = infodata[i]['scene-id'];
927
  if (optiondata != '') {
928
- $('.hotspotscene').append("<option value='" + optiondata + "'>"+optiondata+"</option>");
929
  }
930
  }
931
- }
932
- });
933
 
934
- $(document).on("click",".toppitch",function(event) {
935
  var datacoords = $('#panodata').text().split(',');
936
  var pitchsplit = datacoords[0];
937
  var pitch = pitchsplit.split(':');
@@ -942,121 +934,222 @@ $(document).on("change","input[type=radio][name=panovideo]",function(event) {
942
  $('div.single-scene.rex-pano-tab.active').children('div.hotspot-setup.rex-pano-sub-tabs').children('div.rex-pano-tab-content').children('div.single-hotspot.rex-pano-tab.active.clearfix').find('.hotspot-yaw').val(yaw[1]);
943
  });
944
  jQuery(document).ready(function($) {
945
- $('.hotspot-customclass-pro-select').fontIconPicker();
946
  });
947
  jQuery(document).ready(function($) {
948
- $('span.change-icon').hide();
949
  });
950
 
951
  jQuery(document).ready(function($) {
952
- var autrotateset = $("input[name='autorotation']").val();
953
-
954
- if (autrotateset == 'off') {
955
- $('.autorotationdata-wrapper').hide();
956
- }
957
- else {
958
- $('.autorotationdata-wrapper').show();
959
- }
960
  });
961
 
962
- $(document).on("change","input[name='autorotation']",function(event) {
963
- var autrotateset = $(this).val();
964
 
965
- if ( autrotateset == 'on' ) {
966
- $('.autorotationdata-wrapper').show();
967
- }
968
- else {
969
- $('.autorotationdata-wrapper').hide();
970
- }
971
  });
972
 
973
- $(document).on("change",".ptyscene",function(event) {
974
- var ptyscene = $(this).val();
975
- if (ptyscene == 'off') {
976
- $(this).parent('.single-settings').siblings('.ptyscenedata').hide();
977
- }
978
- else {
979
- $(this).parent('.single-settings').siblings('.ptyscenedata').show();
980
- }
981
  });
982
 
983
- $(document).on("change",".cvgscene",function(event) {
984
- var cvgscene = $(this).val();
985
- if (cvgscene == 'off') {
986
- $(this).parent('.single-settings').siblings('.cvgscenedata').hide();
987
- }
988
- else {
989
- $(this).parent('.single-settings').siblings('.cvgscenedata').show();
990
- }
991
  });
992
 
993
- $(document).on("change",".chgscene",function(event) {
994
- var chgscenedata = $(this).val();
995
- if (chgscenedata == 'off') {
996
- $(this).parent('.single-settings').siblings('.chgscenedata').hide();
997
- }
998
- else {
999
- $(this).parent('.single-settings').siblings('.chgscenedata').show();
1000
- }
1001
  });
1002
 
1003
- $(document).on("change",".czscene",function(event) {
1004
- var czscene = $(this).val();
1005
- if (czscene == 'off') {
1006
- $(this).parent('.single-settings').siblings('.czscenedata').hide();
1007
- }
1008
- else {
1009
- $(this).parent('.single-settings').siblings('.czscenedata').show();
1010
- }
1011
  });
1012
 
1013
- $(document).on("click","#wpvr_role_submit",function(e) {
1014
  e.preventDefault();
1015
  var ajaxurl = wpvr_obj.ajaxurl;
1016
  $('#wpvr_role_progress').show();
1017
- $('#wpvr_role_submit').attr('disabled' , true);
1018
  var editor = $('#wpvr_editor_active').is(':checked');
1019
  var author = $('#wpvr_author_active').is(':checked');
1020
  var fontawesome = $('#wpvr_fontawesome_disable').is(':checked');
1021
  var wpvr_script_control = $('#wpvr_script_control').is(':checked');
1022
  var wpvr_script_list = $('#wpvr_script_list').val();
1023
  var high_res_image = $('#high_res_image').is(':checked');
1024
- jQuery.ajax({
1025
- type: "POST",
1026
- url: ajaxurl,
1027
- data: {
1028
- action: "wpvr_role_management",
1029
- editor: editor,
1030
- author: author,
1031
- fontawesome: fontawesome,
1032
- high_res_image: high_res_image,
1033
- wpvr_script_control: wpvr_script_control,
1034
- wpvr_script_list: wpvr_script_list,
1035
- },
1036
- success: function( response ){
1037
- $('#wpvr_role_progress').hide();
1038
- $('#wpvr_role_submit').attr('disabled' , false);
1039
- if (response.status == 'success') {
1040
- Materialize.toast(response.message, 2000);
1041
- }
1042
- }
1043
  });
1044
- });
1045
 
1046
 
1047
- //------general tab's inner tab-------
1048
- jQuery(document).ready(function($) {
1049
- $('.general-inner-tab .inner-nav li span').on('click', function(){
1050
- var this_id = $(this).attr('data-href');
 
 
 
 
 
1051
 
1052
- $(this).parent('li').addClass('active');
1053
- $(this).parent('li').siblings().removeClass('active');
1054
 
1055
- $(this_id).show();
1056
- $(this_id).siblings().hide();
1057
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1058
 
1059
- });
 
 
 
 
 
 
 
 
 
 
1060
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1061
 
1062
- })( jQuery );
 
1
+ (function($) {
2
  'use strict';
3
+ var j = 1;
4
+ var color = '#00b4ff';
5
 
6
  /**
7
  * All of the code for your admin-facing JavaScript source
31
  * practising this, we should strive to set a better example in our own work.
32
  */
33
 
34
+ $(document).ready(function() {
35
  $(".vrowl-carousel").owlCarousel({
36
+ margin: 10,
37
+ autoWidth: true,
38
  });
 
39
 
40
 
41
+ $('.meta-box-sortables').sortable({
42
+ items: '#wpvr_item_builder_box',
43
+ disabled: true
44
+ });
45
+
46
+ $('.postbox .hndle').css('cursor', 'pointer');
47
+ });
48
+
49
+
50
+ $(document).on("change", "input.vr-switcher-check", function(event) {
51
+ if (this.checked) {
52
+ $(this).val('on');
53
+ } else {
54
+ $(this).val('off');
55
+ }
56
+ });
57
 
58
+ jQuery(document).ready(function($) {
59
 
60
 
61
+ j = $('#scene-1').find('.hotspot-nav li').eq(-2).find('span').attr('data-index');
62
+ var ajaxurl = wpvr_obj.ajaxurl;
63
+ $('#panolenspreview').on('click', function(e) {
64
  e.preventDefault();
65
  $('.wpvr-loading').show();
66
  var postid = $("#post_ID").val();
67
+ var autoload = $("input[name='autoload']").val();
68
  var compass = $("input[name='compass']:checked").val();
69
+ var control = $("input[name='controls']").val();
70
+ var rotation = $("input[name='autorotation']").val();
71
  var defaultscene = $("input[name='default-scene-id']").val();
72
  var preview = $("input[name='preview-attachment-url']").val();
73
  var scenefadeduration = $("input[name='scene-fade-duration']").val();
74
+
75
  var autorotation = $("input[name='auto-rotation']").val();
76
  var autorotationinactivedelay = $("input[name='auto-rotation-inactive-delay']").val();
77
  var autorotationstopdelay = $("input[name='auto-rotation-stop-delay']").val();
78
 
79
  var panodata = $('.scene-setup').repeaterVal();
80
  var panolist = JSON.stringify(panodata);
81
+ jQuery.ajax({
82
+ type: "POST",
83
+ url: ajaxurl,
84
+ data: {
85
+ action: "wpvr_preview",
86
+ postid: postid,
87
+ compass: compass,
88
+ control: control,
89
+ autoload: autoload,
90
+ panodata: panolist,
91
+ defaultscene: defaultscene,
92
+ rotation: rotation,
93
+ autorotation: autorotation,
94
+ autorotationinactivedelay: autorotationinactivedelay,
95
+ autorotationstopdelay: autorotationstopdelay,
96
+
97
+ preview: preview,
98
+ scenefadeduration: scenefadeduration,
99
+ },
100
+
101
+ success: function(response) {
102
+ $('.wpvr-loading').hide();
103
+ if (response.success == true) {
104
+ $('#error_occured').hide();
105
+ $('#error_occuredpub').hide();
106
+ $('#' + response.data[0]["panoid"]).empty();
107
+ var scenes = response.data[1];
108
+
109
+ if (scenes) {
110
+ $.each(scenes.scenes, function(i) {
111
+ $.each(scenes.scenes[i]['hotSpots'], function(key, val) {
112
+ if (val["clickHandlerArgs"] != "") {
113
+ val["clickHandlerFunc"] = wpvrhotspot;
114
+ }
115
+ if (val["createTooltipArgs"] != "") {
116
+ val["createTooltipFunc"] = wpvrtooltip;
117
+ }
118
+ });
119
  });
120
+ }
121
+ if (scenes) {
122
+ $('.scene-gallery').trigger('destroy.owl.carousel');
123
+ $('.scene-gallery').empty();
124
+ $.each(scenes.scenes, function(key, val) {
125
+ $('.scene-gallery').append('<ul style="width:150px;"><li>' + key + '</li><li title="Double click to view scene"><img class="scctrl" id="' + key + '_gallery" src="' + val.panorama + '"></li></ul>');
 
 
 
 
126
  });
127
+ }
128
+ var panoshow = pannellum.viewer(response.data[0]["panoid"], scenes);
129
+ if (scenes.autoRotate) {
130
+ panoshow.on('load', function() {
131
+ setTimeout(function() {
132
+ panoshow.startAutoRotate(scenes.autoRotate, 0);
133
+ }, 3000);
134
+ });
135
+ panoshow.on('scenechange', function() {
136
+ setTimeout(function() {
137
+ panoshow.startAutoRotate(scenes.autoRotate, 0);
138
+ }, 3000);
139
+ });
140
+ }
141
+ var touchtime = 0;
142
+ if (scenes) {
143
+ $.each(scenes.scenes, function(key, val) {
144
+ document.getElementById('' + key + '_gallery').addEventListener('click', function(e) {
145
+ if (touchtime == 0) {
146
+ touchtime = new Date().getTime();
147
+ } else {
148
+ if (((new Date().getTime()) - touchtime) < 800) {
149
+ panoshow.loadScene(key);
150
+ touchtime = 0;
151
+ } else {
152
+ touchtime = new Date().getTime();
153
+ }
154
+ }
155
+ });
156
+ });
157
+ }
158
+ $('html, body').animate({
159
+ scrollTop: $("#wpvr_item_builder__box").offset().top
160
+ }, 500);
161
+ } else {
162
+ $('#error_occured').show();
163
+ $('#error_occured').html(response.data);
164
+ $('#error_occuredpub').show();
165
+ $('#error_occuredpub').html(response.data);
166
+ $('body').addClass('error-overlay');
167
+ $('html, body').animate({
168
+ scrollTop: $("#error_occured").offset().top
169
+ }, 500);
170
+ }
171
+ }
172
  });
173
  });
174
  });
175
 
176
+ jQuery(document).ready(function($) {
177
+ var ajaxurl = wpvr_obj.ajaxurl;
178
+ $('#videopreview').on('click', function(e) {
179
  e.preventDefault();
180
  $('.wpvr-loading').show();
181
  var postid = $("#post_ID").val();
182
  var videourl = $("input[name='video-attachment-url']").val();
183
  var vidautoplay = $("input[name='playvideo']:checked").val();
184
  var vidcontrol = $("input[name='playcontrol']:checked").val();
185
+ jQuery.ajax({
186
+ type: "POST",
187
+ url: ajaxurl,
188
+ data: {
189
+ action: "wpvrvideo_preview",
190
+ postid: postid,
191
+ videourl: videourl,
192
+ vidautoplay: vidautoplay,
193
+ vidcontrol: vidcontrol,
194
+ },
195
+
196
+ success: function(response) {
197
+ $('.wpvr-loading').hide();
198
+ if (response.success == true) {
199
+ $('#' + response.data["panoid"]).empty();
200
+ $('#' + response.data["panoid"]).html(response.data["panodata"]);
201
+ if (response.data['vidtype'] == 'selfhost') {
202
+ videojs(response.data["vidid"], {
203
+ plugins: {
204
+ pannellum: {}
205
+ }
206
  });
207
+ }
208
+ $('html, body').animate({
209
+ scrollTop: $("#wpvr_item_builder__box").offset().top
210
+ }, 500);
211
+ } else {}
212
+ }
213
+ });
214
+ });
215
+ });
216
+
217
+ jQuery(document).ready(function($) {
218
+
219
+ var flag_ok = false;
220
+ $('#publish').on('click', function(e) {
221
+ var x = $(this).val();
222
+ if (!flag_ok) {
223
+ e.preventDefault();
224
+ $('.wpvr-loading').show();
225
+ var postid = $("#post_ID").val();
226
+ var panovideo = $("input[name='panovideo']:checked").val();
227
+ var videourl = $("input[name='video-attachment-url']").val();
228
+ var autoload = $("input[name='autoload']").val();
229
+ var control = $("input[name='controls']").val();
230
+ var compass = $("input[name='compass']:checked").val();
231
+ var defaultscene = $("input[name='default-scene-id']").val();
232
+ var preview = $("input[name='preview-attachment-url']").val();
233
+ var rotation = $("input[name='autorotation']").val();
234
+ var autorotation = $("input[name='auto-rotation']").val();
235
+ var autorotationinactivedelay = $("input[name='auto-rotation-inactive-delay']").val();
236
+ var autorotationstopdelay = $("input[name='auto-rotation-stop-delay']").val();
237
+
238
+ var scenefadeduration = $("input[name='scene-fade-duration']").val();
239
+
240
+ if ($('.scene-setup')[0]) {
241
+ var panodata = $('.scene-setup').repeaterVal();
242
+ var panolist = JSON.stringify(panodata);
243
+ } else {
244
+ var panodata = '';
245
+ var panolist = '';
246
+ }
247
+
248
+ jQuery.ajax({
249
+
250
+ type: "POST",
251
+ url: ajaxurl,
252
+ data: {
253
+ action: "wpvr_save",
254
+ postid: postid,
255
+ panovideo: panovideo,
256
+ videourl: videourl,
257
+ control: control,
258
+ compass: compass,
259
+ autoload: autoload,
260
+ panodata: panolist,
261
+ defaultscene: defaultscene,
262
+ preview: preview,
263
+ rotation: rotation,
264
+ autorotation: autorotation,
265
+ autorotationinactivedelay: autorotationinactivedelay,
266
+ autorotationstopdelay: autorotationstopdelay,
267
+ scenefadeduration: scenefadeduration,
268
+ },
269
+
270
+ success: function(response) {
271
+ $('.wpvr-loading').hide();
272
+ if (response.success == false) {
273
+ $('#error_occured').show();
274
+ $('#error_occured').html(response.data);
275
+ $('#error_occuredpub').show();
276
+ $('#error_occuredpub').html(response.data);
277
+
278
+ $('body').addClass('error-overlay');
279
  $('html, body').animate({
280
+ scrollTop: $("#error_occured").offset().top
281
  }, 500);
282
+ } else {
283
+ flag_ok = true;
284
+ $('#publish').trigger('click');
285
+ }
286
+ }
287
+ });
288
+ }
289
+ });
290
+ });
291
 
292
+ jQuery(document).ready(function($) {
293
+ $("body").on("click", function(e) {
294
+ $("#error_occured").hide();
295
+ $('body').removeClass('error-overlay');
296
+ });
297
+
298
+ $("#panolenspreview, #error_occured").on("click", function(e) {
299
+ e.stopPropagation();
300
  });
301
  });
302
 
303
+ jQuery(document).ready(function($) {
304
 
305
  var flag_ok = false;
306
+ $('#save-post').on('click', function(e) {
307
+ var x = $(this).val();
308
+ if (!flag_ok) {
309
+ e.preventDefault();
310
  $('.wpvr-loading').show();
311
  var postid = $("#post_ID").val();
312
  var panovideo = $("input[name='panovideo']:checked").val();
324
  var scenefadeduration = $("input[name='scene-fade-duration']").val();
325
 
326
  if ($('.scene-setup')[0]) {
327
+ var panodata = $('.scene-setup').repeaterVal();
328
+ var panolist = JSON.stringify(panodata);
329
  } else {
330
  var panodata = '';
331
  var panolist = '';
332
  }
333
 
334
+ jQuery.ajax({
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
 
336
+ type: "POST",
337
+ url: ajaxurl,
338
+ data: {
339
+ action: "wpvr_save",
340
+ postid: postid,
341
+ panovideo: panovideo,
342
+ videourl: videourl,
343
+ control: control,
344
+ compass: compass,
345
+ autoload: autoload,
346
+ panodata: panolist,
347
+ defaultscene: defaultscene,
348
+ preview: preview,
349
+ rotation: rotation,
350
+ autorotation: autorotation,
351
+ autorotationinactivedelay: autorotationinactivedelay,
352
+ autorotationstopdelay: autorotationstopdelay,
353
+ scenefadeduration: scenefadeduration,
354
+ },
355
+
356
+ success: function(response) {
357
+ $('.wpvr-loading').hide();
358
+ if (response.success == false) {
359
+ $('#error_occured').show();
360
+ $('#error_occured').html(response.data);
361
+ $('#error_occuredpub').show();
362
+ $('#error_occuredpub').html(response.data);
363
+
364
+ $('body').addClass('error-overlay');
365
+ $('html, body').animate({
366
+ scrollTop: $("#error_occured").offset().top
367
+ }, 500);
368
+ } else {
369
+ flag_ok = true;
370
+ $('#save-post').trigger('click');
371
+ }
 
 
 
 
 
372
  }
373
+ });
374
+ }
375
+ });
376
+ });
377
 
378
+ function wpvrhotspot(hotSpotDiv, args) {
379
+ var argst = args.replace(/\\/g, '');
380
+ $("#custom-ifram").html(argst);
381
+ $("#custom-ifram").fadeToggle();
382
+ $(".iframe-wrapper").toggleClass("show-modal");
383
  }
384
 
385
  function wpvrtooltip(hotSpotDiv, args) {
386
+ hotSpotDiv.classList.add('custom-tooltip');
387
+ var span = document.createElement('span');
388
+ args = args.replace(/\\/g, "");
389
+ span.innerHTML = args;
390
+ hotSpotDiv.appendChild(span);
391
+ span.style.marginLeft = -(span.scrollWidth - hotSpotDiv.offsetWidth) / 2 + 'px';
392
+ span.style.marginTop = -span.scrollHeight - 12 + 'px';
393
  }
394
 
395
+ jQuery(document).ready(function($) {
396
+ $("#cross").on("click", function(e) {
397
+ e.preventDefault();
398
+ $("#custom-ifram").fadeOut();
399
+ $(".iframe-wrapper").removeClass("show-modal");
400
+ $('iframe').attr('src', $('iframe').attr('src'));
401
+ });
402
+ });
403
 
404
+ jQuery(document).ready(function($) {
405
 
406
+ var i = $('.scene-nav li').eq(-2).find('span').attr('data-index');
407
+ i = parseInt(i);
408
 
409
  $('.scene-setup').repeater({
410
 
411
+ defaultValues: {
412
+ 'scene-type': 'equirectangular',
413
  'dscene': 'off',
414
  'ptyscene': 'off',
415
  'cvgscene': 'off',
416
  'chgscene': 'off',
417
  'czscene': 'off',
418
+ },
419
+ show: function() {
420
 
421
+ if ($(this).parents(".scene-setup").attr("data-limit").length > 0) {
422
 
423
+ if ($(this).parents(".scene-setup").find("div[data-repeater-item]:not(.hotspot-setup div[data-repeater-item])").length <= $(this).parents(".scene-setup").attr("data-limit")) {
424
 
425
  $(this).slideDown();
426
  $(this).removeClass('active');
427
 
428
+ i = i + 1;
429
+ var scene = 'scene-' + i;
430
 
431
+ $(this).find(".title .scene-num").html(i);
432
 
433
+ $('<li><span data-index="' + i + '" data-href="#' + scene + '"><i class="fa fa-image"></i></span></li>').insertBefore($(this).parent().parent('.scene-setup').find('.scene-nav ul li:last-child'));
434
 
435
+ $(this).attr('id', scene);
436
+ changehotspotid(i);
437
+ $(this).siblings('.active').removeClass('active');
438
+ $(this).addClass('active');
439
+ setTimeout(changeicon, 1000);
440
  } else {
441
+ $('.pano-alert > p').html('You can only add 5 scenes in free version');
442
+ $('.pano-alert').show();
443
  $(this).remove();
444
  }
445
  } else {
446
  jQuery(this).slideDown();
447
+ $(this).removeClass('active');
448
+
449
+ i = i + 1;
450
+ var scene = 'scene-' + i;
451
+ $(this).find(".title .scene-num").html(i);
452
+ $('<li><span data-index="' + i + '" data-href="#' + scene + '"><i class="fa fa-image"></i></span></li>').insertBefore($(this).parent().parent('.scene-setup').find('.scene-nav ul li:last-child'));
453
+ $(this).attr('id', scene);
454
+ changehotspotid(i);
 
 
 
 
455
  }
456
 
457
  $(this).hide();
 
 
458
 
459
+ //tab active setup
460
+ $('#wpvr_active_scenes').val(i);
461
+ $('#wpvr_active_hotspot').val(1);
462
+ },
463
+ hide: function(deleteElement) {
464
+ var hide_id = $(this).attr("id");
465
+ var _hide_id = hide_id.split('-').pop();
466
+ hide_id = "#" + hide_id;
467
 
468
+ var current = $(this).attr('id');
469
+ var fchild = $('.single-scene:nth-child(2)').attr('id');
470
 
471
+ var elementcontains = $(this).attr("id");
472
  var str1 = 'scene';
473
  var str2 = 'hotspot';
474
+ if (elementcontains.indexOf(str1) != -1 && elementcontains.indexOf(str2) == -1) {
475
+ if (confirm('Are you sure you want to delete?')) {
476
+ jQuery(this).slideUp(deleteElement);
477
+ if (current == fchild) {
478
+ $(this).next().addClass("active");
479
+ $(this).parent().parent('.scene-setup').find('.scene-nav li span[data-href="' + hide_id + '"]').parent("li").next().addClass("active");
480
+ $(this).parent().parent('.scene-setup').find('.scene-nav li span[data-href="' + hide_id + '"]').parent("li").next().children("span").trigger("click");
481
+ } else {
482
+ $(this).prev().addClass("active");
483
+ $(this).parent().parent('.scene-setup').find('.scene-nav li span[data-href="' + hide_id + '"]').parent("li").prev().addClass("active");
484
+ $(this).parent().parent('.scene-setup').find('.scene-nav li span[data-href="' + hide_id + '"]').parent("li").prev().children("span").trigger("click");
485
+ }
486
+ $(this).parent().parent('.scene-setup').find('.scene-nav li span[data-href="' + hide_id + '"]').parent("li").remove();
487
+ setTimeout(deleteinfodata, 1000);
 
 
 
 
 
 
 
 
 
 
 
 
 
488
 
489
+ //tab active setup
490
+ if (parseInt(_hide_id) - 1 > 0) {
491
+ $('#wpvr_active_scenes').val(parseInt(_hide_id) - 1);
492
+ } else {
493
+ $('#wpvr_active_scenes').val(1);
494
+ }
495
+ $('#wpvr_active_hotspot').val(1);
496
+ }
497
 
498
+ }
499
+ },
500
+ repeaters: [{
501
+ selector: '.hotspot-setup',
502
+ defaultValues: {
503
+ 'hotspot-type': 'info',
504
+ 'hotspot-customclass-pro': 'none',
505
+ },
506
+ show: function() {
507
+ if ($(this).parents(".hotspot-setup").attr("data-limit").length > 0) {
508
+
509
+ if ($(this).parents(".hotspot-setup").find("div[data-repeater-item]").length <= $(this).parents(".hotspot-setup").attr("data-limit")) {
510
 
511
  $(this).slideDown();
512
  $(this).removeClass('active');
513
  $(this).siblings('.active').removeClass('active');
514
+ $(this).addClass('active');
515
+ j = parseInt(j);
516
+ j = j + 1;
517
+ var parent_scene = $(this).parent().parent().parent('.single-scene.active').attr('id');
518
+ var hotspot = parent_scene + '-hotspot-' + j;
519
 
520
+ var replace_string = parent_scene.replace("scene-", "");
521
 
522
+ $(this).find(".title .hotspot-num").html(j);
523
+ $(this).find(".title .scene-num").html(replace_string);
524
 
525
+ $('<li><span data-index="' + j + '" data-href="#' + hotspot + '"><i class="far fa-dot-circle"></i></span></li>').insertBefore($(this).parent().parent('.hotspot-setup').find('.hotspot-nav ul li:last-child'));
526
 
527
+ $(this).attr('id', hotspot);
528
 
529
+ setTimeout(changeicon, 1000);
530
  } else {
531
+ $('.pano-alert > p').html('You can only add 5 hotspots in free version');
532
+ $('.pano-alert').show();
533
  $(this).remove();
534
  }
535
  } else {
536
  jQuery(this).slideDown();
537
+ $(this).removeClass('active');
538
+ j = parseInt(j);
539
+ j = j + 1;
540
+ var parent_scene = $(this).parent().parent().parent('.single-scene.active').attr('id');
541
+ var hotspot = parent_scene + '-hotspot-' + j;
542
 
543
+ var replace_string = parent_scene.replace("scene-", "");
544
 
545
+ $(this).find(".title .hotspot-num").html(j);
546
+ $(this).find(".title .scene-num").html(replace_string);
547
 
548
+ $('<li><span data-index="' + j + '" data-href="#' + hotspot + '"><i class="far fa-dot-circle"></i></span></li>').insertBefore($(this).parent().parent('.hotspot-setup').find('.hotspot-nav ul li:last-child'));
549
 
550
+ $(this).attr('id', hotspot);
551
  }
552
+ $('#wpvr_active_hotspot').val(j);
553
+ },
554
+ hide: function(deleteElement) {
555
+ var hotspot_hide_id = $(this).attr("id");
556
+ var _hide_id = hotspot_hide_id.split('-').pop();
557
+ hotspot_hide_id = "#" + hotspot_hide_id;
558
+ var hotspot_current = $(this).attr('id');
559
+ var hotspot_fchild = $(this).parent().children(":first").attr('id');
560
+
561
+ var hpelementcontains = $(this).attr("id");
562
  var hpstr1 = 'scene';
563
  var hpstr2 = 'hotspot';
564
+ if (hpelementcontains.indexOf(hpstr1) != -1 && hpelementcontains.indexOf(hpstr2) != -1) {
565
+ if (confirm('Are you sure you want to delete?')) {
566
  jQuery(this).slideUp(deleteElement);
567
+ if (hotspot_current == hotspot_fchild) {
568
+ $(this).next().addClass("active");
569
+ $(this).parent().parent('.hotspot-setup').find('.hotspot-nav li span[data-href="' + hotspot_hide_id + '"]').parent("li").next().addClass("active");
570
 
571
+ } else {
572
+ $(this).prev().addClass("active");
573
+ $(this).parent().parent('.hotspot-setup').find('.hotspot-nav li span[data-href="' + hotspot_hide_id + '"]').parent("li").prev().addClass("active");
574
+ }
575
+
576
+ $(this).parent().parent('.hotspot-setup').find('.hotspot-nav li:not(:last-child) span[data-href="' + hotspot_hide_id + '"]').parent("li").remove();
577
 
578
+ //tab active setup
579
+ if (parseInt(_hide_id) - 1 > 0) {
580
+ $('#wpvr_active_hotspot').val(parseInt(_hide_id) - 1);
581
+ } else {
582
+ $('#wpvr_active_hotspot').val(1);
583
+ }
584
  }
585
  }
586
+ },
587
 
588
+ }]
589
+ });
590
  });
591
 
592
 
593
  var file_frame;
594
  var parent;
595
+ $(document).on("click", ".scene-upload", function(event) {
596
  event.preventDefault();
597
+ parent = $(this).parent('.form-group');
598
+
599
+ if (file_frame) {
600
+ file_frame.open();
601
+ return;
602
+ }
603
+
604
+ file_frame = wp.media.frames.file_frame = wp.media({
605
+ title: $(this).data('uploader_title'),
606
+ button: {
607
+ text: $(this).data('uploader_button_text'),
608
+ },
609
+ library: {
610
+ type: ['image']
611
+ },
612
+ multiple: false
613
+ });
614
+
615
+ file_frame.on('select', function() {
616
+
617
+ var attachment = file_frame.state().get('selection').first().toJSON();
618
+ parent.find('.scene-attachment-url').val(attachment.url);
619
+ parent.find('img').attr('src', attachment.url).show();
620
+ });
621
+
622
+ file_frame.open();
623
+ });
624
+
625
+ var file_frames;
626
+ $(document).on("click", ".video-upload", function(event) {
627
  event.preventDefault();
628
 
629
+ parent = $(this).parent('.form-group');
630
 
631
+ if (file_frames) {
632
+ file_frames.open();
633
+ return;
634
+ }
635
 
636
+ file_frames = wp.media.frames.file_frames = wp.media({
637
+ title: $(this).data('uploader_title'),
638
+ button: {
639
+ text: $(this).data('uploader_button_text'),
640
+ },
641
+ library: {
642
+ type: ['video/mp4']
643
+ },
644
+ multiple: false
645
+ });
646
 
647
+ file_frames.on('select', function() {
648
+ var attachment = file_frames.state().get('selection').first().toJSON();
649
+ parent.find('.video-attachment-url').val(attachment.url);
650
+ });
651
 
652
+ file_frames.open();
653
+ });
654
 
655
+ var file_fram;
656
 
657
+ $(document).on("click", ".preview-upload", function(event) {
658
  event.preventDefault();
659
+ parent = $(this).parent('.form-group');
660
+
661
+ if (file_fram) {
662
+ file_fram.open();
663
+ return;
664
+ }
665
+
666
+ file_fram = wp.media.frames.file_fram = wp.media({
667
+ title: $(this).data('uploader_title'),
668
+ button: {
669
+ text: $(this).data('uploader_button_text'),
670
+ },
671
+ library: {
672
+ type: ['image']
673
+ },
674
+ multiple: false
675
+ });
676
 
677
+ file_fram.on('select', function() {
678
+ var attachment = file_fram.state().get('selection').first().toJSON();
679
+ parent.find('.preview-attachment-url').val(attachment.url);
680
+ parent.find('.img-upload-frame').css('background-image', 'url(' + attachment.url + ')');
681
+ parent.find('.img-upload-frame').addClass('img-uploaded');
682
+ });
683
 
684
+ file_fram.open();
685
+ });
686
+
687
+
688
+ $(document).on("change", "select[name*=hotspot-type]", function(event) {
689
+
690
+ var getparent = $(this).parent();
691
+
692
+ var getvalue = $(this).val();
693
+ if (getvalue == 'info') {
694
+ getparent.find('.hotspot-scene').hide();
695
+ getparent.find('.hotspot-url').show();
696
+ getparent.find('.hotspot-content').show();
697
+ } else {
698
+ getparent.find('.hotspot-scene').show();
699
+ getparent.find('.hotspot-url').hide();
700
+ getparent.find('.hotspot-content').hide();
701
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
702
  });
703
 
704
+ jQuery(document).ready(function($) {
705
+ var viddata = $("input[name='panovideo']:checked").val();
706
+ if (viddata == 'on') {
707
+ $("li.general").removeClass('active');
708
+ $(".rex-pano-tab.general").removeClass('active');
709
+ $("li.video").addClass('active');
710
+ $(".rex-pano-tab.video").addClass('active');
711
+ $(".video-setting").show();
712
+ $("li.general").hide();
713
+ $("li.scene").hide();
714
+ $("li.hotspot").hide();
715
+ } else {
716
+ $(".video-setting").hide();
717
+ $("li.general").show();
718
+ $("li.scene").show();
719
+ $("li.hotspot").show();
720
+ }
721
  });
722
 
723
+ $(document).on("change", "select[name*=hotspot-customclass-pro]", function(event) {
724
+ var getval = $(this).val();
725
+ $(this).parent('.hotspot-setting').children('span.change-icon').html('<i class="' + getval + '"></i>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
726
 
727
  });
728
 
729
+ $(document).on("change", ".hotspot-customclass-color", function(event) {
730
+ var getcolor = $(this).val();
731
+ color = getcolor;
732
+ $('.hotspot-customclass-color-icon-value').val(getcolor);
733
+ $('.hotspot-customclass-color').val(getcolor);
734
  });
735
 
736
+ jQuery(document).ready(function($) {
737
+ if ($(".icon-found-value")[0]) {
738
+ color = $('.hotspot-customclass-color-icon-value.icon-found-value').val();
739
  } else {
740
+ color = '#00b4ff';
741
  }
742
+ });
743
 
744
+ function changeicon() {
745
+ $('.hotspot-customclass-color-icon-value').val(color);
746
+ $('.hotspot-customclass-color').val(color);
747
  }
748
 
749
+ //------------panolens tab js------------------
 
750
 
 
751
 
752
+ $(document).on("click", ".scene-nav ul li:not(:last-child) span", function() {
 
753
 
754
+ var scene_id = $(this).data('index');
755
+ scene_id = '#scene-' + scene_id;
756
 
757
+ j = $(scene_id).find('.hotspot-nav li').eq(-2).find('span').attr('data-index');
758
 
759
+ $([$(this).parent()[0], $($(this).data('href'))[0]]).addClass('active').siblings('.active').removeClass('active');
760
+ $('#wpvr_active_scenes').val($(this).data('index'));
761
+ });
762
 
763
+ //add click
764
+ $(document).on("click", ".scene-nav ul li:last-child span", function() {
765
+ var scene_id = $(this).parent('li').prev().children("span").data('index');
766
+ scene_id = '#scene-' + scene_id;
767
+ j = $(scene_id).find('.hotspot-nav li').eq(-2).find('span').attr('data-index');
768
+ $('.scene-nav ul li.active').removeClass('active');
769
+ $(this).parent('li').prev().addClass('active');
770
+ var sceneinfo = $('.scene-setup').repeaterVal();
771
  var infodata = sceneinfo['scene-list'];
772
  $('.hotspotscene').find('option').remove();
773
  $('.hotspotscene').append("<option value='none'>None</option>");
774
  for (var i in infodata) {
775
  var optiondata = infodata[i]['scene-id'];
776
  if (optiondata != '') {
777
+ $('.hotspotscene').append("<option value='" + optiondata + "'>" + optiondata + "</option>");
778
  }
779
  }
780
  $('.hotspot-customclass-pro-select').fontIconPicker();
781
  $('span.change-icon').hide();
782
+ });
 
 
 
 
 
783
 
784
+ //end add click
785
+ $(document).on("click", ".hotspot-nav ul li:not(:last-child) span", function() {
786
+ $('#wpvr_active_hotspot').val($(this).data('index'));
787
+ $([$(this).parent()[0], $($(this).data('href'))[0]]).addClass('active').siblings('.active').removeClass('active');
788
+ });
789
 
790
+ $(document).on("click", ".hotspot-nav ul li:last-child span", function() {
791
  $(this).parent('li').siblings('.active').removeClass('active');
792
+ $(this).parent('li').prev().addClass('active');
793
+ var sceneinfo = $('.scene-setup').repeaterVal();
794
  var infodata = sceneinfo['scene-list'];
795
  $('.hotspotscene').find('option').remove();
796
  $('.hotspotscene').append("<option value='none'>None</option>");
797
  for (var i in infodata) {
798
  var optiondata = infodata[i]['scene-id'];
799
  if (optiondata != '') {
800
+ $('.hotspotscene').append("<option value='" + optiondata + "'>" + optiondata + "</option>");
801
  }
802
  }
803
+ $('.trtr').trigger('change');
804
+ $('.hotspot-customclass-pro-select').fontIconPicker();
805
+ $('span.change-icon').hide();
806
+
807
+ });
808
+
809
+ function changehotspotid(id) {
810
+ var scene_id = '#scene-' + id;
811
+ var hotspot_id = 'scene-' + id + '-hotspot-1';
812
+ $(scene_id).find('.hotspot-nav li span').attr('data-href', '#' + hotspot_id + '');
813
+ $(scene_id).find('.single-hotspot').attr('id', hotspot_id);
814
+
815
+ }
816
+
817
+ $(document).on("click", ".rex-pano-nav-menu.main-nav ul li span", function() {
818
+ var screen = $(this).parent().attr('data-screen');
819
+ $('#wpvr_active_tab').val(screen);
820
+ $([$(this).parent()[0], $($(this).data('href'))[0]]).addClass('active').siblings('.active').removeClass('active');
821
+ });
822
+
823
+ //----------alert dismiss--------//
824
+ $(document).on("click", "body", function() {
825
+ $('.pano-alert').hide();
826
+ });
827
+ $(document).on("click", ".pano-alert > .destroy", function() {
828
+ $('.pano-alert').hide();
829
+ });
830
+ $(document).on("click", ".pano-alert, .rex-pano-sub-tabs .rex-pano-tab-nav li.add", function(e) {
831
+ e.stopPropagation();
832
+ });
833
+
834
+
835
+ $(document).on("click", ".main-nav li.hotspot span", function() {
836
+ $(".hotspot-setup.rex-pano-sub-tabs").show();
837
+ $(".scene-setup > nav.scene-nav").hide();
838
+ $(".scene-setup .single-scene > .scene-content").hide();
839
+ $(".scene-setup .delete-scene").hide();
840
+ });
841
+
842
+ $(document).on("click", ".main-nav li.scene span", function() {
843
+ $(".hotspot-setup.rex-pano-sub-tabs").hide();
844
+ $(".scene-setup > nav.scene-nav").show();
845
+ $(".scene-setup .single-scene > .scene-content").show();
846
+ $(".scene-setup .delete-scene").show();
847
+ });
848
+
849
+ $(document).on("change", ".dscen", function() {
850
+ var dscene = $(this).val();
851
+ $(".dscen").not(this).each(function() {
852
+ var oth_scene = $(this).val();
853
+ if (dscene == 'on' && oth_scene == 'on') {
854
+ alert('Default scene updated.');
855
+ $(this).val('off');
856
+ }
857
  });
858
  });
859
 
860
+ $(document).on("change", ".sceneid", function() {
861
  var sceneinfo = $('.scene-setup').repeaterVal();
862
  var infodata = sceneinfo['scene-list'];
863
  $('.hotspotscene').find('option').remove();
865
  for (var i in infodata) {
866
  var optiondata = infodata[i]['scene-id'];
867
  if (optiondata != '') {
868
+ $('.hotspotscene').append("<option value='" + optiondata + "'>" + optiondata + "</option>");
869
  }
870
  }
871
  });
872
+
873
+ function deleteinfodata() {
874
  var sceneinfo = $('.scene-setup').repeaterVal();
875
  var infodata = sceneinfo['scene-list'];
876
  $('.hotspotscene').find('option').remove();
878
  for (var i in infodata) {
879
  var optiondata = infodata[i]['scene-id'];
880
  if (optiondata != '') {
881
+ $('.hotspotscene').append("<option value='" + optiondata + "'>" + optiondata + "</option>");
882
  }
883
  }
884
  }
885
 
886
+ $(document).on("change", ".hotspotscene", function() {
887
 
888
  var chanheghtptpval = $(this).val();
889
+ if (chanheghtptpval != "none") {
890
  $(this).parent('.hotspot-scene').siblings('.hotspot-scene').children('.hotspotsceneinfodata').val(chanheghtptpval);
891
+ } else {
 
892
  $(this).parent('.hotspot-scene').siblings('.hotspot-scene').children('.hotspotsceneinfodata').val('');
893
  }
894
  });
895
 
896
+ $(document).on("click", ".hotpitch", function(event) {
897
  var datacoords = $('#panodata').text().split(',');
898
  var pitchsplit = datacoords[0];
899
  var pitch = pitchsplit.split(':');
900
  $(this).parent().parent('.hotspot-setting').children('.hotspot-pitch').val(pitch[1]);
901
  });
902
 
903
+ $(document).on("click", ".hotyaw", function(event) {
904
  var datacoords = $('#panodata').text().split(',');
905
  var yawsplit = datacoords[1];
906
  var yaw = yawsplit.split(':');
907
  $(this).parent().parent('.hotspot-setting').children('.hotspot-yaw').val(yaw[1]);
908
  });
909
 
910
+ jQuery(document).ready(function($) {
911
 
912
  if ($(".scene-setup").length > 0) {
913
+ var sceneinfo = $('.scene-setup').repeaterVal();
914
  var infodata = sceneinfo['scene-list'];
915
  $('.hotspotscene').find('option').remove();
916
  $('.hotspotscene').append("<option value='none'>None</option>");
917
  for (var i in infodata) {
918
  var optiondata = infodata[i]['scene-id'];
919
  if (optiondata != '') {
920
+ $('.hotspotscene').append("<option value='" + optiondata + "'>" + optiondata + "</option>");
921
  }
922
  }
923
+ }
924
+ });
925
 
926
+ $(document).on("click", ".toppitch", function(event) {
927
  var datacoords = $('#panodata').text().split(',');
928
  var pitchsplit = datacoords[0];
929
  var pitch = pitchsplit.split(':');
934
  $('div.single-scene.rex-pano-tab.active').children('div.hotspot-setup.rex-pano-sub-tabs').children('div.rex-pano-tab-content').children('div.single-hotspot.rex-pano-tab.active.clearfix').find('.hotspot-yaw').val(yaw[1]);
935
  });
936
  jQuery(document).ready(function($) {
937
+ $('.hotspot-customclass-pro-select').fontIconPicker();
938
  });
939
  jQuery(document).ready(function($) {
940
+ $('span.change-icon').hide();
941
  });
942
 
943
  jQuery(document).ready(function($) {
944
+ var autrotateset = $("input[name='autorotation']").val();
945
+
946
+ if (autrotateset == 'off') {
947
+ $('.autorotationdata-wrapper').hide();
948
+ } else {
949
+ $('.autorotationdata-wrapper').show();
950
+ }
 
951
  });
952
 
953
+ $(document).on("change", "input[name='autorotation']", function(event) {
954
+ var autrotateset = $(this).val();
955
 
956
+ if (autrotateset == 'on') {
957
+ $('.autorotationdata-wrapper').show();
958
+ } else {
959
+ $('.autorotationdata-wrapper').hide();
960
+ }
 
961
  });
962
 
963
+ $(document).on("change", ".ptyscene", function(event) {
964
+ var ptyscene = $(this).val();
965
+ if (ptyscene == 'off') {
966
+ $(this).parent('.single-settings').siblings('.ptyscenedata').hide();
967
+ } else {
968
+ $(this).parent('.single-settings').siblings('.ptyscenedata').show();
969
+ }
 
970
  });
971
 
972
+ $(document).on("change", ".cvgscene", function(event) {
973
+ var cvgscene = $(this).val();
974
+ if (cvgscene == 'off') {
975
+ $(this).parent('.single-settings').siblings('.cvgscenedata').hide();
976
+ } else {
977
+ $(this).parent('.single-settings').siblings('.cvgscenedata').show();
978
+ }
 
979
  });
980
 
981
+ $(document).on("change", ".chgscene", function(event) {
982
+ var chgscenedata = $(this).val();
983
+ if (chgscenedata == 'off') {
984
+ $(this).parent('.single-settings').siblings('.chgscenedata').hide();
985
+ } else {
986
+ $(this).parent('.single-settings').siblings('.chgscenedata').show();
987
+ }
 
988
  });
989
 
990
+ $(document).on("change", ".czscene", function(event) {
991
+ var czscene = $(this).val();
992
+ if (czscene == 'off') {
993
+ $(this).parent('.single-settings').siblings('.czscenedata').hide();
994
+ } else {
995
+ $(this).parent('.single-settings').siblings('.czscenedata').show();
996
+ }
 
997
  });
998
 
999
+ $(document).on("click", "#wpvr_role_submit", function(e) {
1000
  e.preventDefault();
1001
  var ajaxurl = wpvr_obj.ajaxurl;
1002
  $('#wpvr_role_progress').show();
1003
+ $('#wpvr_role_submit').attr('disabled', true);
1004
  var editor = $('#wpvr_editor_active').is(':checked');
1005
  var author = $('#wpvr_author_active').is(':checked');
1006
  var fontawesome = $('#wpvr_fontawesome_disable').is(':checked');
1007
  var wpvr_script_control = $('#wpvr_script_control').is(':checked');
1008
  var wpvr_script_list = $('#wpvr_script_list').val();
1009
  var high_res_image = $('#high_res_image').is(':checked');
1010
+ jQuery.ajax({
1011
+ type: "POST",
1012
+ url: ajaxurl,
1013
+ data: {
1014
+ action: "wpvr_role_management",
1015
+ editor: editor,
1016
+ author: author,
1017
+ fontawesome: fontawesome,
1018
+ high_res_image: high_res_image,
1019
+ wpvr_script_control: wpvr_script_control,
1020
+ wpvr_script_list: wpvr_script_list,
1021
+ },
1022
+ success: function(response) {
1023
+ $('#wpvr_role_progress').hide();
1024
+ $('#wpvr_role_submit').attr('disabled', false);
1025
+ if (response.status == 'success') {
1026
+ Materialize.toast(response.message, 2000);
1027
+ }
1028
+ }
1029
  });
1030
+ });
1031
 
1032
 
1033
+ //------general tab's inner tab-------
1034
+ jQuery(document).ready(function($) {
1035
+ $('.general-inner-tab .inner-nav li span').on('click', function() {
1036
+ var this_id = $(this).attr('data-href');
1037
+ $(this_id).show();
1038
+ $(this_id).siblings().hide();
1039
+ });
1040
+ });
1041
+
1042
 
1043
+ //------active tab scripts-------
1044
+ jQuery(document).ready(function($) {
1045
 
1046
+ function getUrlVars() {
1047
+ var vars = [],
1048
+ hash;
1049
+ var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
1050
+ for (var i = 0; i < hashes.length; i++) {
1051
+ hash = hashes[i].split('=');
1052
+ vars.push(hash[0]);
1053
+ vars[hash[0]] = hash[1];
1054
+ }
1055
+ return vars;
1056
+ }
1057
+ var activeTab = 'general',
1058
+ vr_main_tab = $('#wpvr-main-nav'),
1059
+ var_main_tab_contents = $('#wpvr-main-tab-contents').find('.rex-pano-tab').not(".single-scene,.single-hotspot"),
1060
+ scene_content = $('.scene-content'),
1061
+ scene_nav = $('.scene-nav'),
1062
+ single_scene = $('.single-scene'),
1063
+ hotspot_content = $('.hotspot-setup'),
1064
+ single_hotspot = $('.single-hotspot'),
1065
+ delete_scene_btn = $('.delete-scene'),
1066
+ delete_hotspot_btn = $('.delete-hotspot');
1067
+
1068
+ var _q_activeTab = getUrlVars()["active_tab"];
1069
+ var _sceneID = getUrlVars()["scene"];
1070
+ var _hotspotID = getUrlVars()["hotspot"];
1071
+ var default_tabs = ['general', 'scene', 'hotspot', 'video'];
1072
+ if (_q_activeTab) {
1073
+ if (default_tabs.includes(_q_activeTab)) {
1074
+ activeTab = _q_activeTab;
1075
+ vr_main_tab.find('li:not(:first)').removeClass('active');
1076
+ vr_main_tab.find('.' + activeTab).addClass('active');
1077
+
1078
+ // scene screens
1079
+ var_main_tab_contents.addClass('active');
1080
+ if (activeTab === 'scene' || activeTab === 'hotspot') {
1081
+ var_main_tab_contents.not('#scenes').removeClass('active');
1082
+ } else {
1083
+ var_main_tab_contents.not('#' + activeTab).removeClass('active');
1084
+ }
1085
+
1086
+ // scene contents
1087
+ if (_sceneID) {
1088
+ var scenesIds = [];
1089
+ var sceneID = '#scene-' + _sceneID;
1090
+ var scene_nav_items = scene_nav.find('li');
1091
+ scene_nav.find('li').each(function() {
1092
+ var index = $(this).find('span').attr('data-index');
1093
+ if (index) {
1094
+ scenesIds.push(index);
1095
+ }
1096
+ });
1097
+ if (scenesIds.includes(_sceneID)) {
1098
+ scene_nav_items.removeClass('active');
1099
+ scene_nav.find('li').each(function() {
1100
+ var index = $(this).find('span').attr('data-index');
1101
+ if (_sceneID == index) {
1102
+ $(this).addClass('active');
1103
+ }
1104
+ });
1105
+ if (activeTab == 'scene' || _sceneID) {
1106
+ single_scene.removeClass('active');
1107
+ $(sceneID).addClass('active');
1108
+ }
1109
+ } else {
1110
+ scene_nav.find('li:first').addClass('active');
1111
+ }
1112
 
1113
+ if (activeTab === 'scene') {
1114
+ if (scenesIds.includes(_sceneID)) {
1115
+ $(single_scene).removeClass('active');
1116
+ $(sceneID).addClass('active');
1117
+ }
1118
+ } else {
1119
+ $(delete_scene_btn).hide();
1120
+ $(scene_nav).hide();
1121
+ $('.scene-content').hide();
1122
+ $(sceneID).find('.hotspot-setup').show();
1123
+ }
1124
 
1125
+ //hotspot contents
1126
+ var hotspot_nav = $('.single-scene.active').find('.hotspot-nav');
1127
+ var hotspotIds = [];
1128
+ var hotspot_nav_items = $('.single-scene.active').find('.hotspot-nav').find('li');
1129
+ var activeHotspotId = '#scene-' + _sceneID + 'hotspot-' + _hotspotID;
1130
+ hotspot_nav_items.each(function() {
1131
+ var index = $(this).find('span').attr('data-index');
1132
+ if (index) {
1133
+ hotspotIds.push(index);
1134
+ activeHotspotId = $(this).find('span').attr('data-href');
1135
+ }
1136
+ });
1137
+ if (hotspotIds.includes(_hotspotID)) {
1138
+ hotspot_nav_items.removeClass('active');
1139
+ hotspot_nav.find('li').each(function() {
1140
+ var index = $(this).find('span').attr('data-index');
1141
+ if (_hotspotID === index) {
1142
+ $(this).addClass('active');
1143
+ }
1144
+ });
1145
+ if (activeHotspotId) {
1146
+ $(sceneID).find('.single-hotspot').removeClass('active');
1147
+ $(activeHotspotId).addClass('active');
1148
+ }
1149
+ }
1150
+ }
1151
+ }
1152
+ }
1153
 
1154
+ });
1155
+ })(jQuery);
admin/partials/wpvr-meta-box-builder-display.php CHANGED
@@ -92,7 +92,34 @@ elseif (isset($postdata['streetviewdata'])) {
92
  </ul>
93
  </div>
94
  <?php
95
- }else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  $control = false;
97
  if (isset($postdata['showControls'])) {
98
  $control = $postdata['showControls'];
@@ -276,45 +303,21 @@ if (isset($postdata['panodata'])) {
276
  $hotspot_scene_yaw = $hotspot_data["hotspot-scene-yaw"];
277
  }
278
 
279
- $hotspot_type = 'info';
280
  $hotspot_content = '';
281
 
282
- if($hotspot_data["hotspot-type"] === 'wc_product') {
283
- $hotspot_type = 'info';
284
- $product_id = $hotspot_data['hotspot-product-id'];
285
- if ( class_exists( 'WooCommerce' ) ) {
286
- $product = wc_get_product($product_id);
287
- if (is_object($product)) {
288
- $post_thumbnail_id = $product->get_image_id();
289
- $html = wc_get_gallery_image_html($post_thumbnail_id, true);
290
- ob_start(); ?>
291
- <div class="wpvr-product-container">
292
- <div class="wpvr-pr-left-block">
293
- <?php echo apply_filters('woocommerce_single_product_image_thumbnail_html', $html, $post_thumbnail_id); ?>
294
- </div>
295
- <div class="wpvr-pr-right-block">
296
- <a href="<?php echo $product->get_permalink(); ?>">
297
- <h2><?php echo $product->get_title(); ?></h2>
298
- </a>
299
- <?php echo do_shortcode('[add_to_cart id="'.$product_id.'"]'); ?>
300
- </div>
301
- </div>
302
- <?php
303
- $hotspot_content = ob_get_clean();
304
- }
305
- }
306
- }
307
- else {
308
- $hotspot_type = $hotspot_data["hotspot-type"];
309
- $hotspot_content = $hotspot_data["hotspot-content"];
310
- }
311
 
312
 
313
  $hotspot_info = array(
314
  "text"=>$hotspot_data["hotspot-title"],
315
  "pitch"=>$hotspot_data["hotspot-pitch"],
316
  "yaw"=>$hotspot_data["hotspot-yaw"],
317
- "type"=>$hotspot_data["hotspot-type"],
318
  "URL"=>$hotspot_data["hotspot-url"],
319
  "clickHandlerArgs"=>$hotspot_content,
320
  "createTooltipArgs"=>$hotspot_data["hotspot-hover"],
92
  </ul>
93
  </div>
94
  <?php
95
+ }
96
+ elseif (isset($postdata['flat_image'])) {
97
+ ?>
98
+ <div class="iframe-wrapper">
99
+ <i class="fa fa-times" id="cross"></i>
100
+ <div id="custom-ifram" style="display: none;">
101
+
102
+ </div>
103
+ <div id="<?php echo 'pano'.$id; ?>" class="pano-wrap" style="height: 100%;">
104
+ <img src="<?php echo $postdata['flat_image_url']; ?>" style="width: 600px">
105
+ </div>
106
+ </div>
107
+
108
+ <div class="rex-add-coordinates" style="text-align: center;">
109
+ <ul>
110
+ <li>
111
+ <div id="panodata" style="text-align: center; font-weight: bold;">
112
+ </div>
113
+ </li>
114
+ <li class="rex-hide-coordinates add-pitch">
115
+ <span class="rex-tooltiptext">Add This Position into active Hotspot</span>
116
+ <i class="fa fa-arrow-down toppitch"></i>
117
+ </li>
118
+ </ul>
119
+ </div>
120
+ <?php
121
+ }
122
+ else {
123
  $control = false;
124
  if (isset($postdata['showControls'])) {
125
  $control = $postdata['showControls'];
303
  $hotspot_scene_yaw = $hotspot_data["hotspot-scene-yaw"];
304
  }
305
 
306
+ $hotspot_type = $hotspot_data["hotspot-type"] !== 'scene' ? 'info' : $hotspot_data["hotspot-type"];
307
  $hotspot_content = '';
308
 
309
+ ob_start();
310
+ do_action('wpvr_hotspot_content', $hotspot_data);
311
+ $hotspot_content = ob_get_clean();
312
+
313
+ if(!$hotspot_content) $hotspot_content = $hotspot_data["hotspot-content"];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
 
315
 
316
  $hotspot_info = array(
317
  "text"=>$hotspot_data["hotspot-title"],
318
  "pitch"=>$hotspot_data["hotspot-pitch"],
319
  "yaw"=>$hotspot_data["hotspot-yaw"],
320
+ "type"=>$hotspot_type,
321
  "URL"=>$hotspot_data["hotspot-url"],
322
  "clickHandlerArgs"=>$hotspot_content,
323
  "createTooltipArgs"=>$hotspot_data["hotspot-hover"],
admin/partials/wpvr_documentation.php CHANGED
@@ -498,14 +498,17 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
498
  <div class="wpvr_role-container">
499
  <ul>
500
  <?php
501
- $is_wpvr_premium = apply_filters('is_wpvr_premium', false);
502
-
503
- $editor_active = get_option('wpvr_editor_active');
504
- $author_active = get_option('wpvr_author_active');
505
- $fontawesome_disable = get_option('wpvr_fontawesome_disable');
506
- $wpvr_script_control = get_option('wpvr_script_control');
507
- $wpvr_script_list = get_option('wpvr_script_list');
508
- $high_res_image = get_option('high_res_image');
 
 
 
509
  ?>
510
  <li>
511
  <h6><?php echo __( "Allow the Editors of your site to Create, Edit, Update, and Delete virtual tours (They can access other users' tours):", "wpvr" ); ?></h6>
@@ -615,6 +618,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
615
  </li>
616
 
617
  <li>
 
618
  <h6><?php echo __( "Enable script control (It will load the WP VR scripts on the pages with virtual tours only):", "wpvr" ); ?></h6>
619
 
620
  <span class="wpvr-switcher">
498
  <div class="wpvr_role-container">
499
  <ul>
500
  <?php
501
+ $is_wpvr_premium = apply_filters('is_wpvr_premium', false);
502
+ $is_integration_module = apply_filters('is_integration_module', false);
503
+
504
+ $editor_active = get_option('wpvr_editor_active');
505
+ $author_active = get_option('wpvr_author_active');
506
+ $fontawesome_disable = get_option('wpvr_fontawesome_disable');
507
+ $wpvr_script_control = get_option('wpvr_script_control');
508
+ $wpvr_script_list = get_option('wpvr_script_list');
509
+ $high_res_image = get_option('high_res_image');
510
+ $enable_woocommerce = get_option('wpvr_enable_woocommerce', false);
511
+
512
  ?>
513
  <li>
514
  <h6><?php echo __( "Allow the Editors of your site to Create, Edit, Update, and Delete virtual tours (They can access other users' tours):", "wpvr" ); ?></h6>
618
  </li>
619
 
620
  <li>
621
+
622
  <h6><?php echo __( "Enable script control (It will load the WP VR scripts on the pages with virtual tours only):", "wpvr" ); ?></h6>
623
 
624
  <span class="wpvr-switcher">
includes/class-wpvr.php CHANGED
@@ -209,6 +209,9 @@ class Wpvr {
209
 
210
  $plugin_admin_ajax = new Wpvr_Ajax();
211
 
 
 
 
212
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
213
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
214
 
@@ -231,7 +234,7 @@ class Wpvr {
231
  add_filter( 'big_image_size_threshold', '__return_false' );
232
  }
233
 
234
- $this->loader->add_action( 'admin_init', $plugin_admin, 'trigger_rollback' );
235
  }
236
 
237
  /**
209
 
210
  $plugin_admin_ajax = new Wpvr_Ajax();
211
 
212
+ //plugin action links
213
+ $this->loader->add_filter( 'plugin_action_links_' . WPVR_BASE, $plugin_admin, 'plugin_action_links_wpvr', 10, 4);
214
+
215
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
216
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
217
 
234
  add_filter( 'big_image_size_threshold', '__return_false' );
235
  }
236
 
237
+ $this->loader->add_action( 'admin_init', $plugin_admin, 'trigger_rollback' );
238
  }
239
 
240
  /**
public/class-wpvr-public.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
 
3
  /**
4
  * The public-facing functionality of the plugin.
5
  *
@@ -20,6 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
20
  * @subpackage Wpvr/public
21
  * @author Rextheme <sakib@coderex.co>
22
  */
 
23
  class Wpvr_Public {
24
 
25
  /**
@@ -131,7 +133,7 @@ class Wpvr_Public {
131
  * between the defined hooks and the functions defined in this
132
  * class.
133
  */
134
-
135
  global $wp;
136
  $wpvr_script_control = get_option('wpvr_script_control');
137
  $wpvr_script_list = get_option('wpvr_script_list');
@@ -173,558 +175,540 @@ class Wpvr_Public {
173
  add_shortcode( $this->plugin_name, array( $this , 'wpvr_shortcode') );
174
  }
175
 
176
- /**
177
- * Shortcode output for the plugin
178
- *
179
- * @since 1.0.0
180
- */
181
- public function wpvr_shortcode( $atts ) {
182
-
183
- extract(
184
- shortcode_atts(
185
- array(
186
- 'id' => 0,
187
- 'width' => NULL,
188
- 'height' => NULL,
189
- 'radius' => NULL
190
- ), $atts
191
- )
192
- );
193
-
194
- if ( !$id ) {
195
- $obj = get_page_by_path( $slug, OBJECT, $this->post_type );
196
- if ( $obj ) {
197
- $id = $obj->ID;
198
- } else {
199
- return __('Invalid Wpvr slug attribute', $this->plugin_name);
200
- }
201
- }
202
 
203
- $postdata = get_post_meta( $id, 'panodata', true );
204
- $panoid = 'pano'.$id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
 
206
- if (isset($postdata['streetviewdata'])) {
207
- if (empty($width)) {
208
- $width = '600px';
209
- }
210
- if (empty($height)) {
211
- $height = '400px';
212
- }
213
- $streetviewurl = $postdata['streetviewurl'];
214
- $html = '';
215
- $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
216
- $html .= '<iframe src="'.$streetviewurl.'" width="'.trim($width,'px').'" height="'.trim($height,'px').'" frameborder="0" style="border:0;" allowfullscreen=""></iframe>';
217
- $html .= '</div>';
218
-
219
- return $html;
220
- }
221
-
222
- if (isset($postdata['vidid'])) {
223
- if (empty($width)) {
224
- $width = '600px';
225
- }
226
- if (empty($height)) {
227
- $height = '400px';
228
- }
229
 
230
- $videourl = $postdata['vidurl'];
231
- $autoplay = 'off';
232
- if (isset($postdata['autoplay'])) {
233
- $autoplay = $postdata['autoplay'];
234
- }
235
- $loop = 'off';
236
- if (isset($postdata['loop'])) {
237
- $loop = $postdata['loop'];
238
- }
 
 
 
239
 
240
- if (strpos($videourl, 'youtube') > 0) {
241
- $explodeid = '';
242
- $explodeid = explode("=",$videourl);
243
- $foundid = '';
244
 
245
- if ($autoplay == 'on') {
246
- $autoplay = '&autoplay=1';
247
- $muted = '&mute=1';
248
- }
249
- else {
250
- $autoplay = '';
251
- $muted = '';
252
- }
253
 
254
- if ($loop == 'on') {
255
- $loop = '&loop=1';
256
- }
257
- else {
258
- $loop = '';
259
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
 
261
- $foundid = $explodeid[1].'?'.$autoplay.$loop;
262
- $html = '';
263
- $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
264
- $html .= '
265
  <iframe src="https://www.youtube.com/embed/'.$explodeid[1].'?rel=0&modestbranding=1'.$loop.'&autohide=1'.$muted.'&showinfo=0&controls=1'.$autoplay.'" width="560" height="315" frameborder="0" allowfullscreen></iframe>
266
  ';
267
- $html .= '</div>';
268
 
269
- error_log(print_r($html,true));
270
 
271
- } elseif (strpos($videourl, 'vimeo') > 0) {
272
 
273
- $explodeid = '';
274
- $explodeid = explode("/",$videourl);
275
- $foundid = '';
276
- if ($autoplay == 'on') {
277
- $autoplay = '&autoplay=1&muted=1';
278
- }
279
- else {
280
- $autoplay = '';
281
- }
282
 
283
- if ($loop == 'on') {
284
- $loop = '&loop=1';
285
- }
286
- else {
287
- $loop = '';
288
- }
289
- $foundid = $explodeid[3].'?'.$autoplay.$loop;
290
- $html = '';
291
- $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
292
- $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="'.trim($width,'px').'" height="'.trim($height,'px').'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
293
- $html .= '</div>';
294
-
295
- } else {
296
- $html = '';
297
- $html .= '<div id="pano'.$id.'" class="pano-wrap" style="max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto;">';
298
- $html .= '<div style="width:100%; height:100%; ">'.$postdata['panoviddata'].'</div>';
299
- $html .= '<script>';
300
- $html .= 'var player = videojs('.$postdata['vidid'].', {';
301
- $html .= 'plugins: {';
302
- $html .= 'pannellum: {}';
303
- $html .= '}';
304
- $html .= '});';
305
- $html .= '
306
  videojs('.$postdata['vidid'].').play();
307
  ';
308
- $html .= '</script>';
309
- $html .= '</div>';
310
- }
311
-
312
- return $html;
313
- }
314
-
315
- $control = false;
316
- if (isset($postdata['showControls'])) {
317
- $control = $postdata['showControls'];
318
- }
319
-
320
- if ($control) {
321
- if (isset($postdata['customcontrol'])) {
322
- $custom_control = $postdata['customcontrol'];
323
- if ($custom_control['panupSwitch'] == "on" || $custom_control['panDownSwitch'] == "on" || $custom_control['panLeftSwitch'] == "on" || $custom_control['panRightSwitch'] == "on" || $custom_control['panZoomInSwitch'] == "on" || $custom_control['panZoomOutSwitch'] == "on" || $custom_control['panFullscreenSwitch'] == "on" || $custom_control['gyroscopeSwitch'] == "on" || $custom_control['backToHomeSwitch'] == "on") {
324
- $control = false;
325
- }
326
- }
327
- }
328
-
329
- $vrgallery = false;
330
- if (isset($postdata['vrgallery'])) {
331
- $vrgallery = $postdata['vrgallery'];
332
- }
333
-
334
- $vrgallery_title = false;
335
- if (isset($postdata['vrgallery_title'])) {
336
- $vrgallery_title = $postdata['vrgallery_title'];
337
- }
338
-
339
- $gyro = false;
340
- $gyro_orientation = false;
341
- if (isset($postdata['gyro'])) {
342
- $gyro = $postdata['gyro'];
343
- if (isset($postdata['deviceorientationcontrol'])) {
344
- $gyro_orientation = $postdata['deviceorientationcontrol'];
345
- }
346
- }
347
-
348
- $compass = false;
349
- $audio_right = "5px";
350
- if (isset($postdata['compass'])) {
351
- $compass = $postdata['compass'];
352
- if ($compass) {
353
- $audio_right = "60px";
354
- }
355
- }
356
 
357
- $mouseZoom = true;
358
- if (isset($postdata['mouseZoom'])) {
359
- $mouseZoom = $postdata['mouseZoom'];
360
- }
361
-
362
- $draggable = true;
363
- if (isset($postdata['draggable'])) {
364
- $draggable = $postdata['draggable'];
365
- }
366
-
367
- $diskeyboard = false;
368
- if (isset($postdata['diskeyboard'])) {
369
- $diskeyboard = $postdata['diskeyboard'];
370
- }
371
-
372
- $keyboardzoom = true;
373
- if (isset($postdata['keyboardzoom'])) {
374
- $keyboardzoom = $postdata['keyboardzoom'];
375
- }
376
-
377
- $autoload = false;
378
-
379
- if (isset($postdata['autoLoad'])) {
380
- $autoload = $postdata['autoLoad'];
381
- }
382
-
383
- $default_scene = '';
384
- if (isset($postdata['defaultscene'])) {
385
- $default_scene = $postdata['defaultscene'];
386
- }
387
-
388
- $preview = '';
389
- if (isset($postdata['preview'])) {
390
- $preview = $postdata['preview'];
391
- }
392
-
393
- $autorotation = '';
394
- if (isset($postdata["autoRotate"])) {
395
- $autorotation = $postdata["autoRotate"];
396
- }
397
- $autorotationinactivedelay = '';
398
- if (isset($postdata["autoRotateInactivityDelay"])) {
399
- $autorotationinactivedelay = $postdata["autoRotateInactivityDelay"];
400
- }
401
- $autorotationstopdelay = '';
402
- if (isset($postdata["autoRotateStopDelay"])) {
403
- $autorotationstopdelay = $postdata["autoRotateStopDelay"];
404
- }
405
-
406
- $scene_fade_duration = '';
407
- if (isset($postdata['scenefadeduration'])) {
408
- $scene_fade_duration = $postdata['scenefadeduration'];
409
- }
410
-
411
- $panodata = '';
412
- if (isset($postdata['panodata'])) {
413
- $panodata = $postdata['panodata'];
414
- }
415
- $hotspoticoncolor = '#00b4ff';
416
- $hotspotblink = 'on';
417
- $default_data = array();
418
- $default_data = array("firstScene"=>$default_scene,"sceneFadeDuration"=>$scene_fade_duration);
419
- $scene_data = array();
420
-
421
- if (!empty($panodata["scene-list"])) {
422
- foreach ($panodata["scene-list"] as $panoscenes) {
423
-
424
- $scene_ititle = '';
425
- if (isset($panoscenes["scene-ititle"])) {
426
- $scene_ititle = sanitize_text_field($panoscenes["scene-ititle"]);
427
- }
428
-
429
- $scene_author = '';
430
- if (isset($panoscenes["scene-author"])) {
431
- $scene_author = sanitize_text_field($panoscenes["scene-author"]);
432
  }
433
 
434
- $scene_author_url = '';
435
- if (isset($panoscenes["scene-author-url"])) {
436
- $scene_author_url = sanitize_text_field($panoscenes["scene-author-url"]);
437
- }
438
 
439
- $scene_vaov = 180;
440
- if (isset($panoscenes["scene-vaov"])) {
441
- $scene_vaov = (float)$panoscenes["scene-vaov"];
442
- }
 
 
 
 
443
 
444
- $scene_haov = 360;
445
- if (isset($panoscenes["scene-haov"])) {
446
- $scene_haov = (float)$panoscenes["scene-haov"];
447
- }
448
 
 
 
 
 
449
 
450
- $scene_vertical_offset = 0;
451
- if (isset($panoscenes["scene-vertical-offset"])) {
452
- $scene_vertical_offset = (float)$panoscenes["scene-vertical-offset"];
453
- }
 
 
 
 
454
 
455
- $default_scene_pitch = null;
456
- if (isset($panoscenes["scene-pitch"])) {
457
- $default_scene_pitch = (float)$panoscenes["scene-pitch"];
458
- }
459
-
460
- $default_scene_yaw = null;
461
- if (isset($panoscenes["scene-yaw"])) {
462
- $default_scene_yaw = (float)$panoscenes["scene-yaw"];
463
- }
464
-
465
- $scene_max_pitch = '';
466
- if (isset($panoscenes["scene-maxpitch"])) {
467
- $scene_max_pitch = (float)$panoscenes["scene-maxpitch"];
468
- }
469
-
470
-
471
- $scene_min_pitch = '';
472
- if (isset($panoscenes["scene-minpitch"])) {
473
- $scene_min_pitch = (float)$panoscenes["scene-minpitch"];
474
- }
475
-
476
-
477
- $scene_max_yaw = '';
478
- if (isset($panoscenes["scene-maxyaw"])) {
479
- $scene_max_yaw = (float)$panoscenes["scene-maxyaw"];
480
- }
481
-
482
-
483
- $scene_min_yaw = '';
484
- if (isset($panoscenes["scene-minyaw"])) {
485
- $scene_min_yaw = (float)$panoscenes["scene-minyaw"];
486
- }
487
-
488
- $default_zoom = 100;
489
- if (isset($panoscenes["scene-zoom"])) {
490
- $default_zoom = $panoscenes["scene-zoom"];
491
- }
492
-
493
- if (!empty($default_zoom)) {
494
- $default_zoom = (int)$default_zoom;
495
- }
496
- else {
497
- $default_zoom = 100;
498
- }
499
-
500
- $max_zoom = 120;
501
- if (isset($panoscenes["scene-maxzoom"])) {
502
- $max_zoom = $panoscenes["scene-maxzoom"];
503
- }
504
-
505
- if (!empty($max_zoom)) {
506
- $max_zoom = (int)$max_zoom;
507
- }
508
- else {
509
- $max_zoom = 120;
510
- }
511
-
512
- $min_zoom = 50;
513
- if (isset($panoscenes["scene-minzoom"])) {
514
- $min_zoom = $panoscenes["scene-minzoom"];
515
- }
516
-
517
- if (!empty($min_zoom)) {
518
- $min_zoom = (int)$min_zoom;
519
- }
520
- else {
521
- $min_zoom = 50;
522
- }
523
- $hotspot_datas = array();
524
- if (isset($panoscenes["hotspot-list"])) {
525
- $hotspot_datas = $panoscenes["hotspot-list"];
526
- }
527
-
528
- $hotspots = array();
529
-
530
- foreach ($hotspot_datas as $hotspot_data) {
531
-
532
- $status = get_option( 'wpvr_edd_license_status' );
533
- if( $status !== false && $status == 'valid' ) {
534
- if (isset($hotspot_data["hotspot-customclass-pro"]) && $hotspot_data["hotspot-customclass-pro"] != 'none') {
535
- $hotspot_data["hotspot-customclass"] = $hotspot_data["hotspot-customclass-pro"];
536
- $hotspoticoncolor = $hotspot_data["hotspot-customclass-color-icon-value"];
537
- }
538
- if (isset($hotspot_data['hotspot-blink'])) {
539
- $hotspotblink = $hotspot_data['hotspot-blink'];
540
- }
541
- }
542
- $hotspot_scene_pitch = '';
543
- if (isset($hotspot_data["hotspot-scene-pitch"])) {
544
- $hotspot_scene_pitch = $hotspot_data["hotspot-scene-pitch"];
545
- }
546
- $hotspot_scene_yaw = '';
547
- if (isset($hotspot_data["hotspot-scene-yaw"])) {
548
- $hotspot_scene_yaw = $hotspot_data["hotspot-scene-yaw"];
549
- }
550
-
551
- $hotspot_type = 'info';
552
- $hotspot_content = '';
553
 
554
- if($hotspot_data["hotspot-type"] === 'wc_product') {
555
- $hotspot_type = 'info';
556
- $product_id = $hotspot_data['hotspot-product-id'];
557
- if ( class_exists( 'WooCommerce' ) ) {
558
- $product = wc_get_product($product_id);
559
- if (is_object($product)) {
560
- $post_thumbnail_id = $product->get_image_id();
561
- $html = wc_get_gallery_image_html($post_thumbnail_id, true);
562
- ob_start(); ?>
563
- <div class="wpvr-product-container">
564
- <div class="wpvr-pr-left-block">
565
- <?php echo apply_filters('woocommerce_single_product_image_thumbnail_html', $html, $post_thumbnail_id); ?>
566
- </div>
567
- <div class="wpvr-pr-right-block">
568
- <a href="<?php echo $product->get_permalink(); ?>">
569
- <h2><?php echo $product->get_title(); ?></h2>
570
- </a>
571
- <?php echo do_shortcode('[add_to_cart id="'.$product_id.'"]'); ?>
572
- </div>
573
- </div>
574
- <?php
575
- $hotspot_content = ob_get_clean();
576
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
577
  }
578
- }else {
579
- $hotspot_type = $hotspot_data["hotspot-type"];
580
- $hotspot_content = $hotspot_data["hotspot-content"];
 
 
 
 
581
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
582
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
583
 
 
 
 
584
 
585
- $hotspot_info = array(
586
- "text"=>$hotspot_data["hotspot-title"],
587
- "pitch"=>$hotspot_data["hotspot-pitch"],
588
- "yaw"=>$hotspot_data["hotspot-yaw"],
589
- "type"=>$hotspot_type,
590
- "cssClass"=>$hotspot_data["hotspot-customclass"],
591
- "URL"=>$hotspot_data["hotspot-url"],
592
- "clickHandlerArgs" => $hotspot_content,
593
- "createTooltipArgs"=>$hotspot_data["hotspot-hover"],
594
- "sceneId"=>$hotspot_data["hotspot-scene"],
595
- "targetPitch"=>(float)$hotspot_scene_pitch,
596
- "targetYaw"=>(float)$hotspot_scene_yaw);
597
- if ($hotspot_data["hotspot-customclass"] == 'none' || $hotspot_data["hotspot-customclass"] == '') {
598
- unset($hotspot_info["cssClass"]);
599
- }
600
- if (empty($hotspot_data["hotspot-scene"])) {
601
- unset($hotspot_info['targetPitch']);
602
- unset($hotspot_info['targetYaw']);
603
- }
604
- array_push($hotspots, $hotspot_info);
605
- }
606
- $scene_info = array();
607
- $scene_info = array("type"=>$panoscenes["scene-type"],"panorama"=>$panoscenes["scene-attachment-url"],"pitch"=>$default_scene_pitch,"maxPitch"=>$scene_max_pitch,"minPitch"=>$scene_min_pitch,"maxYaw"=>$scene_max_yaw,"minYaw"=>$scene_min_yaw,"yaw"=>$default_scene_yaw,"hfov"=>$default_zoom,"maxHfov"=>$max_zoom,"minHfov"=>$min_zoom,"title"=>$scene_ititle,"author"=>$scene_author, "authorURL"=>$scene_author_url, "vaov"=>$scene_vaov, "haov"=>$scene_haov, "vOffset"=>$scene_vertical_offset, "hotSpots"=>$hotspots);
608
-
609
- if (isset($panoscenes["ptyscene"])) {
610
- if ($panoscenes["ptyscene"] == "off") {
611
- unset($scene_info['pitch']);
612
- unset($scene_info['yaw']);
613
- }
614
- }
615
-
616
- if (empty($panoscenes["scene-ititle"])) {
617
- unset($scene_info['title']);
618
- }
619
- if (empty($panoscenes["scene-author"])) {
620
- unset($scene_info['author']);
621
- }
622
- if (empty($panoscenes["scene-author-url"])) {
623
- unset($scene_info['authorURL']);
624
  }
 
625
 
626
- if (empty($scene_vaov)) {
627
- unset($scene_info['vaov']);
628
- }
 
629
 
630
- if (empty($scene_haov)) {
631
- unset($scene_info['haov']);
632
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
633
 
634
- if (empty($scene_vertical_offset)) {
635
- unset($scene_info['vOffset']);
636
- }
637
 
638
- if (isset($panoscenes["cvgscene"])) {
639
- if ($panoscenes["cvgscene"] == "off") {
640
- unset($scene_info['maxPitch']);
641
- unset($scene_info['minPitch']);
642
- }
643
- }
644
- if (empty($panoscenes["scene-maxpitch"])) {
645
- unset($scene_info['maxPitch']);
646
- }
647
-
648
- if (empty($panoscenes["scene-minpitch"])) {
649
- unset($scene_info['minPitch']);
650
- }
651
-
652
- if (isset($panoscenes["chgscene"])) {
653
- if ($panoscenes["chgscene"] == "off") {
654
- unset($scene_info['maxYaw']);
655
- unset($scene_info['minYaw']);
656
- }
657
- }
658
- if (empty($panoscenes["scene-maxyaw"])) {
659
- unset($scene_info['maxYaw']);
660
- }
661
-
662
- if (empty($panoscenes["scene-minyaw"])) {
663
- unset($scene_info['minYaw']);
664
- }
665
-
666
- if (isset($panoscenes["czscene"])) {
667
- if ($panoscenes["czscene"] == "off") {
668
- unset($scene_info['hfov']);
669
- unset($scene_info['maxHfov']);
670
- unset($scene_info['minHfov']);
671
- }
672
- }
673
-
674
- $scene_array = array();
675
- $scene_array = array(
676
- $panoscenes["scene-id"]=>$scene_info
677
- );
678
- $scene_data[$panoscenes["scene-id"]] = $scene_info;
679
- }
680
- }
681
-
682
- $pano_id_array = array();
683
- $pano_id_array = array("panoid"=>$panoid);
684
- $pano_response = array();
685
- $pano_response = array("autoLoad"=>$autoload,"showControls"=>$control,"orientationSupport"=>'false',"compass"=>$compass,'orientationOnByDefault'=>$gyro_orientation,"mouseZoom"=>$mouseZoom,"draggable"=>$draggable,'disableKeyboardCtrl'=>$diskeyboard,'keyboardZoom'=>$keyboardzoom,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,"default"=>$default_data,"scenes"=>$scene_data);
686
-
687
- if (empty($autorotation)) {
688
- unset($pano_response['autoRotate']);
689
- unset($pano_response['autoRotateInactivityDelay']);
690
- unset($pano_response['autoRotateStopDelay']);
691
- }
692
- if (empty($autorotationinactivedelay)) {
693
- unset($pano_response['autoRotateInactivityDelay']);
694
- }
695
- if (empty($autorotationstopdelay)) {
696
- unset($pano_response['autoRotateStopDelay']);
697
- }
698
- $response = array();
699
- $response = array($pano_id_array,$pano_response);
700
- if (!empty($response)) {
701
- $response = json_encode($response);
702
- }
703
- if (empty($width)) {
704
- $width = '600px';
705
- }
706
- if (empty($height)) {
707
- $height = '400px';
708
- }
709
- $foreground_color = '#fff';
710
- $pulse_color = wpvr_hex2rgb($hotspoticoncolor);
711
- $rgb = wpvr_HTMLToRGB($hotspoticoncolor);
712
- $hsl = wpvr_RGBToHSL($rgb);
713
- if($hsl->lightness > 200) {
714
- $foreground_color = '#000000';
715
- }
716
- else {
717
- $foreground_color = '#fff';
718
- }
719
- $html = '';
720
- $html .= '<style>';
721
  if ($width == 'embed'){
722
- $html .= 'body{
723
  overflow: hidden;
724
  }';
725
 
726
  }
727
- $html .= '#'.$panoid.' div.pnlm-hotspot-base.fas,
728
  #'.$panoid.' div.pnlm-hotspot-base.fab,
729
  #'.$panoid.' div.pnlm-hotspot-base.fa,
730
  #'.$panoid.' div.pnlm-hotspot-base.far {
@@ -736,8 +720,8 @@ class Wpvr_Public {
736
  height: 30px;
737
  animation: icon-pulse'.$panoid.' 1.5s infinite cubic-bezier(.25, 0, 0, 1);
738
  }';
739
- if ($hotspotblink == 'on') {
740
- $html .= '@-webkit-keyframes icon-pulse'.$panoid.' {
741
  0% {
742
  box-shadow: 0 0 0 0px rgba('.$pulse_color[0].', 1);
743
  }
@@ -753,231 +737,241 @@ class Wpvr_Public {
753
  box-shadow: 0 0 0 10px rgba('.$pulse_color[0].', 0);
754
  }
755
  }';
756
- }
757
 
758
- $status = get_option( 'wpvr_edd_license_status' );
759
- if( $status !== false && $status == 'valid' ) {
760
  if (!$gyro) {
761
- $html .= '#'.$panoid.' div.pnlm-orientation-button {
762
  display: none;
763
  }';
764
  }
765
- }
766
- else {
767
  $html .= '#'.$panoid.' div.pnlm-orientation-button {
768
  display: none;
769
  }';
770
- }
771
-
772
- $html .= '</style>';
773
- if ($width == 'fullwidth') {
774
- if (wpvr_isMobileDevice()) {
775
- if ($radius) {
776
- $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center; border-radius:'.$radius.'; direction:ltr;">';
777
- }
778
- else {
779
- $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center;">';
780
- }
781
-
782
- }
783
- else {
784
- if ($radius) {
785
- $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'; border-radius:'.$radius.'; direction:ltr;" >';
786
- }
787
- else {
788
- $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'; direction:ltr;" >';
789
- }
790
-
791
- }
792
- }
793
- elseif ($width == 'embed') {
794
- if (wpvr_isMobileDevice()) {
795
- if ($radius) {
796
- $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center; border-radius:'.$radius.'; direction:ltr;">';
797
- }
798
- else {
799
- $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center;">';
800
- }
801
-
802
- }
803
- else {
804
- if ($radius) {
805
- $html .= '<div id="pano'.$id.'" class="pano-wrap vrembed" style=" text-align:center; height: '.$height.'; border-radius:'.$radius.'; direction:ltr;" >';
806
- }
807
- else {
808
- $html .= '<div id="pano'.$id.'" class="pano-wrap vrembed" style=" text-align:center; height: '.$height.'; direction:ltr;" >';
809
- }
810
-
811
- }
812
- }
813
- else {
814
- if ($radius) {
815
- $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto; border-radius:'.$radius.'; direction:ltr;">';
816
- }
817
- else {
818
- $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto; direction:ltr;">';
819
- }
820
-
821
- }
822
-
823
- //===company logo===//
824
- if (isset($postdata['cpLogoSwitch'])) {
825
- $cpLogoImg = $postdata['cpLogoImg'];
826
- $cpLogoContent = $postdata['cpLogoContent'];
827
- if ($postdata['cpLogoSwitch'] == 'on') {
828
- $html .= '<div id="cp-logo-controls">';
829
- $html .= '<div class="cp-logo-ctrl" id="cp-logo">';
830
- if ($cpLogoImg) {
831
- $html .= '<img src="'.$cpLogoImg.'" alt="Company Logo">';
832
- }
833
-
834
- if ($cpLogoContent) {
835
- $html .= '<div class="cp-info">'.$cpLogoContent.'</div>';
836
- }
837
- $html .= '</div>';
838
- $html .= '</div>';
839
- }
840
- }
841
- //===company logo ends===//
842
-
843
- //===Custom Control===//
844
- if (isset($custom_control)) {
845
- if ( $custom_control['panZoomInSwitch'] == "on" || $custom_control['panZoomOutSwitch'] == "on" || $custom_control['gyroscopeSwitch'] == "on" || $custom_control['backToHomeSwitch'] == "on") {
846
-
847
- $html .= '<div id="zoom-in-out-controls'.$id.'" class="zoom-in-out-controls">';
848
-
849
- if ($custom_control['backToHomeSwitch'] == "on") {
850
- $html .= '<div class="ctrl" id="backToHome'.$id.'"><i class="'.$custom_control['backToHomeIcon'].'" style="color:'.$custom_control['backToHomeColor'].';"></i></div>';
851
- }
852
-
853
- if ($custom_control['panZoomInSwitch'] == "on") {
854
- $html .= '<div class="ctrl" id="zoom-in'.$id.'"><i class="'.$custom_control['panZoomInIcon'].'" style="color:'.$custom_control['panZoomInColor'].';"></i></div>';
855
- }
856
 
857
- if ($custom_control['panZoomOutSwitch'] == "on") {
858
- $html .= '<div class="ctrl" id="zoom-out'.$id.'"><i class="'.$custom_control['panZoomOutIcon'].'" style="color:'.$custom_control['panZoomOutColor'].';"></i></div>';
859
- }
860
- if ($custom_control['gyroscopeSwitch'] == "on") {
861
- $html .= '<div class="ctrl" id="gyroscope'.$id.'"><i class="'.$custom_control['gyroscopeIcon'].'" style="color:'.$custom_control['gyroscopeColor'].';"></i></div>';
862
- }
863
- $html .= '</div>';
864
- }
865
- //===zoom in out Control===//
866
 
867
- if ($custom_control['panupSwitch'] == "on" || $custom_control['panDownSwitch'] == "on" || $custom_control['panLeftSwitch'] == "on" || $custom_control['panRightSwitch'] == "on" || $custom_control['panFullscreenSwitch'] == "on") {
868
- //===Custom Control===//
869
- $html .= '<div class="controls" id="controls'.$id.'">';
 
 
 
 
 
870
 
871
- if ($custom_control['panupSwitch'] == "on") {
872
- $html .= '<div class="ctrl pan-up" id="pan-up'.$id.'"><i class="'.$custom_control['panupIcon'].'" style="color:'.$custom_control['panupColor'].';"></i></div>';
873
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
874
 
875
- if ($custom_control['panDownSwitch'] == "on") {
876
- $html .= '<div class="ctrl pan-down" id="pan-down'.$id.'"><i class="'.$custom_control['panDownIcon'].'" style="color:'.$custom_control['panDownColor'].';"></i></div>';
877
- }
878
 
879
- if ($custom_control['panLeftSwitch'] == "on") {
880
- $html .= '<div class="ctrl pan-left" id="pan-left'.$id.'"><i class="'.$custom_control['panLeftIcon'].'" style="color:'.$custom_control['panLeftColor'].';"></i></div>';
881
- }
 
 
 
 
 
 
 
882
 
883
- if ($custom_control['panRightSwitch'] == "on") {
884
- $html .= '<div class="ctrl pan-right" id="pan-right'.$id.'"><i class="'.$custom_control['panRightIcon'].'" style="color:'.$custom_control['panRightColor'].';"></i></div>';
885
- }
 
 
 
 
 
886
 
887
- if ($custom_control['panFullscreenSwitch'] == "on") {
888
- $html .= '<div class="ctrl fullscreen" id="fullscreen'.$id.'"><i class="'.$custom_control['panFullscreenIcon'].'" style="color:'.$custom_control['panFullscreenColor'].';"></i></div>';
889
- }
890
- $html .= '</div>';
891
- }
892
- }
893
- //===Custom Control===//
894
 
895
- if ($vrgallery) {
896
- //===Carousal setup===//
897
- $html .= '<div id="vrgcontrols'.$id.'" class="vrgcontrols">';
898
 
899
- $html .= '<div class="vrgctrl'.$id.' vrbounce">';
900
- $html .= '</div>';
901
- $html .= '</div>';
902
 
903
- $html .= '<div id="sccontrols'.$id.'" class="scene-gallery vrowl-carousel owl-theme">';
904
- if (isset($panodata["scene-list"])) {
905
- foreach ($panodata["scene-list"] as $panoscenes) {
906
- $scene_key = $panoscenes['scene-id'];
907
- if ($vrgallery_title == 'on') {
908
- $scene_key_title = $panoscenes['scene-ititle'];
909
- // $scene_key_title = $panoscenes['scene-id'];
910
  }
911
- else {
912
- $scene_key_title = "";
 
913
  }
914
- $img_src_url = $panoscenes['scene-attachment-url'];
915
- $src_to_id = attachment_url_to_postid($img_src_url);
916
- $thumbnail_array = wp_get_attachment_image_src($src_to_id, 'thumbnail');
917
- if ($thumbnail_array) {
918
- $thumbnail = $thumbnail_array[0];
919
  }
920
- else {
921
- $thumbnail = $img_src_url;
 
 
 
 
 
 
 
 
922
  }
923
 
924
- $html .= '<ul style="width:150px;"><li title="Double click to view scene">'.$scene_key_title.'<img class="scctrl" id="'.$scene_key.'_gallery_'.$id.'" src="'.$thumbnail.'"></li></ul>';
925
- }
926
- }
927
- $html .= '</div>';
928
 
929
- //===Carousal setup end===//
930
- }
 
931
 
932
- if (isset($postdata['bg_music'])) {
933
- $bg_music = $postdata['bg_music'];
934
- $bg_music_url = $postdata['bg_music_url'];
935
- $autoplay_bg_music = $postdata['autoplay_bg_music'];
936
- $loop_bg_music = $postdata['loop_bg_music'];
937
- $bg_loop = '';
938
- if ($loop_bg_music == 'on') {
939
- $bg_loop = 'loop';
940
- }
941
 
942
- if ($bg_music == 'on') {
943
- $html .= '<div id="adcontrol'.$id.'" class="adcontrol" style="right:'.$audio_right.'">';
944
- $html .= '<audio id="vrAudio'.$id.'" onended="audionEnd'.$id.'()" '.$bg_loop.'>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
945
  <source src="'.$bg_music_url.'" type="audio/mpeg">
946
  Your browser does not support the audio element.
947
  </audio>
948
  <button onclick="playPause'.$id.'()" class="ctrl audio_control" id="audio_control'.$id.'"><i id="vr-volume'.$id.'" class="fas fa-volume-up" style="color:#fff;"></i></button>
949
  ';
950
- $html .= '</div>';
951
- }
952
- }
953
-
954
 
955
- $html .= '<i class="fa fa-times cross"></i>';
956
- $html .= '<div class="custom-ifram" style="display: none;">';
957
- $html .= '</div>';
958
- $html .= '</div>';
959
-
960
- //script started
961
- $html .= '<script>';
962
- $html .= 'var response = '.$response.';';
963
- $html .= 'var scenes = response[1];';
964
- $html .= 'if(scenes) {';
965
- $html .= 'var scenedata = scenes.scenes;';
966
- $html .= 'for(var i in scenedata) {';
967
- $html .= 'var scenehotspot = scenedata[i].hotSpots;';
968
- $html .= 'for(var i = 0; i < scenehotspot.length; i++) {';
969
- $html .= 'if(scenehotspot[i]["clickHandlerArgs"] != "") {';
970
- $html .= 'scenehotspot[i]["clickHandlerFunc"] = wpvrhotspot;';
971
- $html .= '}';
972
- $html .= 'if(scenehotspot[i]["createTooltipArgs"] != "") {';
973
- $html .= 'scenehotspot[i]["createTooltipFunc"] = wpvrtooltip;';
974
- $html .= '}';
975
- $html .= '}';
976
- $html .= '}';
977
- $html .= '}';
978
-
979
- $html .= 'var panoshow'.$id.' = pannellum.viewer(response[0]["panoid"], scenes);';
980
- $html .= 'panoshow'.$id.'.on("load", function (){
 
 
 
 
 
 
 
 
 
981
  if (jQuery("#pano'.$id.'").children().children(".pnlm-panorama-info:visible").length > 0) {
982
  jQuery("#controls'.$id.'").css("bottom", "55px");
983
  }
@@ -986,7 +980,7 @@ class Wpvr_Public {
986
  }
987
  });';
988
 
989
- $html .= '
990
  if (scenes.autoRotate) {
991
  panoshow'.$id.'.on("load", function (){
992
  setTimeout(function(){ panoshow'.$id.'.startAutoRotate(scenes.autoRotate, 0); }, 3000);
@@ -996,82 +990,82 @@ class Wpvr_Public {
996
  });
997
  }
998
  ';
999
- $html .= 'var touchtime = 0;';
1000
- if ($vrgallery) {
1001
- if (isset($panodata["scene-list"])) {
1002
- foreach ($panodata["scene-list"] as $panoscenes) {
1003
- $scene_key = $panoscenes['scene-id'];
1004
- $scene_key_gallery = $panoscenes['scene-id'].'_gallery_'.$id;
1005
- $img_src_url = $panoscenes['scene-attachment-url'];
1006
- $html .= 'document.getElementById("'.$scene_key_gallery.'").addEventListener("click", function(e) { ';
1007
- $html .= 'if (touchtime == 0) {';
1008
- $html .= 'touchtime = new Date().getTime();';
1009
- $html .= '} else {';
1010
- $html .= 'if (((new Date().getTime()) - touchtime) < 800) {';
1011
- $html .= 'panoshow'.$id.'.loadScene("'.$scene_key.'");';
1012
- $html .= 'touchtime = 0;';
1013
- $html .= '} else {';
1014
- $html .= 'touchtime = new Date().getTime();';
1015
- $html .= '}';
1016
- $html .= '}';
1017
- $html .= '});';
1018
- }
1019
- }
1020
- }
1021
-
1022
- //===Custom Control===//
1023
- if (isset($custom_control)) {
1024
- if ($custom_control['panupSwitch'] == "on") {
1025
- $html .= 'document.getElementById("pan-up'.$id.'").addEventListener("click", function(e) {';
1026
- $html .= 'panoshow'.$id.'.setPitch(panoshow'.$id.'.getPitch() + 10);';
1027
- $html .= '});';
1028
- }
1029
 
1030
- if ($custom_control['panDownSwitch'] == "on") {
1031
- $html .= 'document.getElementById("pan-down'.$id.'").addEventListener("click", function(e) {';
1032
- $html .= 'panoshow'.$id.'.setPitch(panoshow'.$id.'.getPitch() - 10);';
1033
- $html .= '});';
1034
- }
 
 
1035
 
1036
- if ($custom_control['panLeftSwitch'] == "on") {
1037
- $html .= 'document.getElementById("pan-left'.$id.'").addEventListener("click", function(e) {';
1038
- $html .= 'panoshow'.$id.'.setYaw(panoshow'.$id.'.getYaw() - 10);';
1039
- $html .= '});';
1040
- }
1041
 
1042
- if ($custom_control['panRightSwitch'] == "on") {
1043
- $html .= 'document.getElementById("pan-right'.$id.'").addEventListener("click", function(e) {';
1044
- $html .= 'panoshow'.$id.'.setYaw(panoshow'.$id.'.getYaw() + 10);';
1045
- $html .= '});';
1046
- }
1047
 
1048
- if ($custom_control['panZoomInSwitch'] == "on") {
1049
- $html .= 'document.getElementById("zoom-in'.$id.'").addEventListener("click", function(e) {';
1050
- $html .= 'panoshow'.$id.'.setHfov(panoshow'.$id.'.getHfov() - 10);';
1051
- $html .= '});';
1052
- }
1053
 
1054
- if ($custom_control['panZoomOutSwitch'] == "on") {
1055
- $html .= 'document.getElementById("zoom-out'.$id.'").addEventListener("click", function(e) {';
1056
- $html .= 'panoshow'.$id.'.setHfov(panoshow'.$id.'.getHfov() + 10);';
1057
- $html .= '});';
1058
- }
1059
 
1060
- if ($custom_control['panFullscreenSwitch'] == "on") {
1061
- $html .= 'document.getElementById("fullscreen'.$id.'").addEventListener("click", function(e) {';
1062
- $html .= 'panoshow'.$id.'.toggleFullscreen();';
1063
- $html .= '});';
1064
- }
1065
 
1066
- if ($custom_control['backToHomeSwitch'] == "on") {
1067
- $html .= 'document.getElementById("backToHome'.$id.'").addEventListener("click", function(e) {';
1068
- $html .= 'panoshow'.$id.'.loadScene("'.$default_scene.'");';
1069
- $html .= '});';
1070
- }
1071
 
1072
- if ($custom_control['gyroscopeSwitch'] == "on") {
1073
- $html .= 'document.getElementById("gyroscope'.$id.'").addEventListener("click", function(e) {';
1074
- $html .= '
 
 
 
 
 
 
1075
  if (panoshow'.$id.'.isOrientationActive()) {
1076
  panoshow'.$id.'.stopOrientation();
1077
  }
@@ -1080,22 +1074,22 @@ class Wpvr_Public {
1080
  }
1081
 
1082
  ';
1083
- $html .= '});';
1084
- }
1085
- }
1086
 
1087
- $angle_up = '<i class="fa fa-angle-up"></i>';
1088
- $angle_down = '<i class="fa fa-angle-down"></i>';
1089
- $sin_qout = "'";
1090
 
1091
- $html .= '
1092
  jQuery(document).ready(function($){
1093
  jQuery("#sccontrols'.$id.'").hide();
1094
  jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1095
  });
1096
  ';
1097
 
1098
- $html .= '
1099
  var slide'.$id.' = "down";
1100
  jQuery(document).on("click","#vrgcontrols'.$id.'",function() {
1101
 
@@ -1114,9 +1108,9 @@ class Wpvr_Public {
1114
  ';
1115
 
1116
 
1117
- if (isset($postdata['bg_music'])) {
1118
- if ($bg_music == 'on') {
1119
- $html .= '
1120
  var x'.$id.' = document.getElementById("vrAudio'.$id.'");
1121
 
1122
  var playing'.$id.' = false;
@@ -1145,8 +1139,8 @@ class Wpvr_Public {
1145
  }
1146
  ';
1147
 
1148
- if ($autoplay_bg_music == 'on') {
1149
- $html .= '
1150
  document.getElementById("pano'.$id.'").addEventListener("click", musicPlay'.$id.');
1151
  function musicPlay'.$id.'() {
1152
  playing'.$id.' = true;
@@ -1154,12 +1148,12 @@ class Wpvr_Public {
1154
  document.getElementById("pano'.$id.'").removeEventListener("click", musicPlay'.$id.');
1155
  }
1156
  ';
1157
- }
1158
- }
1159
- }
1160
 
1161
- if (!$autoload) {
1162
- $html .= '
1163
 
1164
  jQuery(document).ready(function(){
1165
  jQuery("#controls'.$id.'").hide();
@@ -1170,17 +1164,17 @@ class Wpvr_Public {
1170
 
1171
  ';
1172
 
1173
- $html .= 'panoshow'.$id.'.on("load", function (){
1174
  jQuery("#controls'.$id.'").show();
1175
  jQuery("#zoom-in-out-controls'.$id.'").show();
1176
  jQuery("#adcontrol'.$id.'").show();
1177
  jQuery("#pano'.$id.'").find(".pnlm-panorama-info").show();
1178
  });';
1179
- }
1180
 
1181
- $html .= '</script>';
1182
- //script end
1183
- return $html;
1184
- }
1185
 
 
 
1186
  }
1
  <?php
2
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
+
4
  /**
5
  * The public-facing functionality of the plugin.
6
  *
21
  * @subpackage Wpvr/public
22
  * @author Rextheme <sakib@coderex.co>
23
  */
24
+
25
  class Wpvr_Public {
26
 
27
  /**
133
  * between the defined hooks and the functions defined in this
134
  * class.
135
  */
136
+ wp_enqueue_script('jquery_cookie', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js', array(), true);
137
  global $wp;
138
  $wpvr_script_control = get_option('wpvr_script_control');
139
  $wpvr_script_list = get_option('wpvr_script_list');
175
  add_shortcode( $this->plugin_name, array( $this , 'wpvr_shortcode') );
176
  }
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
 
179
+ /**
180
+ * Shortcode output for the plugin
181
+ *
182
+ * @since 1.0.0
183
+ */
184
+ public function wpvr_shortcode( $atts ) {
185
+
186
+ extract(
187
+ shortcode_atts(
188
+ array(
189
+ 'id' => 0,
190
+ 'width' => NULL,
191
+ 'height' => NULL,
192
+ 'radius' => NULL
193
+ ), $atts
194
+ )
195
+ );
196
+
197
+ if ( !$id ) {
198
+ $obj = get_page_by_path( $slug, OBJECT, $this->post_type );
199
+ if ( $obj ) {
200
+ $id = $obj->ID;
201
+ } else {
202
+ return __('Invalid Wpvr slug attribute', $this->plugin_name);
203
+ }
204
+ }
205
 
206
+ $postdata = get_post_meta( $id, 'panodata', true );
207
+ $panoid = 'pano'.$id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
 
209
+ if (isset($postdata['streetviewdata'])) {
210
+ if (empty($width)) {
211
+ $width = '600px';
212
+ }
213
+ if (empty($height)) {
214
+ $height = '400px';
215
+ }
216
+ $streetviewurl = $postdata['streetviewurl'];
217
+ $html = '';
218
+ $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
219
+ $html .= '<iframe src="'.$streetviewurl.'" width="'.trim($width,'px').'" height="'.trim($height,'px').'" frameborder="0" style="border:0;" allowfullscreen=""></iframe>';
220
+ $html .= '</div>';
221
 
222
+ return $html;
223
+ }
 
 
224
 
225
+ if (isset($postdata['vidid'])) {
226
+ if (empty($width)) {
227
+ $width = '600px';
228
+ }
229
+ if (empty($height)) {
230
+ $height = '400px';
231
+ }
 
232
 
233
+ $videourl = $postdata['vidurl'];
234
+ $autoplay = 'off';
235
+ if (isset($postdata['autoplay'])) {
236
+ $autoplay = $postdata['autoplay'];
237
+ }
238
+ $loop = 'off';
239
+ if (isset($postdata['loop'])) {
240
+ $loop = $postdata['loop'];
241
+ }
242
+
243
+ if (strpos($videourl, 'youtube') > 0) {
244
+ $explodeid = '';
245
+ $explodeid = explode("=",$videourl);
246
+ $foundid = '';
247
+
248
+ if ($autoplay == 'on') {
249
+ $autoplay = '&autoplay=1';
250
+ $muted = '&mute=1';
251
+ }
252
+ else {
253
+ $autoplay = '';
254
+ $muted = '';
255
+ }
256
+
257
+ if ($loop == 'on') {
258
+ $loop = '&loop=1';
259
+ }
260
+ else {
261
+ $loop = '';
262
+ }
263
 
264
+ $foundid = $explodeid[1].'?'.$autoplay.$loop;
265
+ $html = '';
266
+ $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
267
+ $html .= '
268
  <iframe src="https://www.youtube.com/embed/'.$explodeid[1].'?rel=0&modestbranding=1'.$loop.'&autohide=1'.$muted.'&showinfo=0&controls=1'.$autoplay.'" width="560" height="315" frameborder="0" allowfullscreen></iframe>
269
  ';
270
+ $html .= '</div>';
271
 
 
272
 
273
+ } elseif (strpos($videourl, 'vimeo') > 0) {
274
 
275
+ $explodeid = '';
276
+ $explodeid = explode("/",$videourl);
277
+ $foundid = '';
278
+ if ($autoplay == 'on') {
279
+ $autoplay = '&autoplay=1&muted=1';
280
+ }
281
+ else {
282
+ $autoplay = '';
283
+ }
284
 
285
+ if ($loop == 'on') {
286
+ $loop = '&loop=1';
287
+ }
288
+ else {
289
+ $loop = '';
290
+ }
291
+ $foundid = $explodeid[3].'?'.$autoplay.$loop;
292
+ $html = '';
293
+ $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
294
+ $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="'.trim($width,'px').'" height="'.trim($height,'px').'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
295
+ $html .= '</div>';
296
+
297
+ } else {
298
+ $html = '';
299
+ $html .= '<div id="pano'.$id.'" class="pano-wrap" style="max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto;">';
300
+ $html .= '<div style="width:100%; height:100%; ">'.$postdata['panoviddata'].'</div>';
301
+ $html .= '<script>';
302
+ $html .= 'var player = videojs('.$postdata['vidid'].', {';
303
+ $html .= 'plugins: {';
304
+ $html .= 'pannellum: {}';
305
+ $html .= '}';
306
+ $html .= '});';
307
+ $html .= '
308
  videojs('.$postdata['vidid'].').play();
309
  ';
310
+ $html .= '</script>';
311
+ $html .= '</div>';
312
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
 
314
+ return $html;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  }
316
 
317
+ $control = false;
318
+ if (isset($postdata['showControls'])) {
319
+ $control = $postdata['showControls'];
320
+ }
321
 
322
+ if ($control) {
323
+ if (isset($postdata['customcontrol'])) {
324
+ $custom_control = $postdata['customcontrol'];
325
+ if ($custom_control['panupSwitch'] == "on" || $custom_control['panDownSwitch'] == "on" || $custom_control['panLeftSwitch'] == "on" || $custom_control['panRightSwitch'] == "on" || $custom_control['panZoomInSwitch'] == "on" || $custom_control['panZoomOutSwitch'] == "on" || $custom_control['panFullscreenSwitch'] == "on" || $custom_control['gyroscopeSwitch'] == "on" || $custom_control['backToHomeSwitch'] == "on") {
326
+ $control = false;
327
+ }
328
+ }
329
+ }
330
 
331
+ $vrgallery = false;
332
+ if (isset($postdata['vrgallery'])) {
333
+ $vrgallery = $postdata['vrgallery'];
334
+ }
335
 
336
+ $vrgallery_title = false;
337
+ if (isset($postdata['vrgallery_title'])) {
338
+ $vrgallery_title = $postdata['vrgallery_title'];
339
+ }
340
 
341
+ $gyro = false;
342
+ $gyro_orientation = false;
343
+ if (isset($postdata['gyro'])) {
344
+ $gyro = $postdata['gyro'];
345
+ if (isset($postdata['deviceorientationcontrol'])) {
346
+ $gyro_orientation = $postdata['deviceorientationcontrol'];
347
+ }
348
+ }
349
 
350
+ $compass = false;
351
+ $audio_right = "5px";
352
+ if (isset($postdata['compass'])) {
353
+ $compass = $postdata['compass'];
354
+ if ($compass) {
355
+ $audio_right = "60px";
356
+ }
357
+ }
358
+
359
+ $mouseZoom = true;
360
+ if (isset($postdata['mouseZoom'])) {
361
+ $mouseZoom = $postdata['mouseZoom'];
362
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
 
364
+ $draggable = true;
365
+ if (isset($postdata['draggable'])) {
366
+ $draggable = $postdata['draggable'];
367
+ }
368
+
369
+ $diskeyboard = false;
370
+ if (isset($postdata['diskeyboard'])) {
371
+ $diskeyboard = $postdata['diskeyboard'];
372
+ }
373
+
374
+ $keyboardzoom = true;
375
+ if (isset($postdata['keyboardzoom'])) {
376
+ $keyboardzoom = $postdata['keyboardzoom'];
377
+ }
378
+
379
+ $autoload = false;
380
+
381
+ if (isset($postdata['autoLoad'])) {
382
+ $autoload = $postdata['autoLoad'];
383
+ }
384
+
385
+ $default_scene = '';
386
+ if (isset($postdata['defaultscene'])) {
387
+ $default_scene = $postdata['defaultscene'];
388
+ }
389
+
390
+ $preview = '';
391
+ if (isset($postdata['preview'])) {
392
+ $preview = $postdata['preview'];
393
+ }
394
+
395
+ $autorotation = '';
396
+ if (isset($postdata["autoRotate"])) {
397
+ $autorotation = $postdata["autoRotate"];
398
+ }
399
+ $autorotationinactivedelay = '';
400
+ if (isset($postdata["autoRotateInactivityDelay"])) {
401
+ $autorotationinactivedelay = $postdata["autoRotateInactivityDelay"];
402
+ }
403
+ $autorotationstopdelay = '';
404
+ if (isset($postdata["autoRotateStopDelay"])) {
405
+ $autorotationstopdelay = $postdata["autoRotateStopDelay"];
406
+ }
407
+
408
+ $scene_fade_duration = '';
409
+ if (isset($postdata['scenefadeduration'])) {
410
+ $scene_fade_duration = $postdata['scenefadeduration'];
411
+ }
412
+
413
+ $panodata = '';
414
+ if (isset($postdata['panodata'])) {
415
+ $panodata = $postdata['panodata'];
416
+ }
417
+ $hotspoticoncolor = '#00b4ff';
418
+ $hotspotblink = 'on';
419
+ $default_data = array();
420
+ $default_data = array("firstScene"=>$default_scene,"sceneFadeDuration"=>$scene_fade_duration);
421
+ $scene_data = array();
422
+
423
+ if (!empty($panodata["scene-list"])) {
424
+ foreach ($panodata["scene-list"] as $panoscenes) {
425
+
426
+ $scene_ititle = '';
427
+ if (isset($panoscenes["scene-ititle"])) {
428
+ $scene_ititle = sanitize_text_field($panoscenes["scene-ititle"]);
429
+ }
430
+
431
+ $scene_author = '';
432
+ if (isset($panoscenes["scene-author"])) {
433
+ $scene_author = sanitize_text_field($panoscenes["scene-author"]);
434
+ }
435
+
436
+ $scene_author_url = '';
437
+ if (isset($panoscenes["scene-author-url"])) {
438
+ $scene_author_url = sanitize_text_field($panoscenes["scene-author-url"]);
439
+ }
440
+
441
+ $scene_vaov = 180;
442
+ if (isset($panoscenes["scene-vaov"])) {
443
+ $scene_vaov = (float)$panoscenes["scene-vaov"];
444
+ }
445
+
446
+ $scene_haov = 360;
447
+ if (isset($panoscenes["scene-haov"])) {
448
+ $scene_haov = (float)$panoscenes["scene-haov"];
449
+ }
450
+
451
+
452
+ $scene_vertical_offset = 0;
453
+ if (isset($panoscenes["scene-vertical-offset"])) {
454
+ $scene_vertical_offset = (float)$panoscenes["scene-vertical-offset"];
455
+ }
456
+
457
+ $default_scene_pitch = null;
458
+ if (isset($panoscenes["scene-pitch"])) {
459
+ $default_scene_pitch = (float)$panoscenes["scene-pitch"];
460
+ }
461
+
462
+ $default_scene_yaw = null;
463
+ if (isset($panoscenes["scene-yaw"])) {
464
+ $default_scene_yaw = (float)$panoscenes["scene-yaw"];
465
+ }
466
+
467
+ $scene_max_pitch = '';
468
+ if (isset($panoscenes["scene-maxpitch"])) {
469
+ $scene_max_pitch = (float)$panoscenes["scene-maxpitch"];
470
+ }
471
+
472
+
473
+ $scene_min_pitch = '';
474
+ if (isset($panoscenes["scene-minpitch"])) {
475
+ $scene_min_pitch = (float)$panoscenes["scene-minpitch"];
476
+ }
477
+
478
+
479
+ $scene_max_yaw = '';
480
+ if (isset($panoscenes["scene-maxyaw"])) {
481
+ $scene_max_yaw = (float)$panoscenes["scene-maxyaw"];
482
+ }
483
+
484
+
485
+ $scene_min_yaw = '';
486
+ if (isset($panoscenes["scene-minyaw"])) {
487
+ $scene_min_yaw = (float)$panoscenes["scene-minyaw"];
488
+ }
489
+
490
+ $default_zoom = 100;
491
+ if (isset($panoscenes["scene-zoom"])) {
492
+ $default_zoom = $panoscenes["scene-zoom"];
493
+ }
494
+
495
+ if (!empty($default_zoom)) {
496
+ $default_zoom = (int)$default_zoom;
497
+ }
498
+ else {
499
+ $default_zoom = 100;
500
+ }
501
+
502
+ $max_zoom = 120;
503
+ if (isset($panoscenes["scene-maxzoom"])) {
504
+ $max_zoom = $panoscenes["scene-maxzoom"];
505
+ }
506
+
507
+ if (!empty($max_zoom)) {
508
+ $max_zoom = (int)$max_zoom;
509
+ }
510
+ else {
511
+ $max_zoom = 120;
512
+ }
513
+
514
+ $min_zoom = 50;
515
+ if (isset($panoscenes["scene-minzoom"])) {
516
+ $min_zoom = $panoscenes["scene-minzoom"];
517
+ }
518
+
519
+ if (!empty($min_zoom)) {
520
+ $min_zoom = (int)$min_zoom;
521
+ }
522
+ else {
523
+ $min_zoom = 50;
524
+ }
525
+ $hotspot_datas = array();
526
+ if (isset($panoscenes["hotspot-list"])) {
527
+ $hotspot_datas = $panoscenes["hotspot-list"];
528
+ }
529
+
530
+ $hotspots = array();
531
+
532
+ foreach ($hotspot_datas as $hotspot_data) {
533
+
534
+ $status = get_option( 'wpvr_edd_license_status' );
535
+ if( $status !== false && $status == 'valid' ) {
536
+ if (isset($hotspot_data["hotspot-customclass-pro"]) && $hotspot_data["hotspot-customclass-pro"] != 'none') {
537
+ $hotspot_data["hotspot-customclass"] = $hotspot_data["hotspot-customclass-pro"];
538
+ $hotspoticoncolor = $hotspot_data["hotspot-customclass-color-icon-value"];
539
  }
540
+ if (isset($hotspot_data['hotspot-blink'])) {
541
+ $hotspotblink = $hotspot_data['hotspot-blink'];
542
+ }
543
+ }
544
+ $hotspot_scene_pitch = '';
545
+ if (isset($hotspot_data["hotspot-scene-pitch"])) {
546
+ $hotspot_scene_pitch = $hotspot_data["hotspot-scene-pitch"];
547
  }
548
+ $hotspot_scene_yaw = '';
549
+ if (isset($hotspot_data["hotspot-scene-yaw"])) {
550
+ $hotspot_scene_yaw = $hotspot_data["hotspot-scene-yaw"];
551
+ }
552
+
553
+ $hotspot_type = $hotspot_data["hotspot-type"] !== 'scene' ? 'info' : $hotspot_data["hotspot-type"];
554
+ $hotspot_content = '';
555
+
556
+ ob_start();
557
+ do_action('wpvr_hotspot_content', $hotspot_data);
558
+ $hotspot_content = ob_get_clean();
559
+
560
+ if (!$hotspot_content) $hotspot_content = $hotspot_data["hotspot-content"];
561
+
562
+
563
+
564
+ $hotspot_info = array(
565
+ "text"=>$hotspot_data["hotspot-title"],
566
+ "pitch"=>$hotspot_data["hotspot-pitch"],
567
+ "yaw"=>$hotspot_data["hotspot-yaw"],
568
+ "type"=>$hotspot_type,
569
+ "cssClass"=>$hotspot_data["hotspot-customclass"],
570
+ "URL"=>$hotspot_data["hotspot-url"],
571
+ "clickHandlerArgs" => $hotspot_content,
572
+ "createTooltipArgs"=>$hotspot_data["hotspot-hover"],
573
+ "sceneId"=>$hotspot_data["hotspot-scene"],
574
+ "targetPitch"=>(float)$hotspot_scene_pitch,
575
+ "targetYaw"=>(float)$hotspot_scene_yaw,
576
+ 'hotspot_type' => $hotspot_data['hotspot-type']
577
+ );
578
+ if ($hotspot_data["hotspot-customclass"] == 'none' || $hotspot_data["hotspot-customclass"] == '') {
579
+ unset($hotspot_info["cssClass"]);
580
+ }
581
+ if (empty($hotspot_data["hotspot-scene"])) {
582
+ unset($hotspot_info['targetPitch']);
583
+ unset($hotspot_info['targetYaw']);
584
+ }
585
+ array_push($hotspots, $hotspot_info);
586
+ }
587
+ $scene_info = array();
588
+ $scene_info = array("type"=>$panoscenes["scene-type"],"panorama"=>$panoscenes["scene-attachment-url"],"pitch"=>$default_scene_pitch,"maxPitch"=>$scene_max_pitch,"minPitch"=>$scene_min_pitch,"maxYaw"=>$scene_max_yaw,"minYaw"=>$scene_min_yaw,"yaw"=>$default_scene_yaw,"hfov"=>$default_zoom,"maxHfov"=>$max_zoom,"minHfov"=>$min_zoom,"title"=>$scene_ititle,"author"=>$scene_author, "authorURL"=>$scene_author_url, "vaov"=>$scene_vaov, "haov"=>$scene_haov, "vOffset"=>$scene_vertical_offset, "hotSpots"=>$hotspots);
589
+
590
+ if (isset($panoscenes["ptyscene"])) {
591
+ if ($panoscenes["ptyscene"] == "off") {
592
+ unset($scene_info['pitch']);
593
+ unset($scene_info['yaw']);
594
+ }
595
+ }
596
+
597
+ if (empty($panoscenes["scene-ititle"])) {
598
+ unset($scene_info['title']);
599
+ }
600
+ if (empty($panoscenes["scene-author"])) {
601
+ unset($scene_info['author']);
602
+ }
603
+ if (empty($panoscenes["scene-author-url"])) {
604
+ unset($scene_info['authorURL']);
605
+ }
606
+
607
+ if (empty($scene_vaov)) {
608
+ unset($scene_info['vaov']);
609
+ }
610
+
611
+ if (empty($scene_haov)) {
612
+ unset($scene_info['haov']);
613
+ }
614
 
615
+ if (empty($scene_vertical_offset)) {
616
+ unset($scene_info['vOffset']);
617
+ }
618
+
619
+ if (isset($panoscenes["cvgscene"])) {
620
+ if ($panoscenes["cvgscene"] == "off") {
621
+ unset($scene_info['maxPitch']);
622
+ unset($scene_info['minPitch']);
623
+ }
624
+ }
625
+ if (empty($panoscenes["scene-maxpitch"])) {
626
+ unset($scene_info['maxPitch']);
627
+ }
628
+
629
+ if (empty($panoscenes["scene-minpitch"])) {
630
+ unset($scene_info['minPitch']);
631
+ }
632
+
633
+ if (isset($panoscenes["chgscene"])) {
634
+ if ($panoscenes["chgscene"] == "off") {
635
+ unset($scene_info['maxYaw']);
636
+ unset($scene_info['minYaw']);
637
+ }
638
+ }
639
+ if (empty($panoscenes["scene-maxyaw"])) {
640
+ unset($scene_info['maxYaw']);
641
+ }
642
 
643
+ if (empty($panoscenes["scene-minyaw"])) {
644
+ unset($scene_info['minYaw']);
645
+ }
646
 
647
+ if (isset($panoscenes["czscene"])) {
648
+ if ($panoscenes["czscene"] == "off") {
649
+ unset($scene_info['hfov']);
650
+ unset($scene_info['maxHfov']);
651
+ unset($scene_info['minHfov']);
652
+ }
653
+ }
654
+
655
+ $scene_array = array();
656
+ $scene_array = array(
657
+ $panoscenes["scene-id"]=>$scene_info
658
+ );
659
+ $scene_data[$panoscenes["scene-id"]] = $scene_info;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
660
  }
661
+ }
662
 
663
+ $pano_id_array = array();
664
+ $pano_id_array = array("panoid"=>$panoid);
665
+ $pano_response = array();
666
+ $pano_response = array("autoLoad"=>$autoload,"showControls"=>$control,"orientationSupport"=>'false',"compass"=>$compass,'orientationOnByDefault'=>$gyro_orientation,"mouseZoom"=>$mouseZoom,"draggable"=>$draggable,'disableKeyboardCtrl'=>$diskeyboard,'keyboardZoom'=>$keyboardzoom,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,"default"=>$default_data,"scenes"=>$scene_data);
667
 
668
+ if (empty($autorotation)) {
669
+ unset($pano_response['autoRotate']);
670
+ unset($pano_response['autoRotateInactivityDelay']);
671
+ unset($pano_response['autoRotateStopDelay']);
672
+ }
673
+ if (empty($autorotationinactivedelay)) {
674
+ unset($pano_response['autoRotateInactivityDelay']);
675
+ }
676
+ if (empty($autorotationstopdelay)) {
677
+ unset($pano_response['autoRotateStopDelay']);
678
+ }
679
+ $response = array();
680
+ $response = array($pano_id_array,$pano_response);
681
+ if (!empty($response)) {
682
+ $response = json_encode($response);
683
+ }
684
 
 
 
 
685
 
686
+ if (empty($width)) {
687
+ $width = '600px';
688
+ }
689
+ if (empty($height)) {
690
+ $height = '400px';
691
+ }
692
+ $foreground_color = '#fff';
693
+ $pulse_color = wpvr_hex2rgb($hotspoticoncolor);
694
+ $rgb = wpvr_HTMLToRGB($hotspoticoncolor);
695
+ $hsl = wpvr_RGBToHSL($rgb);
696
+ if($hsl->lightness > 200) {
697
+ $foreground_color = '#000000';
698
+ }
699
+ else {
700
+ $foreground_color = '#fff';
701
+ }
702
+ $html = '';
703
+
704
+ $html .= '<style>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
705
  if ($width == 'embed'){
706
+ $html .= 'body{
707
  overflow: hidden;
708
  }';
709
 
710
  }
711
+ $html .= '#'.$panoid.' div.pnlm-hotspot-base.fas,
712
  #'.$panoid.' div.pnlm-hotspot-base.fab,
713
  #'.$panoid.' div.pnlm-hotspot-base.fa,
714
  #'.$panoid.' div.pnlm-hotspot-base.far {
720
  height: 30px;
721
  animation: icon-pulse'.$panoid.' 1.5s infinite cubic-bezier(.25, 0, 0, 1);
722
  }';
723
+ if ($hotspotblink == 'on') {
724
+ $html .= '@-webkit-keyframes icon-pulse'.$panoid.' {
725
  0% {
726
  box-shadow: 0 0 0 0px rgba('.$pulse_color[0].', 1);
727
  }
737
  box-shadow: 0 0 0 10px rgba('.$pulse_color[0].', 0);
738
  }
739
  }';
740
+ }
741
 
742
+ $status = get_option( 'wpvr_edd_license_status' );
743
+ if( $status !== false && $status == 'valid' ) {
744
  if (!$gyro) {
745
+ $html .= '#'.$panoid.' div.pnlm-orientation-button {
746
  display: none;
747
  }';
748
  }
749
+ }
750
+ else {
751
  $html .= '#'.$panoid.' div.pnlm-orientation-button {
752
  display: none;
753
  }';
754
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
755
 
756
+ $html .= '</style>';
757
+ if ($width == 'fullwidth') {
758
+ if (wpvr_isMobileDevice()) {
759
+ if ($radius) {
760
+ $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center; border-radius:'.$radius.'; direction:ltr;">';
761
+ }
762
+ else {
763
+ $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center;">';
764
+ }
765
 
766
+ }
767
+ else {
768
+ if ($radius) {
769
+ $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'; border-radius:'.$radius.'; direction:ltr;" >';
770
+ }
771
+ else {
772
+ $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'; direction:ltr;" >';
773
+ }
774
 
775
+ }
776
+ }
777
+ // elseif ($width == 'embed') {
778
+ // if (apply_filters('is_wpvr_premium', false)) {
779
+ // if (wpvr_isMobileDevice()) {
780
+ // if ($radius) {
781
+ // $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center; border-radius:'.$radius.'; direction:ltr;">';
782
+ // }
783
+ // else {
784
+ // $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center;">';
785
+ // }
786
+ //
787
+ // }
788
+ // else {
789
+ // if ($radius) {
790
+ // $html .= '<div id="pano'.$id.'" class="pano-wrap vrembed" style=" text-align:center; height: '.$height.'; border-radius:'.$radius.'; direction:ltr;" >';
791
+ // }
792
+ // else {
793
+ // $html .= '<div id="pano'.$id.'" class="pano-wrap vrembed" style=" text-align:center; height: '.$height.'; direction:ltr;" >';
794
+ // }
795
+ //
796
+ // }
797
+ // }
798
+ // }
799
+ else {
800
+ if ($radius) {
801
+ $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto; border-radius:'.$radius.'; direction:ltr;">';
802
+ }
803
+ else {
804
+ $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto; direction:ltr;">';
805
+ }
806
 
807
+ }
 
 
808
 
809
+ //===company logo===//
810
+ if (isset($postdata['cpLogoSwitch'])) {
811
+ $cpLogoImg = $postdata['cpLogoImg'];
812
+ $cpLogoContent = $postdata['cpLogoContent'];
813
+ if ($postdata['cpLogoSwitch'] == 'on') {
814
+ $html .= '<div id="cp-logo-controls">';
815
+ $html .= '<div class="cp-logo-ctrl" id="cp-logo">';
816
+ if ($cpLogoImg) {
817
+ $html .= '<img src="'.$cpLogoImg.'" alt="Company Logo">';
818
+ }
819
 
820
+ if ($cpLogoContent) {
821
+ $html .= '<div class="cp-info">'.$cpLogoContent.'</div>';
822
+ }
823
+ $html .= '</div>';
824
+ $html .= '</div>';
825
+ }
826
+ }
827
+ //===company logo ends===//
828
 
829
+ //===Custom Control===//
830
+ if (isset($custom_control)) {
831
+ if ( $custom_control['panZoomInSwitch'] == "on" || $custom_control['panZoomOutSwitch'] == "on" || $custom_control['gyroscopeSwitch'] == "on" || $custom_control['backToHomeSwitch'] == "on") {
 
 
 
 
832
 
833
+ $html .= '<div id="zoom-in-out-controls'.$id.'" class="zoom-in-out-controls">';
 
 
834
 
835
+ if ($custom_control['backToHomeSwitch'] == "on") {
836
+ $html .= '<div class="ctrl" id="backToHome'.$id.'"><i class="'.$custom_control['backToHomeIcon'].'" style="color:'.$custom_control['backToHomeColor'].';"></i></div>';
837
+ }
838
 
839
+ if ($custom_control['panZoomInSwitch'] == "on") {
840
+ $html .= '<div class="ctrl" id="zoom-in'.$id.'"><i class="'.$custom_control['panZoomInIcon'].'" style="color:'.$custom_control['panZoomInColor'].';"></i></div>';
 
 
 
 
 
841
  }
842
+
843
+ if ($custom_control['panZoomOutSwitch'] == "on") {
844
+ $html .= '<div class="ctrl" id="zoom-out'.$id.'"><i class="'.$custom_control['panZoomOutIcon'].'" style="color:'.$custom_control['panZoomOutColor'].';"></i></div>';
845
  }
846
+ if ($custom_control['gyroscopeSwitch'] == "on") {
847
+ $html .= '<div class="ctrl" id="gyroscope'.$id.'"><i class="'.$custom_control['gyroscopeIcon'].'" style="color:'.$custom_control['gyroscopeColor'].';"></i></div>';
 
 
 
848
  }
849
+ $html .= '</div>';
850
+ }
851
+ //===zoom in out Control===//
852
+
853
+ if ($custom_control['panupSwitch'] == "on" || $custom_control['panDownSwitch'] == "on" || $custom_control['panLeftSwitch'] == "on" || $custom_control['panRightSwitch'] == "on" || $custom_control['panFullscreenSwitch'] == "on") {
854
+ //===Custom Control===//
855
+ $html .= '<div class="controls" id="controls'.$id.'">';
856
+
857
+ if ($custom_control['panupSwitch'] == "on") {
858
+ $html .= '<div class="ctrl pan-up" id="pan-up'.$id.'"><i class="'.$custom_control['panupIcon'].'" style="color:'.$custom_control['panupColor'].';"></i></div>';
859
  }
860
 
861
+ if ($custom_control['panDownSwitch'] == "on") {
862
+ $html .= '<div class="ctrl pan-down" id="pan-down'.$id.'"><i class="'.$custom_control['panDownIcon'].'" style="color:'.$custom_control['panDownColor'].';"></i></div>';
863
+ }
 
864
 
865
+ if ($custom_control['panLeftSwitch'] == "on") {
866
+ $html .= '<div class="ctrl pan-left" id="pan-left'.$id.'"><i class="'.$custom_control['panLeftIcon'].'" style="color:'.$custom_control['panLeftColor'].';"></i></div>';
867
+ }
868
 
869
+ if ($custom_control['panRightSwitch'] == "on") {
870
+ $html .= '<div class="ctrl pan-right" id="pan-right'.$id.'"><i class="'.$custom_control['panRightIcon'].'" style="color:'.$custom_control['panRightColor'].';"></i></div>';
871
+ }
 
 
 
 
 
 
872
 
873
+ if ($custom_control['panFullscreenSwitch'] == "on") {
874
+ $html .= '<div class="ctrl fullscreen" id="fullscreen'.$id.'"><i class="'.$custom_control['panFullscreenIcon'].'" style="color:'.$custom_control['panFullscreenColor'].';"></i></div>';
875
+ }
876
+ $html .= '</div>';
877
+ }
878
+ }
879
+ //===Custom Control===//
880
+
881
+ if ($vrgallery) {
882
+ //===Carousal setup===//
883
+ $html .= '<div id="vrgcontrols'.$id.'" class="vrgcontrols">';
884
+
885
+ $html .= '<div class="vrgctrl'.$id.' vrbounce">';
886
+ $html .= '</div>';
887
+ $html .= '</div>';
888
+
889
+ $html .= '<div id="sccontrols'.$id.'" class="scene-gallery vrowl-carousel owl-theme">';
890
+ if (isset($panodata["scene-list"])) {
891
+ foreach ($panodata["scene-list"] as $panoscenes) {
892
+ $scene_key = $panoscenes['scene-id'];
893
+ if ($vrgallery_title == 'on') {
894
+ $scene_key_title = $panoscenes['scene-ititle'];
895
+ // $scene_key_title = $panoscenes['scene-id'];
896
+ }
897
+ else {
898
+ $scene_key_title = "";
899
+ }
900
+ $img_src_url = $panoscenes['scene-attachment-url'];
901
+ $src_to_id = attachment_url_to_postid($img_src_url);
902
+ $thumbnail_array = wp_get_attachment_image_src($src_to_id, 'thumbnail');
903
+ if ($thumbnail_array) {
904
+ $thumbnail = $thumbnail_array[0];
905
+ }
906
+ else {
907
+ $thumbnail = $img_src_url;
908
+ }
909
+
910
+ $html .= '<ul style="width:150px;"><li title="Double click to view scene">'.$scene_key_title.'<img class="scctrl" id="'.$scene_key.'_gallery_'.$id.'" src="'.$thumbnail.'"></li></ul>';
911
+ }
912
+ }
913
+ $html .= '</div>';
914
+
915
+ //===Carousal setup end===//
916
+ }
917
+
918
+ if (isset($postdata['bg_music'])) {
919
+ $bg_music = $postdata['bg_music'];
920
+ $bg_music_url = $postdata['bg_music_url'];
921
+ $autoplay_bg_music = $postdata['autoplay_bg_music'];
922
+ $loop_bg_music = $postdata['loop_bg_music'];
923
+ $bg_loop = '';
924
+ if ($loop_bg_music == 'on') {
925
+ $bg_loop = 'loop';
926
+ }
927
+
928
+ if ($bg_music == 'on') {
929
+ $html .= '<div id="adcontrol'.$id.'" class="adcontrol" style="right:'.$audio_right.'">';
930
+ $html .= '<audio id="vrAudio'.$id.'" onended="audionEnd'.$id.'()" '.$bg_loop.'>
931
  <source src="'.$bg_music_url.'" type="audio/mpeg">
932
  Your browser does not support the audio element.
933
  </audio>
934
  <button onclick="playPause'.$id.'()" class="ctrl audio_control" id="audio_control'.$id.'"><i id="vr-volume'.$id.'" class="fas fa-volume-up" style="color:#fff;"></i></button>
935
  ';
936
+ $html .= '</div>';
937
+ }
938
+ }
 
939
 
940
+ $html .= '<i class="fa fa-times cross"></i>';
941
+ $html .= '<div class="wpvr-hotspot-tweak-contents" style="display: none">';
942
+ ob_start();
943
+ do_action('wpvr_hotspot_tweak_contents', $scene_data);
944
+ $hotspot_content = ob_get_clean();
945
+ $html .= $hotspot_content;
946
+ $html .= '</div>';
947
+ $html .= '<div class="custom-ifram" style="display: none">';
948
+ $html .= '</div>';
949
+ $html .= '</div>';
950
+
951
+
952
+
953
+ //script started
954
+ $html .= '<script>';
955
+ $html .= 'var response = '.$response.';';
956
+ $html .= 'var scenes = response[1];';
957
+ $html .= 'if(scenes) {';
958
+ $html .= 'var scenedata = scenes.scenes;';
959
+ $html .= 'for(var i in scenedata) {';
960
+ $html .= 'var scenehotspot = scenedata[i].hotSpots;';
961
+ $html .= 'for(var i = 0; i < scenehotspot.length; i++) {';
962
+ $html .= 'if(scenehotspot[i]["clickHandlerArgs"] != "") {';
963
+
964
+ $html .= 'scenehotspot[i]["clickHandlerFunc"] = wpvrhotspot;';
965
+ $html .= '}';
966
+ $html .= 'if(scenehotspot[i]["createTooltipArgs"] != "") {';
967
+ $html .= 'scenehotspot[i]["createTooltipFunc"] = wpvrtooltip;';
968
+ $html .= '}';
969
+ $html .= '}';
970
+ $html .= '}';
971
+ $html .= '}';
972
+
973
+ $html .= 'var panoshow'.$id.' = pannellum.viewer(response[0]["panoid"], scenes);';
974
+ $html .= 'panoshow'.$id.'.on("load", function (){
975
  if (jQuery("#pano'.$id.'").children().children(".pnlm-panorama-info:visible").length > 0) {
976
  jQuery("#controls'.$id.'").css("bottom", "55px");
977
  }
980
  }
981
  });';
982
 
983
+ $html .= '
984
  if (scenes.autoRotate) {
985
  panoshow'.$id.'.on("load", function (){
986
  setTimeout(function(){ panoshow'.$id.'.startAutoRotate(scenes.autoRotate, 0); }, 3000);
990
  });
991
  }
992
  ';
993
+ $html .= 'var touchtime = 0;';
994
+ if ($vrgallery) {
995
+ if (isset($panodata["scene-list"])) {
996
+ foreach ($panodata["scene-list"] as $panoscenes) {
997
+ $scene_key = $panoscenes['scene-id'];
998
+ $scene_key_gallery = $panoscenes['scene-id'].'_gallery_'.$id;
999
+ $img_src_url = $panoscenes['scene-attachment-url'];
1000
+ $html .= 'document.getElementById("'.$scene_key_gallery.'").addEventListener("click", function(e) { ';
1001
+ $html .= 'if (touchtime == 0) {';
1002
+ $html .= 'touchtime = new Date().getTime();';
1003
+ $html .= '} else {';
1004
+ $html .= 'if (((new Date().getTime()) - touchtime) < 800) {';
1005
+ $html .= 'panoshow'.$id.'.loadScene("'.$scene_key.'");';
1006
+ $html .= 'touchtime = 0;';
1007
+ $html .= '} else {';
1008
+ $html .= 'touchtime = new Date().getTime();';
1009
+ $html .= '}';
1010
+ $html .= '}';
1011
+ $html .= '});';
1012
+ }
1013
+ }
1014
+ }
 
 
 
 
 
 
 
 
1015
 
1016
+ //===Custom Control===//
1017
+ if (isset($custom_control)) {
1018
+ if ($custom_control['panupSwitch'] == "on") {
1019
+ $html .= 'document.getElementById("pan-up'.$id.'").addEventListener("click", function(e) {';
1020
+ $html .= 'panoshow'.$id.'.setPitch(panoshow'.$id.'.getPitch() + 10);';
1021
+ $html .= '});';
1022
+ }
1023
 
1024
+ if ($custom_control['panDownSwitch'] == "on") {
1025
+ $html .= 'document.getElementById("pan-down'.$id.'").addEventListener("click", function(e) {';
1026
+ $html .= 'panoshow'.$id.'.setPitch(panoshow'.$id.'.getPitch() - 10);';
1027
+ $html .= '});';
1028
+ }
1029
 
1030
+ if ($custom_control['panLeftSwitch'] == "on") {
1031
+ $html .= 'document.getElementById("pan-left'.$id.'").addEventListener("click", function(e) {';
1032
+ $html .= 'panoshow'.$id.'.setYaw(panoshow'.$id.'.getYaw() - 10);';
1033
+ $html .= '});';
1034
+ }
1035
 
1036
+ if ($custom_control['panRightSwitch'] == "on") {
1037
+ $html .= 'document.getElementById("pan-right'.$id.'").addEventListener("click", function(e) {';
1038
+ $html .= 'panoshow'.$id.'.setYaw(panoshow'.$id.'.getYaw() + 10);';
1039
+ $html .= '});';
1040
+ }
1041
 
1042
+ if ($custom_control['panZoomInSwitch'] == "on") {
1043
+ $html .= 'document.getElementById("zoom-in'.$id.'").addEventListener("click", function(e) {';
1044
+ $html .= 'panoshow'.$id.'.setHfov(panoshow'.$id.'.getHfov() - 10);';
1045
+ $html .= '});';
1046
+ }
1047
 
1048
+ if ($custom_control['panZoomOutSwitch'] == "on") {
1049
+ $html .= 'document.getElementById("zoom-out'.$id.'").addEventListener("click", function(e) {';
1050
+ $html .= 'panoshow'.$id.'.setHfov(panoshow'.$id.'.getHfov() + 10);';
1051
+ $html .= '});';
1052
+ }
1053
 
1054
+ if ($custom_control['panFullscreenSwitch'] == "on") {
1055
+ $html .= 'document.getElementById("fullscreen'.$id.'").addEventListener("click", function(e) {';
1056
+ $html .= 'panoshow'.$id.'.toggleFullscreen();';
1057
+ $html .= '});';
1058
+ }
1059
 
1060
+ if ($custom_control['backToHomeSwitch'] == "on") {
1061
+ $html .= 'document.getElementById("backToHome'.$id.'").addEventListener("click", function(e) {';
1062
+ $html .= 'panoshow'.$id.'.loadScene("'.$default_scene.'");';
1063
+ $html .= '});';
1064
+ }
1065
+
1066
+ if ($custom_control['gyroscopeSwitch'] == "on") {
1067
+ $html .= 'document.getElementById("gyroscope'.$id.'").addEventListener("click", function(e) {';
1068
+ $html .= '
1069
  if (panoshow'.$id.'.isOrientationActive()) {
1070
  panoshow'.$id.'.stopOrientation();
1071
  }
1074
  }
1075
 
1076
  ';
1077
+ $html .= '});';
1078
+ }
1079
+ }
1080
 
1081
+ $angle_up = '<i class="fa fa-angle-up"></i>';
1082
+ $angle_down = '<i class="fa fa-angle-down"></i>';
1083
+ $sin_qout = "'";
1084
 
1085
+ $html .= '
1086
  jQuery(document).ready(function($){
1087
  jQuery("#sccontrols'.$id.'").hide();
1088
  jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1089
  });
1090
  ';
1091
 
1092
+ $html .= '
1093
  var slide'.$id.' = "down";
1094
  jQuery(document).on("click","#vrgcontrols'.$id.'",function() {
1095
 
1108
  ';
1109
 
1110
 
1111
+ if (isset($postdata['bg_music'])) {
1112
+ if ($bg_music == 'on') {
1113
+ $html .= '
1114
  var x'.$id.' = document.getElementById("vrAudio'.$id.'");
1115
 
1116
  var playing'.$id.' = false;
1139
  }
1140
  ';
1141
 
1142
+ if ($autoplay_bg_music == 'on') {
1143
+ $html .= '
1144
  document.getElementById("pano'.$id.'").addEventListener("click", musicPlay'.$id.');
1145
  function musicPlay'.$id.'() {
1146
  playing'.$id.' = true;
1148
  document.getElementById("pano'.$id.'").removeEventListener("click", musicPlay'.$id.');
1149
  }
1150
  ';
1151
+ }
1152
+ }
1153
+ }
1154
 
1155
+ if (!$autoload) {
1156
+ $html .= '
1157
 
1158
  jQuery(document).ready(function(){
1159
  jQuery("#controls'.$id.'").hide();
1164
 
1165
  ';
1166
 
1167
+ $html .= 'panoshow'.$id.'.on("load", function (){
1168
  jQuery("#controls'.$id.'").show();
1169
  jQuery("#zoom-in-out-controls'.$id.'").show();
1170
  jQuery("#adcontrol'.$id.'").show();
1171
  jQuery("#pano'.$id.'").find(".pnlm-panorama-info").show();
1172
  });';
1173
+ }
1174
 
1175
+ $html .= '</script>';
1176
+ //script end
 
 
1177
 
1178
+ return $html;
1179
+ }
1180
  }
public/css/wpvr-public.css CHANGED
@@ -1,7 +1,40 @@
1
  /**
2
  * All of the CSS for your public-facing functionality should be
3
  * included in this file.
4
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  #cp-logo-controls {
7
  position: absolute;
@@ -303,13 +336,18 @@ div.custom-tooltip:hover span:after {
303
 
304
  div.custom-ifram {
305
  position: absolute;
306
- top: 12%;
307
  left: 50%;
308
- transform: translateX(-50%);
309
  z-index: 99;
310
  width: 80%;
 
 
 
 
311
  }
312
 
 
313
  .pano-wrap:before {
314
  content: "";
315
  position: absolute;
@@ -330,19 +368,21 @@ div.custom-ifram {
330
 
331
  .pano-wrap .cross {
332
  background: #fff;
333
- width: 30px;
334
- height: 30px;
335
  color: red;
336
- line-height: 30px;
337
  position: absolute;
338
  top: 6px;
339
- z-index: 99;
340
  right: 6px;
 
 
 
341
  border-radius: 100%;
342
  cursor: pointer;
343
  opacity: 0;
344
  visibility: hidden;
345
- transition: all 0.4s linear;
346
  }
347
  .pano-wrap.show-modal .cross {
348
  opacity: 1;
@@ -360,8 +400,6 @@ div.custom-ifram {
360
  }
361
  .custom-ifram p{
362
  padding: 10px;
363
- overflow-y: auto;
364
- max-height: 250px;
365
  }
366
 
367
  .custom-ifram video{
@@ -370,6 +408,7 @@ div.custom-ifram {
370
 
371
  .custom-ifram img {
372
  max-width: 100%;
 
373
  margin: 0 auto;
374
  display: block;
375
  }
@@ -422,6 +461,7 @@ div.custom-ifram {
422
  margin: 0;
423
  max-width: 500px;
424
  width: 100%;
 
425
  }
426
  .wpvr-product-container .wpvr-pr-right-block {
427
  width: 50%;
@@ -453,6 +493,10 @@ div.custom-ifram {
453
  display: inline-block;
454
  margin-bottom: 7px;
455
  }
 
 
 
 
456
  .wpvr-product-container .wpvr-pr-right-block .add_to_cart_inline .add_to_cart_button {
457
  display: block;
458
  width: 200px;
@@ -517,8 +561,15 @@ div.custom-ifram {
517
  }
518
 
519
  @media (max-width: 575px){
520
- .custom-ifram p{
521
- max-height: 230px;
 
 
 
 
 
 
 
522
  }
523
 
524
  .scene-gallery ul {
1
  /**
2
  * All of the CSS for your public-facing functionality should be
3
  * included in this file.
4
+ */
5
+
6
+ .wpvr-mobile-notice {
7
+ position: fixed;
8
+ bottom: 0;
9
+ left: 0;
10
+ width: 100%;
11
+ background: #004efa;
12
+ display: flex;
13
+ flex-flow: row;
14
+ align-items: center;
15
+ justify-content: center;
16
+ padding: 10px;
17
+ display: none;
18
+ }
19
+ .wpvr-mobile-notice p {
20
+ color: #fff;
21
+ margin: 0;
22
+ font-size: 13px;
23
+ margin-right: 17px;
24
+ width: calc(100% - 20px);
25
+ }
26
+ .wpvr-mobile-notice .notice-close {
27
+ font-size: 11px;
28
+ border: 1px solid;
29
+ color: #fff;
30
+ display: inline-block;
31
+ line-height: 18px;
32
+ height: 20px;
33
+ width: 20px;
34
+ text-align: center;
35
+ border-radius: 100%;
36
+ cursor: pointer;
37
+ }
38
 
39
  #cp-logo-controls {
40
  position: absolute;
336
 
337
  div.custom-ifram {
338
  position: absolute;
339
+ top: 50%;
340
  left: 50%;
341
+ transform: translate(-50%, -50%);
342
  z-index: 99;
343
  width: 80%;
344
+ max-height: 80%;
345
+ overflow: auto;
346
+ background: #fff;
347
+ border-radius: 5px;
348
  }
349
 
350
+
351
  .pano-wrap:before {
352
  content: "";
353
  position: absolute;
368
 
369
  .pano-wrap .cross {
370
  background: #fff;
371
+ width: 24px;
372
+ height: 24px;
373
  color: red;
374
+ line-height: 26px;
375
  position: absolute;
376
  top: 6px;
 
377
  right: 6px;
378
+ text-align: center;
379
+ z-index: 99;
380
+ font-size: 13px;
381
  border-radius: 100%;
382
  cursor: pointer;
383
  opacity: 0;
384
  visibility: hidden;
385
+ transition: all 0.4s ease;
386
  }
387
  .pano-wrap.show-modal .cross {
388
  opacity: 1;
400
  }
401
  .custom-ifram p{
402
  padding: 10px;
 
 
403
  }
404
 
405
  .custom-ifram video{
408
 
409
  .custom-ifram img {
410
  max-width: 100%;
411
+ height: auto;
412
  margin: 0 auto;
413
  display: block;
414
  }
461
  margin: 0;
462
  max-width: 500px;
463
  width: 100%;
464
+ height: auto;
465
  }
466
  .wpvr-product-container .wpvr-pr-right-block {
467
  width: 50%;
493
  display: inline-block;
494
  margin-bottom: 7px;
495
  }
496
+ .wpvr-product-container .wpvr-pr-right-block .add_to_cart_inline del .amount {
497
+ text-decoration: line-through;
498
+ opacity: 0.5;
499
+ }
500
  .wpvr-product-container .wpvr-pr-right-block .add_to_cart_inline .add_to_cart_button {
501
  display: block;
502
  width: 200px;
561
  }
562
 
563
  @media (max-width: 575px){
564
+ .wpvr-mobile-notice {
565
+ display: flex;
566
+ }
567
+ .wpvr-mobile-notice p {
568
+ width: calc(100% - 46px);
569
+ }
570
+ .pano-wrap .cross {
571
+ top: 2px;
572
+ right: 1px;
573
  }
574
 
575
  .scene-gallery ul {
public/js/wpvr-public.js CHANGED
@@ -37,9 +37,7 @@ function wpvrhotspot(hotSpotDiv, args) {
37
  $(hotSpotDiv.target).parent().siblings(".custom-ifram").html(argst);
38
  $(hotSpotDiv.target).parent().siblings(".custom-ifram").fadeToggle();
39
  $(hotSpotDiv.target).parent().parent(".pano-wrap").toggleClass("show-modal");
40
-
41
  });
42
- console.log(hotSpotDiv);
43
  }
44
 
45
  function wpvrtooltip(hotSpotDiv, args) {
@@ -54,12 +52,27 @@ function wpvrtooltip(hotSpotDiv, args) {
54
 
55
 
56
  jQuery(document).ready(function($){
57
-
58
  $(".cross").on("click", function(e){
59
  e.preventDefault();
60
  $(this).siblings(".custom-ifram").fadeOut();
61
  $(this).parent(".pano-wrap").removeClass("show-modal");
62
  $('iframe').attr('src', $('iframe').attr('src'));
63
  $('#wpvr-video').get(0).pause();
64
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  });
37
  $(hotSpotDiv.target).parent().siblings(".custom-ifram").html(argst);
38
  $(hotSpotDiv.target).parent().siblings(".custom-ifram").fadeToggle();
39
  $(hotSpotDiv.target).parent().parent(".pano-wrap").toggleClass("show-modal");
 
40
  });
 
41
  }
42
 
43
  function wpvrtooltip(hotSpotDiv, args) {
52
 
53
 
54
  jQuery(document).ready(function($){
55
+
56
  $(".cross").on("click", function(e){
57
  e.preventDefault();
58
  $(this).siblings(".custom-ifram").fadeOut();
59
  $(this).parent(".pano-wrap").removeClass("show-modal");
60
  $('iframe').attr('src', $('iframe').attr('src'));
61
  $('#wpvr-video').get(0).pause();
62
+ });
63
+ });
64
+
65
+ jQuery(document).ready(function($){
66
+ if (!$.cookie("wpvr_mobile_notice")) {
67
+ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
68
+ if ($(".pano-wrap")[0]){
69
+ $('body').append("<div class='wpvr-mobile-notice'><p>Turn your phone sideways (portrait orientation) for better VR experience.</p> <span class='notice-close'><i class='fa fa-times'></i></span></div>");
70
+ }
71
+ }
72
+ }
73
+
74
+ $('.wpvr-mobile-notice .notice-close').on('click', function(){
75
+ $('.wpvr-mobile-notice').fadeOut();
76
+ $.cookie('wpvr_mobile_notice', 'true');
77
+ });
78
  });
src/index.js CHANGED
@@ -22,8 +22,8 @@ class wpvredit extends Component {
22
 
23
  componentDidMount() {
24
  wp.apiFetch( { path : 'wpvr/v1/panodata' } ).then( data => {
25
- this.setState( { data, data } );
26
- } );
27
  }
28
 
29
  render() {
@@ -46,6 +46,7 @@ class wpvredit extends Component {
46
  el( TextControl, {
47
  className : 'wpvr-base-control',
48
  label: 'Width',
 
49
  value: this.props.attributes.width,
50
  onChange: ( value ) => { this.props.setAttributes( { width: value } ); },
51
  } )
22
 
23
  componentDidMount() {
24
  wp.apiFetch( { path : 'wpvr/v1/panodata' } ).then( data => {
25
+ this.setState({data: data});
26
+ } );
27
  }
28
 
29
  render() {
46
  el( TextControl, {
47
  className : 'wpvr-base-control',
48
  label: 'Width',
49
+ className: 'HelloClass',
50
  value: this.props.attributes.width,
51
  onChange: ( value ) => { this.props.setAttributes( { width: value } ); },
52
  } )
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: 5.7.0
20
  * Author: Rextheme
21
  * Author URI: http://rextheme.com/
22
  * License: GPL-2.0+
@@ -35,7 +35,10 @@ require plugin_dir_path( __FILE__ ) . 'elementor/elementor.php';
35
  * Rename this for your plugin and update it as you release new versions.
36
  */
37
  define( 'WPVR', '1.0.0' );
 
38
  define( "WPVR_PLUGIN_DIR_URL", plugin_dir_url( __FILE__ ) );
 
 
39
  /**
40
  * The code that runs during plugin activation.
41
  * This action is documented in includes/class-wpvr-activator.php
@@ -518,18 +521,28 @@ function wpvr_block_render( $attributes ) {
518
  $hotspot_scene_yaw = $hotspot_data["hotspot-scene-yaw"];
519
  }
520
 
 
 
 
 
 
 
 
 
 
521
  $hotspot_info = array(
522
  'text'=>$hotspot_data['hotspot-title'],
523
  'pitch'=>$hotspot_data['hotspot-pitch'],
524
  'yaw'=>$hotspot_data['hotspot-yaw'],
525
- 'type'=>$hotspot_data['hotspot-type'],
526
  'cssClass'=>$hotspot_data['hotspot-customclass'],
527
  'URL'=>$hotspot_data['hotspot-url'],
528
- 'clickHandlerArgs'=>$hotspot_data['hotspot-content'],
529
  'createTooltipArgs'=>$hotspot_data['hotspot-hover'],
530
  "sceneId"=>$hotspot_data["hotspot-scene"],
531
  "targetPitch"=>(float)$hotspot_scene_pitch,
532
- "targetYaw"=>(float)$hotspot_scene_yaw);
 
533
  if ($hotspot_data["hotspot-customclass"] == 'none' || $hotspot_data["hotspot-customclass"] == '') {
534
  unset($hotspot_info["cssClass"]);
535
  }
@@ -722,14 +735,14 @@ function wpvr_block_render( $attributes ) {
722
  $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'px; border-radius:'.$radius.'; direction:ltr;" >';
723
  }
724
  }
725
- elseif ($width == 'embed') {
726
- if (wpvr_isMobileDevice()) {
727
- $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center; border-radius:'.$radius.'; direction:ltr;" >';
728
- }
729
- else {
730
- $html .= '<div id="pano'.$id.'" class="pano-wrap vrembed" style=" text-align:center; height: '.$height.'px; border-radius:'.$radius.'; direction:ltr;" >';
731
- }
732
- }
733
  else {
734
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'px; height: '.$height.'px; margin: 0 auto; border-radius:'.$radius.'; direction:ltr;">';
735
  }
@@ -869,12 +882,19 @@ function wpvr_block_render( $attributes ) {
869
  }
870
 
871
  $html .= '<i class="fa fa-times cross"></i>';
 
 
 
 
 
 
872
  $html .= '<div class="custom-ifram" style="display: none;">';
873
  $html .= '</div>';
874
  $html .= '</div>';
875
 
876
  //script started
877
  $html .= '<script>';
 
878
  $html .= 'var response = '.$response.';';
879
  $html .= 'var scenes = response[1];';
880
  $html .= 'if(scenes) {';
@@ -901,6 +921,8 @@ function wpvr_block_render( $attributes ) {
901
  jQuery("#controls'.$id.'").css("bottom", "5px");
902
  }
903
  });';
 
 
904
  $html .= '
905
  if (scenes.autoRotate) {
906
  panoshow'.$id.'.on("load", function (){
@@ -1098,16 +1120,6 @@ function wpvr_block_render( $attributes ) {
1098
  return $html;
1099
  }
1100
 
1101
- function wpvr_upgrade_to_pro_link( $links ) {
1102
- $links = array_merge( array(
1103
- '<a href="' . esc_url( 'https://rextheme.com/wpvr/' ) . '">' . __( 'Upgrade to pro', 'wpvr' ) . '</a>'
1104
- ), $links );
1105
- return $links;
1106
- }
1107
-
1108
- if (!apply_filters('is_wpvr_pro_active', false)) {
1109
- add_action( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'wpvr_upgrade_to_pro_link' );
1110
- }
1111
 
1112
  function wpvr_hex2rgb( $colour ) {
1113
  if ( $colour[0] == '#' ) {
@@ -1356,3 +1368,21 @@ function wpvr_add_role_cap() {
1356
  }
1357
  }
1358
  add_action( 'admin_notices', 'sample_admin_notice__success' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: 5.8.0
20
  * Author: Rextheme
21
  * Author URI: http://rextheme.com/
22
  * License: GPL-2.0+
35
  * Rename this for your plugin and update it as you release new versions.
36
  */
37
  define( 'WPVR', '1.0.0' );
38
+ define('WPVR_FILE', __FILE__ );
39
  define( "WPVR_PLUGIN_DIR_URL", plugin_dir_url( __FILE__ ) );
40
+ define('WPVR_BASE', plugin_basename( WPVR_FILE ) );
41
+
42
  /**
43
  * The code that runs during plugin activation.
44
  * This action is documented in includes/class-wpvr-activator.php
521
  $hotspot_scene_yaw = $hotspot_data["hotspot-scene-yaw"];
522
  }
523
 
524
+ $hotspot_type = $hotspot_data["hotspot-type"] !== 'scene' ? 'info' : $hotspot_data["hotspot-type"];
525
+ $hotspot_content = '';
526
+
527
+ ob_start();
528
+ do_action('wpvr_hotspot_content', $hotspot_data);
529
+ $hotspot_content = ob_get_clean();
530
+
531
+ if(!$hotspot_content) $hotspot_content = $hotspot_data["hotspot-content"];
532
+
533
  $hotspot_info = array(
534
  'text'=>$hotspot_data['hotspot-title'],
535
  'pitch'=>$hotspot_data['hotspot-pitch'],
536
  'yaw'=>$hotspot_data['hotspot-yaw'],
537
+ 'type'=>$hotspot_type,
538
  'cssClass'=>$hotspot_data['hotspot-customclass'],
539
  'URL'=>$hotspot_data['hotspot-url'],
540
+ "clickHandlerArgs"=>$hotspot_content,
541
  'createTooltipArgs'=>$hotspot_data['hotspot-hover'],
542
  "sceneId"=>$hotspot_data["hotspot-scene"],
543
  "targetPitch"=>(float)$hotspot_scene_pitch,
544
+ "targetYaw"=>(float)$hotspot_scene_yaw,
545
+ 'hotspot_type' => $hotspot_data['hotspot-type']);
546
  if ($hotspot_data["hotspot-customclass"] == 'none' || $hotspot_data["hotspot-customclass"] == '') {
547
  unset($hotspot_info["cssClass"]);
548
  }
735
  $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'px; border-radius:'.$radius.'; direction:ltr;" >';
736
  }
737
  }
738
+ // elseif ($width == 'embed') {
739
+ // if (wpvr_isMobileDevice()) {
740
+ // $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center; border-radius:'.$radius.'; direction:ltr;" >';
741
+ // }
742
+ // else {
743
+ // $html .= '<div id="pano'.$id.'" class="pano-wrap vrembed" style=" text-align:center; height: '.$height.'px; border-radius:'.$radius.'; direction:ltr;" >';
744
+ // }
745
+ // }
746
  else {
747
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'px; height: '.$height.'px; margin: 0 auto; border-radius:'.$radius.'; direction:ltr;">';
748
  }
882
  }
883
 
884
  $html .= '<i class="fa fa-times cross"></i>';
885
+ $html .= '<div class="wpvr-hotspot-tweak-contents" style="display: none">';
886
+ ob_start();
887
+ do_action('wpvr_hotspot_tweak_contents', $scene_data);
888
+ $hotspot_content = ob_get_clean();
889
+ $html .= $hotspot_content;
890
+ $html .= '</div>';
891
  $html .= '<div class="custom-ifram" style="display: none;">';
892
  $html .= '</div>';
893
  $html .= '</div>';
894
 
895
  //script started
896
  $html .= '<script>';
897
+
898
  $html .= 'var response = '.$response.';';
899
  $html .= 'var scenes = response[1];';
900
  $html .= 'if(scenes) {';
921
  jQuery("#controls'.$id.'").css("bottom", "5px");
922
  }
923
  });';
924
+
925
+
926
  $html .= '
927
  if (scenes.autoRotate) {
928
  panoshow'.$id.'.on("load", function (){
1120
  return $html;
1121
  }
1122
 
 
 
 
 
 
 
 
 
 
 
1123
 
1124
  function wpvr_hex2rgb( $colour ) {
1125
  if ( $colour[0] == '#' ) {
1368
  }
1369
  }
1370
  add_action( 'admin_notices', 'sample_admin_notice__success' );
1371
+
1372
+
1373
+
1374
+
1375
+ /**
1376
+ * Redirect to the edit.php on post save or publish.
1377
+ */
1378
+ //function wpse_124132_redirect_post_location( $location, $post_id ) {
1379
+ // if( isset( $_POST['post_type'] ) ) {
1380
+ //
1381
+ // error_log(print_r($_POST,1));
1382
+ // if($_POST['post_type'] === 'wpvr_item') {
1383
+ // return admin_url( "post.php?post=".$post_id."&action=edit&active_tab=".$_POST['wpvr_active_tab'].'&scene="'.$_POST['wpvr_active_scenes'].'&hotspot="'.$_POST['wpvr_active_hotspot'] );
1384
+ // }
1385
+ // }
1386
+ // return $location;
1387
+ //}
1388
+ //add_filter( 'redirect_post_location', 'wpse_124132_redirect_post_location', 10, 2 );