PageSourceSearch

https://www.giardinipensilibovino.it/wp-content/plugins/wpvr-pro/admin/js/wpvr-public.js?ver=7.1.3

js giardinipensilibovino.it collected 2026-10-07 16:41:10 UTC 8,230 bytes, 269 lines download raw bytes

1(function($) {
2  'use strict';
3  var owl;
4  /**
5   * All of the code for your public-facing JavaScript source
6   * should reside in this file.
7   *
8   * Note: It has been assumed you will write jQuery code here, so the
9   * $ function reference has been prepared for usage within the scope
10   * of this function.
11   *
12   * This enables you to define handlers, for when the DOM is ready:
13   *
14   * $(function() {
15   *
16   * });
17   *
18   * When the window is loaded:
19   *
20   * $( window ).load(function() {
21   *
22   * });
23   *
24   * ...and/or other possibilities.
25   *
26   * Ideally, it is not considered best practise to attach more than a
27   * single DOM-ready or window-load handler for a particular page.
28   * Although scripts in the WordPress core, Plugins and Themes may be
29   * practising this, we should strive to set a better example in our own work.
30   */
31  var owl;
32  $(document).ready(function() {
33    jQuery(".vr-mode-title").hide();
34    owl = $(".vrowl-carousel");
35    function initializeOwlCarousel() {
36      owl.owlCarousel({
37        margin: 18,
38        autoWidth: true,
39        loop: false,
40        nav: false, // using custom buttons
41        dots: false,
42        responsiveRefreshRate: 50,
43      });
44    }
45
46    // Re-initialize once images are loaded
47    let totalImgs = owl.find('img').length;
48    let loadedImgs = 0;
49
50    owl.find('img').each(function () {
51      if (this.complete) {
52        loadedImgs++;
53      } else {
54        $(this).on('load', function () {
55          loadedImgs++;
56          if (loadedImgs === totalImgs) {
57            initializeOwlCarousel();
58          }
59        });
60      }
61    });
62
63    // Edge case: all images already loaded
64    if (loadedImgs === totalImgs) {
65      initializeOwlCarousel();
66    }
67
68    // Custom nav buttons
69    $('button.owl-next').on('click', function () {
70      owl.trigger('next.owl.carousel');
71    });
72
73    $('button.owl-prev').on('click', function () {
74      owl.trigger('prev.owl.carousel');
75    });
76
77  });
78
79
80    // With this (also fixing the method call)
81    $('.owl-prev').on('click', function() {
82        owl.trigger.prev();
83    });
84
85
86})(jQuery);
87
88
89function wpvrhotspot(hotSpotDiv, hotspotData) {
90  let args = hotspotData.on_click_content;
91  if(args){
92    var target = hotSpotDiv.target;
93    var idgetter = jQuery(target).parent().parent().attr('id');
94    var pano_id = idgetter.replace('pano','');
95
96    var music = jQuery('#vrAudio'+pano_id).attr('data-autoplay');
97    var player = jQuery('#audio_control'+pano_id).attr('data-play');
98    if (music == "on") {
99      jQuery('#vrAudio'+pano_id).get(0).pause();
100      jQuery('.wpvrvolumeicon'+pano_id).removeClass('fas fa-volume-up');
101      jQuery('.wpvrvolumeicon'+pano_id).addClass('fas fa-volume-mute');
102    }
103    else {
104      if (player == 'on') {
105        jQuery('#vrAudio'+pano_id).get(0).pause();
106        jQuery('.wpvrvolumeicon'+pano_id).removeClass('fas fa-volume-up');
107        jQuery('.wpvrvolumeicon'+pano_id).addClass('fas fa-volume-mute');
108      }
109    }
110
111    var argst = args.replace(/\\/g, '');
112    jQuery(document).ready(function($) {
113      var div = document.createElement('div');
114      div.innerHTML = argst.trim();
115      if ($(div).find('.fluentform').length) {
116        var id = $(div).find('.fluentform form').attr('data-form_id');
117        var form_class = '.fluentform_wrapper_' + id + ':first';
118        $(hotSpotDiv.target).parent().siblings('.wpvr-hotspot-tweak-contents-wrapper').find('.ff-message-success, .ff-errors-in-stack').show();
119        $(hotSpotDiv.target).parent().siblings('.wpvr-hotspot-tweak-contents-wrapper').find('.fluentform').hide();
120        $(hotSpotDiv.target).parent().siblings('.wpvr-hotspot-tweak-contents-wrapper').find(form_class).show();
121        $(hotSpotDiv.target).parent().siblings('.wpvr-hotspot-tweak-contents-wrapper').fadeToggle();
122        $(div).find('.fluentform').show();
123      } else {
124        $(hotSpotDiv.target).parent().siblings(".custom-ifram-wrapper").find('.custom-ifram').html(argst);
125        $(hotSpotDiv.target).parent().siblings(".custom-ifram-wrapper").fadeToggle();
126
127        //------add to cart button------//
128        $('.wpvr-product-container p.add_to_cart_inline a.button').wrap('<span class="wpvr-cart-wrap"></span>');
129        $('.wpvr-product-container p.add_to_cart_inline a.button').attr("target", "_blank");
130      }
131
132      $(hotSpotDiv.target).parent().parent(".pano-wrap").toggleClass("show-modal");
133
134      // Registrations for The Events Calendar – Event Registration Plugin shortcode support
135      if ($('.rtec').length && !$('.rtec').hasClass('rtec-initialized')) {
136        rtecInit();
137      }
138    });
139  }
140
141  //analytics ajax request
142  jQuery.ajax({
143    url: wpvrAnalyticsObj.ajaxUrl,
144    type: "POST",
145    data: {
146      action: "store_scene_hotspot_data",
147      scene_id: hotspotData.scene_id,
148      tour_id: hotspotData.tour_id,
149      type: 'hotspot',
150      hotspot_id: hotspotData.hotspot_id || "",
151      user_agent: navigator.userAgent,
152      device_type: getDeviceType() || "desktop",
153      nonce: wpvrAnalyticsObj.nonce,
154      session_id: wpvrAnalyticsObj.session_id,
155    },
156    success: function (response) {
157    },
158    error: function (error) {
159    }
160  });
161}
162
163function wpvrtooltip(hotSpotDiv, args) {
164  hotSpotDiv.classList.add('custom-tooltip');
165  var span = document.createElement('span');
166  args = args.replace(/\\/g, "");
167  span.innerHTML = args;
168  hotSpotDiv.appendChild(span);
169  span.style.marginLeft = -(span.scrollWidth - hotSpotDiv.offsetWidth) / 2 + 'px';
170  span.style.marginTop = -span.scrollHeight - 12 + 'px';
171}
172
173jQuery(document).ready(function($) {
174
175  $(".cross").on("click", function(e) {
176    e.preventDefault();
177
178    var pano_id = $(this).attr('data-id');
179
180    $(this).parent('.wpvr-hotspot-tweak-contents-wrapper').find('.ff-message-success, .ff-errors-in-stack').hide();
181    $(this).parent('.wpvr-hotspot-tweak-contents-wrapper').fadeOut();
182    $(this).parent(".custom-ifram-wrapper").fadeOut();
183    $(this).parents(".pano-wrap").removeClass("show-modal");
184
185    $('.vr-iframe').attr('src', '');
186    if ($('#wpvr-video').length != 0) {
187      $('#wpvr-video').get(0).pause();
188    }
189  });
190  $(".elementor-tab-title").on("click", function(e) {
191    $('audio').each(function() {
192        $(this).get(0).pause();
193    });
194  });
195});
196
197jQuery(document).ready(function($) {
198  $('.cp-logo-ctrl').on('click', function() {
199    $(this).toggleClass('show');
200  });
201
202  $('.vrbounce').on('click', function() {
203    window.dispatchEvent(new Event('resize'));
204  });
205});
206
207jQuery(document).ready(function($) {
208
209  $('#player_audio').on('click', function() {
210
211    if (this.paused == false) {
212      this.pause();
213      alert('music paused');
214    } else {
215      this.play();
216      alert('music playing');
217    }
218  });
219
220});
221
222
223jQuery(document).ready(function($) {
224  // Check if the wpvr_public object exists
225  if (typeof wpvr_public != "undefined") {
226    var notice_active = wpvr_public.notice_active;
227    var notice = wpvr_public.notice;
228
229    // Check if notices are enabled
230    if (notice_active == "true") {
231      if (!$.cookie("wpvr_mobile_notice")) {
232        if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
233          if ($(".pano-wrap")[0]) {
234            $('body').append("<div class='wpvr-mobile-notice'><p>" + notice + "</p> <span class='notice-close'><i class='fa fa-times'></i></span></div>");
235          }
236        }
237      }
238    }
239
240    // Set up event handler using the recommended .on() method
241    $('.wpvr-mobile-notice .notice-close').on('click', function() {
242      $('.wpvr-mobile-notice').fadeOut();
243      $.cookie('wpvr_mobile_notice', 'true');
244    });
245  }
246
247});
248
249
250/**
251 * Determines the user's device type based on their user agent string.
252 * @returns {string} Device type: "mobile", "tablet", or "desktop"
253 */
254function getDeviceType() {
255  const userAgent = navigator.userAgent.toLowerCase();
256  
257  // Check for mobile devices first
258  if (/mobile|android|iphone|ipod|blackberry|iemobile|opera mini/i.test(userAgent)) {
259    return "mobile";
260  } 
261  // Check for tablets (note that some tablets may also match mobile patterns)
262  else if (/tablet|ipad/i.test(userAgent)) {
263    return "tablet";
264  } 
265  // Default to desktop for all other devices
266  else {
267    return "desktop";
268  }
269}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.