PageSourceSearch

https://www.albisolaturismo.it/en/templates/shaper_travelia/js/main.js

js albisolaturismo.it collected 2026-10-02 07:38:05 UTC 16,054 bytes, 539 lines download raw bytes

1/**
2 * @package Helix3 Framework
3 * @author JoomShaper http://www.joomshaper.com
4 * @copyright Copyright (c) 2010 - 2022 JoomShaper
5 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
6 */
7
8jQuery(function ($) {
9  // ************    START Helix 1.4 JS    ************** //
10  // **************************************************** //
11
12  //Default
13  if (typeof sp_offanimation === "undefined" || sp_offanimation === "") {
14    sp_offanimation = "default";
15  }
16
17  if (sp_offanimation == "default") {
18    $("#offcanvas-toggler").on("click", function (event) {
19      event.preventDefault();
20      $(".off-canvas-menu-init").addClass("offcanvas");
21    });
22
23    $('<div class="offcanvas-overlay"></div>').insertBefore(".offcanvas-menu");
24    $(".close-offcanvas, .offcanvas-overlay").on("click", function (event) {
25      event.preventDefault();
26      $(".off-canvas-menu-init").removeClass("offcanvas");
27    });
28  }
29
30  // Slide Top Menu
31  if (sp_offanimation == "slidetop") {
32    $("#offcanvas-toggler").on("click", function (event) {
33      event.preventDefault();
34      $(".off-canvas-menu-init").addClass("slide-top-menu");
35    });
36
37    $('<div class="offcanvas-overlay"></div>').insertBefore(".offcanvas-menu");
38    $(".close-offcanvas, .offcanvas-overlay").on("click", function (event) {
39      event.preventDefault();
40      $(".off-canvas-menu-init").removeClass("slide-top-menu");
41    });
42  }
43
44  //Full Screen
45  if (sp_offanimation == "fullscreen") {
46    $("#offcanvas-toggler").on("click", function (event) {
47      event.preventDefault();
48      $(".off-canvas-menu-init").addClass("full-screen-off-canvas");
49    });
50    $(document).ready(function () {
51      $(".off-canvas-menu-init").addClass("full-screen");
52    });
53    $(".close-offcanvas, .offcanvas-overlay").on("click", function (event) {
54      event.preventDefault();
55      $(".off-canvas-menu-init").removeClass("full-screen-off-canvas");
56    });
57  }
58
59  //Full screen from top
60  if (sp_offanimation == "fullScreen-top") {
61    $("#offcanvas-toggler").on("click", function (event) {
62      event.preventDefault();
63      $(".off-canvas-menu-init").addClass("full-screen-off-canvas-ftop");
64    });
65    $(document).ready(function () {
66      $(".off-canvas-menu-init").addClass("full-screen-ftop");
67    });
68    $(".close-offcanvas, .offcanvas-overlay").on("click", function (event) {
69      event.preventDefault();
70      $(".off-canvas-menu-init").removeClass("full-screen-off-canvas-ftop");
71    });
72  }
73
74  //Dark with plus
75  if (sp_offanimation == "drarkplus") {
76    $("#offcanvas-toggler").on("click", function (event) {
77      event.preventDefault();
78      $(".off-canvas-menu-init").addClass("new-look-off-canvas");
79    });
80    $('<div class="offcanvas-overlay"></div>').insertBefore(".offcanvas-menu");
81    $(document).ready(function () {
82      $(".off-canvas-menu-init").addClass("new-look");
83    });
84    $(".close-offcanvas,.offcanvas-overlay").on("click", function (event) {
85      event.preventDefault();
86      $(".off-canvas-menu-init").removeClass("new-look-off-canvas");
87    });
88  }
89
90  // if sticky header
91  if ($("body.sticky-header").length > 0) {
92    var fixedSection = $("#sp-header");
93    // sticky nav
94    var headerHeight = fixedSection.outerHeight();
95    var stickyNavTop = fixedSection.offset().top;
96    fixedSection.addClass("animated");
97    fixedSection.before('<div class="nav-placeholder"></div>');
98    $(".nav-placeholder").height("inherit");
99    //add class
100    fixedSection.addClass("menu-fixed-out");
101    var stickyNav = function () {
102      var scrollTop = $(window).scrollTop();
103      if (scrollTop > stickyNavTop) {
104        fixedSection.removeClass("menu-fixed-out").addClass("menu-fixed");
105        $(".nav-placeholder").height(headerHeight);
106      } else {
107        if (fixedSection.hasClass("menu-fixed")) {
108          fixedSection.removeClass("menu-fixed").addClass("menu-fixed-out");
109          $(".nav-placeholder").height("inherit");
110        }
111      }
112    };
113    stickyNav();
114    $(window).scroll(function () {
115      stickyNav();
116    });
117  }
118  // go to top
119  if (typeof sp_gotop === "undefined") {
120    sp_gotop = "";
121  }
122
123  if (sp_gotop) {
124    // go to top
125    $(window).scroll(function () {
126      if ($(this).scrollTop() > 100) {
127        $(".scrollup").fadeIn();
128      } else {
129        $(".scrollup").fadeOut(400);
130      }
131    });
132
133    $(".scrollup").click(function () {
134      $("html, body").animate(
135        {
136          scrollTop: 0,
137        },
138        600
139      );
140      return false;
141    });
142  } // has go to top
143
144  // Preloader
145  if (typeof sp_preloader === "undefined") {
146    sp_preloader = "";
147  }
148
149  if (sp_preloader) {
150    $(window).on("load", function () {
151      if ($(".sp-loader-with-logo").length > 0) {
152        move();
153      }
154      setTimeout(function () {
155        $(".sp-pre-loader").fadeOut();
156      }, 1000);
157    });
158  } // has preloader
159  //preloader Function
160  function move() {
161    var elem = document.getElementById("line-load");
162    var width = 1;
163    var id = setInterval(frame, 10);
164    function frame() {
165      if (width >= 100) {
166        clearInterval(id);
167      } else {
168        width++;
169        elem.style.width = width + "%";
170      }
171    }
172  }
173  // ************    END:: Helix 1.4 JS    ************** //
174  // **************************************************** //
175
176  // **************   START Mega SCRIPT   *************** //
177  // **************************************************** //
178
179  //mega menu
180  $(".sp-megamenu-wrapper")
181    .parent()
182    .parent()
183    .css("position", "static")
184    .parent()
185    .css("position", "relative");
186  $(".sp-menu-full").each(function () {
187    $(this).parent().addClass("menu-justify");
188  });
189
190  // boxlayout
191  if ($("body.layout-boxed").length > 0) {
192    var windowWidth = $("#sp-header").parent().outerWidth();
193    $("#sp-header").css({ "max-width": windowWidth, left: "auto" });
194  }
195
196  // **************   END:: Mega SCRIPT   *************** //
197  // **************************************************** //
198
199  // **************  START Others SCRIPT  *************** //
200  // **************************************************** //
201
202  var tooltipTriggerList = [].slice.call(
203    document.querySelectorAll('[data-bs-toggle="tooltip"]')
204  );
205  var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
206    return new bootstrap.Tooltip(tooltipTriggerEl);
207  });
208
209  // Article Ajax voting
210  $(document).on("click", ".sp-rating .star", function (event) {
211    event.preventDefault();
212
213    var data = {
214      action: "voting",
215      user_rating: $(this).data("number"),
216      id: $(this).closest(".post_rating").attr("id"),
217    };
218
219    var request = {
220      option: "com_ajax",
221      plugin: "helix3",
222      data: data,
223      format: "json",
224    };
225
226    $.ajax({
227      type: "POST",
228      data: request,
229      beforeSend: function () {
230        $(".post_rating .ajax-loader").show();
231      },
232      success: function (response) {
233        var data = $.parseJSON(response.data);
234
235        $(".post_rating .ajax-loader").hide();
236
237        if (data.status == "invalid") {
238          $(".post_rating .voting-result")
239            .text("You have already rated this entry!")
240            .fadeIn("fast");
241        } else if (data.status == "false") {
242          $(".post_rating .voting-result")
243            .text("Somethings wrong here, try again!")
244            .fadeIn("fast");
245        } else if (data.status == "true") {
246          var rate = data.action;
247          $(".voting-symbol")
248            .find(".star")
249            .each(function (i) {
250              if (i < rate) {
251                $(".star")
252                  .eq(-(i + 1))
253                  .addClass("active");
254              }
255            });
256
257          $(".post_rating .voting-result").text("Thank You!").fadeIn("fast");
258        }
259      },
260      error: function () {
261        $(".post_rating .ajax-loader").hide();
262        $(".post_rating .voting-result")
263          .text("Failed to rate, try again!")
264          .fadeIn("fast");
265      },
266    });
267  });
268
269  // **************  END:: Others SCRIPT  *************** //
270  // **************************************************** //
271
272  // **************   Start Travelia Script   *************** //
273  // ******************************************************** //
274
275  // Select
276  $(document).on("click", function (e) {
277    var selector = $(".sp-select");
278    if (!selector.is(e.target) && selector.has(e.target).length === 0) {
279      selector.find("ul").slideUp();
280      selector.removeClass("active");
281    }
282  });
283
284  $(".mod-languages select").each(function (event) {
285    $(this).hide();
286    var $self = $(this);
287    var spselect = '<div class="sp-select">';
288    spselect += '<div class="sp-select-result">';
289    spselect +=
290      '<span class="sp-select-text">' +
291      $self.find("option:selected").text() +
292      "</span>";
293    spselect += ' <i class="fa fa-angle-down"></i>';
294    spselect += "</div>";
295    spselect += '<ul class="sp-select-dropdown">';
296
297    $self.children().each(function (event) {
298      if ($self.val() == $(this).val()) {
299        spselect +=
300          '<li class="active" data-val="' +
301          $(this).val() +
302          '">' +
303          $(this).text() +
304          "</li>";
305      } else {
306        spselect +=
307          '<li data-val="' + $(this).val() + '">' + $(this).text() + "</li>";
308      }
309    });
310
311    spselect += "</ul>";
312    spselect += "</div>";
313    $(this).after($(spselect));
314  });
315
316  $(document).on("click", ".sp-select", function (event) {
317    $(".sp-select").not(this).find("ul").slideUp();
318    $(this).find("ul").slideToggle();
319    $(this).toggleClass("active");
320  });
321
322  $(document).on("click", ".sp-select ul li", function (event) {
323    var $select = $(this).closest(".sp-select").prev("select");
324    $(this)
325      .parent()
326      .prev(".sp-select-result")
327      .find("span")
328      .html($(this).text());
329    $(this).parent().find(".active").removeClass("active");
330    $(this).addClass("active");
331    $select.val($(this).data("val"));
332    $select.change();
333  });
334  // End Select
335
336  // Top Search
337  $(".search-open-icon").on("click", function () {
338    $(".top-search-input-wrap, .top-search-overlay").fadeIn(200);
339    $(this).hide();
340    $(".search-close-icon").show().css("display", "inline-block");
341    $("body").addClass("search-open");
342  });
343
344  $(".search-close-icon, .top-search-overlay").on("click", function () {
345    $(".top-search-input-wrap, .top-search-overlay").fadeOut(200);
346    $(".search-close-icon").hide();
347    $(".search-open-icon").show();
348    window.setTimeout(function () {
349      $("body").removeClass("search-open");
350    }, 300);
351  });
352  $(document).on("keydown", function (e) {
353    if (e.keyCode === 27) {
354      $(".top-search-input-wrap, .top-search-overlay").fadeOut(200);
355      $(".search-close-icon").hide();
356      $(".search-open-icon").show();
357    }
358  });
359  // End Top Search
360
361  //Header content wrap
362  $("#sp-header > .container > .row").wrapAll(
363    '<div class="header-content-wrap"></div>'
364  );
365  //End Header content wrap
366
367  // Thumb Gallery
368  if ($("#carousel").is(".flexslider")) {
369    // Thumb Gallery
370    var $sppbTgOptions = $(".sppb-tg-slider");
371
372    // Autoplay
373    var $autoplay = $sppbTgOptions.data("sppb-tg-autoplay");
374    //if ($autoplay == 'true') { var $autoplay = true; } else { var $autoplay = false};
375
376    // arrows
377    var $arrows = $sppbTgOptions.data("sppb-tg-arrows");
378    //if ($arrows == 'true') { var $arrows = true; } else { var $arrows = false};
379
380    $(window).load(function () {
381      $("#carousel").flexslider({
382        animation: "slide",
383        controlNav: false,
384        directionNav: $arrows,
385        animationLoop: false,
386        slideshow: $autoplay,
387        minItems: 5,
388        move: 1,
389        itemWidth: 129,
390        itemMargin: 15,
391        asNavFor: "#slider",
392      });
393
394      $("#slider").flexslider({
395        animation: "fade",
396        controlNav: false,
397        directionNav: $arrows,
398        animationLoop: false,
399        slideshow: $autoplay,
400        sync: "#carousel",
401      });
402    });
403  }
404  // END::  Thumb Gallery
405
406  $(document).ready(function () {
407    var clipWidth = $(".clip-text").outerWidth(true);
408    var clipHeight = $(".clip-text").outerHeight(true);
409
410    $(".clip-text-bg").css({
411      width: clipWidth,
412      height: clipHeight,
413    });
414  });
415
416  // For React Dom Load
417  var observer = new MutationObserver(function (mutations) {
418    mutations.forEach(function (mutation) {
419      var newNodes = mutation.addedNodes;
420      if (newNodes !== null) {
421        var $nodes = $(newNodes);
422
423        $nodes.each(function () {
424          var $node = $(this);
425
426          $node.find(".flexslider").each(function () {
427            if ($("#carousel").is(".flexslider")) {
428              var $sppbTgOptions = $(".sppb-tg-slider");
429              var $autoplay = $sppbTgOptions.data("sppb-tg-autoplay");
430              var $arrows = $sppbTgOptions.data("sppb-tg-arrows");
431
432              $("#carousel").flexslider({
433                animation: "slide",
434                controlNav: false,
435                directionNav: $arrows,
436                animationLoop: false,
437                slideshow: $autoplay,
438                itemWidth: 108,
439                itemMargin: 15,
440                asNavFor: "#slider",
441                after: function (slider) {
442                  if (!slider.playing) {
443                    slider.play();
444                  }
445                },
446              });
447
448              $("#slider").flexslider({
449                animation: "slide",
450                controlNav: false,
451                directionNav: false,
452                animationLoop: false,
453                slideshow: $autoplay,
454                sync: "#carousel",
455                after: function (slider) {
456                  if (!slider.playing) {
457                    slider.play();
458                  }
459                },
460              });
461            }
462          });
463
464          $node.find(".sppb-fullwidth-title").each(function () {
465            var clipWidth = $(".clip-text").outerWidth(true);
466            var clipHeight = $(".clip-text").outerHeight(true);
467
468            $(".clip-text-bg").css({
469              width: clipWidth,
470              height: clipHeight,
471            });
472          });
473
474          $node.find("#slide-fullwidth").each(function () {
475            var $slideFullwidth = $(this);
476
477            var $autoplay = $slideFullwidth.attr("data-sppb-slide-ride");
478            if ($autoplay == "true") {
479              var $autoplay = true;
480            } else {
481              var $autoplay = false;
482            }
483            var $controllers = $slideFullwidth.attr(
484              "data-sppb-slidefull-controllers"
485            );
486            if ($controllers == "true") {
487              var $controllers = true;
488            } else {
489              var $controllers = false;
490            }
491
492            $slideFullwidth.owlCarousel({
493              margin: 0,
494              loop: true,
495              video: true,
496              autoplay: $autoplay,
497              animateIn: "fadeIn",
498              animateOut: "fadeOut",
499              autoplayHoverPause: true,
500              autoplaySpeed: 1500,
501              responsive: {
502                0: {
503                  items: 1,
504                },
505                600: {
506                  items: 1,
507                },
508                1000: {
509                  items: 1,
510                },
511              },
512              dots: $controllers,
513            });
514
515            $(".sppbSlidePrev").click(function () {
516              $slideFullwidth.trigger("prev.owl.carousel", [400]);
517            });
518
519            $(".sppbSlideNext").click(function () {
520              $slideFullwidth.trigger("next.owl.carousel", [400]);
521            });
522            $(".owl-controls").wrapAll("<div class='sppb-container'></div>");
523          });
524        });
525      }
526    });
527  });
528
529  var config = {
530    childList: true,
531    subtree: true,
532  };
533
534  // Pass in the target node, as well as the observer options
535  observer.observe(document.body, config);
536
537  // **************   END:: Travelia Script   *************** //
538  // ******************************************************** //
539});

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.