1(function ($) { 2 'use strict'; 3 4 function slickInit() { 5 $('[data-init="slick"]').each(function () { 6 var $el = $(this); 7 8 var breakpointsWidth = {tn: 319, xs: 479, sm: 767, md: 991, lg: 1199}; 9 10 var slickDefault = { 11 dots: false, 12 arrows: true, 13 14 fade: false, 15 infinite: true, 16 autoplay: true, 17 pauseOnHover: true, 18 speed: 500, 19 20 slidesToShow: 1, 21 slidesToScroll: 1, 22 23 mobileFirst: true, 24 }; 25 26 // Merge settings. 27 var settings = $.extend(slickDefault, $el.data()); 28 delete settings.init; 29 30 // Build breakpoints. 31 if (settings.breakpoints) { 32 var _responsive = []; 33 var _breakpoints = settings.breakpoints; 34 35 var buildBreakpoints = function (key, value) { 36 if (breakpointsWidth[key]) { 37 _responsive.push({ 38 breakpoint: breakpointsWidth[key], 39 settings: { 40 slidesToShow: parseInt(value, 10), 41 slidesToScroll: 1 42 } 43 }); 44 }; 45 }; 46 47 if (typeof _breakpoints === "object") { 48 $.each(_breakpoints, buildBreakpoints); 49 } 50 51 delete settings.breakpoints; 52 settings.responsive = _responsive; 53 } 54 55 // console.log(settings); 56 $el.slick(settings); 57 }); 58 } 59 60 /** 61 * slick slide 62 */ 63 function sliderSyncing() { 64 $('.js-product-slide-for').slick({ 65 slidesToShow: 1, 66 slidesToScroll: 1, 67 arrows: false, 68 dots: false, 69 infinite: false, 70 fade: true, 71 asNavFor: '.js-product-slide-nav', 72 responsive: [ 73 { 74 breakpoint: 480, 75 settings: { 76 dots: true 77 } 78 } 79 ] 80 }); 81 $('.js-product-slide-nav').slick({ 82 slidesToShow: 5, 83 slidesToScroll: 1, 84 asNavFor: '.js-product-slide-for', 85 dots: false, 86 nav: true, 87 focusOnSelect: true, 88 infinite: false, 89 responsive: [ 90 { 91 breakpoint: 768, 92 settings: { 93 slidesToShow: 4 94 } 95 } 96 ] 97 }); 98 99 $('.js-list-post').slick({ 100 slidesToShow: 2, 101 slidesToScroll: 1, 102 dots: false, 103 arrows: true, 104 infinite: false, 105 responsive: [ 106 { 107 breakpoint: 1300, 108 settings: { 109 slidesToShow: 1, 110 dots: true, 111 arrows: false, 112 } 113 }, 114 { 115 breakpoint: 768, 116 settings: { 117 slidesToShow: 1 118 } 119 } 120 ] 121 }); 122 123 $('.js-special-mean').slick({ 124 slidesToShow: 4, 125 slidesToScroll: 1, 126 dots: false, 127 arrows: true, 128 infinite: false, 129 responsive: [ 130 { 131 breakpoint: 1400, 132 settings: { 133 dots: true, 134 arrows: false, 135 } 136 }, 137 { 138 breakpoint: 992, 139 settings: { 140 slidesToShow: 3 141 } 142 }, 143 { 144 breakpoint: 768, 145 settings: { 146 slidesToShow: 2 147 } 148 }, 149 { 150 breakpoint: 480, 151 settings: { 152 slidesToShow: 1 153 } 154 } 155 ] 156 }); 157 158 $('.js-event-gallery').slick({ 159 dots: false, 160 arrows: true, 161 infinite: false, 162 responsive: [ 163 { 164 breakpoint: 1400, 165 settings: { 166 dots: true, 167 arrows: false 168 } 169 }, 170 ] 171 }); 172 } 173 174 /** 175 * Custom select 176 */ 177 function customSelect() { 178 $('select').select2({ 179 minimumResultsForSearch: Infinity 180 }); 181 } 182 183 /** 184 * Datepicker 185 */ 186 function datePicker() { 187 $( ".datepicker" ).datepicker({ 188 showOtherMonths: true, 189 dayNamesMin: [ "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su" ] 190 }); 191 } 192 193 /** 194 * TimePicker 195 */ 196 function timePicker() { 197 $('#timepicker').timepicker(); 198 } 199 200 /** 201 * Popup 202 */ 203 function magnificPopup() { 204 $('.popup-video').magnificPopup({ 205 disableOn: 700, 206 type: 'iframe', 207 mainClass: 'mfp-fade', 208 removalDelay: 160, 209 preloader: false, 210 211 fixedContentPos: false 212 }); 213 214 $('.candia-card-wrapper .candia-card').magnificPopup({ 215 delegate: 'a', 216 type: 'image', 217 tLoading: 'Loading image #%curr%...', 218 mainClass: 'mfp-img-mobile', 219 gallery: { 220 enabled: true, 221 navigateByImgClick: true, 222 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 223 } 224 }); 225 } 226 227 // TODO: Fix error 228 function launchIntoFullscreen(element) { 229 if(element.requestFullscreen) { 230 element.requestFullscreen(); 231 } else if(element.mozRequestFullScreen) { 232 element.mozRequestFullScreen(); 233 } else if(element.webkitRequestFullscreen) { 234 element.webkitRequestFullscreen(); 235 } else if(element.msRequestFullscreen) { 236 element.msRequestFullscreen(); 237 } 238 239 $('.candia-card-fullscreen__icon').on('click', function(e) { 240 e.preventDefault(); 241 242 launchIntoFullscreen($(this).parent().find('.candia-card-fullscreen')[0]); 243 $(document).find('.candia-card-fullscreen').trigger('resize'); 244 245 }); 246 } 247 248 $('[data-init="slick"]').on('beforeChange', function(event, slick, currentSlide, nextSlide){ 249 // console.log(currentSlide); 250 }); 251 252 $(window).on('load', function() { 253 $('.candia-card-fullscreen-wrapper').each(function() { 254 var $this = $(this), 255 btnOpen = $('.candia-card-fullscreen__icon', $this), 256 btnClose = $('.candia-card-fullscreen__icon-close', $this), 257 slider = $('.candia-card-fullscreen', $this), 258 sliderOverlay = $('.candia-overlay', $this), 259 windowHeight = $(window).height(), 260 sliderWidth = sliderOverlay.outerWidth(), 261 sliderHeight = sliderOverlay.outerHeight(), 262 sliderOffsetTop = slider.offset().top, 263 sliderOffsetLeft = slider.offset().left; 264 $this.css({ 265 'width': sliderWidth, 266 'height': sliderHeight 267 }); 268 269 btnOpen.on('click', function(e) { 270 e.preventDefault(); 271 var scrollTop = $(window).scrollTop(); 272 273 $this.addClass('candia-card-fullscreen-wrapper--active'); 274 $('body').addClass('overflow-hidden'); 275 btnClose.addClass('zoom-in').removeClass('zoom-out'); 276 $(this).addClass('zoom-out').removeClass('zoom-in'); 277 278 $('.candia-overlay', $this).css({ 279 'opacity': '0', 280 'transition': 'none' 281 }); 282 slider.css({ 283 'position': 'fixed', 284 'top': sliderOffsetTop - scrollTop, 285 'left': sliderOffsetLeft, 286 'width': sliderWidth, 287 'height': sliderHeight 288 }).animate({ 289 'top': 0, 290 'left': 0, 291 'width': 100 + '%', 292 'height': 100 + '%' 293 }, 400, function() { 294 295 $(window).trigger('resize'); 296 297 setTimeout(function() { 298 $('.candia-overlay', $this).css({ 299 'opacity': '1', 300 'transition': 'all .3s ease' 301 }); 302 }, 100); 303 304 }); 305 306 }); 307 btnClose.on('click', function(e) { 308 e.preventDefault(); 309 var scrollTop = $(window).scrollTop(); 310 311 $('body').removeClass('overflow-hidden'); 312 btnOpen.addClass('zoom-in').removeClass('zoom-out'); 313 $(this).addClass('zoom-out').removeClass('zoom-in'); 314 315 $('.candia-overlay', $this).css({ 316 'opacity': '0', 317 'transition': 'none' 318 }); 319 slider.addClass('slider-fix').animate({ 320 'top': sliderOffsetTop - scrollTop, 321 'left': sliderOffsetLeft, 322 'width': sliderWidth, 323 'height': sliderHeight 324 }, 400, function() { 325 $this.removeClass('candia-card-fullscreen-wrapper--active'); 326 slider 327 .removeClass('slider-fix') 328 .removeAttr('style'); 329 $(window).trigger('resize'); 330 setTimeout(function() { 331 $('.candia-overlay', $this).css({ 332 'opacity': '1', 333 'transition': 'all .3s ease' 334 }); 335 }, 100); 336 }); 337 338 }); 339 340 var bg = $('.slick-current', '[data-init="slick"]').find('.img').css('background-image'); 341 slider.append('<div class="bg-fix"></div>'); 342 $('.bg-fix', slider).css('background-image', bg); 343 344 slider.on('afterChange', function(event, slick, currentSlide, nextSlide){ 345 var bg = $('.slick-current', '[data-init="slick"]').find('.img').css('background-image'); 346 if (slider.children('bg-fix').length == 1) 347 slider.append('<div class="bg-fix"></div>'); 348 $('.bg-fix', slider).css('background-image', bg); 349 }); 350 }); 351 }); 352 353 354 /** 355 * // jquery ui spinner 356 */ 357 function spinerInit() { 358 $('input[type="number"]').spinner({ 359 min: 0, 360 step: 1, 361 numberFormat: "C" 362 }); 363 } 364 365 /** 366 * Countdown 367 */ 368 function countdown() { 369 $('.candia-countdown').countdown('2025/10/10', function(event) { 370 var $this = $(this).html(event.strftime('' 371 + '<span><strong>%d</strong> <br> days</span> ' 372 + '<span><strong>%H</strong> <br> hours</span> ' 373 + '<span><strong>%M</strong> <br> minutes</span> ' 374 + '<span><strong>%S</strong> <br> seconds</span>')); 375 }); 376 } 377 378 /** 379 * isotope 380 */ 381 function isotope() { 382 $('.filtering__container').each(function() { 383 var el = $(this); 384 var filtering__container = el, 385 filters = $('.filters'); 386 filters.on('click', 'a', function() { 387 var selector = $(this).attr('data-filter'); 388 $('.current', filters).removeClass('current'); 389 $(this).addClass('current'); 390 filtering__container.isotope({ 391 filter: selector 392 }); 393 return false;
394 }); 395 396 $(window).on('resize', function() { 397 398 filtering__container.imagesLoaded(function() { 399 filtering__container.isotope({ 400 layoutMode: 'fitRows', 401 itemSelector: '.candia-card', 402 transitionDuration: '0.5s', 403 }); 404 }); 405 406 }).resize(); 407 408 filters.find('.current').trigger('click'); 409 }); 410 } 411 412 function debounce(func, wait, immediate) { 413 var timeout; 414 return function() { 415 var context = this, args = arguments; 416 var later = function() { 417 timeout = null; 418 if (!immediate) func.apply(context, args); 419 }; 420 var callNow = immediate && !timeout; 421 clearTimeout(timeout); 422 timeout = setTimeout(later, wait); 423 if (callNow) func.apply(context, args); 424 }; 425 }; 426 427 /* 428 * Fix bootstrap dropdown hover menu 429 */ 430 var dropdownHover = debounce(function() { 431 if ($(window).width()>1200) { 432 $('ul.nav li.dropdown').hover(function() { 433 $(this).find('.dropdown-menu').stop(true, true).delay(50).fadeIn(200); 434 }, function() { 435 $(this).find('.dropdown-menu').stop(true, true).delay(50).fadeOut(200); 436 }); 437 438 $('ul.nav li.dropdown').on('click', function(e) { 439 e.stopPropagation(); 440 }); 441 442 } 443 }, 100); 444 window.addEventListener('resize', dropdownHover); 445 446 function overlay() { 447 $('.navbar-toggle').on('click', function(event) { 448 $('.navbar-overlay').stop().toggleClass('open'); 449 $('html, body').stop().toggleClass('overflow-hidden'); 450 }); 451 }; 452 453 $(function () { 454 // Init bootstrap plugins. 455 $('[data-toggle="popover"]').popover(); 456 $('[data-toggle="tooltip"]').tooltip(); 457 458 var tpj = jQuery; 459 460 var revapi202; 461 tpj(document).ready(function() { 462 if (tpj("#rev_slider_202_1").revolution == undefined) { 463 revslider_showDoubleJqueryError("#rev_slider_202_1"); 464 } else { 465 revapi202 = tpj("#rev_slider_202_1").show().revolution({ 466 sliderType: "standard", 467 sliderLayout: "fullscreen", 468 dottedOverlay: "none", 469 delay: 5000, 470 navigation: { 471 keyboardNavigation: "off", 472 keyboard_direction: "horizontal", 473 mouseScrollNavigation: "off", 474 onHoverStop: "off", 475 touch: { 476 touchenabled: "on", 477 swipe_threshold: 75, 478 swipe_min_touches: 50, 479 swipe_direction: "horizontal", 480 drag_block_vertical: false 481 }, 482 arrows: { 483 style:"uranus", 484 enable:true, 485 hide_onmobile:true, 486 hide_under:778, 487 hide_onleave:true, 488 hide_delay:200, 489 hide_delay_mobile:1200, 490 tmp:'', 491 left: { 492 h_align:"left", 493 v_align:"center", 494 h_offset:20, 495 v_offset:0 496 }, 497 right: { 498 h_align:"right", 499 v_align:"center", 500 h_offset:20, 501 v_offset:0 502 } 503 }, 504 bullets: { 505 enable: true, 506 hide_onmobile: false, 507 style: "hermes", 508 hide_onleave: false, 509 direction: "horizontal", 510 h_align: "center", 511 v_align: "bottom", 512 h_offset: 0, 513 v_offset: 30, 514 space: 5, 515 tmp: '' 516 } 517 }, 518 responsiveLevels: [1240, 1024, 778, 480], 519 visibilityLevels: [1240, 1024, 778, 480], 520 gridwidth: [1240, 1024, 778, 480], 521 gridheight: [868, 768, 960, 720], 522 lazyType: "none", 523 parallax: { 524 type: "scroll", 525 origo: "slidercenter", 526 speed: 1000, 527 levels: [5, 10, 15, 20, 25, 30, 35, 40, 45, 46, 47, 48, 49, 50, 100, 55], 528 type: "scroll", 529 }, 530 shadow: 0, 531 spinner: "off", 532 stopLoop: "on", 533 stopAfterLoops: 0, 534 stopAtSlide: 1, 535 shuffle: "off", 536 autoHeight: "off", 537 fullScreenAutoWidth: "off", 538 fullScreenAlignForce: "off", 539 fullScreenOffsetContainer: "", 540 fullScreenOffset: "0", 541 disableProgressBar: "on", 542 hideThumbsOnMobile: "off", 543 hideSliderAtLimit: 0, 544 hideCaptionAtLimit: 0, 545 hideAllCaptionAtLilmit: 0, 546 debugMode: false, 547 fallbacks: { 548 simplifyAll: "off", 549 nextSlideOnWindowFocus: "off", 550 disableFocusListener: false, 551 } 552 }); 553 } 554 }); 555 556 setTimeout(function(){ 557 $('body').addClass('loaded'); 558 }, 500); 559 560 // Call functions here. 561 slickInit(); 562 customSelect(); 563 datePicker(); 564 spinerInit(); 565 sliderSyncing(); 566 countdown(); 567 timePicker(); 568 magnificPopup(); 569 isotope(); 570 dropdownHover(); 571 overlay(); 572 573 // launchIntoFullscreen(); 574 }); 575 576})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.