1(function ($) { 2 "use strict"; 3 var GaviasElements = { 4 init: function(){ 5 GaviasElements.initDebouncedresize(); 6 elementorFrontend.hooks.addAction('frontend/element_ready/gva-testimonials.default', GaviasElements.elementTestimonial); 7 elementorFrontend.hooks.addAction('frontend/element_ready/gva-posts.default', GaviasElements.elementPosts); 8 elementorFrontend.hooks.addAction('frontend/element_ready/gva-portfolio.default', GaviasElements.elementPortfolio); 9 elementorFrontend.hooks.addAction('frontend/element_ready/gva-gallery.default', GaviasElements.elementGallery); 10 elementorFrontend.hooks.addAction('frontend/element_ready/gva-events.default', GaviasElements.elementEvents); 11 elementorFrontend.hooks.addAction('frontend/element_ready/gva-brand.default', GaviasElements.elementBrand); 12 elementorFrontend.hooks.addAction('frontend/element_ready/gva_counter_group.default', GaviasElements.elementCounter); 13 elementorFrontend.hooks.addAction('frontend/element_ready/gva-services.default', GaviasElements.elementServices); 14 elementorFrontend.hooks.addAction('frontend/element_ready/gva-countdown.default', GaviasElements.elementCountDown); 15 elementorFrontend.hooks.addAction('frontend/element_ready/gva-user.default', GaviasElements.elementUser); 16 elementorFrontend.hooks.addAction('frontend/element_ready/gva-circle-progress.default', GaviasElements.elementCircleProgress); 17 18 elementorFrontend.hooks.addAction('frontend/element_ready/gva_icon_box_group.default', GaviasElements.elementInitCarousel); 19 elementorFrontend.hooks.addAction('frontend/element_ready/gva-content-carousel.default', GaviasElements.elementInitCarousel); 20 21 elementorFrontend.hooks.addAction('frontend/element_ready/gva-team.default', GaviasElements.elementInitCarousel); 22 23 elementorFrontend.hooks.addAction('frontend/element_ready/gva-products.default', GaviasElements.elementInitCarousel); 24 25 elementorFrontend.hooks.addAction('frontend/element_ready/gva-product-item-related.default', GaviasElements.elementProductItemRelated); 26 27 elementorFrontend.hooks.addAction('frontend/element_ready/gva-tab-contact-form.default', GaviasElements.elementTabsContactForm); 28 29 elementorFrontend.hooks.addAction('frontend/element_ready/gva-banners.default', GaviasElements.elementBanners); 30 31 elementorFrontend.hooks.addAction('frontend/element_ready/gva_ba_booking.default', GaviasElements.elementInitCarousel); 32 elementorFrontend.hooks.addAction('frontend/element_ready/gva_ba_item_gallery.default', GaviasElements.elementInitCarousel); 33 elementorFrontend.hooks.addAction('frontend/element_ready/gva_ba_search_form.default', GaviasElements.elementBookingSearchForm); 34 elementorFrontend.hooks.addAction('frontend/element_ready/gva_ba_item_booking_form.default', GaviasElements.elementItemBookingForm); 35 elementorFrontend.hooks.addAction('frontend/element_ready/gva_ba_item_rating_criteria.default', GaviasElements.elementItemRatingCriteria); 36 elementorFrontend.hooks.addAction('frontend/element_ready/gva_ba_item_comment.default', GaviasElements.elementItemRating); 37 elementorFrontend.hooks.addAction('frontend/element_ready/gva_ba_item_related.default', GaviasElements.elementInitCarousel); 38 elementorFrontend.hooks.addAction('frontend/element_ready/gva-team.default', GaviasElements.elementInitCarousel); 39 40 elementorFrontend.hooks.addAction('frontend/element_ready/gva-all-tour.default', GaviasElements.elementInitCarousel); 41 elementorFrontend.hooks.addAction('frontend/element_ready/wptravelengine-trip-search.default', GaviasElements.elementTripSearch); 42 43 44 elementorFrontend.hooks.addAction('frontend/element_ready/column', GaviasElements.elementColumn); 45 46 elementorFrontend.hooks.addAction('frontend/element_ready/section', GaviasElements.elementRow); 47 48 }, 49 backend: function(){ 50 elementor.settings.page.addChangeCallback( 'gowilds_post_preview', GaviasElements.handlePostPreview); 51 }, 52 handlePostPreview: function(doc_preview_post_id){ 53 elementor.saver.update({ 54 onSuccess: function onSuccess() { 55 window.location.reload(); 56 } 57 }); 58 window.location.reload(); 59 }, 60 61 initDebouncedresize: function(){ 62 var $event = $.event, 63 $special, resizeTimeout; 64 $special = $event.special.debouncedresize = { 65 setup: function () { 66 $(this).on("resize", $special.handler); 67 }, 68 teardown: function () { 69 $(this).off("resize", $special.handler); 70 }, 71 handler: function (event, execAsap) { 72 var context = this, 73 args = arguments, 74 dispatch = function () { 75 event.type = "debouncedresize";
76 $event.dispatch.apply(context, args); 77 }; 78 79 if (resizeTimeout) { 80 clearTimeout(resizeTimeout); 81 } 82 83 execAsap ? dispatch() : resizeTimeout = setTimeout(dispatch, $special.threshold); 84 }, 85 threshold: 150 86 }; 87 }, 88 89 elementColumn: function($scope){ 90 91 if(($scope).hasClass('gv-sidebar-offcanvas')){ 92 var html = '<div class="control-mobile">'; 93 html += '<a class="control-mobile-link" href="#"><i class="las la-bars"></i>Show Sidebar<a>'; 94 html += '</div>'; 95 $scope.append(html); 96 97 html = '<span class="filter-top"><a href="#" class="btn-close-filter"><i class="fas fa-times"></i></a></span>'; 98 $scope.children('.elementor-column-wrap, .elementor-widget-wrap').children('.elementor-widget-wrap').prepend(html); 99 } 100 101 var _body = $('body'); 102 var _sidebar = $scope; 103 104 $($scope).find('.control-mobile, .btn-close-filter').on('click', function(e){ 105 e.preventDefault(); 106 if(_body.hasClass('open-el-sidebar-offcanvas')){ 107 _sidebar.removeClass('open'); 108 setTimeout(function(){ 109 _body.removeClass('open-el-sidebar-offcanvas'); 110 }, 200); 111 }else{ 112 _sidebar.addClass('open'); 113 _body.addClass('open-el-sidebar-offcanvas'); 114 } 115 }); 116 }, 117 118 elementPostArchive: function($scope){ 119 120 var $container = $scope.find('.post-masonry-style'); 121 $container.imagesLoaded( function(){ 122 $container.masonry({ 123 itemSelector : '.item-masory', 124 gutterWidth: 0, 125 columnWidth: 1, 126 }); 127 }); 128 }, 129 130 elementTestimonial: function($scope){ 131 var $carousel = $scope.find('.init-carousel-swiper'); 132 GaviasElements.initCarousel($carousel); 133 }, 134 135 136 elementPosts: function($scope){ 137 var $carousel = $scope.find('.init-carousel-swiper'); 138 GaviasElements.initCarousel($carousel); 139 }, 140 141 142 elementServices: function($scope){ 143 var $carousel = $scope.find('.init-carousel-swiper'); 144 GaviasElements.initCarousel($carousel); 145 }, 146 147 elementPortfolio: function($scope){ 148 var $carousel = $scope.find('.init-carousel-swiper'); 149 GaviasElements.initCarousel($carousel); 150 if( $.fn.isotope ){ 151 if($('.isotope-items').length){ 152 $( '.isotope-items' ).each(function() { 153 var $el = $( this ), 154 $filter = $( '.portfolio-filter a'), 155 $loop = $( this ); 156 157 $loop.isotope(); 158 159 $(window).load(function() { 160 $loop.isotope( 'layout' ); 161 }); 162 163 if ( $filter.length > 0 ) { 164 $filter.on( 'click', function( e ) { 165 e.preventDefault(); 166 var $a = $(this); 167 $filter.removeClass( 'active' ); 168 $a.addClass( 'active' ); 169 $loop.isotope({ filter: $a.data( 'filter' ) }); 170 }); 171 }; 172 }); 173 } 174 }; 175 }, 176 177 elementGallery: function($scope){ 178 var $carousel = $scope.find('.init-carousel-swiper'); 179 GaviasElements.initCarousel($carousel); 180 }, 181 182 elementEvents: function($scope){ 183 var $carousel = $scope.find('.init-carousel-swiper'); 184 GaviasElements.initCarousel($carousel); 185 }, 186 187 elementBrand: function($scope){ 188 var $carousel = $scope.find('.init-carousel-swiper'); 189 GaviasElements.initCarousel($carousel); 190 }, 191 192 elementCounter: function($scope){ 193 var $carousel = $scope.find('.init-carousel-swiper'); 194 GaviasElements.initCarousel($carousel); 195 196 $scope.find('.milestone-block').each(function(){ 197 var block = $(this); 198 block.appear(function() { 199 var $endNum = parseInt(block.find('.milestone-number').text()); 200 block.find('.milestone-number').countTo({ 201 from: 0, 202 to: $endNum, 203 speed: 4000, 204 refreshInterval: 60, 205 formatter: function (value, options) { 206 value = value.toFixed(options.decimals); 207 value = value.replace(/\B(?=(\d{3})+(?!\d))/g, ','); 208 return value; 209 } 210 }); 211 },{accX: 0, accY: 0}); 212 }) 213 }, 214 215 elementCountDown: function($scope){ 216 $('[data-countdown="countdown"]').each(function(index, el) { 217 var $this = $(this); 218 var $date = $this.data('date').split("-"); 219 $this.gvaCountDown({ 220 TargetDate:$date[0]+"/"+$date[1]+"/"+$date[2]+" "+$date[3]+":"+$date[4]+":"+$date[5], 221 DisplayFormat:"<div class=\"countdown-times\"><div class=\"day\">%%D%% <span class=\"label\">Days</span> </div><div class=\"hours\">%%H%% <span class=\"label\">Hours</span> </div><div class=\"minutes\">%%M%% <span class=\"label\">Minutes</span> </div><div class=\"seconds\">%%S%% <span class=\"label\">Seconds</span></div></div>", 222 FinishMessage: "Expired" 223 }); 224 }); 225 }, 226 227 elementInitCarousel: function($scope){ 228 var $carousel = $scope.find('.init-carousel-swiper'); 229 GaviasElements.initCarousel($carousel); 230 }, 231 232 elementProductItemRelated: function($scope){ 233 var $carousel = $scope.find('.init-carousel-swiper-theme'); 234 GaviasElements.initCarousel($carousel); 235 }, 236 237 elementBanners: function($scope){ 238 var $carousel = $scope.find('.init-carousel-swiper'); 239 GaviasElements.initCarousel($carousel); 240 }, 241 242 elementCircleProgress: function($scope){ 243 $scope.find(".circle-progress").appear(function () { 244 $scope.find(".circle-progress").each(function () { 245 let progress = $(this); 246 let progressOptions = progress.data("options"); 247 progress.circleProgress({ 248 startAngle: -Math.PI / 2 249 }).on('circle-animation-progress', function(event, progress, stepValue) { 250 $(this).find('strong').html(Math.round(stepValue.toFixed(2) * 100) + '<i>%</i>'); 251 });
252 }); 253 }); 254 }, 255 256 elementTabsContactForm: function($scope){ 257 $scope.find(".get-insurance__range").each(function () { 258 let range = $(this); 259 let show = range.find('.get-insurance__balance span'); 260 let input = range.find('.get-insurance__balance-input'); 261 range.find('.balance-range-slider').ionRangeSlider({ 262 onStart: function (data) { 263 show.html(data.from); 264 input.prop("value", data.from); 265 }, 266 onChange: function (data) { 267 show.html(data.from); 268 input.prop("value", data.from); 269 } 270 }); 271 }); 272 273 }, 274 275 //Booking Elements 276 elementItemBookingForm: function($scope){ 277 var _form = $scope.find('form#booking_form').first(); 278 _form.find('.booking_services_inner .list_service .list_service_title').each(function(){ 279 var _this = $(this); 280 var value = _this.find('input').val(); 281 var title = _this.find('h4').html(); 282 _this.find('input').attr('id', 'input_' + value).unwrap(); 283 _this.find('h4').html('<label for=input_' + value + '>' + title + '</label>'); 284 _this.find('label').unwrap(); 285 }); 286 }, 287 288 elementBookingSearchForm: function($scope){ 289 var _form = $scope.find('form.babe-search-form').first(); 290 291 var data_hidden = $scope.find('.data-hidden').first().data('hidden-tax'); 292 for (let i = 0; i < data_hidden.length; ++i){ 293 _form.find('.input-group > div[data-tax="' + data_hidden[i] + '"]').remove(); 294 } 295 296 var count = _form.find('.input-group > .is-active:not(.search_advanced_field):not(.input_select_field_time_from):not(.input_select_field_time_to)').length; 297 298 _form.addClass('form-col-' + count); 299 300 $scope.find('.search-keyword-block.is-active').each(function(){ 301 var input = $(this); 302 var title = $scope.find('.form-fields-title .search_box_title').text(); 303 $(input).find('> i').wrap('<div class="icon"></div>'); 304 input.find('.search-keyword').wrap('<div class="field-content"></div>'); 305 input.find('.field-content').prepend('<div class="title-field">' + title + '</div>'); 306 }); 307 308 $scope.find('.search_date_wrapper_date_from.is-active').each(function(){ 309 var input = $(this); 310 var title = $scope.find('.form-fields-title .date_from_title').text(); 311 $(input).find('> i').wrap('<div class="icon"></div>'); 312 input.find('#date_from').wrap('<div class="field-content"></div>'); 313 input.find('.field-content').prepend('<label class="title-field" for="date_from">' + title + '</label>'); 314 }); 315 316 $scope.find('.search_date_wrapper_date_to.is-active').each(function(){ 317 var input = $(this); 318 var title = $scope.find('.form-fields-title .date_to_title').text(); 319 $(input).find('> i').wrap('<div class="icon"></div>'); 320 input.find('#date_to').wrap('<div class="field-content"></div>'); 321 input.find('.field-content').prepend('<label class="title-field" for="date_to">' + title + '</label>'); 322 323 }); 324 325 $scope.find('.search_guests_field.is-active').each(function(){ 326 var input = $(this); 327 $(input).find('> i').wrap('<div class="icon"></div>'); 328 input.find('> div:not(.icon)').addClass('field-content'); 329 }); 330 331 $scope.find('.add_input_field.is-active').each(function(){ 332 var input = $(this); 333 var tax = $(this).attr('data-tax'); 334 var title = $scope.find('.form-fields-title .' + tax + '_title').text(); 335 $(input).find('> i').wrap('<div class="icon"></div>'); 336 input.find('.add_ids_title').wrap('<div class="field-content"></div>'); 337 input.find('.field-content').prepend('<div class="title-field">' + title + '</div>'); 338 }); 339 340 $scope.find('.is-active:not(.search_advanced_field)').each(function(){ 341 $(this).find('> div').wrapAll( "<div class='field-group-content'></div>"); 342 }); 343 344 $scope.find('.search_advanced_field .advanced-header').each(function(){ 345 var html = $(this).html(); 346 $(this).html(html.replace("All ", "")); 347 }); 348 349 setTimeout(function(){ 350 $scope.find('.gowilds-search-form-wrap').addClass('show'); 351 }, 360); 352 353 }, 354 355 elementItemSingleIncludeExclude: function($scope){ 356 var icon = $scope.find('.icon_list').first(); 357 icon.parents('.content-inner').find('ul li').each(function(){ 358 $(this).wrapInner('<span class="list-text"></span>'); 359 $(this).prepend(icon.html()); 360 }); 361 }, 362 363 elementItemRatingCriteria: function($scope){ 364 $("[data-progress-animation]").each(function() { 365 var $this = $(this); 366 $this.appear(function() {
367 var delay = ($this.attr("data-appear-animation-delay") ? $this.attr("data-appear-animation-delay") : 1); 368 if(delay > 1) $this.css("animation-delay", delay + "ms"); 369 setTimeout(function() { $this.animate({width: $this.attr("data-progress-animation")}, 1000);}, delay); 370 }, {accX: 0, accY: -50}); 371 }); 372 }, 373 374 elementItemRating: function($scope){ 375 var count = 0; 376 var total = 0; 377 var avg_html = $scope.find('.avg-total-tmp').html(); 378 $scope.find('form.comment-form .comment-form-rating-ul').after('<div class="avg-review">' + avg_html + '</div>'); 379 $scope.find('.comment-form-rating-ul').find('.fa-star').removeClass('fa').addClass('fas'); 380 $scope.find('input.rating_hidden_input').val(5); 381 382 $('.comment-form-rating-stars').on('click', '.star', function(event){ 383 var count = 0; 384 var total = 0; 385 $scope.find('input.rating_hidden_input').each(function(){ 386 var val = $(this).val(); 387 if(val){ 388 val = parseInt(val); 389 if(Number.isInteger(val)){ 390 total += val; 391 count ++; 392 } 393 } 394 }); 395 var avg = total/count; 396 $scope.find('.avg-review .value').html(avg.toFixed(2)); 397 }); 398 }, 399 400 elementTripSearch: function($scope){ 401 $scope.find('.wpte-trip__search-fields').find('.wpte-trip__adv-field').each(function(){ 402 var placeholder = $(this).find('.wpte__input, .wpte__input-value').attr('placeholder'); 403 if( $(this).find('input[name="destination"]').length ){ 404 placeholder = 'Location'; 405 } 406 if( $(this).find('input[name="trip_types"]').length ){ 407 placeholder = 'Type'; 408 } 409 $(this).prepend('<div class="title_field">' + placeholder + '</div>'); 410 }); 411 setTimeout(function(){ 412 $scope.find('.elementor-widget-container').addClass('show'); 413 }, 360); 414 }, 415 416 initCarousel: function($target){ 417 var _default = { 418 items: 3, 419 items_lg: 3, 420 items_md: 2, 421 items_sm: 2, 422 items_xs: 1, 423 items_xx: 1, 424 space_between: 30, 425 effect: 'slide', 426 loop: 1, 427 speed: 600, 428 autoplay: 1, 429 autoplay_delay: 6000, 430 autoplay_hover: 0, 431 navigation: 1, 432 pagination: 1, 433 pagination_type: 'bullets', 434 dynamic_bullets: 0 435 }; 436 var settings = $target.data('carousel'); 437 settings = $.extend(!0, _default, settings); 438 439 //-- Autoplay 440 var _autoplay = false; 441 if(settings.autoplay){ 442 _autoplay = { 443 delay: settings.autoplay_delay, 444 disableOnInteraction: false, 445 pauseOnMouseEnter: settings.autoplay_hover, 446 } 447 } 448 //-- Pagination 449 var _pagination = false; 450 if(settings.pagination){ 451 _pagination = { 452 el: $target.parents('.swiper-slider-wrapper').find('.swiper-pagination')[0], 453 type: settings.pagination_type, 454 clickable: true, 455 dynamicBullets: settings.dynamic_bullets 456 } 457 } 458 //-- Navigation 459 var _navigation = false; 460 if(settings.navigation){ 461 _navigation = { 462 nextEl: $target.parents('.swiper-slider-wrapper').find('.swiper-nav-next')[0], 463 prevEl: $target.parents('.swiper-slider-wrapper').find('.swiper-nav-prev')[0], 464 hiddenClass: 'hidden' 465 } 466 } 467 468 const swiper = new Swiper($target[0], { 469 loop: settings.loop, 470 spaceBetween: settings.space_between, 471 autoplay: _autoplay, 472 speed: settings.speed, 473 grabCursor: false, 474 centeredSlides: false, 475 centeredSlidesBounds: true, 476 effect: settings.effect, 477 breakpoints: { 478 0: { 479 slidesPerView: 1 480 }, 481 560: { 482 slidesPerView: settings.items_xx 483 }, 484 640: { 485 slidesPerView: settings.items_xs 486 }, 487 768: { 488 slidesPerView: settings.items_sm 489 }, 490 1024: { 491 slidesPerView: settings.items_md 492 }, 493 1200: { // when window width is >= 1200px 494 slidesPerView: settings.items_lg, 495 496 }, 497 1400: { // when window width is >= 1200px 498 slidesPerView: settings.items 499 } 500 }, 501 pagination: _pagination, 502 navigation: _navigation, 503 observer: true, 504 observeParents: true, 505 slideVisibleClass: 'item-active', 506 watchSlidesVisibility: true, 507 on: { 508 progress: function(){ 509 var total = $target.find('.swiper-slide.item-active').length; 510 511 $target.find('.swiper-slide').removeClass('first'); 512 $target.find('.swiper-slide').removeClass('last'); 513 $target.find('.swiper-slide').removeClass('center'); 514 515 var start = 0; 516 if(total == 5){start = 1;} 517 518 $target.find('.swiper-slide.item-active').each(function(index){ 519 if(index === start) { 520 $(this).addClass('first') 521 } 522 if(index === start + 1){ 523 $(this).addClass('center') 524 } 525 if( index === total - (start + 1) && total > (start + 1) ) { 526 $(this).addClass('last') 527 } 528 }) 529 }, 530 } 531 }); 532 533 if(settings.autoplay_hover && settings.autoplay){ 534 $target.hover(function() { 535 swiper.autoplay.stop(); 536 }, function() { 537 swiper.autoplay.start(); 538 }); 539 } 540 } 541 }; 542 543 $(window).on('elementor/frontend/init', GaviasElements.init); 544 545}(jQuery));
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.