1jQuery().ready(function() { 2 const styleAndTranslateButtons = (context = document) => { 3 const $buttons = $(context).find('.jcr-load-more'); 4 $buttons.each(function () { 5 const btn = $(this); 6 7 // altijd styling veilig toepassen 8 if (!btn.data('styled')) { 9 btn.addClass('btn btn-sm btn-outline-secondary'); 10 btn.data('styled', true); 11 } 12 13 // vertaling robuuster maken (niet enkel exact match) 14 const text = btn.text().trim().toLowerCase(); 15 if (text.includes("load more") || text === "") { 16 if (lng.startsWith('nl')) { 17 btn.text("Laad meer"); 18 } else { 19 btn.text("Afficher plus"); 20 } 21 } 22 }); 23 }; 24 if($('#juicer-container').length){ 25 const waitForButton = setInterval(() => { 26 const btn = document.querySelector('.jcr-load-more'); 27 if (btn) { 28 clearInterval(waitForButton); 29 styleAndTranslateButtons(document); 30 } 31 }, 500); 32 } 33 34 35 // Initial call voor buttons die al in DOM staan 36 //styleAndTranslateButtons(document); 37 // Luister naar HTMX events op de document 38 document.body.addEventListener('htmx:afterSwap', function(evt) { 39 styleAndTranslateButtons(evt.target); 40 }); 41 42 43 const container = document.getElementById('juicer-container'); 44 if (container) { 45 let juicerLoaded = false; 46 const observer = new IntersectionObserver((entries, obs) => { 47 entries.forEach((entry) => { 48 if (entry.isIntersecting && !juicerLoaded) { 49 juicerLoaded = true; 50 const script = document.createElement('script'); 51 script.type = 'text/javascript'; 52 script.async = true; 53 script.defer = true; 54 const isNL = document.documentElement.lang?.startsWith('nl'); 55 const dayOfMonth = new Date().getDate(); 56 const firstHalf = dayOfMonth <= 15; 57 if (isNL) { 58 script.src = firstHalf 59 ? 'https://www.juicer.io/embed/gemeente-voeren-7edd3af5-fcb1-4896-94f3-43f75137f052/embed-code.js?per=6' 60 : 'https://www.juicer.io/embed/gemeente-voeren/embed-code.js?per=6'; 61 } else { 62 script.src = firstHalf 63 ? 'https://www.juicer.io/embed/commune-de-fourons-58101cc1-ff47-49cf-9986-7d4fc162e57d/embed-code.js?per=6' 64 : 'https://www.juicer.io/embed/commune-de-fourons/embed-code.js?per=6'; 65 } 66 container.appendChild(script); 67 obs.unobserve(entry.target); 68 } 69 }); 70 }, { 71 rootMargin: '0px', 72 threshold: 0 73 }); 74 observer.observe(container); 75 } 76 77 //print screen 78 jQuery('.print_screen').click(function(){ 79 window.print(); 80 }); 81 82 jQuery('.search-open').click(function(){ 83 $('.searchfield').focus(); 84 }); 85 86 $('#searchform').submit(function () { 87 if($('.searchfield').val() == ""){ 88 $('.searchfield').focus(); 89 return false; 90 } 91 }); 92 93 //selectbox calendar mobile 94 $('.selectcalendarmonth').on('change', function() { 95 location.href = this.value; 96 }); 97 98 //play video in lightbox 99 $('.youtube,.playvideo').magnificPopup({ 100 type: 'iframe', 101 midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href. 102 }); 103 104 $(".newshistory").click(function(event) { 105 event.preventDefault(); 106 getoverviewurl($("html").attr("lang"), "voeren.be/nieuws/p", "fourons.be/nouvelles/p", "/nieuws", "/nouvelles" ); 107 }); 108 $(".calendarhistory").click(function(event) { 109 event.preventDefault(); 110 getoverviewurl($("html").attr("lang"), "voeren.be/agenda/", "fourons.be/calendrier/", "/agenda", "/calendrier" ); 111 }); 112 113 function getoverviewurl(lng, checknl, checkfr, fallbacknl, fallbackfr){ 114 if(document.referrer.indexOf(eval("check" + lng)) > 0){ 115 window.location.href = document.referrer; 116 }else{ 117 window.location.href = eval("fallback" + lng); 118 } 119 } 120 121 alignewstitlesonhome(); 122 arrangeMenuDropDowns(); 123 124 /*mobile menu*/ 125 jQuery('.navbar-toggler').click(function(){ 126 position_menu(); 127 }); 128 129 $(window).on('resize', function(){ 130 if (jQuery('.navbar-toggler').css('display') == 'none' || jQuery('.navbar-toggler').css("visibility") == "hidden"){ 131 jQuery('.navbar-nav').attr('style', 'margin-left: 0px !important'); 132 }else{ 133 position_menu(); 134 } 135 alignewstitlesonhome(); 136 arrangeMenuDropDowns(); 137 }); 138 139 function arrangeMenuDropDowns(){ 140 if (jQuery('.sz-large').is(':visible')){ 141 $('ul.navbar-nav').children('li:nth-last-child(2)').find('ul.dropdown-menu li ul.dropdown-menu').addClass('alignsubleft dropdown-menu-right'); 142 $('ul.navbar-nav').children('li:nth-last-child(3)').find('ul.dropdown-menu li ul.dropdown-menu').addClass('alignsubleft dropdown-menu-right'); 143 }else{ 144 $('ul.navbar-nav').children('li:nth-last-child(2)').find('ul.dropdown-menu li ul.dropdown-menu').removeClass('alignsubleft dropdown-menu-right'); 145 $('ul.navbar-nav').children('li:nth-last-child(3)').find('ul.dropdown-menu li ul.dropdown-menu').removeClass('alignsubleft dropdown-menu-right'); 146 } 147 /*Make subitems of last menu item popup on the left site of the parent menu*/ 148 $('ul.navbar-nav').children('li:last-child').find('ul.dropdown-menu li ul.dropdown-menu').addClass('alignsubleft dropdown-menu-right'); 149 150 //Hide to long sub sub sub items -> for instance 'uittreksels' 151 if (jQuery('.sz-xsmall').is(':visible') || jQuery('.sz-small').is(':visible') || jQuery('.sz-medium').is(':visible')){ 152 $("ul.dropdown-menu li ul.dropdown-menu li ul.dropdown-menu").show(); 153 }else{ 154 $("ul.dropdown-menu li ul.dropdown-menu li ul.dropdown-menu").each(function(n) { 155 if($(this).find('li').length > 20){ 156 $(this).hide(); 157 //$(this).find('li').css("width", "400px"); 158 } 159 }); 160 } 161 } 162 163 function position_menu() { 164 var verschil = jQuery('.navbar-brand').offset().left - jQuery('.navigationabsolute').offset().left - 40; 165 jQuery('.navbar-nav').attr('style', 'margin-left: ' + verschil + 'px !important'); 166 } 167 /*mobile menu-end*/ 168 169 function alignewstitlesonhome(){
170 $('.h4height').attr('style', 'height: none'); 171 if($('.h4height').length > 0){ 172 if (jQuery('.sz-large').is(':visible') || jQuery('.sz-extra-large').is(':visible')){ 173 var numberofrows = Math.floor($('.h4height').length / 4 -0.1) + 1; 174 for (i = 1; i <= numberofrows; i++) { 175 h4height = 0; 176 for (j = (i*4-4); j < (i*4); j++) { 177 if(j < $('.h4height').length){ 178 if($('.h4height:eq(' + j + ')').height() > h4height){ 179 h4height = $('.h4height:eq(' + j + ')').height(); 180 } 181 } 182 } 183 for (j = (i*4-4); j < (i*4); j++) { 184 $('.h4height:eq(' + j + ')').attr('style', 'height: ' + h4height + 'px'); 185 } 186 } 187 } 188 if (jQuery('.sz-medium').is(':visible') || jQuery('.sz-small').is(':visible')){ 189 var numberofrows = Math.floor($('.h4height').length / 2 -0.1) + 1; 190 $('.h4height').attr('style', 'height: none'); 191 for (i = 1; i <= numberofrows; i++) { 192 h4height = 0; 193 for (j = (i*2-2); j < (i*2); j++) { 194 if(j < $('.h4height').length){ 195 if($('.h4height:eq(' + j + ')').height() > h4height){ 196 h4height = $('.h4height:eq(' + j + ')').height(); 197 } 198 } 199 } 200 for (j = (i*2-2); j < (i*2); j++) { 201 $('.h4height:eq(' + j + ')').attr('style', 'height: ' + h4height + 'px'); 202 } 203 } 204 } 205 } 206 207 $('.h4heightb').attr('style', 'height: none'); 208 if($('.h4heightb').length > 0){ 209 if (jQuery('.sz-large').is(':visible') || jQuery('.sz-extra-large').is(':visible')){ 210 var numberofrows = Math.floor($('.h4heightb').length / 4 -0.1) + 1; 211 for (i = 1; i <= numberofrows; i++) { 212 h4heightb = 0; 213 for (j = (i*4-4); j < (i*4); j++) { 214 if(j < $('.h4heightb').length){ 215 if($('.h4heightb:eq(' + j + ')').height() > h4heightb){ 216 h4heightb = $('.h4heightb:eq(' + j + ')').height(); 217 } 218 } 219 } 220 for (j = (i*4-4); j < (i*4); j++) { 221 $('.h4heightb:eq(' + j + ')').attr('style', 'height: ' + h4heightb + 'px'); 222 } 223 } 224 } 225 if (jQuery('.sz-medium').is(':visible') || jQuery('.sz-small').is(':visible')){ 226 var numberofrows = Math.floor($('.h4heightb').length / 2 -0.1) + 1; 227 $('.h4heightb').attr('style', 'height: none'); 228 for (i = 1; i <= numberofrows; i++) { 229 h4heightb = 0; 230 for (j = (i*2-2); j < (i*2); j++) { 231 if(j < $('.h4heightb').length){ 232 if($('.h4heightb:eq(' + j + ')').height() > h4heightb){ 233 h4heightb = $('.h4heightb:eq(' + j + ')').height(); 234 } 235 } 236 } 237 for (j = (i*2-2); j < (i*2); j++) { 238 $('.h4heightb:eq(' + j + ')').attr('style', 'height: ' + h4heightb + 'px'); 239 } 240 } 241 } 242 } 243 } 244 245 /*font-sizes for readability*/ 246 var appsys_cElements = ""; 247 var appsys_fonts = []; 248 var appsys_lineheight = []; 249 var appsys_textsizefactor = 0; 250 var appsys_ignore = [ "fa fa-facebook", "fa fa-youtube", "fa fa-envelope", "fa fa-phone", "fa fa-fax", "form-control selectcalendarmonth", "calendaricon", "newsicon", "categoryicon", "label-related" ]; 251 252 function appsys_getFontSizes() { 253 if(appsys_cElements.length==0){ 254 appsys_cElements = $(".breadcrumbs, #pagecontent1, #pagecontent2, #footercontent1, #footercontent2").find("*"); 255 } 256 for (var i = 0; i < appsys_cElements.length; i++) { 257 appsys_fonts.push(parseFloat(appsys_cElements.eq(i).css('font-size'))); 258 appsys_lineheight.push(parseFloat(appsys_cElements.eq(i).css('line-height'))); 259 } 260 } 261 var appsys_cookievalue = appsys_getCookie('appsys_fontsizefactor'); 262 if(appsys_cookievalue != "not found"){ 263 appsys_textsizefactor = appsys_cookievalue; 264 if(appsys_textsizefactor != 0){ 265 appsys_resizetext(appsys_textsizefactor); 266 } 267 } 268 269 $(".font_resize_reset, .font_resize_add").on('click', function() { 270 attr_factor = parseInt($(this).attr('factor')); 271 appsys_textsizefactor = parseInt(appsys_textsizefactor) + attr_factor; 272 if(attr_factor == 0){ 273 appsys_textsizefactor = 0; 274 } 275 if(appsys_textsizefactor > 8){ 276 appsys_textsizefactor = 8; 277 return; 278 } 279 appsys_setCookieFontSize(appsys_textsizefactor); 280 appsys_resizetext(appsys_textsizefactor); 281 }); 282 283 function appsys_resizetext(fontsizefactor){ 284 appsys_getFontSizes(); 285 $(".font_resize_add").removeClass('active'); 286 if(fontsizefactor > 0){ 287 $(".font_resize_add").addClass('active'); 288 } 289 for (var i = 0; i < appsys_cElements.length; i++) { 290 if(jQuery.inArray(appsys_cElements.eq(i).attr('class'), appsys_ignore) < 0){ 291 appsys_fontsizes = parseInt(appsys_fonts[i]) + parseInt(fontsizefactor); 292 appsys_lineheights = parseInt(appsys_lineheight[i]) + parseInt(fontsizefactor); 293 appsys_cElements.eq(i).css('font-size', appsys_fontsizes); 294 appsys_cElements.eq(i).css('line-height', appsys_lineheights + "px"); 295 } 296 } 297 } 298 299 /*left menu*/ 300 var checkmasterul = 0; 301 var checkmasterulul = 0; 302 $("ul.list-unstyled.categories li a").each(function(n) { 303 if($(this).closest("li").children("ul").length) { 304 sub = $(this); 305 sub.addClass('hasChildren'); 306 sub.addClass("closed"); 307 sub.closest("li").children("ul").hide(); 308 $("ul.list-unstyled.categories li ul li a").each(function(n) { 309 if($(this).hasClass("active") && checkmasterul == 0){ 310 if ( $(this).hasClass("hasChildren")) { 311 $("ul.list-unstyled.categories li ul li a.hasChildren").removeClass("open"); 312 $("ul.list-unstyled.categories li ul li a.hasChildren").addClass("closed"); 313 checkmasterul = 1; 314 }else{ 315 $(this).closest("ul").show(); 316 $(this).parent().parent().closest("li").find('a.hasChildren').removeClass("closed"); 317 $(this).parent().parent().closest("li").find('a.hasChildren').addClass("open"); 318 if ( $(this).parents("ul").length) { 319 $(this).parents("ul").show(); 320 } 321 } 322 if($(this).parents('ul').length == 2 && !$(this).hasClass("hasChildren")){ 323 $("ul.list-unstyled.categories li ul li a.hasChildren").each(function(n) { 324 $(this).removeClass("open"); 325 $(this).addClass("closed"); 326 }); 327 } 328 } 329 }); 330 } 331 $("ul.list-unstyled.categories li ul li ul li a").each(function(n) { 332 if($(this).hasClass("active")){ 333 if($(this).parents('ul').parents('li').find('a.hasChildren').text() != "" && checkmasterulul == 0){ 334 checkmasterulul = 1; 335 $(this).parents('ul').parents('li').find('a.hasChildren').removeClass("closed"); 336 $(this).parents('ul').parents('li').find('a.hasChildren').addClass("open"); 337 } 338 } 339 }); 340 if(sub.hasClass("active")){ 341 if($(this).closest("li").children("ul").length) { 342 $(this).closest("li").children("ul").show(); 343 $(this).closest("li a").removeClass("closed"); 344 $(this).closest("li a").addClass("open"); 345 } 346 } 347 }); 348 349 $("ul.list-unstyled.categories li a").on('click', function(event) { 350 var maxwidth = $(this).width() + 33 - 25; 351 if($(this).closest("li").children("ul").length) { 352 if(event.offsetX > maxwidth){ 353 event.preventDefault(); 354 if ( $(this).closest("li").children("ul").is( ":hidden" ) ) { 355 $(this).closest("li").children("ul").slideDown( "fast" ); 356 $(this).closest("li a").removeClass("closed"); 357 $(this).closest("li a").addClass("open"); 358 } else { 359 $(this).closest("li").children("ul").hide(); 360 $(this).closest("li a").removeClass("open"); 361 $(this).closest("li a").addClass("closed"); 362 } 363 } 364 } 365 }); 366}); 367/*left menu-end*/ 368 369function appsys_getCookie(cname) { 370 var name = cname + "="; 371 var ca = window.document.cookie.split(';'); 372 for(var i = 0; i < ca.length; i++) { 373 var c = ca[i]; 374 while (c.charAt(0) == ' ') { 375 c = c.substring(1); 376 } 377 if (c.indexOf(name) == 0) { 378 return c.substring(name.length, c.length); 379 } 380 } 381 return "not found"; 382} 383 384function appsys_setCookieFontSize(fontsizefactor) { 385 var d = new Date(); 386 d.setTime(d.getTime() + (10*24*60*60*1000)); 387 var expires = "expires="+ d.toUTCString(); 388 //document.cookie = "fontsizefactor=" + fontsizefactor + ";" + expires + ";path=/"; 389 document.cookie = "appsys_fontsizefactor=" + fontsizefactor + ";" + expires + ";path=C:/websites/voeren_html/"; 390} 391/*font-sizes for readability - end*/
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.