1"use strict"; 2(function () { 3 // Global variables 4 var userAgent = navigator.userAgent.toLowerCase(), 5 initialDate = new Date(), 6 7 $document = $(document), 8 $window = $(window), 9 $html = $("html"), 10 $body = $("body"), 11 12 isDesktop = $html.hasClass("desktop"), 13 isIE = userAgent.indexOf("msie") !== -1 ? parseInt(userAgent.split("msie")[1], 10) : userAgent.indexOf("trident") !== -1 ? 11 : userAgent.indexOf("edge") !== -1 ? 12 : false, 14 isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), 15 windowReady = false, 16 isNoviBuilder = false, 17 18 plugins = { 19 bootstrapTooltip: $("[data-toggle='tooltip']"), 20 bootstrapModalDialog: $('.modal'), 21 bootstrapTabs: $(".tabs-custom"), 22 customToggle: $("[data-custom-toggle]"), 23 counter: $(".counter"), 24 circleProgress: $(".progress-bar-circle"), 25 captcha: $('.recaptcha'), 26 campaignMonitor: $('.campaign-mailform'), 27 copyrightYear: $(".copyright-year"), 28 checkbox: $("input[type='checkbox']"), 29 dateCountdown: $('.DateCountdown'), 30 isotope: $(".isotope"), 31 lightGallery: $("[data-lightgallery='group']"), 32 lightGalleryItem: $("[data-lightgallery='item']"), 33 lightDynamicGalleryItem: $("[data-lightgallery='dynamic']"), 34 materialParallax: $(".parallax-container"), 35 mailchimp: $('.mailchimp-mailform'), 36 owl: $(".owl-carousel"), 37 popover: $('[data-toggle="popover"]'), 38 progressLinear: $(".progress-linear"), 39 preloader: $(".preloader"), 40 rdNavbar: $(".rd-navbar"), 41 rdGoogleMaps: $(".rd-google-map"), 42 rdMailForm: $(".rd-mailform"), 43 rdInputLabel: $(".form-label"), 44 regula: $("[data-constraints]"), 45 radio: $("input[type='radio']"), 46 swiper: $(".swiper-slider"), 47 search: $(".rd-search"), 48 searchResults: $('.rd-search-results'), 49 statefulButton: $('.btn-stateful'), 50 scroller: $(".scroll-wrap"), 51 viewAnimate: $('.view-animate'), 52 wow: $(".wow"), 53 slick: $('.slick-slider'), 54 selectFilter: $("select"), 55 bootstrapDateTimePicker: $("[data-time-picker]"), 56 // tiltHover: $('.js-tilt'), 57 youtubeBg: $('.bg-youtube') 58 }; 59 60 // Initialize scripts that require a loaded page 61 $window.on('load', function () { 62 // Page loader & Page transition 63 if (plugins.preloader.length && !isNoviBuilder) { 64 pageTransition({ 65 target: document.querySelector( '.page' ), 66 delay: 0, 67 duration: 500, 68 classIn: 'fadeIn', 69 classOut: 'fadeOut', 70 classActive: 'animated', 71 conditions: function (event, link) { 72 return !/(\#|callto:|tel:|mailto:|javascript:void\(0\);|:\/\/)/.test(link) && !event.currentTarget.hasAttribute('data-lightgallery'); 73 }, 74 onTransitionStart: function ( options ) { 75 setTimeout( function () { 76 plugins.preloader.removeClass('loaded'); 77 }, options.duration * .75 ); 78 }, 79 onReady: function () { 80 plugins.preloader.addClass('loaded'); 81 windowReady = true; 82 } 83 }); 84 } 85 }); 86 87 // Initialize scripts that require a finished document 88 $(function () { 89 isNoviBuilder = window.xMode; 90 91 /** 92 * @desc Calculate the height of swiper slider basing on data attr 93 * @param {object} object - slider jQuery object 94 * @param {string} attr - attribute name 95 * @return {number} slider height 96 */ 97 function getSwiperHeight(object, attr) { 98 var val = object.attr("data-" + attr), 99 dim; 100 101 if (!val) { 102 return undefined; 103 } 104 105 dim = val.match(/(px)|(%)|(vh)|(vw)$/i); 106 107 if (dim.length) { 108 switch (dim[0]) { 109 case "px": 110 return parseFloat(val); 111 case "vh": 112 return $window.height() * (parseFloat(val) / 100); 113 case "vw": 114 return $window.width() * (parseFloat(val) / 100); 115 case "%": 116 return object.width() * (parseFloat(val) / 100); 117 } 118 } else { 119 return undefined; 120 } 121 } 122 123 /** 124 * @desc Toggle swiper videos on active slides 125 * @param {object} swiper - swiper slider 126 */ 127 function toggleSwiperInnerVideos(swiper) { 128 var prevSlide = $(swiper.slides[swiper.previousIndex]), 129 nextSlide = $(swiper.slides[swiper.activeIndex]), 130 videos, 131 videoItems = prevSlide.find("video"); 132 133 for (var i = 0; i < videoItems.length; i++) { 134 videoItems[i].pause(); 135 } 136 137 videos = nextSlide.find("video"); 138 if (videos.length) { 139 videos.get(0).play(); 140 } 141 } 142 143 /** 144 * SwiperCounter 145 * @description 146 */ 147 function getSwiperActiveSlideNumber( swiper ) { 148 for ( var i = 0; i < plugins.swiper.length; i++ ) { 149 var slider = $( plugins.swiper[i] ), 150 swiperSlides = slider.find( '.'+ swiper.params.slideClass ), 151 counter = slider.find(".swiper-counter"), 152 total = slider.find(".swiper-slide").length; 153 154 for( var n = 0; n < swiperSlides.length; n++ ) { 155 if( $( swiperSlides[n] ).hasClass( swiper.params.slideActiveClass ) ) { 156 counter.html( '<span class="count">'+ (n + 1) +'</span></span><span class="total"> \\ '+ total +'</span>'); 157 }; 158 } 159 } 160 } 161 162 /** 163 * @desc Toggle swiper animations on active slides 164 * @param {object} swiper - swiper slider 165 */ 166 function toggleSwiperCaptionAnimation(swiper) { 167 var prevSlide = $(swiper.container).find("[data-caption-animate]"), 168 nextSlide = $(swiper.slides[swiper.activeIndex]).find("[data-caption-animate]"), 169 delay, 170 duration, 171 nextSlideItem, 172 prevSlideItem; 173 174 for (var i = 0; i < prevSlide.length; i++) { 175 prevSlideItem = $(prevSlide[i]); 176 177 prevSlideItem.removeClass("animated") 178 .removeClass(prevSlideItem.attr("data-caption-animate")) 179 .addClass("not-animated"); 180 } 181 182 183 var tempFunction = function (nextSlideItem, duration) { 184 return function () { 185 nextSlideItem 186 .removeClass("not-animated") 187 .addClass(nextSlideItem.attr("data-caption-animate")) 188 .addClass("animated"); 189 if (duration) { 190 nextSlideItem.css('animation-duration', duration + 'ms'); 191 } 192 }; 193 }; 194 195 for (var i = 0; i < nextSlide.length; i++) { 196 nextSlideItem = $(nextSlide[i]);
197 delay = nextSlideItem.attr("data-caption-delay"); 198 duration = nextSlideItem.attr('data-caption-duration'); 199 if (!isNoviBuilder) { 200 if (delay) { 201 setTimeout(tempFunction(nextSlideItem, duration), parseInt(delay, 10)); 202 } else { 203 tempFunction(nextSlideItem, duration); 204 } 205 206 } else { 207 nextSlideItem.removeClass("not-animated") 208 } 209 } 210 } 211 212 /** 213 * @desc Initialize owl carousel plugin 214 * @param {object} c - carousel jQuery object 215 */ 216 function initOwlCarousel(c) { 217 var aliaces = ["-", "-sm-", "-md-", "-lg-", "-xl-", "-xxl-"], 218 values = [0, 576, 768, 992, 1200, 1600], 219 responsive = {}; 220 221 for (var j = 0; j < values.length; j++) { 222 responsive[values[j]] = {}; 223 for (var k = j; k >= -1; k--) { 224 if (!responsive[values[j]]["items"] && c.attr("data" + aliaces[k] + "items")) { 225 responsive[values[j]]["items"] = k < 0 ? 1 : parseInt(c.attr("data" + aliaces[k] + "items"), 10); 226 } 227 if (!responsive[values[j]]["stagePadding"] && responsive[values[j]]["stagePadding"] !== 0 && c.attr("data" + aliaces[k] + "stage-padding")) { 228 responsive[values[j]]["stagePadding"] = k < 0 ? 0 : parseInt(c.attr("data" + aliaces[k] + "stage-padding"), 10); 229 } 230 if (!responsive[values[j]]["margin"] && responsive[values[j]]["margin"] !== 0 && c.attr("data" + aliaces[k] + "margin")) { 231 responsive[values[j]]["margin"] = k < 0 ? 30 : parseInt(c.attr("data" + aliaces[k] + "margin"), 10); 232 } 233 } 234 } 235 236 // Enable custom pagination 237 if (c.attr('data-dots-custom')) { 238 c.on("initialized.owl.carousel", function (event) { 239 var carousel = $(event.currentTarget), 240 customPag = $(carousel.attr("data-dots-custom")), 241 active = 0; 242 243 if (carousel.attr('data-active')) { 244 active = parseInt(carousel.attr('data-active'), 10); 245 } 246 247 carousel.trigger('to.owl.carousel', [active, 300, true]); 248 customPag.find("[data-owl-item='" + active + "']").addClass("active"); 249 250 customPag.find("[data-owl-item]").on('click', function (e) { 251 e.preventDefault(); 252 carousel.trigger('to.owl.carousel', [parseInt(this.getAttribute("data-owl-item"), 10), 300, true]); 253 }); 254 255 carousel.on("translate.owl.carousel", function (event) { 256 customPag.find(".active").removeClass("active"); 257 customPag.find("[data-owl-item='" + event.item.index + "']").addClass("active") 258 }); 259 }); 260 } 261 262 c.owlCarousel({ 263 autoplay: isNoviBuilder ? false : c.attr("data-autoplay") === "true", 264 loop: isNoviBuilder ? false : c.attr("data-loop") !== "false", 265 items: 1, 266 center: c.attr("data-center") === "true", 267 dotsContainer: c.attr("data-pagination-class") || false, 268 navContainer: c.attr("data-navigation-class") || false, 269 mouseDrag: isNoviBuilder ? false : c.attr("data-mouse-drag") !== "false", 270 nav: c.attr("data-nav") === "true", 271 dots: c.attr("data-dots") === "true", 272 dotsEach: c.attr("data-dots-each") ? parseInt(c.attr("data-dots-each"), 10) : false, 273 animateIn: c.attr('data-animation-in') ? c.attr('data-animation-in') : false, 274 animateOut: c.attr('data-animation-out') ? c.attr('data-animation-out') : false, 275 responsive: responsive, 276 lazyLoad:true, 277 // autoWidth:true, 278 smartSpeed: 700, 279 navText: function () { 280 try { 281 return JSON.parse(c.attr("data-nav-text")); 282 } catch (e) { 283 return []; 284 } 285 }(), 286 navClass: function () { 287 try { 288 return JSON.parse(c.attr("data-nav-class")); 289 } catch (e) { 290 return ['owl-prev', 'owl-next']; 291 } 292 }() 293 }); 294 } 295 296 /** 297 * @desc Check the element whas been scrolled into the view 298 * @param {object} elem - jQuery object 299 * @return {boolean} 300 */ 301 function isScrolledIntoView(elem) { 302 if (!isNoviBuilder) { 303 return elem.offset().top + elem.outerHeight() >= $window.scrollTop() && elem.offset().top <= $window.scrollTop() + $window.height(); 304 } 305 else { 306 return true; 307 } 308 } 309 310 /** 311 * @desc Calls a function when element has been scrolled into the view 312 * @param {object} element - jQuery object 313 * @param {function} func - callback function 314 */ 315 function lazyInit(element, func) { 316 $document.on('scroll', function () { 317 if ((!element.hasClass('lazy-loaded') && (isScrolledIntoView(element)))) { 318 func.call(); 319 element.addClass('lazy-loaded'); 320 } 321 }).trigger("scroll"); 322 } 323 324 /** 325 * @desc Create live search results 326 * @param {object} options 327 */ 328 function liveSearch(options) { 329 $('#' + options.live).removeClass('cleared').html(); 330 options.current++; 331 options.spin.addClass('loading'); 332 $.get(handler, {
333 s: decodeURI(options.term), 334 liveSearch: options.live, 335 dataType: "html", 336 liveCount: options.liveCount, 337 filter: options.filter, 338 template: options.template 339 }, function (data) { 340 options.processed++; 341 var live = $('#' + options.live); 342 if ((options.processed === options.current) && !live.hasClass('cleared')) { 343 live.find('> #search-results').removeClass('active'); 344 live.html(data); 345 setTimeout(function () { 346 live.find('> #search-results').addClass('active'); 347 }, 50); 348 } 349 options.spin.parents('.rd-search').find('.input-group-addon').removeClass('loading'); 350 }) 351 } 352 353 /** 354 * @desc Attach form validation to elements 355 * @param {object} elements - jQuery object 356 */ 357 function attachFormValidator(elements) { 358 // Custom validator - phone number 359 regula.custom({ 360 name: 'PhoneNumber', 361 defaultMessage: 'Invalid phone number format', 362 validator: function() { 363 if ( this.value === '' ) return true; 364 else return /^(\+\d)?[0-9\-\(\) ]{5,}$/i.test( this.value ); 365 } 366 }); 367 368 for (var i = 0; i < elements.length; i++) { 369 var o = $(elements[i]), v; 370 o.addClass("form-control-has-validation").after("<span class='form-validation'></span>"); 371 v = o.parent().find(".form-validation"); 372 if (v.is(":last-child")) o.addClass("form-control-last-child"); 373 } 374 375 elements.on('input change propertychange blur', function (e) { 376 var $this = $(this), results; 377 378 if (e.type !== "blur") if (!$this.parent().hasClass("has-error")) return; 379 if ($this.parents('.rd-mailform').hasClass('success')) return; 380 381 if (( results = $this.regula('validate') ).length) { 382 for (i = 0; i < results.length; i++) { 383 $this.siblings(".form-validation").text(results[i].message).parent().addClass("has-error"); 384 } 385 } else { 386 $this.siblings(".form-validation").text("").parent().removeClass("has-error") 387 } 388 }).regula('bind'); 389 390 var regularConstraintsMessages = [ 391 { 392 type: regula.Constraint.Required, 393 newMessage: "The text field is required." 394 }, 395 { 396 type: regula.Constraint.Email, 397 newMessage: "The email is not a valid email." 398 }, 399 { 400 type: regula.Constraint.Numeric, 401 newMessage: "Only numbers are required" 402 }, 403 { 404 type: regula.Constraint.Selected, 405 newMessage: "Please choose an option." 406 } 407 ]; 408 409 410 for (var i = 0; i < regularConstraintsMessages.length; i++) { 411 var regularConstraint = regularConstraintsMessages[i]; 412 413 regula.override({ 414 constraintType: regularConstraint.type, 415 defaultMessage: regularConstraint.newMessage 416 }); 417 } 418 } 419 420 /** 421 * @desc Check if all elements pass validation 422 * @param {object} elements - object of items for validation 423 * @param {object} captcha - captcha object for validation 424 * @return {boolean} 425 */ 426 function isValidated(elements, captcha) { 427 var results, errors = 0; 428 429 if (elements.length) { 430 for (var j = 0; j < elements.length; j++) { 431 432 var $input = $(elements[j]); 433 if ((results = $input.regula('validate')).length) { 434 for (k = 0; k < results.length; k++) { 435 errors++; 436 $input.siblings(".form-validation").text(results[k].message).parent().addClass("has-error"); 437 } 438 } else { 439 $input.siblings(".form-validation").text("").parent().removeClass("has-error") 440 } 441 } 442 443 if (captcha) { 444 if (captcha.length) { 445 return validateReCaptcha(captcha) && errors === 0 446 } 447 } 448 449 return errors === 0; 450 } 451 return true; 452 } 453 454 /** 455 * @desc Validate google reCaptcha 456 * @param {object} captcha - captcha object for validation 457 * @return {boolean} 458 */ 459 function validateReCaptcha(captcha) { 460 var captchaToken = captcha.find('.g-recaptcha-response').val(); 461 462 if (captchaToken.length === 0) { 463 captcha 464 .siblings('.form-validation') 465 .html('Please, prove that you are not robot.') 466 .addClass('active'); 467 captcha 468 .closest('.form-wrap') 469 .addClass('has-error'); 470 471 captcha.on('propertychange', function () { 472 var $this = $(this), 473 captchaToken = $this.find('.g-recaptcha-response').val(); 474 475 if (captchaToken.length > 0) { 476 $this 477 .closest('.form-wrap') 478 .removeClass('has-error'); 479 $this 480 .siblings('.form-validation') 481 .removeClass('active') 482 .html(''); 483 $this.off('propertychange'); 484 } 485 }); 486 487 return false; 488 } 489 490 return true; 491 } 492 493 /** 494 * @desc Initialize Google reCaptcha 495 */ 496 window.onloadCaptchaCallback = function () { 497 for (var i = 0; i < plugins.captcha.length; i++) { 498 var $capthcaItem = $(plugins.captcha[i]); 499 500 grecaptcha.render( 501 $capthcaItem.attr('id'), 502 { 503 sitekey: $capthcaItem.attr('data-sitekey'), 504 size: $capthcaItem.attr('data-size') ? $capthcaItem.attr('data-size') : 'normal', 505 theme: $capthcaItem.attr('data-theme') ? $capthcaItem.attr('data-theme') : 'light', 506 callback: function (e) { 507 $('.recaptcha').trigger('propertychange'); 508 } 509 } 510 ); 511 $capthcaItem.after("<span class='form-validation'></span>"); 512 } 513 }; 514 515 /** 516 * @desc Initialize Bootstrap tooltip with required placement 517 * @param {string} tooltipPlacement 518 */ 519 function initBootstrapTooltip(tooltipPlacement) { 520 plugins.bootstrapTooltip.tooltip('dispose'); 521 522 if (window.innerWidth < 576) { 523 plugins.bootstrapTooltip.tooltip({placement: 'bottom'}); 524 } else { 525 plugins.bootstrapTooltip.tooltip({placement: tooltipPlacement}); 526 } 527 } 528 529 /** 530 * @desc Initialize the gallery with set of images 531 * @param {object} itemsToInit - jQuery object 532 * @param {string} addClass - additional gallery class 533 */ 534 function initLightGallery(itemsToInit, addClass) { 535 if (!isNoviBuilder) { 536 $(itemsToInit).lightGallery({ 537 thumbnail: $(itemsToInit).attr("data-lg-thumbnail") !== "fal
537se", 538 selector: "[data-lightgallery='item']", 539 autoplay: $(itemsToInit).attr("data-lg-autoplay") === "false", 540 pause: parseInt($(itemsToInit).attr("data-lg-autoplay-delay")) || 5000, 541 addClass: addClass, 542 mode: $(itemsToInit).attr("data-lg-animation") || "lg-slide", 543 loop: $(itemsToInit).attr("data-lg-loop") !== "false" 544 }); 545 } 546 } 547 548 /** 549 * @desc Initialize the gallery with dynamic addition of images 550 * @param {object} itemsToInit - jQuery object 551 * @param {string} addClass - additional gallery class 552 */ 553 function initDynamicLightGallery(itemsToInit, addClass) { 554 if (!isNoviBuilder) { 555 $(itemsToInit).on("click", function () { 556 $(itemsToInit).lightGallery({ 557 thumbnail: $(itemsToInit).attr("data-lg-thumbnail") !== "false", 558 selector: "[data-lightgallery='item']", 559 autoplay: $(itemsToInit).attr("data-lg-autoplay") === "false", 560 pause: parseInt($(itemsToInit).attr("data-lg-autoplay-delay")) || 5000, 561 addClass: addClass, 562 mode: $(itemsToInit).attr("data-lg-animation") || "lg-slide", 563 loop: $(itemsToInit).attr("data-lg-loop") !== "false", 564 dynamic: true, 565 dynamicEl: JSON.parse($(itemsToInit).attr("data-lg-dynamic-elements")) || [] 566 }); 567 }); 568 } 569 } 570 571 /** 572 * @desc Initialize the gallery with one image 573 * @param {object} itemToInit - jQuery object 574 * @param {string} addClass - additional gallery class 575 */ 576 function initLightGalleryItem(itemToInit, addClass) { 577 if (!isNoviBuilder) { 578 $(itemToInit).lightGallery({ 579 selector: "this", 580 addClass: addClass, 581 counter: false, 582 youtubePlayerParams: { 583 modestbranding: 1, 584 showinfo: 0, 585 rel: 0, 586 controls: 0 587 }, 588 vimeoPlayerParams: { 589 byline: 0, 590 portrait: 0 591 } 592 }); 593 } 594 } 595 596 // Google ReCaptcha 597 if (plugins.captcha.length) { 598 $.getScript("//www.google.com/recaptcha/api.js?onload=onloadCaptchaCallback&render=explicit&hl=en"); 599 } 600 601 // Additional class on html if mac os. 602 if (navigator.platform.match(/(Mac)/i)) { 603 $html.addClass("mac-os"); 604 } 605 606 // Adds some loosing functionality to IE browsers (IE Polyfills) 607 if (isIE) { 608 if (isIE < 10) { 609 $html.addClass("lt-ie-10"); 610 } 611 612 if (isIE < 11) { 613 $.getScript('js/pointer-events.min.js') 614 .done(function () { 615 $html.addClass("ie-10"); 616 PointerEventsPolyfill.initialize({}); 617 }); 618 } 619 620 if (isIE === 11) { 621 $html.addClass("ie-11"); 622 } 623 624 if (isIE === 12) { 625 $html.addClass("ie-edge"); 626 } 627 } 628 629 // Bootstrap Tooltips 630 if (plugins.bootstrapTooltip.length) { 631 var tooltipPlacement = plugins.bootstrapTooltip.attr('data-placement'); 632 initBootstrapTooltip(tooltipPlacement); 633 634 $window.on('resize orientationchange', function () { 635 initBootstrapTooltip(tooltipPlacement); 636 }) 637 } 638 639 // Stop vioeo in bootstrapModalDialog 640 if (plugins.bootstrapModalDialog.length) { 641 for (var i = 0; i < plugins.bootstrapModalDialog.length; i++) { 642 var modalItem = $(plugins.bootstrapModalDialog[i]); 643 644 modalItem.on('hidden.bs.modal', $.proxy(function () { 645 var activeModal = $(this), 646 rdVideoInside = activeModal.find('video'), 647 youTubeVideoInside = activeModal.find('iframe'); 648 649 if (rdVideoInside.length) { 650 rdVideoInside[0].pause(); 651 } 652 653 if (youTubeVideoInside.length) { 654 var videoUrl = youTubeVideoInside.attr('src'); 655 656 youTubeVideoInside 657 .attr('src', '') 658 .attr('src', videoUrl); 659 } 660 }, modalItem)) 661 } 662 } 663 664 // Popovers 665 if (plugins.popover.length) { 666 if (window.innerWidth < 767) { 667 plugins.popover.attr('data-placement', 'bottom'); 668 plugins.popover.popover(); 669 } 670 else { 671 plugins.popover.popover(); 672 } 673 } 674 675 // Bootstrap Buttons 676 if (plugins.statefulButton.length) { 677 $(plugins.statefulButton).on('click', function () { 678 var statefulButtonLoading = $(this).button('loading'); 679 680 setTimeout(function () { 681 statefulButtonLoading.button('reset') 682 }, 2000); 683 }) 684 } 685 686 // Bootstrap tabs 687 if (plugins.bootstrapTabs.length) { 688 for (var i = 0; i < plugins.bootstrapTabs.length; i++) { 689 var bootstrapTabsItem = $(plugins.bootstrapTabs[i]); 690 691 //If have slick carousel inside tab - resize slick carousel on click 692 if (bootstrapTabsItem.find('.slick-slider').length) { 693 bootstrapTabsItem.find('.tabs-custom-list > li > a').on('click', $.proxy(function () { 694 var $this = $(this); 695 var setTimeOutTime = isNoviBuilder ? 1500 : 300; 696 697 setTimeout(function () { 698 $this.find('.tab-content .tab-pane.active .slick-slider').slick('setPosition'); 699 }, setTimeOutTime); 700 }, bootstrapTabsItem)); 701 } 702 } 703 } 704 705 // Copyright Year (Evaluates correct copyright year) 706 if (plugins.copyrightYear.length) { 707 plugins.copyrightYear.text(initialDate.getFullYear()); 708 } 709 710 // RD Google Maps 711 //if (plugins.rdGoogleMaps.length ) { 712 // $.getScript("//maps.google.com/maps/api/js?key=AIzaSyCxte-UqwgitfI6KOJyk9C4I5lMPRZeuAQ&sensor=false&libraries=geometry,places&v=3.7", function () { 713 // var head = document.getElementsByTagName('head')[0], 714 // insertBefore = head.insertBefore; 715 716 717 // head.insertBefore = function (newElement, referenceElement) { 718 // if (newElement.href && newElement.href.indexOf('//fonts.googleapis.com/css?family=Roboto') !== -1 || newElement.innerHTML.indexOf('gm-style') !== -1) { 719 // return; 720 // } 721 // insertBefore.call(head, newElement, referenceElement); 722 // }; 723 724 // for (var i = 0; i < plugins.rdGoogleMaps.length; i++) {
725 // var $googleMapItem = $(plugins.rdGoogleMaps[i]); 726 727 // lazyInit($googleMapItem, $.proxy(function () { 728 // var $this = $(this), 729 // styles = $this.attr("data-styles"); 730 731 // $this.googleMap({ 732 // marker: { 733 // basic: $this.data('marker'), 734 // active: $this.data('marker-active') 735 // }, 736 // styles: styles ? JSON.parse(styles) : [], 737 // onInit: function (map) { 738 // var inputAddress = $('#address'); 739 740 741 // if (inputAddress.length) { 742 // var input = inputAddress.text(); 743 // var geocoder = new google.maps.Geocoder(); 744 // var marker = new google.maps.Marker( 745 // { 746 // map: map, 747 // icon: $this.data('marker-url') 748 // } 749 // ); 750 751 // var autocomplete = new google.maps.places.Autocomplete(inputAddress[0]); 752 // autocomplete.bindTo('bounds', map); 753 // inputAddress.attr('placeholder', ''); 754 // inputAddress.on('change', function () { 755 // $("#rd-google-map-address-submit").trigger('click'); 756 // }); 757 // inputAddress.on('keydown', function (e) { 758 // if (e.keyCode === 13) { 759 // $("#rd-google-map-address-submit").trigger('click'); 760 // } 761 // }); 762 763 764 // //$("#rd-google-map-address-submit").on('click', function (e) { 765 // // e.preventDefault(); 766 // // var address = input.val(); 767 // // geocoder.geocode({'address': address}, function (results, status) { 768 // // if (status === google.maps.GeocoderStatus.OK) { 769 // // var latitude = results[0].geometry.location.lat(); 770 // // var longitude = results[0].geometry.location.lng(); 771 772 // // map.setCenter(new google.maps.LatLng( 773 // // parseFloat(latitude), 774 // // parseFloat(longitude) 775 // // )); 776 // // marker.setPosition(new google.maps.LatLng( 777 // // parseFloat(latitude), 778 // // parseFloat(longitude) 779 // // )) 780 // // } 781 // // }); 782 // //}); 783 // } 784 // } 785 // }); 786 // }, $googleMapItem)); 787 // } 788 // }); 789 //} 790 791 // Add custom styling options for input[type="radio"] 792 if (plugins.radio.length) { 793 for (var i = 0; i < plugins.radio.length; i++) { 794 $(plugins.radio[i]).addClass("radio-custom").after("<span class='radio-custom-dummy'></span>") 795 } 796 } 797 798 // Add custom styling options for input[type="checkbox"] 799 if (plugins.checkbox.length) { 800 for (var i = 0; i < plugins.checkbox.length; i++) { 801 $(plugins.checkbox[i]).addClass("checkbox-custom").after("<span class='checkbox-custom-dummy'></span>") 802 } 803 } 804 805 // UI To Top 806 if (isDesktop && !isNoviBuilder) { 807 $().UItoTop({ 808 easingType: 'easeOutQuad', 809 containerClass: 'ui-to-top fa fa-angle-up' 810 }); 811 } 812 813 // RD Navbar 814 if (plugins.rdNavbar.length) { 815 var aliaces, i, j, len, value, values, responsiveNavbar; 816 817 aliaces = ["-", "-sm-", "-md-", "-lg-", "-xl-", "-xxl-"]; 818 values = [0, 576, 768, 992, 1200, 1600]; 819 responsiveNavbar = {}; 820 821 for (i = j = 0, len = values.length; j < len; i = ++j) { 822 value = values[i]; 823 if (!responsiveNavbar[values[i]]) { 824 responsiveNavbar[values[i]] = {}; 825 } 826 if (plugins.rdNavbar.attr('data' + aliaces[i] + 'layout')) { 827 responsiveNavbar[values[i]].layout = plugins.rdNavbar.attr('data' + aliaces[i] + 'layout'); 828 } 829 if (plugins.rdNavbar.attr('data' + aliaces[i] + 'device-layout')) { 830 responsiveNavbar[values[i]]['deviceLayout'] = plugins.rdNavbar.attr('data' + aliaces[i] + 'device-layout'); 831 } 832 if (plugins.rdNavbar.attr('data' + aliaces[i] + 'hover-on')) { 833 responsiveNavbar[values[i]]['focusOnHover'] = plugins.rdNavbar.attr('data' + aliaces[i] + 'hover-on') === 'true'; 834 } 835 if (plugins.rdNavbar.attr('data' + aliaces[i] + 'auto-height')) { 836 responsiveNavbar[values[i]]['autoHeight'] = plugins.rdNavbar.attr('data' + aliaces[i] + 'auto-height') === 'true'; 837 } 838 839 if (isNoviBuilder) { 840 responsiveNavbar[values[i]]['stickUp'] = false; 841 } else if (plugins.rdNavbar.attr('data' + aliaces[i] + 'stick-up')) { 842 responsiveNavbar[values[i]]['stickUp'] = plugins.rdNavbar.attr('data' + aliaces[i] + 'stick-up') === 'true'; 843 } 844 845 if (plugins.rdNavbar.attr('data' + aliaces[i] + 'stick-up-offset')) { 846 responsiveNavbar[values[i]]['stickUpOffset'] = plugins.rdNavbar.attr('data' + aliaces[i] + 'stick-up-offset'); 847 } 848 } 849 850 851 plugins.rdNavbar.RDNavbar({ 852 anchorNav: !isNoviBuilder, 853 stickUpClone: (plugins.rdNavbar.attr("data-stick-up-clone") && !isNoviBuilder) ? plugins.rdNavbar.attr("data-stick-up-clone")
853=== 'true' : false, 854 responsive: responsiveNavbar, 855 callbacks: { 856 onStuck: function () { 857 var navbarSearch = this.$element.find('.rd-search input'); 858 859 if (navbarSearch) { 860 navbarSearch.val('').trigger('propertychange'); 861 } 862 }, 863 onDropdownOver: function () { 864 return !isNoviBuilder; 865 }, 866 onUnstuck: function () { 867 if (this.$clone === null) 868 return; 869 870 var navbarSearch = this.$clone.find('.rd-search input'); 871 872 if (navbarSearch) { 873 navbarSearch.val('').trigger('propertychange'); 874 navbarSearch.trigger('blur'); 875 } 876 877 } 878 } 879 }); 880 881 882 if (plugins.rdNavbar.attr("data-body-class")) { 883 document.body.className += ' ' + plugins.rdNavbar.attr("data-body-class"); 884 } 885 } 886 887 // RD Search 888 if (plugins.search.length || plugins.searchResults) { 889 var handler = "bat/rd-search.php"; 890 var defaultTemplate = '<h5 class="search-title"><a target="_top" href="#{href}" class="search-link">#{title}</a></h5>' + 891 '<p>...#{token}...</p>' + 892 '<p class="match"><em>Terms matched: #{count} - URL: #{href}</em></p>'; 893 var defaultFilter = '*.html'; 894 895 if (plugins.search.length) { 896 for (var i = 0; i < plugins.search.length; i++) { 897 var searchItem = $(plugins.search[i]), 898 options = { 899 element: searchItem, 900 filter: (searchItem.attr('data-search-filter')) ? searchItem.attr('data-search-filter') : defaultFilter, 901 template: (searchItem.attr('data-search-template')) ? searchItem.attr('data-search-template') : defaultTemplate, 902 live: (searchItem.attr('data-search-live')) ? searchItem.attr('data-search-live') : false, 903 liveCount: (searchItem.attr('data-search-live-count')) ? parseInt(searchItem.attr('data-search-live'), 10) : 4, 904 current: 0, processed: 0, timer: {} 905 }; 906 907 var $toggle = $('.rd-navbar-search-toggle'); 908 if ($toggle.length) { 909 $toggle.on('click', (function (searchItem) { 910 return function () { 911 if (!($(this).hasClass('active'))) { 912 searchItem.find('input').val('').trigger('propertychange'); 913 } 914 } 915 })(searchItem)); 916 } 917 918 if (options.live) { 919 var clearHandler = false; 920 921 searchItem.find('input').on("input propertychange", $.proxy(function () { 922 this.term = this.element.find('input').val().trim(); 923 this.spin = this.element.find('.input-group-addon'); 924 925 clearTimeout(this.timer); 926 927 if (this.term.length > 2) { 928 this.timer = setTimeout(liveSearch(this), 200); 929 930 if (clearHandler === false) { 931 clearHandler = true; 932 933 $body.on("click", function (e) { 934 if ($(e.toElement).parents('.rd-search').length === 0) { 935 $('#rd-search-results-live').addClass('cleared').html(''); 936 } 937 }) 938 } 939 940 } else if (this.term.length === 0) { 941 $('#' + this.live).addClass('cleared').html(''); 942 } 943 }, options, this)); 944 } 945 946 searchItem.submit($.proxy(function () { 947 $('<input />').attr('type', 'hidden') 948 .attr('name', "filter") 949 .attr('value', this.filter) 950 .appendTo(this.element); 951 return true; 952 }, options, this)) 953 } 954 } 955 956 if (plugins.searchResults.length) { 957 var regExp = /\?.*s=([^&]+)\&filter=([^&]+)/g; 958 var match = regExp.exec(location.search); 959 960 if (match !== null) { 961 $.get(handler, { 962 s: decodeURI(match[1]), 963 dataType: "html", 964 filter: match[2], 965 template: defaultTemplate, 966 live: '' 967 }, function (data) { 968 plugins.searchResults.html(data); 969 }) 970 } 971 } 972 } 973 974 // Add class in viewport 975 if (plugins.viewAnimate.length) { 976 for (var i = 0; i < plugins.viewAnimate.length; i++) { 977 var $view = $(plugins.viewAnimate[i]).not('.active'); 978 $document.on("scroll", $.proxy(function () { 979 if (isScrolledIntoView(this)) { 980 this.addClass("active"); 981 } 982 }, $view)) 983 .trigger("scroll"); 984 } 985 } 986 987 // Swiper 988 if (plugins.swiper.length) { 989 for (var i = 0; i < plugins.swiper.length; i++) { 990 var s = $(plugins.swiper[i]); 991 var pag = s.find(".swiper-pagination"), 992 next = s.find(".swiper-button-next"), 993 prev = s.find(".swiper-button-prev"), 994 bar = s.find(".swiper-scrollbar"), 995 swiperSlide = s.find(".swiper-slide"), 996 autoplay = false; 997 998 for (var j = 0; j < swiperSlide.length; j++) { 999 var $this = $(swiperSlide[j]), 1000 url; 1001
1002 if (url = $this.attr("data-slide-bg")) { 1003 $this.css({ 1004 "background-image": "url(" + url + ")", 1005 "background-size": "cover" 1006 }) 1007 } 1008 } 1009 1010 swiperSlide.end() 1011 .find("[data-caption-animate]") 1012 .addClass("not-animated") 1013 .end(); 1014 1015 s.swiper({ 1016 autoplay: s.attr('data-autoplay') ? s.attr('data-autoplay') === "false" ? undefined : s.attr('data-autoplay') : 5000, 1017 direction: s.attr('data-direction') ? s.attr('data-direction') : "horizontal", 1018 effect: s.attr('data-slide-effect') ? s.attr('data-slide-effect') : "slide", 1019 speed: s.attr('data-slide-speed') ? s.attr('data-slide-speed') : 600, 1020 keyboardControl: s.attr('data-keyboard') === "true", 1021 mousewheelControl: s.attr('data-mousewheel') === "true", 1022 mousewheelReleaseOnEdges: s.attr('data-mousewheel-release') === "true", 1023 nextButton: next.length ? next.get(0) : null, 1024 prevButton: prev.length ? prev.get(0) : null, 1025 pagination: pag.length ? pag.get(0) : null, 1026 paginationClickable: pag.length ? pag.attr("data-clickable") !== "false" : false, 1027 paginationBulletRender: pag.length ? pag.attr("data-index-bullet") === "true" ? function (swiper, index, className) { 1028 return '<span class="' + className + '">' + (index + 1) + '</span>'; 1029 } : null : null, 1030 scrollbar: bar.length ? bar.get(0) : null, 1031 scrollbarDraggable: bar.length ? bar.attr("data-draggable") !== "false" : true, 1032 scrollbarHide: bar.length ? bar.attr("data-draggable") === "false" : false, 1033 loop: isNoviBuilder ? false : s.attr('data-loop') !== "false", 1034 simulateTouch: s.attr('data-simulate-touch') && !isNoviBuilder ? s.attr('data-simulate-touch') === "true" : false, 1035 onTransitionStart: function (swiper) { 1036 toggleSwiperInnerVideos(swiper); 1037 }, 1038 onTransitionEnd: function (swiper) { 1039 toggleSwiperCaptionAnimation(swiper); 1040 }, 1041 onInit: function (swiper) { 1042 toggleSwiperInnerVideos(swiper); 1043 toggleSwiperCaptionAnimation(swiper); 1044 initLightGalleryItem(s.find('[data-lightgallery="item"]'), 'lightGallery-in-carousel'); 1045 getSwiperActiveSlideNumber( swiper ); 1046 }, 1047 onSlideChangeStart: function( swiper ) { 1048 getSwiperActiveSlideNumber( swiper ); 1049 } 1050 }); 1051 1052 $window.on("resize", (function (s) { 1053 return function () { 1054 var mh = getSwiperHeight(s, "min-height"), 1055 h = getSwiperHeight(s, "height"); 1056 if (h) { 1057 s.css("height", mh ? mh > h ? mh : h : h); 1058 } 1059 } 1060 })(s)).trigger("resize"); 1061 } 1062 } 1063 1064 // Owl carousel 1065 if (plugins.owl.length) { 1066 for (var i = 0; i < plugins.owl.length; i++) { 1067 var c = $(plugins.owl[i]); 1068 plugins.owl[i].owl = c; 1069 1070 initOwlCarousel(c); 1071 } 1072 } 1073 1074 // Isotope 1075 if (plugins.isotope.length) { 1076 var isogroup = []; 1077 for (var i = 0; i < plugins.isotope.length; i++) { 1078 var isotopeItem = plugins.isotope[i], 1079 isotopeInitAttrs = { 1080 itemSelector: '.isotope-item', 1081 layoutMode: isotopeItem.getAttribute('data-isotope-layout') ? isotopeItem.getAttribute('data-isotope-layout') : 'masonry', 1082 filter: '*' 1083 }; 1084 1085 if (isotopeItem.getAttribute('data-column-width')) { 1086 isotopeInitAttrs.masonry = { 1087 columnWidth: parseFloat(isotopeItem.getAttribute('data-column-width')) 1088 }; 1089 } else if (isotopeItem.getAttribute('data-column-class')) { 1090 isotopeInitAttrs.masonry = { 1091 columnWidth: isotopeItem.getAttribute('data-column-class') 1092 }; 1093 } 1094 1095 var iso = new Isotope(isotopeItem, isotopeInitAttrs); 1096 isogroup.push(iso); 1097 } 1098 1099 1100 setTimeout(function () { 1101 for (var i = 0; i < isogroup.length; i++) { 1102 isogroup[i].element.className += " isotope--loaded"; 1103 isogroup[i].layout(); 1104 } 1105 }, 200); 1106 1107 var resizeTimout; 1108 1109 $("[data-isotope-filter]").on("click", function (e) { 1110 e.preventDefault(); 1111 var filter = $(this); 1112 clearTimeout(resizeTimout); 1113 filter.parents(".isotope-filters").find('.active').removeClass("active"); 1114 filter.addClass("active"); 1115 var iso = $('.isotope[data-isotope-group="' + this.getAttribute("data-isotope-group") + '"]'), 1116 isotopeAttrs = { 1117 itemSelector: '.isotope-item', 1118 layoutMode: iso.attr('data-isotope-layout') ? iso.attr('data-isotope-layout') : 'masonry', 1119 filter: this.getAttribute("data-isotope-filter") === '*' ? '*' : '[data-filter*="' + this.getAttribute("data-isotope-filter") + '"]' 1120 }; 1121 if (iso.attr('data-column-width')) { 1122 isotopeAttrs.masonry = { 1123 columnWidth: parseFloat(iso.attr('data-column-width')) 1124 }; 1125 } else if (iso.attr('data-column-class')) { 1126 isotopeAttrs.masonry = { 1127 columnWidth: iso.attr('data-column-class') 1128 }; 1129 } 1130 iso.isotope(isotopeAttrs); 1131 }).eq(0).trigger("click") 1132 } 1133 1134 // WOW 1135 if ($html.hasClass("wow-animation") && plugins.wow.length && !isNoviBuilder && isDesktop) { 1136 new WOW().init(); 1137 } 1138 1139 // RD Input Label 1140 if (plugins.rdInputLabel.length) { 1141 plugins.rdInputLabel.RDInputLabel(); 1142 } 1143 1144 // Regula 1145 if (plugins.regula.length) { 1146 attachFormValidator(plugins.regula); 1147 } 1148 1149 // MailChimp Ajax subscription 1150 if (plugins.mailchimp.length) { 1151 for (i = 0; i < plugins.mailchimp.length; i++) { 1152 var $mailchimpItem = $(plugins.mailchimp[i]), 1153 $email = $mailchimpItem.find('input[type="email"]'); 1154 1155 // Required by MailChimp 1156 $mailchimpItem.attr('novalidate', 'true'); 1157 $email.attr('name', 'EMAIL'); 1158 1159 $mailchimpItem.on('submit', $.proxy( function ( $email, event ) { 1160 event.preventDefault(); 1161 1162 var $this = this; 1163 1164 var data = {}, 1165 url = $this.attr('action').replace('/post?', '/post-json?').concat('&c=?'), 1166 dataArray = $this.serializeArray(), 1167 $output = $("#" + $this.attr("data-form-output")); 1168 1169 for (i = 0; i < dataArray.length; i++) { 1170 data[dataArray[i].name] = dataArray[i].value; 1171 } 1172 1173 $.ajax({
1174 data: data, 1175 url: url, 1176 dataType: 'jsonp', 1177 error: function (resp, text) { 1178 $output.html('Server error: ' + text); 1179 1180 setTimeout(function () { 1181 $output.removeClass("active"); 1182 }, 4000); 1183 }, 1184 success: function (resp) { 1185 $output.html(resp.msg).addClass('active'); 1186 $email[0].value = ''; 1187 var $label = $('[for="'+ $email.attr( 'id' ) +'"]'); 1188 if ( $label.length ) $label.removeClass( 'focus not-empty' ); 1189 1190 setTimeout(function () { 1191 $output.removeClass("active"); 1192 }, 6000); 1193 }, 1194 beforeSend: function (data) { 1195 var isNoviBuilder = window.xMode; 1196 1197 var isValidated = (function () { 1198 var results, errors = 0; 1199 var elements = $this.find('[data-constraints]'); 1200 var captcha = null; 1201 if (elements.length) { 1202 for (var j = 0; j < elements.length; j++) { 1203 1204 var $input = $(elements[j]); 1205 if ((results = $input.regula('validate')).length) { 1206 for (var k = 0; k < results.length; k++) { 1207 errors++; 1208 $input.siblings(".form-validation").text(results[k].message).parent().addClass("has-error"); 1209 } 1210 } else { 1211 $input.siblings(".form-validation").text("").parent().removeClass("has-error") 1212 } 1213 } 1214 1215 if (captcha) { 1216 if (captcha.length) { 1217 return validateReCaptcha(captcha) && errors === 0 1218 } 1219 } 1220 1221 return errors === 0; 1222 } 1223 return true; 1224 })(); 1225 1226 // Stop request if builder or inputs are invalide 1227 if (isNoviBuilder || !isValidated) 1228 return false; 1229 1230 $output.html('Submitting...').addClass('active'); 1231 } 1232 }); 1233 1234 return false; 1235 }, $mailchimpItem, $email )); 1236 } 1237 } 1238 1239 // Campaign Monitor ajax subscription 1240 if (plugins.campaignMonitor.length) { 1241 for (i = 0; i < plugins.campaignMonitor.length; i++) { 1242 var $campaignItem = $(plugins.campaignMonitor[i]); 1243 1244 $campaignItem.on('submit', $.proxy(function (e) { 1245 var data = {}, 1246 url = this.attr('action'), 1247 dataArray = this.serializeArray(), 1248 $output = $("#" + plugins.campaignMonitor.attr("data-form-output")), 1249 $this = $(this); 1250 1251 for (i = 0; i < dataArray.length; i++) { 1252 data[dataArray[i].name] = dataArray[i].value; 1253 } 1254 1255 $.ajax({
1256 data: data, 1257 url: url, 1258 dataType: 'jsonp', 1259 error: function (resp, text) { 1260 $output.html('Server error: ' + text); 1261 1262 setTimeout(function () { 1263 $output.removeClass("active"); 1264 }, 4000); 1265 }, 1266 success: function (resp) { 1267 $output.html(resp.Message).addClass('active'); 1268 1269 setTimeout(function () { 1270 $output.removeClass("active"); 1271 }, 6000); 1272 }, 1273 beforeSend: function (data) { 1274 // Stop request if builder or inputs are invalide 1275 if (isNoviBuilder || !isValidated($this.find('[data-constraints]'))) 1276 return false; 1277 1278 $output.html('Submitting...').addClass('active'); 1279 } 1280 }); 1281 1282 // Clear inputs after submit 1283 var inputs = $this[0].getElementsByTagName('input'); 1284 for (var i = 0; i < inputs.length; i++) { 1285 inputs[i].value = ''; 1286 var label = document.querySelector( '[for="'+ inputs[i].getAttribute( 'id' ) +'"]' ); 1287 if( label ) label.classList.remove( 'focus', 'not-empty' ); 1288 } 1289 1290 return false; 1291 }, $campaignItem)); 1292 } 1293 } 1294 1295 // RD Mailform 1296 if (plugins.rdMailForm.length) { 1297 var i, j, k, 1298 msg = { 1299 'MF000': 'Successfully sent!', 1300 'MF001': 'Recipients are not set!', 1301 'MF002': 'Form will not work locally!', 1302 'MF003': 'Please, define email field in your form!', 1303 'MF004': 'Please, define type of your form!', 1304 'MF254': 'Something went wrong with PHPMailer!', 1305 'MF255': 'Aw, snap! Something went wrong.' 1306 }; 1307 1308 for (i = 0; i < plugins.rdMailForm.length; i++) { 1309 var $form = $(plugins.rdMailForm[i]), 1310 formHasCaptcha = false; 1311 1312 $form.attr('novalidate', 'novalidate').ajaxForm({ 1313 data: { 1314 "form-type": $form.attr("data-form-type") || "contact", 1315 "counter": i 1316 }, 1317 beforeSubmit: function (arr, $form, options) { 1318 if (isNoviBuilder) 1319 return; 1320 1321 var form = $(plugins.rdMailForm[this.extraData.counter]), 1322 inputs = form.find("[data-constraints]"), 1323 output = $("#" + form.attr("data-form-output")), 1324 captcha = form.find('.recaptcha'), 1325 captchaFlag = true; 1326 1327 output.removeClass("active error success"); 1328 1329 if (isValidated(inputs, captcha)) { 1330 1331 // veify reCaptcha 1332 if (captcha.length) { 1333 var captchaToken = captcha.find('.g-recaptcha-response').val(), 1334 captchaMsg = { 1335 'CPT001': 'Please, setup you "site key" and "secret key" of reCaptcha', 1336 'CPT002': 'Something wrong with google reCaptcha' 1337 }; 1338 1339 formHasCaptcha = true; 1340 1341 $.ajax({
1342 method: "POST", 1343 url: "bat/reCaptcha.php", 1344 data: {'g-recaptcha-response': captchaToken}, 1345 async: false 1346 }) 1347 .done(function (responceCode) { 1348 if (responceCode !== 'CPT000') { 1349 if (output.hasClass("snackbars")) { 1350 output.html('<p><span class="icon text-middle mdi mdi-check icon-xxs"></span><span>' + captchaMsg[responceCode] + '</span></p>') 1351 1352 setTimeout(function () { 1353 output.removeClass("active"); 1354 }, 3500); 1355 1356 captchaFlag = false; 1357 } else { 1358 output.html(captchaMsg[responceCode]); 1359 } 1360 1361 output.addClass("active"); 1362 } 1363 }); 1364 } 1365 1366 if (!captchaFlag) { 1367 return false; 1368 } 1369 1370 form.addClass('form-in-process'); 1371 1372 if (output.hasClass("snackbars")) { 1373 output.html('<p><span class="icon text-middle fa fa-circle-o-notch fa-spin icon-xxs"></span><span>Sending</span></p>'); 1374 output.addClass("active"); 1375 } 1376 } else { 1377 return false; 1378 } 1379 }, 1380 error: function (result) { 1381 if (isNoviBuilder) 1382 return; 1383 1384 var output = $("#" + $(plugins.rdMailForm[this.extraData.counter]).attr("data-form-output")), 1385 form = $(plugins.rdMailForm[this.extraData.counter]); 1386 1387 output.text(msg[result]); 1388 form.removeClass('form-in-process'); 1389 1390 if (formHasCaptcha) { 1391 grecaptcha.reset(); 1392 } 1393 }, 1394 success: function (result) { 1395 if (isNoviBuilder) 1396 return; 1397 1398 var form = $(plugins.rdMailForm[this.extraData.counter]), 1399 output = $("#" + form.attr("data-form-output")), 1400 select = form.find('select'); 1401 1402 form 1403 .addClass('success') 1404 .removeClass('form-in-process'); 1405 1406 if (formHasCaptcha) { 1407 grecaptcha.reset(); 1408 } 1409 1410 result = result.length === 5 ? result : 'MF255'; 1411 output.text(msg[result]); 1412 1413 if (result === "MF000") { 1414 if (output.hasClass("snackbars")) { 1415 output.html('<p><span class="icon text-middle mdi mdi-check icon-xxs"></span><span>' + msg[result] + '</span></p>'); 1416 } else { 1417 output.addClass("active success"); 1418 } 1419 } else { 1420 if (output.hasClass("snackbars")) { 1421 output.html(' <p class="snackbars-left"><span class="icon icon-xxs mdi mdi-alert-outline text-middle"></span><span>' + msg[result] + '</span></p>'); 1422 } else { 1423 output.addClass("active error"); 1424 } 1425 } 1426 1427 form.clearForm(); 1428 1429 if (select.length) { 1430 select.select2("val", ""); 1431 } 1432 1433 form.find('input, textarea').trigger('blur'); 1434 1435 setTimeout(function () { 1436 output.removeClass("active error success"); 1437 form.removeClass('success'); 1438 }, 3500); 1439 } 1440 }); 1441 } 1442 } 1443 1444 // lightGallery 1445 if (plugins.lightGallery.length) { 1446 for (var i = 0; i < plugins.lightGallery.length; i++) { 1447 initLightGallery(plugins.lightGallery[i]); 1448 } 1449 } 1450 1451 // lightGallery item 1452 if (plugins.lightGalleryItem.length) { 1453 for (var i = 0; i < plugins.lightGalleryItem.length; i++) { 1454 initLightGalleryItem(plugins.lightGalleryItem[i]); 1455 } 1456 } 1457 1458 // Dynamic lightGallery 1459 if (plugins.lightDynamicGalleryItem.length) { 1460 for (var i = 0; i < plugins.lightDynamicGalleryItem.length; i++) { 1461 initDynamicLightGallery(plugins.lightDynamicGalleryItem[i]); 1462 } 1463 } 1464 1465 // Custom Toggles 1466 if (plugins.customToggle.length) { 1467 for (var i = 0; i < plugins.customToggle.length; i++) { 1468 var $this = $(plugins.customToggle[i]); 1469 1470 $this.on('click', $.proxy(function (event) { 1471 event.preventDefault(); 1472 1473 var $ctx = $(this); 1474 $($ctx.attr('data-custom-toggle')).add(this).toggleClass('active'); 1475 }, $this)); 1476 1477 if ($this.attr("data-custom-toggle-hide-on-blur") === "true") { 1478 $body.on("click", $this, function (e) { 1479 if (e.target !== e.data[0] 1480 && $(e.data.attr('data-custom-toggle')).find($(e.target)).length 1481 && e.data.find($(e.target)).length === 0) { 1482 $(e.data.attr('data-custom-toggle')).add(e.data[0]).removeClass('active'); 1483 } 1484 }) 1485 } 1486
1487 if ($this.attr("data-custom-toggle-disable-on-blur") === "true") { 1488 $body.on("click", $this, function (e) { 1489 if (e.target !== e.data[0] && $(e.data.attr('data-custom-toggle')).find($(e.target)).length === 0 && e.data.find($(e.target)).length === 0) { 1490 $(e.data.attr('data-custom-toggle')).add(e.data[0]).removeClass('active'); 1491 } 1492 }) 1493 } 1494 } 1495 } 1496 1497 // jQuery Count To 1498 if (plugins.counter.length) { 1499 for (var i = 0; i < plugins.counter.length; i++) { 1500 var $counterNotAnimated = $(plugins.counter[i]).not('.animated'); 1501 $document.on("scroll", $.proxy(function () { 1502 var $this = this; 1503 1504 if ((!$this.hasClass("animated")) && (isScrolledIntoView($this))) { 1505 $this.countTo({ 1506 refreshInterval: 40, 1507 from: 0, 1508 to: parseInt($this.text(), 10), 1509 speed: $this.attr("data-speed") || 1000 1510 }); 1511 $this.addClass('animated'); 1512 } 1513 }, $counterNotAnimated)) 1514 .trigger("scroll"); 1515 } 1516 } 1517 1518 // TimeCircles 1519 if (plugins.dateCountdown.length) { 1520 for (var i = 0; i < plugins.dateCountdown.length; i++) { 1521 var dateCountdownItem = $(plugins.dateCountdown[i]), 1522 time = { 1523 "Days": { 1524 "text": "Days", 1525 "show": true, 1526 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1527 }, 1528 "Hours": { 1529 "text": "Hours", 1530 "show": true, 1531 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1532 }, 1533 "Minutes": { 1534 "text": "Minutes", 1535 "show": true, 1536 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1537 }, 1538 "Seconds": { 1539 "text": "Seconds", 1540 "show": true, 1541 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1542 } 1543 }; 1544 1545 dateCountdownItem.TimeCircles({ 1546 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "rgba(247, 247, 247, 1)", 1547 animation: "smooth", 1548 bg_width: dateCountdownItem.attr("data-bg-width") ? dateCountdownItem.attr("data-bg-width") : 0.6, 1549 circle_bg_color: dateCountdownItem.attr("data-bg") ? dateCountdownItem.attr("data-bg") : "rgba(0, 0, 0, 1)", 1550 fg_width: dateCountdownItem.attr("data-width") ? dateCountdownItem.attr("data-width") : 0.03 1551 }); 1552 1553 (function (dateCountdownItem, time) { 1554 $window.on('load resize orientationchange', function () { 1555 if (window.innerWidth < 479) { 1556 dateCountdownItem.TimeCircles({ 1557 time: { 1558 "Days": { 1559 "text": "Days", 1560 "show": true, 1561 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1562 }, 1563 "Hours": { 1564 "text": "Hours", 1565 "show": true, 1566 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1567 }, 1568 "Minutes": { 1569 "text": "Minutes", 1570 "show": true, 1571 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1572 }, 1573 Seconds: { 1574 "text": "Seconds", 1575 show: false, 1576 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1577 } 1578 } 1579 }).rebuild(); 1580 } else if (window.innerWidth < 767) { 1581 dateCountdownItem.TimeCircles({ 1582 time: { 1583 "Days": { 1584 "text": "Days", 1585 "show": true, 1586 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1587 }, 1588 "Hours": { 1589 "text": "Hours", 1590 "show": true, 1591 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1592 }, 1593 "Minutes": { 1594 "text": "Minutes", 1595 "show": true, 1596 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1597 }, 1598 Seconds: { 1599 text: '', 1600 show: false, 1601 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1602 } 1603 } 1604 }).rebuild(); 1605 } else { 1606 dateCountdownItem.TimeCircles({time: time}).rebuild(); 1607 } 1608 });
1609 1610 $window.trigger('resize'); 1611 })(dateCountdownItem, time); 1612 } 1613 } 1614 1615 // Circle Progress 1616 if (plugins.circleProgress.length) { 1617 for (var i = 0; i < plugins.circleProgress.length; i++) { 1618 var circleProgressItem = $(plugins.circleProgress[i]); 1619 $document.on("scroll", $.proxy(function () { 1620 var $this = $(this); 1621 1622 if (!$this.hasClass('animated') && isScrolledIntoView($this)) { 1623 1624 var arrayGradients = $this.attr('data-gradient').split(","); 1625 1626 $this.circleProgress({ 1627 value: $this.attr('data-value'), 1628 size: $this.attr('data-size') ? $this.attr('data-size') : 175, 1629 fill: {gradient: arrayGradients, gradientAngle: Math.PI / 4}, 1630 startAngle: -Math.PI / 4 * 2, 1631 emptyFill: $this.attr('data-empty-fill') ? $this.attr('data-empty-fill') : "rgb(245,245,245)", 1632 thickness: $this.attr('data-thickness') ? parseInt($this.attr('data-thickness'), 10) : 10 1633 1634 }).on('circle-animation-progress', function (event, progress, stepValue) { 1635 $(this).find('span').text(String(stepValue.toFixed(2)).replace('0.', '').replace('1.', '1')); 1636 }); 1637 $this.addClass('animated'); 1638 } 1639 }, circleProgressItem)) 1640 .trigger("scroll"); 1641 } 1642 } 1643 1644 // Linear Progress bar 1645 if (plugins.progressLinear.length) { 1646 for (i = 0; i < plugins.progressLinear.length; i++) { 1647 var progressBar = $(plugins.progressLinear[i]); 1648 $window.on("scroll load", $.proxy(function () { 1649 var bar = $(this); 1650 if (!bar.hasClass('animated-first') && isScrolledIntoView(bar)) { 1651 var end = parseInt($(this).find('.progress-value').text(), 10); 1652 bar.find('.progress-bar-linear').css({width: end + '%'}); 1653 bar.find('.progress-value').countTo({ 1654 refreshInterval: 40, 1655 from: 0, 1656 to: end, 1657 speed: 500 1658 }); 1659 bar.addClass('animated-first'); 1660 } 1661 }, progressBar)); 1662 } 1663 } 1664 1665 // Material Parallax 1666 if (plugins.materialParallax.length) { 1667 if (!isNoviBuilder && !isIE && !isMobile) { 1668 plugins.materialParallax.parallax(); 1669 1670 // heavy pages fix 1671 $window.on('load', function () { 1672 setTimeout(function () { 1673 $window.scroll(); 1674 }, 500); 1675 }); 1676 } else { 1677 for (var i = 0; i < plugins.materialParallax.length; i++) { 1678 var parallax = $(plugins.materialParallax[i]), 1679 imgPath = parallax.data("parallax-img"); 1680 1681 parallax.css({ 1682 "background-image": 'url(' + imgPath + ')', 1683 "background-size": "cover" 1684 }); 1685 } 1686 } 1687 } 1688 1689 // JQuery mousewheel plugin 1690 if (plugins.scroller.length) { 1691 for (var i = 0; i < plugins.scroller.length; i++) { 1692 var scrollerItem = $(plugins.scroller[i]); 1693 1694 scrollerItem.mCustomScrollbar({ 1695 theme: scrollerItem.attr('data-theme') ? scrollerItem.attr('data-theme') : 'minimal', 1696 scrollInertia: 100, 1697 scrollButtons: {enable: false} 1698 }); 1699 } 1700 } 1701 1702 // parallax scroll 1703 if($('[data-parallax-scroll]').length && !isNoviBuilder && !isMobile){ 1704 ParallaxScroll.init(); 1705 } 1706 1707 /** 1708 * Slick carousel 1709 * @description Enable Slick carousel plugin 1710 */ 1711 if (plugins.slick.length) { 1712 for (var i = 0; i < plugins.slick.length; i++) { 1713 var $slickItem = $(plugins.slick[i]); 1714 1715 $slickItem.on('init', function (slick) { 1716 initLightGallery($('[data-lightgallery="group-slick"]'), 'lightGallery-in-carousel'); 1717 initLightGallery($('[data-lightgallery="item-slick"]'), 'lightGallery-in-carousel'); 1718 }); 1719 1720 $slickItem.slick({ 1721 slidesToScroll: parseInt($slickItem.attr('data-slide-to-scroll'), 10) || 1, 1722 asNavFor: $slickItem.attr('data-for') || false, 1723 dots: $slickItem.attr("data-dots") === "true", 1724 infinite: isNoviBuilder ? false : $slickItem.attr("data-loop") === "true", 1725 focusOnSelect: true, 1726 arrows: $slickItem.attr("data-arrows") === "true", 1727 swipe: $slickItem.attr("data-swipe") === "true", 1728 autoplay: $slickItem.attr("data-autoplay") === "true", 1729 vertical: $slickItem.attr("data-vertical") === "true", 1730 centerMode: $slickItem.attr("data-center-mode") === "true", 1731 centerPadding: $slickItem.attr("data-center-padding") ? $slickItem.attr("data-center-padding") : '0.50', 1732 mobileFirst: true, 1733 responsive: [ 1734 { 1735 breakpoint: 0, 1736 settings: { 1737 slidesToShow: parseInt($slickItem.attr('data-items'), 10) || 1 1738 } 1739 }, 1740 { 1741 breakpoint: 575, 1742 settings: { 1743 slidesToShow: parseInt($slickItem.attr('data-sm-items'), 10) || 1 1744 } 1745 }, 1746 { 1747 breakpoint: 767, 1748 settings: { 1749 slidesToShow: parseInt($slickItem.attr('data-md-items'), 10) || 1 1750 } 1751 }, 1752 { 1753 breakpoint: 991, 1754 settings: { 1755 slidesToShow: parseInt($slickItem.attr('data-lg-items'), 10) || 1 1756 } 1757 }, 1758 { 1759 breakpoint: 1199, 1760 settings: { 1761 slidesToShow: parseInt($slickItem.attr('data-xl-items'), 10) || 1 1762 } 1763 } 1764 ] 1765 }) 1766 .on('afterChange', function (event, slick, currentSlide, nextSlide) { 1767 var $this = $(this), 1768 childCarousel = $this.attr('data-child'); 1769 1770 if (childCarousel) { 1771 $(childCarousel + ' .slick-slide').removeClass('slick-current'); 1772 $(childCarousel + ' .slick-slide').eq(currentSlide).addClass('slick-current'); 1773 } 1774 });
1775 1776 } 1777 } 1778 1779 /** 1780 * Select2 1781 * @description Enables select2 plugin 1782 */ 1783 if (plugins.selectFilter.length) { 1784 var i; 1785 for (i = 0; i < plugins.selectFilter.length; i++) { 1786 var select = $(plugins.selectFilter[i]); 1787 1788 select.select2({ 1789 placeholder: select.attr("data-placeholder") ? select.attr("data-placeholder") : false, 1790 minimumResultsForSearch: select.attr("data-minimum-results-search") ? select.attr("data-minimum-results-search") : 10, 1791 maximumSelectionSize: 3 1792 }); 1793 } 1794 } 1795 1796 /** 1797 * Bootstrap Date time picker 1798 */ 1799 if (plugins.bootstrapDateTimePicker.length) { 1800 var i; 1801 for (i = 0; i < plugins.bootstrapDateTimePicker.length; i++) { 1802 var $dateTimePicker = $(plugins.bootstrapDateTimePicker[i]); 1803 var options = {}; 1804 1805 options['format'] = 'dddd DD MMMM YYYY - HH:mm'; 1806 if ($dateTimePicker.attr("data-time-picker") === "date") { 1807 options['format'] = 'dddd DD MMMM YYYY'; 1808 options['minDate'] = new Date(); 1809 } else if ($dateTimePicker.attr("data-time-picker") === "time") { 1810 options['format'] = 'HH:mm'; 1811 } 1812 1813 options["time"] = ($dateTimePicker.attr("data-time-picker") !== "date"); 1814 options["date"] = ($dateTimePicker.attr("data-time-picker") !== "time"); 1815 options["shortTime"] = true; 1816 1817 $dateTimePicker.bootstrapMaterialDatePicker(options); 1818 } 1819 } 1820 1821 // // tilt hover effect 1822 // if( plugins.tiltHover.length ) { 1823 // plugins.tiltHover.tilt({ 1824 // maxTilt: 5, 1825 // glare: true, 1826 // maxGlare: .5 1827 // }) 1828 // } 1829 1830 // youtube bg video 1831 if( plugins.youtubeBg.length ) { 1832 plugins.youtubeBg.YTPlayer({ 1833 1834 }); 1835 } 1836 1837 }); 1838}());
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.