1/** 2 * Global variables 3 */ 4"use strict"; 5 6var userAgent = navigator.userAgent.toLowerCase(), 7 initialDate = new Date(), 8 9 $document = $(document), 10 $window = $(window), 11 $html = $("html"), 12 13 isDesktop = $html.hasClass("desktop"), 14 isIE = userAgent.indexOf("msie") != -1 ? parseInt(userAgent.split("msie")[1]) : userAgent.indexOf("trident") != -1 ? 11 : userAgent.indexOf("edge") != -1 ? 12 : false, 15 isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), 16 isTouch = "ontouchstart" in window, 17 18 plugins = { 19 pointerEvents: isIE < 11 ? "js/pointer-events.min.js" : false, 20 bootstrapTooltip: $("[data-toggle='tooltip']"), 21 bootstrapModalDialog: $('.modal'), 22 bootstrapTabs: $(".tabs"), 23 rdNavbar: $(".rd-navbar"), 24 rdParallax: $(".rd-parallax"), 25 rdGoogleMaps: $(".rd-google-map"), 26 rdMailForm: $(".rd-mailform"), 27 rdInputLabel: $(".form-label"), 28 regula: $("[data-constraints]"), 29 responsiveTabs: $(".responsive-tabs"), 30 owl: $(".owl-carousel"), 31 32 search: $(".rd-search"), 33 searchResults: $('.rd-search-results'), 34 statefulButton: $('.btn-stateful'), 35 isotope: $(".isotope"), 36 popover: $('[data-toggle="popover"]'), 37 viewAnimate: $('.view-animate'), 38 photoSwipeGallery: $("[data-photo-swipe-item]"), 39 radio: $("input[type='radio']"), 40 checkbox: $("input[type='checkbox']"), 41 customToggle: $("[data-custom-toggle]"), 42 facebookWidget: $('#fb-root'), 43 dateCountdown: $('.DateCountdown'), 44 countDown: $(".countdown"), 45 counter: $(".counter"), 46 progressBarCustom: $(".progress-bar-js"), 47 48 twitterfeed: $(".twitter"), 49 stepper: $("input[type='number']"), 50 progressBar: $(".progress-linear"), 51 slick: $('.slick-slider'), 52 pageLoader: $(".page-loader") 53 }; 54 55/** 56 * Initialize All Scripts 57 */ 58 59 60$document.ready(function () { 61 62 /** 63 * getSwiperHeight 64 * @description calculate the height of swiper slider basing on data attr 65 */ 66 function getSwiperHeight(object, attr) { 67 var val = object.attr("data-" + attr), 68 dim; 69 70 if (!val) { 71 return undefined; 72 } 73 74 dim = val.match(/(px)|(%)|(vh)$/i); 75 76 if (dim.length) { 77 switch (dim[0]) { 78 case "px": 79 return parseFloat(val); 80 case "vh": 81 return $(window).height() * (parseFloat(val) / 100); 82 case "%": 83 return object.width() * (parseFloat(val) / 100); 84 } 85 } else { 86 return undefined; 87 } 88 } 89 90 /** 91 * toggleSwiperInnerVideos 92 * @description toggle swiper videos on active slides 93 */ 94 function toggleSwiperInnerVideos(swiper) { 95 var prevSlide = $(swiper.slides[swiper.previousIndex]), 96 nextSlide = $(swiper.slides[swiper.activeIndex]), 97 videos; 98 99 prevSlide.find("video").each(function () { 100 this.pause(); 101 }); 102 103 videos = nextSlide.find("video"); 104 if (videos.length) { 105 videos.get(0).play(); 106 } 107 } 108 109 /** 110 * toggleSwiperCaptionAnimation 111 * @description toggle swiper animations on active slides 112 */ 113 function toggleSwiperCaptionAnimation(swiper) { 114 var prevSlide = $(swiper.container), 115 nextSlide = $(swiper.slides[swiper.activeIndex]); 116 117 prevSlide 118 .find("[data-caption-animate]") 119 .each(function () { 120 var $this = $(this); 121 $this 122 .removeClass("animated") 123 .removeClass($this.attr("data-caption-animate")) 124 .addClass("not-animated"); 125 }); 126 127 nextSlide 128 .find("[data-caption-animate]") 129 .each(function () { 130 var $this = $(this), 131 delay = $this.attr("data-caption-delay"), 132 duration = $this.attr('data-caption-duration'); 133 134 setTimeout(function () { 135 $this 136 .removeClass("not-animated") 137 .addClass($this.attr("data-caption-animate")) 138 .addClass("animated"); 139 140 if (duration) { 141 $this.css('animation-duration', duration + 'ms'); 142 } 143 }, delay ? parseInt(delay) : 0); 144 }); 145 } 146 147 /** 148 * makeParallax 149 * @description create swiper parallax scrolling effect 150 */ 151 function makeParallax(el, speed, wrapper, prevScroll) { 152 var scrollY = window.scrollY || window.pageYOffset; 153 154 if (prevScroll != scrollY) { 155 prevScroll = scrollY; 156 el.addClass('no-transition');
157 el[0].style['transform'] = 'translate3d(0,' + -scrollY * (1 - speed) + 'px,0)'; 158 el.height(); 159 el.removeClass('no-transition'); 160 161 if (el.attr('data-fade') === 'true') { 162 var bound = el[0].getBoundingClientRect(), 163 offsetTop = bound.top * 2 + scrollY, 164 sceneHeight = wrapper.outerHeight(), 165 sceneDevider = wrapper.offset().top + sceneHeight / 2.0, 166 layerDevider = offsetTop + el.outerHeight() / 2.0, 167 pos = sceneHeight / 6.0, 168 opacity; 169 if (sceneDevider + pos > layerDevider && sceneDevider - pos < layerDevider) { 170 el[0].style["opacity"] = 1; 171 } else { 172 if (sceneDevider - pos < layerDevider) { 173 opacity = 1 + ((sceneDevider + pos - layerDevider) / sceneHeight / 3.0 * 5); 174 } else { 175 opacity = 1 - ((sceneDevider - pos - layerDevider) / sceneHeight / 3.0 * 5); 176 } 177 el[0].style["opacity"] = opacity < 0 ? 0 : opacity > 1 ? 1 : opacity.toFixed(2); 178 } 179 } 180 } 181 182 requestAnimationFrame(function () { 183 makeParallax(el, speed, wrapper, prevScroll); 184 }); 185 } 186 187 /** 188 * isScrolledIntoView 189 * @description check the element whas been scrolled into the view 190 */ 191 function isScrolledIntoView(elem) { 192 var $window = $(window); 193 return elem.offset().top + elem.outerHeight() >= $window.scrollTop() && elem.offset().top <= $window.scrollTop() + $window.height(); 194 } 195 196 /** 197 * initOnView 198 * @description calls a function when element has been scrolled into the view 199 */ 200 function lazyInit(element, func) { 201 var $win = jQuery(window); 202 $win.on('load scroll', function () { 203 if ((!element.hasClass('lazy-loaded') && (isScrolledIntoView(element)))) { 204 func.call(); 205 element.addClass('lazy-loaded'); 206 } 207 }); 208 } 209 210 211 212 /** 213 * Live Search 214 * @description create live search results 215 */ 216 function liveSearch(options) { 217 $('#' + options.live).removeClass('cleared').html(); 218 options.current++; 219 options.spin.addClass('loading'); 220 $.get(handler, { 221 s: decodeURI(options.term), 222 liveSearch: options.live, 223 dataType: "html", 224 liveCount: options.liveCount, 225 filter: options.filter, 226 template: options.template 227 }, function (data) { 228 options.processed++; 229 var live = $('#' + options.live); 230 if (options.processed == options.current && !live.hasClass('cleared')) { 231 live.find('> #search-results').removeClass('active'); 232 live.html(data); 233 setTimeout(function () { 234 live.find('> #search-results').addClass('active'); 235 }, 50); 236 } 237 options.spin.parents('.rd-search').find('.input-group-addon').removeClass('loading'); 238 }) 239 } 240 241 242 243 /** 244 * isValidated 245 * @description check if all elemnts pass validation 246 */ 247 function isValidated(elements) { 248 var results, errors = 0; 249 if (elements.length) { 250 for (j = 0; j < elements.length; j++) { 251 252 var $input = $(elements[j]); 253 254 if ((results = $input.regula('validate')).length) { 255 for (k = 0; k < results.length; k++) { 256 errors++; 257 $input.siblings(".form-validation").text(results[k].message).parent().addClass("has-error"); 258 } 259 } else { 260 $input.siblings(".form-validation").text("").parent().removeClass("has-error") 261 } 262 } 263 264 return errors == 0;
265 } 266 return true; 267 } 268 269 /** 270 * Init Bootstrap tooltip 271 * @description calls a function when need to init bootstrap tooltips 272 */ 273 function initBootstrapTooltip(tooltipPlacement) { 274 if (window.innerWidth < 599) { 275 plugins.bootstrapTooltip.tooltip('destroy'); 276 plugins.bootstrapTooltip.tooltip({ 277 placement: 'bottom' 278 }); 279 } else { 280 plugins.bootstrapTooltip.tooltip('destroy'); 281 plugins.bootstrapTooltip.tooltipPlacement; 282 plugins.bootstrapTooltip.tooltip(); 283 } 284 } 285 286 /** 287 * Copyright Year 288 * @description Evaluates correct copyright year 289 */ 290 var o = $("#copyright-year"); 291 if (o.length) { 292 o.text(initialDate.getFullYear()); 293 } 294 295 /** 296 * IE Polyfills 297 * @description Adds some loosing functionality to IE browsers 298 */ 299 if (isIE) { 300 if (isIE < 10) { 301 $html.addClass("lt-ie-10"); 302 } 303 304 if (isIE < 11) { 305 if (plugins.pointerEvents) { 306 $.getScript(plugins.pointerEvents) 307 .done(function () { 308 $html.addClass("ie-10"); 309 PointerEventsPolyfill.initialize({}); 310 }); 311 } 312 } 313 314 if (isIE === 11) { 315 $("html").addClass("ie-11"); 316 } 317 318 if (isIE === 12) { 319 $("html").addClass("ie-edge"); 320 } 321 } 322 323 /** 324 * Bootstrap Tooltips 325 * @description Activate Bootstrap Tooltips 326 */ 327 if (plugins.bootstrapTooltip.length) { 328 var tooltipPlacement = plugins.bootstrapTooltip.attr('data-placement'); 329 initBootstrapTooltip(tooltipPlacement); 330 $(window).on('resize orientationchange', function () { 331 initBootstrapTooltip(tooltipPlacement); 332 }) 333 } 334 335 /** 336 * bootstrapModalDialog 337 * @description Stap vioeo in bootstrapModalDialog 338 */ 339 if (plugins.bootstrapModalDialog.length > 0) { 340 var i = 0; 341 342 for (i = 0; i < plugins.bootstrapModalDialog.length; i++) { 343 var modalItem = $(plugins.bootstrapModalDialog[i]); 344 345 modalItem.on('hidden.bs.modal', $.proxy(function () { 346 var activeModal = $(this), 347 rdVideoInside = activeModal.find('video'), 348 youTubeVideoInside = activeModal.find('iframe'); 349 350 if (rdVideoInside.length) { 351 rdVideoInside[0].pause(); 352 } 353 354 if (youTubeVideoInside.length) { 355 var videoUrl = youTubeVideoInside.attr('src'); 356 357 youTubeVideoInside 358 .attr('src', '') 359 .attr('src', videoUrl); 360 } 361 }, modalItem)) 362 } 363 } 364 365 /** 366 * Progress bar 367 * @description Enable progress bar 368 */ 369 if (plugins.progressBar.length) { 370 for (i = 0; i < plugins.progressBar.length; i++) { 371 var progressBar = $(plugins.progressBar[i]); 372 $window 373 .on("scroll load", $.proxy(function () { 374 var bar = $(this); 375 if (!bar.hasClass('animated-first') && isScrolledIntoView(bar)) { 376 var end = bar.attr("data-to"); 377 bar.find('.progress-bar-linear').css({width: end + '%'}); 378 bar.find('.progress-value').countTo({ 379 refreshInterval: 40, 380 from: 0, 381 to: end, 382 speed: 500 383 }); 384 bar.addClass('animated-first'); 385 } 386 }, progressBar)); 387 } 388 } 389 390 /** 391 * RD Google Maps 392 * @description Enables RD Google Maps plugin 393 */ 394 if (plugins.rdGoogleMaps.length) { 395 var i; 396 397 $.getScript("//maps.google.com/maps/api/js?key=AIzaSyAFeB0kVA6ou
397yJ_gEvFbMaefLy3cBCyRwo&sensor=false&libraries=geometry,places&v=3.7", function () { 398 var head = document.getElementsByTagName('head')[0], 399 insertBefore = head.insertBefore; 400 401 head.insertBefore = function (newElement, referenceElement) { 402 if (newElement.href && newElement.href.indexOf('../../../fonts.googleapis.com/css_c57efaa0.css') != -1 || newElement.innerHTML.indexOf('gm-style') != -1) { 403 return; 404 } 405 insertBefore.call(head, newElement, referenceElement); 406 }; 407 408 for (i = 0; i < plugins.rdGoogleMaps.length; i++) { 409 410 var $googleMapItem = $(plugins.rdGoogleMaps[i]); 411 412 lazyInit($googleMapItem, $.proxy(function () { 413 var $this = $(this), 414 styles = $this.attr("data-styles"); 415 416 $this.googleMap({ 417 styles: styles ? JSON.parse(styles) : [], 418 onInit: function (map) { 419 var inputAddress = $('#rd-google-map-address'); 420 421 if (inputAddress.length) { 422 var input = inputAddress; 423 var geocoder = new google.maps.Geocoder(); 424 var marker = new google.maps.Marker( 425 { 426 map: map, 427 icon: "images/gmap_marker.png", 428 } 429 ); 430 var autocomplete = new google.maps.places.Autocomplete(inputAddress[0]); 431 autocomplete.bindTo('bounds', map); 432 inputAddress.attr('placeholder', ''); 433 inputAddress.on('change', function () { 434 $("#rd-google-map-address-submit").trigger('click'); 435 }); 436 inputAddress.on('keydown', function (e) { 437 if (e.keyCode == 13) { 438 $("#rd-google-map-address-submit").trigger('click'); 439 } 440 }); 441 442 443 $("#rd-google-map-address-submit").on('click', function (e) { 444 e.preventDefault(); 445 var address = input.val(); 446 geocoder.geocode({'address': address}, function (results, status) { 447 if (status == google.maps.GeocoderStatus.OK) { 448 var latitude = results[0].geometry.location.lat(); 449 var longitude = results[0].geometry.location.lng(); 450 451 map.setCenter(new google.maps.LatLng( 452 parseFloat(latitude), 453 parseFloat(longitude) 454 )); 455 marker.setPosition(new google.maps.LatLng( 456 parseFloat(latitude), 457 parseFloat(longitude) 458 )) 459 } 460 }); 461 }); 462 } 463 } 464 }); 465 }, $googleMapItem)); 466 } 467 }); 468 } 469 470 /** 471 * Responsive Tabs 472 * @description Enables Responsive Tabs plugin 473 */ 474 if (plugins.responsiveTabs.length > 0) { 475 var i; 476 477 for (i = 0; i < plugins.responsiveTabs.length; i++) { 478 var responsiveTabsItem = $(plugins.responsiveTabs[i]); 479 480 responsiveTabsItem.easyResponsiveTabs({ 481 type: responsiveTabsItem.attr("data-type") === "accordion" ? "accordion" : "default" 482 }); 483 484 //If have owl carousel inside tab - resize owl carousel on click 485 if (responsiveTabsItem.find('.owl-carousel').length) { 486 responsiveTabsItem.find('.resp-tab-item').on('click', $.proxy(function (event) { 487 var $this = $(this), 488 carouselObj = ($this.find('.resp-tab-content-active .owl-carousel').owlCarousel()).data('owlCarousel'); 489 490 if (carouselObj && typeof carouselObj.onResize === "function") { 491 carouselObj.onResize(); 492 } 493 }, responsiveTabsItem)); 494 495 responsiveTabsItem.find('.resp-accordion').on('click', $.proxy(function (event) { 496 var $this = $(this), 497 carouselObj = ($this.find('.resp-tab-content-active .owl-carousel').owlCarousel()).data('owlCarousel'); 498 499 if (carouselObj && typeof carouselObj.onResize === "function") { 500 carouselObj.onResize(); 501 } 502 }, responsiveTabsItem)); 503 } 504 505 //If have slick carousel inside tab - resize slick carousel on click 506 if (responsiveTabsItem.find('.slick-slider').length) { 507 508 responsiveTabsItem.find('.resp-tab-item').on('click', $.proxy(function (event) { 509 var $this = $(this); 510 $this.find('.resp-tab-content-active .slick-slider').slick('setPosition'); 511 }, responsiveTabsItem)); 512 513 responsiveTabsItem.find('.resp-accordion').on('click', $.proxy(function (event) { 514 var $this = $(this); 515 516 $this.find('.resp-tab-content-active .slick-slider').slick('setPosition'); 517 console.log(1); 518 }, responsiveTabsItem)); 519 } 520 521 // Enable external buttons (prev, text tab) 522 if (responsiveTabsItem.attr('data-external-buttons') == "true") { 523 var list = responsiveTabsItem.find('.resp-tabs-list li'), 524 newList = '<ul class="resp-tabs-extertal-list">'; 525 526 for (var j = 0; j < list.length; j++) { 527 newList += '<li><span>' + $(list[j]).text() + '</span></li>'; 528 } 529 newList += '</ul>'; 530 531 532 responsiveTabsItem.find('.resp-tabs-container').before('<div class="resp-tab-external-prev"></div>') 533 responsiveTabsItem.find('.resp-tab-external-prev').html(newList); 534 responsiveTabsItem.find('.resp-tabs-container').after('<div class="resp-tab-external-next"></div>'); 535 responsiveTabsItem.find('.resp-tab-external-next').html(newList); 536 537 changeExternalButtons(responsiveTabsItem); 538 539 responsiveTabsItem.find('.resp-tab-external-prev').on('click', $.proxy(function (event) { 540 var $this = $(this); 541 542 changeExternalButtons($this, 'prev'); 543 }, responsiveTabsItem)); 544 545 responsiveTabsItem.find('.resp-tab-external-next').on('click', $.proxy(function (event) { 546 var $this = $(this); 547 548 changeExternalButtons($this, 'next'); 549 }, responsiveTabsItem)); 550 551 responsiveTabsItem.find('.resp-tabs-list .resp-tab-item').on('click', $.proxy(function (event) { 552 var $this = $(this); 553 554 changeExternalButtons($this); 555 }, responsiveTabsItem)); 556 } 557 } 558 } 559 560 /** 561 * Facebook widget 562 * @description Enables official Facebook widget 563 */ 564 if (plugins.facebookWidget.length) { 565 lazyInit(plugins.facebookWidget, function () { 566 (function (d, s, id) { 567 var js, fjs = d.getElementsByTagName(s)[0]; 568 if (d.getElementById(id)) return; 569 js = d.createElement(s); 570 js.id = id; 571 js.src = "../../../connect.facebook.net/ru_RU/sdk.js#xfbml=1&version=v2.5"; 572 fjs.parentNode.insertBefore(js, fjs); 573 }(document, 'script', 'facebook-jssdk')); 574 });
575 } 576 577 /** 578 * Radio 579 * @description Add custom styling options for input[type="radio"] 580 */ 581 /* if (plugins.radio.length) { 582 var i; 583 for (i = 0; i < plugins.radio.length; i++) { 584 var $this = $(plugins.radio[i]); 585 $this.addClass("radio-custom").after("<span class='radio-custom-dummy'></span>") 586 } 587 } 588 589 /** 590 * Checkbox 591 * @description Add custom styling options for input[type="checkbox"] 592 */ 593/* if (plugins.checkbox.length) { 594 var i; 595 for (i = 0; i < plugins.checkbox.length; i++) { 596 var $this = $(plugins.checkbox[i]); 597 $this.addClass("checkbox-custom").after("<span class='checkbox-custom-dummy'></span>") 598 } 599 }*/ 600 601 /** 602 * Popovers 603 * @description Enables Popovers plugin 604 */ 605 if (plugins.popover.length) { 606 if (window.innerWidth < 767) { 607 plugins.popover.attr('data-placement', 'bottom'); 608 plugins.popover.popover(); 609 } 610 else { 611 plugins.popover.popover(); 612 } 613 } 614 615 /** 616 * Bootstrap Buttons 617 * @description Enable Bootstrap Buttons plugin 618 */ 619 if (plugins.statefulButton.length) { 620 $(plugins.statefulButton).on('click', function () { 621 var statefulButtonLoading = $(this).button('loading'); 622 623 setTimeout(function () { 624 statefulButtonLoading.button('reset') 625 }, 2000); 626 }) 627 } 628 629 /** 630 * UI To Top 631 * @description Enables ToTop Button 632 */ 633/* if (isDesktop) { 634 $().UItoTop({ 635 easingType: 'easeOutQuart', 636 containerClass: 'ui-to-top fa fa-angle-up' 637 }); 638 }*/ 639 640 /** 641 * RD Navbar 642 * @description Enables RD Navbar plugin 643 */ 644 if (plugins.rdNavbar.length) { 645 plugins.rdNavbar.RDNavbar({ 646 stickUpClone: (plugins.rdNavbar.attr("data-stick-up-clone")) ? plugins.rdNavbar.attr("data-stick-up-clone") === 'true' : false 647 }); 648 if (plugins.rdNavbar.attr("data-body-class")) { 649 document.body.className += ' ' + plugins.rdNavbar.attr("data-body-class"); 650 } 651 } 652 653 /** 654 * ViewPort Universal 655 * @description Add class in viewport 656 */ 657 if (plugins.viewAnimate.length) { 658 var i; 659 for (i = 0; i < plugins.viewAnimate.length; i++) { 660 var $view = $(plugins.viewAnimate[i]).not('.active'); 661 $document.on("scroll", $.proxy(function () { 662 if (isScrolledIntoView(this)) { 663 this.addClass("active"); 664 } 665 }, $view)) 666 .trigger("scroll"); 667 } 668 } 669 670 671 672 673 674 675 /** 676 * RD Search 677 * @description Enables search 678 */ 679 if (plugins.search.length || plugins.searchResults) { 680 var handler = "bat/rd-search.php"; 681 var defaultTemplate = '<h5 class="search_title"><a target="_top" href="#{href}" class="search_link">#{title}</a></h5>' + 682 '<p>...#{token}...</p>' + 683 '<p class="match"><em>Terms matched: #{count} - URL: #{href}</em></p>'; 684 var defaultFilter = '*.html'; 685 686 if (plugins.search.length) { 687 688 for (i = 0; i < plugins.search.length; i++) { 689 var searchItem = $(plugins.search[i]), 690 options = { 691 element: searchItem, 692 filter: (searchItem.attr('data-search-filter')) ? searchItem.attr('data-search-filter') : defaultFilter, 693 template: (searchItem.attr('data-search-template')) ? searchItem.attr('data-search-template') : defaultTemplate, 694 live: (searchItem.attr('data-search-live')) ? searchItem.attr('data-search-live') : false, 695 liveCount: (searchItem.attr('data-search-live-count')) ? parseInt(searchItem.attr('data-search-live')) : 4, 696 current: 0, processed: 0, timer: {} 697 }; 698 699 if ($('.rd-navbar-search-toggle').length) { 700 var toggle = $('.rd-navbar-search-toggle'); 701 toggle.on('click', function () { 702 if (!($(this).hasClass('active'))) { 703 searchItem.find('input').val('').trigger('propertychange'); 704 } 705 }); 706 } 707 708 if (options.live) { 709 var clearHandler = false; 710 711 searchItem.find('input').on("keyup input propertychange", $.proxy(function () { 712 this.term = this.element.find('input').val().trim(); 713 this.spin = this.element.find('.input-group-addon'); 714 715 clearTimeout(this.timer); 716 717 if (this.term.length > 2) { 718 this.timer = setTimeout(liveSearch(this), 200); 719 720 if (clearHandler == false) { 721 clearHandler = true; 722 723 $("body").on("click", function (e) { 724 if ($(e.toElement).parents('.rd-search').length == 0) { 725 $('#rd-search-results-live').addClass('cleared').html(''); 726 } 727 }) 728 } 729 730 } else if (this.term.length == 0) { 731 $('#' + this.live).addClass('cleared').html(''); 732 } 733 }, options, this)); 734 } 735 736 searchItem.submit($.proxy(function () { 737 $('<input />').attr('type', 'hidden') 738 .attr('name', "filter") 739 .attr('value', this.filter) 740 .appendTo(this.element); 741 return true; 742 }, options, this)) 743 } 744 } 745 746 if (plugins.searchResults.length) { 747 var regExp = /\?.*s=([^&]+)\&filter=([^&]+)/g; 748 var match = regExp.exec(location.search); 749 750 if (match != null) { 751 $.get(handler, {
752 s: decodeURI(match[1]), 753 dataType: "html", 754 filter: match[2], 755 template: defaultTemplate, 756 live: '' 757 }, function (data) { 758 plugins.searchResults.html(data); 759 }) 760 } 761 } 762 } 763 764 /** 765 * Owl carousel 766 * @description Enables Owl carousel plugin 767 */ 768 if (plugins.owl.length) { 769 var i; 770 for (i = 0; i < plugins.owl.length; i++) { 771 var c = $(plugins.owl[i]), 772 responsive = {}; 773 774 var aliaces = ["-", "-xs-", "-sm-", "-md-", "-lg-"], 775 values = [0, 480, 768, 992, 1200], 776 j, k; 777 778 for (j = 0; j < values.length; j++) { 779 responsive[values[j]] = {}; 780 for (k = j; k >= -1; k--) { 781 if (!responsive[values[j]]["items"] && c.attr("data" + aliaces[k] + "items")) { 782 responsive[values[j]]["items"] = k < 0 ? 1 : parseInt(c.attr("data" + aliaces[k] + "items")); 783 } 784 if (!responsive[values[j]]["stagePadding"] && responsive[values[j]]["stagePadding"] !== 0 && c.attr("data" + aliaces[k] + "stage-padding")) { 785 responsive[values[j]]["stagePadding"] = k < 0 ? 0 : parseInt(c.attr("data" + aliaces[k] + "stage-padding")); 786 } 787 if (!responsive[values[j]]["margin"] && responsive[values[j]]["margin"] !== 0 && c.attr("data" + aliaces[k] + "margin")) { 788 responsive[values[j]]["margin"] = k < 0 ? 30 : parseInt(c.attr("data" + aliaces[k] + "margin")); 789 } 790 } 791 } 792 793 c.owlCarousel({ 794 autoplay: c.attr("data-autoplay") === "true", 795 loop: c.attr("data-loop") !== "false", 796 items: 1, 797 dotsContainer: c.attr("data-pagination-class") || false, 798 navContainer: c.attr("data-navigation-class") || false, 799 mouseDrag: c.attr("data-mouse-drag") !== "false", 800 nav: c.attr("data-nav") === "true", 801 dots: c.attr("data-dots") === "true", 802 dotsEach: c.attr("data-dots-each") ? parseInt(c.attr("data-dots-each")) : false, 803 animateIn: 'fadeIn', 804 animateOut: c.attr('data-animation-out') ? c.attr('data-animation-out') : false, 805 responsive: responsive, 806 navText: [], 807 center: c.attr("data-center") === "true", 808 navSpeed: 800, 809 }); 810 } 811 } 812 813 /** 814 * Isotope 815 * @description Enables Isotope plugin 816 */ 817 if (plugins.isotope.length) { 818 var i, j, isogroup = []; 819 for (i = 0; i < plugins.isotope.length; i++) { 820 var isotopeItem = plugins.isotope[i], 821 filterItems = $(isotopeItem).closest('.isotope-wrap').find('[data-isotope-filter]'), 822 iso; 823 824 iso = new Isotope(isotopeItem, { 825 itemSelector: '.isotope-item', 826 layoutMode: isotopeItem.getAttribute('data-isotope-layout') ? isotopeItem.getAttribute('data-isotope-layout') : 'masonry', 827 filter: '*', 828 masonry: { 829 columnWidth: 0.66 830 } 831 }); 832 833 isogroup.push(iso); 834 835 filterItems.on("click", function (e) { 836 e.preventDefault(); 837 var filter = $(this), 838 iso = $('.isotope[data-isotope-group="' + this.getAttribute("data-isotope-group") + '"]'), 839 filtersContainer = filter.closest(".isotope-filters"); 840 841 filtersContainer 842 .find('.active') 843 .removeClass("active"); 844 filter.addClass("active"); 845 846 iso.isotope({ 847 itemSelector: '.isotope-item', 848 layoutMode: iso.attr('data-isotope-layout') ? iso.attr('data-isotope-layout') : 'masonry', 849 filter: this.getAttribute("data-isotope-filter") == '*' ? '*' : '[data-filter*="' + this.getAttribute("data-isotope-filter") + '"]', 850 masonry: { 851 columnWidth: 0.66 852 } 853 }); 854 855 $window.trigger('resize'); 856 857 // If d3Charts contains in isotop, resize it on click. 858 if (filtersContainer.hasClass('isotope-has-d3-graphs') && c3ChartsArray != undefined) { 859 setTimeout(function () { 860 for (var j = 0; j < c3ChartsArray.length; j++) { 861 c3ChartsArray[j].resize(); 862 } 863 }, 500); 864 } 865 866 }).eq(0).trigger("click"); 867 } 868 869 $(window).on('load', function () { 870 setTimeout(function () { 871 var i; 872 for (i = 0; i < isogroup.length; i++) { 873 isogroup[i].element.className += " isotope--loaded"; 874 isogroup[i].layout(); 875 } 876 }, 600); 877 });
878 } 879 880 /** 881 * Select2 882 * @description Enables select2 plugin 883 */ 884 885 886 /** 887 * WOW 888 * @description Enables Wow animation plugin 889 */ 890/* if (isDesktop && $html.hasClass("wow-animation") && $(".wow").length) { 891 new WOW().init(); 892 } */ 893 894 /** 895 * Bootstrap tabs 896 * @description Activate Bootstrap Tabs 897 */ 898 if (plugins.bootstrapTabs.length) { 899 var i; 900 for (i = 0; i < plugins.bootstrapTabs.length; i++) { 901 var bootstrapTabsItem = $(plugins.bootstrapTabs[i]); 902 903 bootstrapTabsItem.on("click", "a", function (event) { 904 event.preventDefault(); 905 $(this).tab('show'); 906 }); 907 } 908 } 909 910 911 912 913 /** 914 * RD Mailform 915 */ 916 if (plugins.rdMailForm.length) { 917 var i, j, k, 918 msg = { 919 'MF000': 'Successfully sent!', 920 'MF001': 'Recipients are not set!', 921 'MF002': 'Form will not work locally!', 922 'MF003': 'Please, define email field in your form!', 923 'MF004': 'Please, define type of your form!', 924 'MF254': 'Something went wrong with PHPMailer!', 925 'MF255': 'The Form Successfully Submitted.' 926 }; 927 928 for (i = 0; i < plugins.rdMailForm.length; i++) { 929 var $form = $(plugins.rdMailForm[i]); 930 931 $form.attr('novalidate', 'novalidate').ajaxForm({ 932 data: { 933 "form-type": $form.attr("data-form-type") || "contact", 934 "counter": i 935 }, 936 beforeSubmit: function () { 937 var form = $(plugins.rdMailForm[this.extraData.counter]); 938 var inputs = form.find("[data-constraints]"); 939 if (isValidated(inputs)) { 940 var output = $("#" + form.attr("data-form-output")); 941 942 if (output.hasClass("snackbars")) { 943 output.html('<p><span class="icon text-middle fa fa-circle-o-notch fa-spin icon-xxs"></span><span>Sending</span></p>'); 944 output.addClass("active"); 945 946 } 947 } else { 948 return false; 949 } 950 }, 951 error: function (result) { 952 var output = $("#" + $(plugins.rdMailForm[this.extraData.counter]).attr("data-form-output")); 953 output.text(msg[result]); 954 }, 955 success: function (result) { 956 var form = $(plugins.rdMailForm[this.extraData.counter]), 957 output = $("#" + form.attr("data-form-output")), 958 $select = form.find('select'); 959 960 // Clear select2 after submit form 961 if ($select.length) { 962 for (j = 0; j < $select.length; j++) { 963 var $selectitem = $($select[j]); 964 $selectitem.select2('val', null); 965 } 966 } 967 968 form.addClass('success'); 969 result = result.length == 5 ? result : 'MF255'; 970 output.text(msg[result]); 971 972 if (result === "MF000") { 973 if (output.hasClass("snackbars")) { 974 output.html('<p><span class="icon text-middle mdi mdi-check icon-xxs"></span><span>' + msg[result] + '</span></p>'); 975 } 976 output.addClass("success active"); 977 } else { 978 if (output.hasClass("snackbars")) { 979 output.html(' <p class="snackbars-left"><span class="icon icon-xxs mdi mdi-alert-outline text-middle"></span><span>' + msg[result] + '</span></p>'); 980 } 981 output.addClass("success active"); 982 } 983 984 form.clearForm(); 985 986 //form blurlayan spastik sey 987 form.find('input, textarea').blur(); 988 989 setTimeout(function () { 990 output.removeClass("active error success"); 991 form.removeClass('success'); 992 }, 5000); 993 } 994 }); 995 } 996 } 997 998 /** 999 * jQuery Count To 1000 * @description Enables Count To plugin 1001 */ 1002 if (plugins.counter.length) { 1003 var i; 1004 1005 for (i = 0; i < plugins.counter.length; i++) { 1006 var $counterNotAnimated = $(plugins.counter[i]).not('.animated'); 1007 $document 1008 .on("scroll", $.proxy(function () { 1009 var $this = this; 1010 1011 if ((!$this.hasClass("animated")) && (isScrolledIntoView($this))) { 1012 $this.countTo({ 1013 refreshInterval: 40, 1014 speed: $this.attr("data-speed") || 1000 1015 }); 1016 $this.addClass('animated'); 1017 } 1018 }, $counterNotAnimated)) 1019 .trigger("scroll"); 1020 } 1021 } 1022 1023 /** 1024 * jQuery Countdown 1025 * @description Enable countdown plugin 1026 */ 1027 if (plugins.countDown.length) { 1028 var i; 1029 for (i = 0; i < plugins.countDown.length; i++) { 1030 var countDownItem = plugins.countDown[i], 1031 d = new Date(), 1032 type = countDownItem.getAttribute('data-type'), 1033 time = countDownItem.getAttribute('data-time'), 1034 format = countDownItem.getAttribute('data-format'), 1035 settings = []; 1036
1037 d.setTime(Date.parse(time)).toLocaleString(); 1038 settings[type] = d; 1039 settings['format'] = format; 1040 $(countDownItem).countdown(settings); 1041 } 1042 } 1043 1044 /** 1045 * TimeCircles 1046 * @description Enable TimeCircles plugin 1047 */ 1048 if (plugins.dateCountdown.length) { 1049 var i; 1050 for (i = 0; i < plugins.dateCountdown.length; i++) { 1051 var dateCountdownItem = $(plugins.dateCountdown[i]), 1052 time = { 1053 "Days": { 1054 "text": "Days", 1055 "show": true, 1056 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1057 }, 1058 "Hours": { 1059 "text": "Hours", 1060 "show": true, 1061 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1062 }, 1063 "Minutes": { 1064 "text": "Minutes", 1065 "show": true, 1066 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1067 }, 1068 "Seconds": { 1069 "text": "Seconds", 1070 "show": true, 1071 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1072 } 1073 }; 1074 1075 dateCountdownItem.TimeCircles({ 1076 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "rgba(247, 247, 247, 1)", 1077 animation: "smooth", 1078 bg_width: dateCountdownItem.attr("data-bg-width") ? dateCountdownItem.attr("data-bg-width") : 1.1, 1079 circle_bg_color: dateCountdownItem.attr("data-bg") ? dateCountdownItem.attr("data-bg") : "rgba(0, 0, 0, 1)", 1080 fg_width: dateCountdownItem.attr("data-width") ? dateCountdownItem.attr("data-width") : 0.04 1081 }); 1082 1083 $(window).on('load resize orientationchange', function () { 1084 if (window.innerWidth < 479) { 1085 dateCountdownItem.TimeCircles({ 1086 time: { 1087 "Days": { 1088 "text": "Days", 1089 "show": true, 1090 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1091 }, 1092 "Hours": { 1093 "text": "Hours", 1094 "show": true, 1095 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1096 }, 1097 "Minutes": { 1098 "text": "Minutes", 1099 "show": true, 1100 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1101 }, 1102 Seconds: { 1103 "text": "Seconds", 1104 show: false, 1105 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1106 } 1107 } 1108 }).rebuild(); 1109 } else if (window.innerWidth < 767) { 1110 dateCountdownItem.TimeCircles({ 1111 time: { 1112 "Days": { 1113 "text": "Days", 1114 "show": true, 1115 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1116 }, 1117 "Hours": { 1118 "text": "Hours", 1119 "show": true, 1120 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1121 }, 1122 "Minutes": { 1123 "text": "Minutes", 1124 "show": true, 1125 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1126 }, 1127 Seconds: { 1128 "text": "Seconds", 1129 show: false, 1130 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1131 } 1132 } 1133 }).rebuild(); 1134 } else { 1135 dateCountdownItem.TimeCircles({ 1136 time: { 1137 "Days": { 1138 "text": "Days", 1139 "show": true, 1140 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1141 }, 1142 "Hours": { 1143 "text": "Hours", 1144 "show": true, 1145 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1146 }, 1147 "Minutes": { 1148 "text": "Minutes", 1149 "show": true, 1150 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1151 }, 1152 "Seconds": { 1153 "text": "Seconds", 1154 "show": true, 1155 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1156 } 1157 } 1158 }).rebuild(); 1159 } 1160 }); 1161 } 1162 } 1163 1164 /** 1165 * PhotoSwipe Gallery
1166 * @description Enables PhotoSwipe Gallery plugin 1167 */ 1168 if (plugins.photoSwipeGallery.length) { 1169 1170 // init image click event 1171 $document.delegate("[data-photo-swipe-item]", "click", function (event) { 1172 event.preventDefault(); 1173 1174 var $el = $(this), 1175 $galleryItems = $el.parents("[data-photo-swipe-gallery]").find("a[data-photo-swipe-item]"), 1176 pswpElement = document.querySelectorAll('.pswp')[0], 1177 encounteredItems = {}, 1178 pswpItems = [], 1179 options, 1180 pswpIndex = 0, 1181 pswp; 1182 1183 if ($galleryItems.length == 0) { 1184 $galleryItems = $el; 1185 } 1186 1187 // loop over the gallery to build up the photoswipe items 1188 $galleryItems.each(function () { 1189 var $item = $(this), 1190 src = $item.attr('href'), 1191 size = $item.attr('data-size').split('x'), 1192 pswdItem; 1193 1194 if ($item.is(':visible')) { 1195 1196 // if we have this image the first time 1197 if (!encounteredItems[src]) { 1198 // build the photoswipe item 1199 pswdItem = { 1200 src: src, 1201 w: parseInt(size[0], 10), 1202 h: parseInt(size[1], 10), 1203 el: $item // save link to element for getThumbBoundsFn 1204 }; 1205 1206 // store that we already had this item 1207 encounteredItems[src] = { 1208 item: pswdItem, 1209 index: pswpIndex 1210 }; 1211 1212 // push the item to the photoswipe list 1213 pswpItems.push(pswdItem); 1214 pswpIndex++; 1215 } 1216 } 1217 }); 1218 1219 options = { 1220 index: encounteredItems[$el.attr('href')].index, 1221 1222 getThumbBoundsFn: function (index) { 1223 var $el = pswpItems[index].el, 1224 offset = $el.offset(); 1225 1226 return { 1227 x: offset.left, 1228 y: offset.top, 1229 w: $el.width() 1230 }; 1231 } 1232 }; 1233 1234 // open the photoswipe gallery 1235 pswp = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, pswpItems, options); 1236 pswp.init(); 1237 }); 1238 } 1239 1240 /** 1241 * Custom Toggles 1242 */ 1243 if (plugins.customToggle.length) { 1244 var i; 1245 1246 for (i = 0; i < plugins.customToggle.length; i++) { 1247 var $this = $(plugins.customToggle[i]); 1248 1249 $this.on('click', $.proxy(function (event) { 1250 event.preventDefault(); 1251 var $ctx = $(this); 1252 $($ctx.attr('data-custom-toggle')).add(this).toggleClass('active'); 1253 }, $this)); 1254 1255 if ($this.attr("data-custom-toggle-disable-on-blur") === "true") { 1256 $("body").on("click", $this, function (e) { 1257 if (e.target !== e.data[0] 1258 && $(e.data.attr('data-custom-toggle')).find($(e.target)).length 1259 && e.data.find($(e.target)).length == 0) { 1260 $(e.data.attr('data-custom-toggle')).add(e.data[0]).removeClass('active'); 1261 } 1262 }) 1263 } 1264 } 1265 } 1266 1267 /** 1268 * Progress bar 1269 * @description Enable progress bar 1270 */ 1271 if (plugins.progressBarCustom.length) { 1272 var i, 1273 bar, 1274 type; 1275 1276 for (i = 0; i < plugins.progressBarCustom.length; i++) { 1277 var progressItem = plugins.progressBarCustom[i]; 1278 bar = null; 1279 1280 if (progressItem.className.indexOf("progress-bar-horizontal") > -1) { 1281 type = 'Line'; 1282 } 1283 1284 if (progressItem.className.indexOf("progress-bar-radial") > -1) { 1285 type = 'Circle'; 1286 } 1287 1288 if (progressItem.getAttribute("data-stroke") && progressItem.getAttribute("data-value") && type) { 1289 bar = new ProgressBar[type](progressItem, { 1290 strokeWidth: Math.round(parseFloat(progressItem.getAttribute("data-stroke")) / progressItem.offsetWidth * 100), 1291 trailWidth: progressItem.getAttribute("data-trail") ? Math.round(parseFloat(progressItem.getAttribute("data-trail")) / progressItem.offsetWidth * 100) : 0, 1292 text: { 1293 value: progressItem.getAttribute("data-counter") === "true" ? '0' : null, 1294 className: 'progress-bar__body', 1295 style: null 1296 } 1297 }); 1298 bar.svg.setAttribute('preserveAspectRatio', "none meet"); 1299 if (type === 'Line') { 1300 bar.svg.setAttributeNS(null, "height", progressItem.getAttribute("data-stroke")); 1301 } 1302 1303 bar.path.removeAttribute("stroke"); 1304 bar.path.className.baseVal = "progress-bar__stroke"; 1305 if (bar.trail) { 1306 bar.trail.removeAttribute("stroke"); 1307 bar.trail.className.baseVal = "progress-bar__trail"; 1308 } 1309 1310 if (progressItem.getAttribute("data-easing") && !isIE) { 1311 $(document) 1312 .on("scroll", {"barItem": bar}, $.proxy(function (event) { 1313 var bar = event.data.barItem; 1314 var $this = $(this); 1315 1316 if (isScrolledIntoView($this) && this.className.indexOf("progress-bar--animated") === -1) { 1317 this.className += " progress-bar--animated"; 1318 bar.animate(parseInt($this.attr("data-value")) / 100.0, { 1319 easing: $this.attr("data-easing"), 1320 duration: $this.attr("data-duration") ? parseInt($this.attr("data-duration")) : 800, 1321 step: function (state, b) { 1322 if (b._container.className.indexOf("progress-bar-horizontal") > -1 || 1323 b._container.className.indexOf("progress-bar-vertical") > -1) { 1324 b.text.style.width = Math.abs(b.value() * 100).toFixed(0) + "%" 1325 } 1326 b.setText(Math.abs(b.value() * 100).toFixed(0)); 1327 } 1328 }); 1329 } 1330 }, progressItem)) 1331 .trigger("scroll"); 1332 } else { 1333 bar.set(parseInt($(progressItem).attr("data-value")) / 100.0); 1334 bar.setText($(progressItem).attr("data-value")); 1335 if (type === 'Line') { 1336 bar.text.style.width = parseInt($(progressItem).attr("data-value")) + "%"; 1337 } 1338 } 1339 } else { 1340 console.error(progressItem.className + ": progress bar type is not defined"); 1341 } 1342 } 1343 } 1344 1345 /** 1346 * RD Twitter Feed
1347 * @description Enables RD Twitter Feed plugin 1348 */ 1349 if (plugins.twitterfeed.length > 0) { 1350 var i; 1351 for (i = 0; i < plugins.twitterfeed.length; i++) { 1352 var twitterfeedItem = plugins.twitterfeed[i]; 1353 $(twitterfeedItem).RDTwitter({}); 1354 } 1355 } 1356 1357 /** 1358 * Stepper 1359 * @description Enables Stepper Plugin 1360 */ 1361 if (plugins.stepper.length) { 1362 plugins.stepper.stepper({ 1363 labels: { 1364 up: "", 1365 down: "" 1366 } 1367 }); 1368 } 1369 1370 /** 1371 * Slick carousel 1372 * @description Enable Slick carousel plugin 1373 */ 1374 if (plugins.slick.length) { 1375 var i; 1376 for (i = 0; i < plugins.slick.length; i++) { 1377 var $slickItem = $(plugins.slick[i]); 1378 1379 $slickItem.slick({ 1380 slidesToScroll: parseInt($slickItem.attr('data-slide-to-scroll')) || 1, 1381 asNavFor: $slickItem.attr('data-for') || false, 1382 dots: $slickItem.attr("data-dots") == "true", 1383 infinite: $slickItem.attr("data-loop") == "true", 1384 focusOnSelect: true, 1385 arrows: $slickItem.attr("data-arrows") == "true", 1386 swipe: $slickItem.attr("data-swipe") == "true", 1387 autoplay: $slickItem.attr("data-autoplay") == "true", 1388 vertical: $slickItem.attr("data-vertical") == "true", 1389 centerMode: $slickItem.attr("data-center-mode") == "true", 1390 centerPadding: $slickItem.attr("data-center-padding") ? $slickItem.attr("data-center-padding") : '0.50', 1391 mobileFirst: true, 1392 speed: 700, 1393 responsive: [ 1394 { 1395 breakpoint: 0, 1396 settings: { 1397 slidesToShow: parseInt($slickItem.attr('data-items')) || 1, 1398 } 1399 }, 1400 { 1401 breakpoint: 479, 1402 settings: { 1403 slidesToShow: parseInt($slickItem.attr('data-xs-items')) || 1, 1404 } 1405 }, 1406 { 1407 breakpoint: 767, 1408 settings: { 1409 slidesToShow: parseInt($slickItem.attr('data-sm-items')) || 1, 1410 } 1411 }, 1412 { 1413 breakpoint: 991, 1414 settings: { 1415 slidesToShow: parseInt($slickItem.attr('data-md-items')) || 1, 1416 } 1417 }, 1418 { 1419 breakpoint: 1199, 1420 settings: { 1421 slidesToShow: parseInt($slickItem.attr('data-lg-items')) || 1, 1422 } 1423 }, 1424 { 1425 breakpoint: 1799, 1426 settings: { 1427 slidesToShow: parseInt($slickItem.attr('data-xl-items')) || 1, 1428 } 1429 }, 1430 ] 1431 }) 1432 .on('afterChange', function (event, slick, currentSlide, nextSlide) { 1433 var $this = $(this), 1434 childCarousel = $this.attr('data-child'); 1435 1436 if (childCarousel) { 1437 $(childCarousel + ' .slick-slide').removeClass('slick-current'); 1438 $(childCarousel + ' .slick-slide').eq(currentSlide).addClass('slick-current'); 1439 } 1440 }); 1441 } 1442 } 1443 1444 /** 1445 * RD Parallax 1446 * @description Enables RD Parallax plugin 1447 */ 1448 if (plugins.rdParallax.length) { 1449 var i; 1450 $.RDParallax(); 1451 1452 if (!isIE && !isMobile) { 1453 $(window).on("scroll", function () { 1454 for (i = 0; i < plugins.rdParallax.length; i++) { 1455 var parallax = $(plugins.rdParallax[i]); 1456 if (isScrolledIntoView(parallax)) { 1457 parallax.find(".rd-parallax-inner").css("position", "fixed"); 1458 } else { 1459 parallax.find(".rd-parallax-inner").css("position", "absolute"); 1460 } 1461 } 1462 }); 1463 } 1464 1465 $("a[href='#'], a[href^='#']").on("click", function (event) { 1466 setTimeout(function () { 1467 $(window).trigger("resize"); 1468 }, 300); 1469 }); 1470 } 1471 1472 /** 1473 * Page loader 1474 * @description Enables Page loader 1475 */ 1476 if (plugins.pageLoader.length > 0) { 1477 setTimeout(function () { 1478 plugins.pageLoader.addClass("loaded"); 1479 plugins.pageLoader.fadeOut(500, function () { 1480 $(this).remove(); 1481 }); 1482 1483 $window.trigger("resize"); 1484 }, 200); 1485 } 1486});
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.