PageSourceSearch

https://www.vieuxportdemontreal.com/themes/vpm_d8/js/styles.js?v=10.6.14

js vieuxportdemontreal.com collected 2026-10-02 05:26:24 UTC 26,640 bytes, 846 lines download raw bytes

1(function($) {
2  $.fn.onPageLoadStyles = function() {
3    // HTML : Responsive font size
4    function changeBaseFont() {
5      var zoom = detectZoom.zoom();
6      var device = detectZoom.device();
7      var newZoomVal = parseFloat(zoom, 10).toFixed(2);
8      var newDeviceVal = parseFloat(device, 10).toFixed(2);
9
10      viewportWidth = $(window).outerWidth();
11      fontSize = viewportWidth * 0.00390625 * newZoomVal;
12      $('html').css('font-size', fontSize);
13    }
14
15    changeBaseFont();
16
17    // Conversion to REM
18    // --------------------------------------- //
19
20    var rem = (function rem() {
21      var html = document.getElementsByTagName('html')[0];
22      return function() {
23        return parseInt(window.getComputedStyle(html)['fontSize']);
24      };
25    })();
26
27    function toRem(length) {
28      return parseInt(length) / rem();
29    }
30
31    // --------------------------------------- //
32    //            CALL TO FUNCTIONS            //
33    // --------------------------------------- //
34
35    $(document).ready(function() {
36      changeBaseFont();
37    });
38
39    $(window).smartresize(function() {
40      changeBaseFont();
41    });
42
43    $('html').css('font-size', fontSize);
44    // --------------------------------------- //
45    //             STATE DETECTIONS            //
46    // --------------------------------------- //
47
48    // VIEWPORT RESIZE
49    $(window).resize(function() {
50      changeBaseFont();
51    });
52    ///Detect mobile device
53    var isMobile = {
54      Android: function() {
55        return navigator.userAgent.match(/Android/i);
56      },
57      BlackBerry: function() {
58        return navigator.userAgent.match(/BlackBerry/i);
59      },
60      iOS: function() {
61        return navigator.userAgent.match(/iPhone|iPad|iPod/i);
62      },
63      Opera: function() {
64        return navigator.userAgent.match(/Opera Mini/i);
65      },
66      Windows: function() {
67        return navigator.userAgent.match(/IEMobile/i);
68      },
69      Firefox: function() {
70        return navigator.userAgent.match(/Mozilla/i);
71      },
72      any: function() {
73        return (
74          isMobile.Android() ||
75          isMobile.BlackBerry() ||
76          isMobile.iOS() ||
77          isMobile.Opera() ||
78          isMobile.Windows() ||
79          isMobile.Firefox()
80        );
81      }
82    };
83
84    window.isMobile = isMobile.any();
85    // --------------------------------------- //
86    //                FUNCTIONS                //
87    // --------------------------------------- //
88    //CAROUSELS
89    //
90    //Set variable for different language
91    var previous = "previous";
92    var next = "next";
93    var element = "element";
94    var activeElement = "Active element";
95    var indexOf = "of";
96    if($('html').attr('lang') === 'fr') {
97      previous = "précédent";
98      next = "suivant";
99      element = "élément";
100      activeElement = "Élément actif";
101      indexOf = "de";
102    }
103    var prevArrow = `<button type="button" class="arrow-left"><span class="visuallyhidden">${previous}</span></button>`;
104    var nextArrow = `<button type="button" class="arrow-right"><span class="visuallyhidden">${next}</span></div>`;
105    $('.carousel-init').each(function() {
106      var data = {
107        accessibility: true,
108        dots: true,
109        arrows: true,
110        centerMode: true,
111        centerPadding: '0px',
112        mobileFirst: true,
113        pauseOnDotsHover: true,
114        swipeToSlide: true,
115        infinite: true,
116        prevArrow: prevArrow,
117        nextArrow: nextArrow,
118        customPaging: function(slider, i) {
119          return $('<button type="button" data-role="none" role="button" />').text('');
120        }
121      };
122      //get variables from data, then set
123      $(this).slick(data);
124
125      if ($(this).slick('getSlick').slideCount == 1) {
126        $(this).addClass('single-slide');
127      }
128    });
129    $('.carousel-init-3').each(function() {
130      var data = {
131        autoplay: true,
132        autoplaySpeed: 5000,
133        accessibility: true,
134        dots: true,
135        arrows: false,
136        mobileFirst: true,
137        pauseOnDotsHover: true,
138        swipeToSlide: true,
139        infinite: true,
140        customPaging: function(slider, i) {
141          return $('<button type="button" data-role="none" role="button" />').text('');
142        }
143      };
144      //get variables from data, then set
145      $(this).slick(data);
146
147      if ($(this).slick('getSlick').slideCount == 1) {
148        $(this).addClass('single-slide');
149      }
150    });
151
152    $('.carousel-init-7').each(function() {
153      var data = {
154        autoplay: true,
155        autoplaySpeed: 5000,
156        accessibility: true,
157        dots: false,
158        arrows: true,
159        mobileFirst: true,
160        pauseOnDotsHover: true,
161        swipeToSlide: true,
162        slidesToShow: 1,
163        slidesToScroll: 1,
164        infinite: true,
165        prevArrow: prevArrow,
166        nextArrow: nextArrow,
167        responsive: [
168          {
169            breakpoint: 1200,
170            settings: {
171              slidesToShow: 3,
172              slidesToScroll: 3
173            }
174          },
175          {
176            breakpoint: 992,
177            settings: {
178              slidesToShow: 2,
179              slidesToScroll: 2
180            }
181          },
182          {
183            breakpoint: 768,
184            settings: {
185              slidesToShow: 1,
186              slidesToScroll: 1
187            }
188          }
189        ]
190      };
191      //get variables from data, then set
192      $(this).slick(data);
193
194      if ($(this).slick('getSlick').slideCount == 1) {
195        $(this).addClass('single-slide');
196      }
197    });
198    $('.carousel-init-4').each(function() {
199      var data = {
200        autoplay: false,
201        dots: false,
202        arrows: true,
203        mobileFirst: true,
204        pauseOnDotsHover: true,
205        swipeToSlide: true,
206        infinite: true,
207        prevArrow: prevArrow,
208        nextArrow: nextArrow,
209      };
210      //get variables from data, then set
211      $(this).slick(data);
212
213      if ($(this).slick('getSlick').slideCount == 1) {
214        $(this).addClass('single-slide');
215      }
216    });
217    $('.carousel-init-5').each(function() {
218      var data = {
219        autoplay: true,
220        autoplaySpeed: 8000,
221        accessibility: true,
222        infinite: true,
223        mobileFirst: true,
224        slidesToShow: 2,
225        slidesToScroll: 2,
226        dots: true,
227        arrows: false,
228        pauseOnDotsHover: true,
229        customPaging: function(slider, i) {
230          return $('<button type="button" data-role="none" role="button" />').text('');
231        }
232      };
233      $(this).slick(data);
234
235      if ($(this).slick('getSlick').slideCount == 1) {
236        $(this).addClass('single-slide');
237      }
238    });
239
240    // SLIDERS UPDATE FROM 2021
241    // --------------------------------------------- //
242    $('.carousel-init-might-enjoy').each(function() {
243      var data = {
244        autoplay: false,
245        dots: true,
246        accessibility: true,
247        arrows: true,
248        mobileFirst: true,
249        pauseOnDotsHover: true,
250        swipeToSlide: true,
251        slidesToShow: 1,
252        slidesToScroll: 1,
253        infinite: false,
254        prevArrow: prevArrow,
255        nextArrow: nextArrow,
256        responsive: [
257          {
258            breakpoint: 1400,
259            settings: {
260              slidesToShow: 4,
261              slidesToScroll: 4
262            }
263          },
264          {
265            breakpoint: 991,
266            settings: {
267              slidesToShow: 3,
268              slidesToScroll: 3
269            }
270          },
271          {
272            breakpoint: 768,
273            settings: {
274              slidesToShow: 2,
275              slidesToScroll: 2
276            }
277          }
278        ]
279      };
280      //get variables from data, then set
281      $(this).slick(data);
282
283      if ($(this).slick('getSlick').slideCount == 1) {
284        $(this).addClass('single-slide');
285      }
286    });
287    $('.carousel-init-event-activities').each(function() {
288      var data = {
289        autoplay: false,
290        dots: true,
291        arrows: true,
292        accessibility: true,
293        mobileFirst: true,
294        pauseOnDotsHover: true,
295        swipeToSlide: true,
296        slidesToShow: 1,
297        slidesToScroll: 1,
298        infinite: false,
299        prevArrow: prevArrow,
300        nextArrow: nextArrow,
301        responsive: [
302          {
303            breakpoint: 991,
304            settings: {
305              slidesToShow: 3,
306              slidesToScroll: 3
307            }
308          },
309          {
310            breakpoint: 768,
311            settings: {
312              slidesToShow: 2,
313              slidesToScroll: 2
314            }
315          }
316        ]
317      };
318      //get variables from data, then set
319      $(this).slick(data);
320
321      if ($(this).slick('getSlick').slideCount == 1) {
322        $(this).addClass('single-slide');
323      }
324    });
325    $('.carousel-init-full-width').each(function() {
326      var data = {
327        autoplay: false,
328        dots: true,
329        arrows: true,
330        accessibility: true,
331        mobileFirst: true,
332        pauseOnDotsHover: true,
333        swipeToSlide: true,
334        slidesToShow: 1,
335        slidesToScroll: 1,
336        infinite: false,
337        prevArrow: prevArrow,
338        nextArrow: nextArrow,
339      };
340      //get variables from data, then set
341      $(this).slick(data);
342
343      if ($(this).slick('getSlick').slideCount == 1) {
344        $(this).addClass('single-slide');
345      }
346    });
347
348    // Add exhaustive description to dot navigation
349    $('.slick-dots').each(function() {
350      const childList = $(this).find('li');
351      childList.each(function(index) {
352        if(this.classList.contains('slick-active')) {
353          $(this).find('button').html(`<span class="visuallyhidden">${activeElement}, ${index+1} ${indexOf} ${childList.length}</span>`);
354        } else {
355          $(this).find('button').html(`<span class="visuallyhidden">${element} ${index+1} ${indexOf} ${childList.length}</span>`);
356        }
357      });
358    });
359
360    $('.slick-arrow').each(function() {
361
362    })
363
364    // ANIMATIONS IN SLIDERS
365    // --------------------------------------------- //
366    if (!("ontouchstart" in document.documentElement)) {
367      $('.teaser-might-enjoy-link').hover(function() {
368        $(this).find('.teaser-content').slideToggle();
369      });
370      $('.teaser-might-enjoy-link').focusin(function() {
371        $(this).find('.teaser-content').slideToggle();
372      });
373      $('.teaser-might-enjoy-link').focusout(function() {
374        $(this).find('.teaser-content').slideToggle();
375      });
376    }
377
378    // END SLIDERS UPDATE
379
380    // ACCORDEONS
381    // --------------------------------------------- //
382    $("button.accordion-title").attr('tabindex', 0);
383    $(".accordion-trigger").attr('tabindex', 0);
384
385    $.fn.vpAccordeon = function(params) {
386      var accordeon2Defaultactive = 0;
387      switch (params.type) {
388        case 1:
389          $(window).resize(function() {
390            // Get height of content
391            $(this).find('.field-collection-level-1 h2').click(function() {
392              var x = $(this);
393              accordeonHeightDetection(x);
394            });
395          });
396          // First triggers detection
397          $(this).find('.field-collection-level-1 h2').click(function() {
398            var x = $(this);
399            accordeonHeightDetection(x);
400          });
401          $(this).find('.field-collection-level-1 > .section > h2').each(function() {
402            var labelHeight = toRem($(this).height());
403            var labelPadding = toRem($(this).css('padding-top')) + toRem($(this).css('padding-bottom'));
404            $(this).parents('.field-collection-level-1').css('height', labelHeight + labelPadding + 'rem');
405          });
406          break;
407        case 2:
408          // Adding labels
409          $(this).find('.details .description').each(function() {
410            var labelText = $(this).find('h2').text();
411            if (labelText) {
412              $(this)
413                .parents('.accordeon-2')
414                .find('.labels ul')
415                .append("<li class='section'><h3 class='label'>" + labelText + '</h3></li>');
416            }
417          });
418          // Adding active on first label
419          $(this).find('.details li').eq(accordeon2Defaultactive).addClass('active');
420          $(this).find('.labels li').eq(accordeon2Defaultactive).addClass('active');
421          // Listens for a click on labels
422          $(this).find('.labels .section').click(function() {
423            var x = $(this);
424            accordeon2(x);
425          });
426          break;
427      }
428
429      // ACCORDEON 1
430      // --------------------------------------- //
431
432      function accordeonHeightDetection(itemObj) {
433        var descriptionHeight = toRem($(itemObj).siblings('.acc-content').height());
434        var labelHeight = toRem($(itemObj).height());
435        var descriptionPadding =
436          toRem($(itemObj).siblings('.acc-content').css('padding-top')) +
437          toRem($(itemObj).siblings('.acc-content').css('padding-bottom'));
438        var labelPadding = toRem($(itemObj).css('padding-top')) + toRem($(itemObj).css('padding-bottom'));
439        var totalPadding = descriptionPadding + labelPadding;
440        var totalHeight = labelHeight + descriptionHeight;
441        $(itemObj).parents('.field-collection-level-1').toggleClass('active');
442        if ($(itemObj).parents('.field-collection-level-1').hasClass('active')) {
443          $(itemObj)
444            .parents('.field-collection-level-1')
445            .css('height', labelHeight + descriptionHeight + totalPadding + 'rem');
446        } else {
447          var total = labelHeight + labelPadding;
448          if (window.outerWidth - (window.outerWidth - $(window).outerWidth()) / 2 - 1 < 550) {
449            total = labelHeight;
450          }
451          $(itemObj).parents('.field-collection-level-1').css('height', total + 'rem');
452        }
453      }
454
455      // ACCORDEON 2
456      // --------------------------------------- //
457
458      function accordeon2(itemObj) {
459        var elementIndex = $(itemObj).parents('.labels').find('li').index(itemObj);
460        // LABELS
461        $(itemObj).siblings().removeClass('active');
462        $(itemObj).addClass('active');
463        // DETAILS
464        $(itemObj).parents('.accordeon-wrapper').find('.description').removeClass('active');
465        $(itemObj).parents('.accordeon-wrapper').find('.description').eq(elementIndex).addClass('active');
466      }
467    };
468    $('.accordeon-1').each(function() {
469      $(this).vpAccordeon({
470        type: 1
471      });
472    });
473    $('.accordeon-2').each(function() {
474      $(this).vpAccordeon({
475        type: 2
476      });
477    });
478    // MENU
479    $('.btn-menu').on('click', openMenu);
480    $('.btn-close').on('click', closeMenu);
481    $('.closing-nav').focusin(function() {
482      closeMenu();
483      $('.btn-menu').focus();
484    });
485
486    var $menu = $('.main-menu');
487
488    function openMenu(event) {
489      $menu.fadeIn();
490      $menu.addClass('active');
491      $('.btn-menu').addClass('menu-active');
492      $('.main-menu .btn-close')[0].focus({ preventScroll: true });
493      $(document).on('focusin', onFocus);
494      $(document).on('click', onFocus);
495      event.stopPropagation();
496    }
497
498    function closeMenu(e) {
499      $(document).off('focusin', onFocus);
500      $menu.fadeOut();
501      $menu.removeClass('active');
502      $('.btn-menu').removeClass('menu-active');
503      $('.main-header .btn-menu')[0].focus({ preventScroll: true });
504      $(document).off('click', onFocus);
505    }
506
507    function onFocus(e) {
508      if (!$('.main-menu-wrapper')[0].contains(e.target)) {
509        closeMenu();
510      }
511      if ($('.map-navigation-full').length) {
512        if (!$('.map-navigation-full')[0].contains(e.target)) {
513          closeMapMenu();
514        }
515      }
516    }
517
518    //SVPM MICROSITE - MENU MOBILE
519    $('.menu-mobile-btn').click(toggleMenu);
520    function toggleMenu() {
521      $('.main-menu-mobile').toggleClass('active');
522      if ($('.main-menu-mobile').hasClass('active')) {
523        $(this).attr('aria-expanded', true);
524      } else {
525        $(this).attr('aria-expanded', false);
526      }
527    }
528
529    // MOBILE MENU Filter
530
531    $('.btn-map-menu').on('click', openMapMenu);
532    $('.btn-close').click(closeMapMenu);
533    $('.closing-map-nav').focusin(function() {
534      closeMapMenu();
535      $('.btn-map-menu').focus();
536    });
537
538    var $mapMenu = $('.main-map-navigation-full')
539
540    function openMapMenu(event) {
541      $mapMenu.fadeIn();
542      $mapMenu.addClass('active');
543      $('.main-map-navigation-full .btn-close')[0].focus({ preventScroll: true });
544      $(document).on('focusin', onFocus);
545      $(document).on('click', onFocus);
546      event.stopPropagation();
547    }
548
549    function closeMapMenu(e) {
550      $(document).off('focusin', onFocus);
551      $mapMenu.fadeOut();
552      $mapMenu.removeClass('active');
553      if ($('.btn-map-menu').length) {
554        $('.btn-map-menu')[0].focus({ preventScroll: true });
555      }
556      $(document).off('click', onFocus);
557    }
558
559    // function onFocus(e) {
560    //   if ($('.map-navigation-full')) {
561    //     if (!$('.map-navigation-full')[0].contains(e.target)) {
562    //       closeMapMenu();
563    //     }
564    //   }
565    // }
566
567    // Forms
568
569    $.fn.vpCustomForm = function() {
570      var maxCharactersForPlaceholder = 55;
571      // Subtitles between fields
572      if ($(this).hasClass('port-d-escale-form')) {
573        var subtitle = $(this).find('.ss-title').text();
574        $(this).find('.ss-title').remove();
575        $(this)
576          .find('form > .form-item-field-form-email-0-value')
577          .after("<div class='subtitle'><h2>" + subtitle + '</h2></div>');
578      }
579
580      if ($(this).hasClass('contact-proposal')) {
581        var subtitle = $(this).find('.ss-title').text();
582        $(this).find('.ss-title').remove();
583        $(this)
584          .find('form > .form-item-field-form-room-configurati')
585          .after("<div class='subtitle'><h3>" + subtitle + '</h3></div>');
586      }
587
588      // Most fields will have the title as their placeholder.
589      $(this).find('.form-item').not('.js-form-type-radio').not('.js-form-type-checkbox').each(function(i, t) {
590        placeholderCandidate = true;
591        // If field is dropdown type 2, add class
592        if ($(this).hasClass('form-item-field-form-request')) {
593          $(this).addClass('dropdown-type-2');
594        }
595
596        // Fields who are exceptions
597        if ($(this).hasClass('form-item-field-form-electricity-quantity-0-value')) {
598          $(this).addClass('exception');
599        }
600
601        // This code filters the exceptions
602        // If field is textfield (without textarea) or dropdown, need to verify title is not too long to overflow the box.
603        if (
604          $(this).hasClass('js-form-type-select') ||
605          ($(this).hasClass('js-form-type-textfield') && $(this).find('input').length)
606        ) {
607          if ($(this).find('label').text().length >= maxCharactersForPlaceholder) {
608            placeholderCandidate = false;
609          }
610        }
611
612        if ($(this).hasClass('dropdown-type-2') || $(this).hasClass('exception')) {
613          placeholderCandidate = false;
614        }
615
616        if (placeholderCandidate == true) {
617          titleToPlaceholder(t);
618        }
619      });
620      function titleToPlaceholder(itemObj) {
621        var placeholderOn = true;
622        var required = false;
623        var tag = 'default';
624        var title = $(itemObj).find('label').text();
625        // No placeholders for these items
626        if (
627          $(itemObj).hasClass('form-item-field-form-electricity-quantity-0-value') ||
628          $(itemObj).hasClass('form-item-field-form-length-unit') ||
629          $(itemObj).hasClass('form-item-field-form-beam-unit')
630        ) {
631          placeholderOn = false;
632        }
633
634        // For fields with a label within the legend tag
635        if ($(itemObj).children('legend').length) {
636          title = $(itemObj).find('legend span').text();
637          tag = 'legendLabel';
638        }
639
640        // For select with a placeholder
641        if ($(itemObj).hasClass('js-form-type-select')) {
642          title = $(itemObj).find('label').text();
643          tag = 'select';
644          if ($(itemObj).parents('.contact-form').length) {
645            tag = 'default';
646          }
647        }
648
649        // For date items
650        if ($(itemObj).find('.js-datepicker-input').length) {
651          $(itemObj).addClass('datepicker-on');
652          $(itemObj).append(
653            "<div class='calendar-icon'><div class='wrapper'><i class='fa fa-calendar' aria-hidden='true'></i></div></div>"
654          );
655        }
656
657        // Required fields need an asterisk after their title
658        if ($(itemObj).find('.form-required').length || $(itemObj).find('.required').length) {
659          title = title + '*';
660          required = true;
661        }
662
663        // LABEL AND PLACEHOLDER PLACEMENT
664        if (tag == 'legendLabel') {
665          $(itemObj).find('legend span').text(title);
666          $(itemObj).children('input').attr('placeholder', title);
667          $(itemObj).children('div').children('textarea').attr('placeholder', title);
668        } else if (tag == 'select') {
669          if (placeholderOn == true) {
670            $(itemObj)
671              .find('select')
672              .append("<option selected='selected' class='hide' >" + title + '</option>');
673          }
674
675          $(itemObj).children('label').addClass('hidden');
676        } else if (tag == 'default') {
677          $(itemObj).children('label').text(title);
678          $(itemObj).children('input').attr('placeholder', title);
679          $(itemObj).children('div').children('textarea').attr('placeholder', title);
680          $(itemObj).children('label').addClass('hidden');
681        } else if (placeholderOn == false) {
682          $(itemObj).children('input').removeAttr('placeholder');
683          $(itemObj).children('label').text(title);
684        }
685      }
686    };
687    $('.custom-form').each(function() {
688      $(this).vpCustomForm();
689    });
690    // Dropdown
691    // --------------------------------------- //
692
693    $.fn.initDropdownElementClick = function() {
694      $(this).on('click', function() {
695        var element = $(this).text();
696        $(this).parent().children().removeClass('current');
697        $(this).addClass('current');
698        $(this).parent().siblings('.current-item').text(element);
699        $(this).parents('.dropdown').trigger('dropdown-completed');
700      });
701    };
702    // Type 1
703    function dropdown1() {
704      $('.dropdown').click(function() {
705        $(this).toggleClass('active');
706        $(this).trigger('dropdown');
707      });
708      $('.dropdown ul li').initDropdownElementClick();
709    }
710
711    // Type 2
712
713    $.fn.vpDropdown2 = function() {
714      $(this).wrap('<div class="select-wrapper"></div>');
715      $(this).parent().append('<span class="icon-arrow-down"></span>');
716    };
717    $('.custom-form .js-form-type-select select').each(function() {
718      $(this).vpDropdown2();
719    });
720    $('.webform .js-form-type-select select').each(function() {
721      $(this).vpDropdown2();
722    });
723
724    // Search bar
725    // -------------------------------------- //
726    $.fn.vpSearchBar = function() {
727      var barState = 'closed';
728      $(this).find('.btn-search').click(function() {
729        if (barState == 'closed') {
730          $(this).parents('.search-bar').addClass('open');
731          barState = 'open';
732          $('.form-search').focus();
733        }
734      });
735      $(this).find('.btn-close').click(function() {
736        if (barState == 'open') {
737          $(this).parents('.search-bar').removeClass('open');
738          barState = 'closed';
739        }
740      });
741    };
742    $('.search-bar').each(function() {
743      $(this).vpSearchBar();
744    });
745    // DROPDOWN
746    dropdown1();
747    //Lazy load on image
748    $(document).ready(function() {
749      $('.lazy').Lazy({
750        threshold: 0,
751        delay: 1000,
752        beforeLoad: function(element) {
753          // called before an elements gets handled
754        },
755        afterLoad: function(element) {
756          element.addClass('image-loader-transition');
757          element.removeClass('image-loader');
758        },
759        onError: function(element) {
760          // called whenever an element could not be handled
761        },
762        onFinishedAll: function() {
763          // called once all elements was handled
764        }
765      });
766    });
767    // Iframe CSS
768    // -------------------------------------- //
769    $.fn.vpiframeCss = function() {};
770    $('iframe').each(function() {
771      $(this).vpiframeCss();
772    });
773  };
774
775  $(document).ready(function() {
776    $('[href*="/evenement/lancement-estival-2018"]').addClass('hide-date-end');
777    $('.hide-date-end').parent().addClass('hide-date-end-2');
778    $('.hide-date-end-2 .end-date').hide();
779    $('.hide-date-end-2 .dash-separator').hide();
780
781    //FOR ENGLISH
782    $('[href*="/event/summer-launch-2018"]').addClass('hide-date-end');
783    $('.hide-date-end').parent().addClass('hide-date-end-2');
784    $('.hide-date-end-2 .end-date').hide();
785    $('.hide-date-end-2 .dash-separator').hide();
786
787    $('div[aria-describedby*="slick-slide01"] .day').hide();
788    $('div[aria-describedby*="slick-slide01"] .separator').hide();
789    $('div[aria-describedby*="slick-slide01"] .month').hide();
790
791    $('body').onPageLoadStyles();
792  });
793
794  /*** Animations lors du scroll du front page  ***/
795
796  $(window).on('load', function() {
797    showHiddenElements();
798  });
799
800  $(document).on('scroll', function() {
801    showHiddenElements();
802  });
803  function showHiddenElements() {
804    $('.vpm-to-show:not(".show")').each(function() {
805      if (checkVisible(this, 'above')) {
806        $(this).addClass('show');
807      }
808    });
809  }
810  function checkVisible(elm, evalType) {
811    evalType = evalType || 'visible';
812    var vpH = $(window).height();
813    // Viewport Height
814    st = $(window).scrollTop();
815    // Scroll Top
816    y = $(elm).offset().top;
817    var elementHeight = $(elm).height();
818    if (evalType === 'visible') {
819      return y < vpH + st && y > st - elementHeight;
820    }
821    if (evalType === 'above') {
822      return y < vpH + st;
823    }
824  }
825  //fix for some input in the form that doesnt show properly on mobile firefox
826  $(
827    '#webform-submission-commercial-project-proposal-form div.js-form-item input, #webform-submission-commercial-project-proposal-form div.js-form-item textarea '
828  ).css({
829    padding: '20px',
830    'min-height': '40px'
831  });
832
833  $('#edit-financial-projections--wrapper [type=checkbox]').css({
834    'background-color': '#eee'
835  });
836
837  // fix the blog width
838  var isBlogFullWidth = $('div#blog').hasClass('full-width');
839  var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
840  var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
841  if (isBlogFullWidth === true && w > 900) {
842    $('div.blog-post-row.views-row').css({
843      width: '100%'
844    });
845  }
846})(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.