PageSourceSearch

https://www.wallonia.be//sites/all/themes/wallonia/assets/js/main.js?sdh48r

js wallonia.be collected 2026-10-01 11:49:37 UTC 7,136 bytes, 255 lines download raw bytes

1jQuery(document).ready(function () {
2
3  let vh = window.innerHeight * 0.01;
4  document.documentElement.style.setProperty('--vh', `${vh}px`);
5  window.addEventListener('resize', () => {
6    // We execute the same script as before
7    let vh = window.innerHeight * 0.01;
8    document.documentElement.style.setProperty('--vh', `${vh}px`);
9  });
10
11  /* Menu overlay trigger */
12  jQuery('.navbar-toggler-main').on('click', function () {
13    jQuery('body').toggleClass('navbar-open');
14  });
15
16  
17  $('.view-toggler a').on('click', function () {
18    
19    $('.view-toggler a').each(function(){
20      $(this).removeClass('active');
21    })
22    $(this).toggleClass('active');
23    if($(this).hasClass('list')){
24      jQuery('.ambassadors').addClass('list');
25    }else{
26      jQuery('.ambassadors').removeClass('list');
27    }
28   
29    return false;
30  });
31
32  if($(window).width() <= 991) {
33    
34    $('li.dropdown > span').on('click', function () {
35      event.preventDefault();
36      $container = $(this).parent('li').children('ul');
37      $container.toggleClass('show');
38      $('body').toggleClass('show-sub');
39      $container.prepend('<span class="navbar-toggler"><span class="navbar-toggler-icon"></span></span>')
40      return false;
41    });
42    
43  }
44
45
46  /* Menu overlay trigger */
47  if(jQuery('.pager').length){
48    $first = jQuery('.pager').find('li.first a');
49    $last = jQuery('.pager').find('li.last a');
50    console.log($last);
51    if($last.attr('href')){
52      $link = $last.attr('href').match(/page=([0-9]+)/)[1];
53      $last.html(parseInt($link)+1);
54    }
55    $first.html('1');
56  }
57
58
59  $('main .content iframe:not(.embed-responsive-item)').each(function(){
60    $(this).wrap('<div class="embed-responsive embed-responsive-16by9" />').addClass('embed-responsive-item');
61  });
62
63
64  /* Cookies warning */
65  jQuerycookie_enabled = Cookies.get('cookie_enabled');
66  if(!jQuerycookie_enabled){
67      jQuery('.cookie').addClass("show");
68  }
69  jQuery('.cookie button').click(function(){
70  Cookies.set('cookie_enabled', 1, { expires: 7 });
71      jQuery('.cookie').removeClass("show");
72  });
73
74  /* Scroll */
75  jQuery(".scroll").on('click', function(event) {
76    if (this.hash !== "") {
77        event.preventDefault();
78        var hash = this.hash;
79        jQuery('html, body').animate({
80        scrollTop: jQuery(hash).offset().top
81        }, 500, function(){
82        window.location.hash = hash;
83        });
84    }
85  });
86
87  if($('.slider-services').length){
88    var SwiperServices = new Swiper ('.slider-services', {
89      speed: 500,
90      spaceBetween: 30,
91      loop: true,
92      centeredSlides :true,
93      autoplay: {
94        delay: 4000,
95      },
96      navigation: {
97        nextEl: '.swiper-button-next',
98        prevEl: '.swiper-button-prev',
99      },
100      breakpoints: {
101        320: {
102          slidesPerView: 1,
103        },
104        767: {
105          slidesPerView: 3,
106        },
107      }
108    });
109  }
110
111  if($('.slider-auras').length){
112    var SwiperAuras = new Swiper ('.slider-auras', {
113      speed: 500,
114      loop: true,
115      effect: 'fade',
116      fadeEffect: {
117        crossFade: true
118      },
119      /*autoplay: {
120        delay: 4000,
121      },*/
122      pagination: {
123        el: '.swiper-pagination',
124        type: 'fraction',
125      },
126      navigation: {
127        nextEl: '.swiper-button-next',
128        prevEl: '.swiper-button-prev',
129      },
130
131    });
132  }
133
134  /* GALLERY MODAL */
135  var $imgSrc;
136  $('.gallery_trigger').click(function() {
137      $imgSrc = $(this).data( "src" );
138  });
139  //console.log($videoSrc);
140
141  // when the modal is opened autoplay it
142  $('#gallery').on('shown.bs.modal', function (e) {
143    $("#imgplayer").html('<img src="'+$imgSrc+'">');
144  })
145  // stop playing the youtube video when I close the modal
146  $('#gallery').on('hide.bs.modal', function (e) {
147    $("#imgplayer").html('');
148  })
149
150
151  /* VIDEO MODAL */
152  var $videoSrc;
153  $('.play').click(function() {
154      $videoSrc = $(this).data( "src" );
155  });
156  //console.log($videoSrc);
157
158  // when the modal is opened autoplay it
159  $('#video').on('shown.bs.modal', function (e) {
160    $("#videoplayer").attr('src',$videoSrc + "?autoplay=1&amp;modestbranding=1&amp;showinfo=0&amp;rel=0" );
161  })
162  // stop playing the youtube video when I close the modal
163  $('#video').on('hide.bs.modal', function (e) {
164      $("#videoplayer").attr('src','');
165  })
166
167
168  doSelects();
169
170  /* Date filter */
171
172  $('.views-widget-filter-date_filter .select-options li').click(function() {
173    console.log('click');
174    $(this).siblings().removeClass( "active" );
175    $(this).addClass( "active" );
176  });
177
178
179});
180
181$(document).on('click', 'li.dropdown ul span.navbar-toggler', function () {
182  $(this).parent('ul').removeClass('show');
183  $('body').removeClass('show-sub');
184});
185
186/* CUSTOM SELECT */
187function doSelects(){
188  $('select').each(function(){
189    var $this = $(this), numberOfOptions = $(this).children('option').length;
190
191    $this.addClass('select-hidden');
192    $this.wrap('<div class="select"></div>');
193    $this.after('<div class="select-styled"></div>');
194
195    var $styledSelect = $this.next('div.select-styled');
196    var $selected = $(this).children('option:selected');
197
198    var $list = $('<ul />', {
199        'class': 'select-options'
200    }).insertAfter($styledSelect);
201
202    for (var i = 0; i < numberOfOptions; i++) {
203        $('<li />', {
204            text: $this.children('option').eq(i).text(),
205            rel: $this.children('option').eq(i).val()
206        }).appendTo($list);
207    }
208
209    $list.children('li[rel="'+$selected.val()+'"]').addClass('active');
210    $styledSelect.text($selected.text());
211
212    var $listItems = $list.children('li');
213
214    $styledSelect.click(function(e) {
215        e.stopPropagation();
216        $('div.select-styled.active').not(this).each(function(){
217            $(this).removeClass('active').next('ul.select-options').hide();
218        });
219        $(this).toggleClass('active').next('ul.select-options').toggle();
220    });
221
222    $listItems.click(function(e) {
223        e.stopPropagation();
224        $styledSelect.text($(this).text()).removeClass('active');
225        $this.val($(this).attr('rel'));
226        //$this.children('option[value='+$(this).attr('rel')+']').attr('selected','selected');
227        if($this.is("#edit-field-modele-und")){
228          if($(this).attr('rel') == 'H'){
229            $('#edit-field-taille-h').css('display','block');
230          }else{
231            $('#edit-field-taille-h').css('display','none');
232          }
233          if($(this).attr('rel') == 'F'){
234            $('#edit-field-taille-f').css('display','block');
235          }else{
236            $('#edit-field-taille-f').css('display','none');
237          }
238        }
239        $list.hide();
240        //console.log($this.val());
241    });
242
243    $(document).click(function() {
244        $styledSelect.removeClass('active');
245        $list.hide();
246    });
247
248  });
249}
250
251function goBack() {
252  event.preventDefault();
253  window.history.back();
254  return false;
255}

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.