1 2 3 4jQuery(document).ready(($) => { 5 6 7 /** Common for all The pages */ 8 $('.navbar-expand-lg ul.navbar-nav li').attr('role','none'); 9 10 11 12 13 $('.navbar-toggler').on('click', function (e) { 14 e.stopPropagation(); 15 e.preventDefault(); 16 $('.close-nav').show(); 17 $("#collapsibleNavbar").attr('aria-hidden', false); 18 $("a, button,input, textarea, main, footer").attr('aria-hidden', true); 19 $('.navbar-nav li a, .navbar-nav li button').attr('aria-hidden', false); 20 $('.navbar-toggler').attr('aria-expanded', true); 21 $('.close-nav').attr('aria-expanded', true); 22 23 setTimeout(()=> { 24 $('.nav-item .nav-link').first().focus(); 25 }, 500); 26 }); 27 28 $('body').on('click', '.mobile-active .nav-link.dropdown-toggle', function (e) { 29 e.stopPropagation(); 30 e.preventDefault(); 31 $('.showonly li a' ).first().focus(); 32 33 }); 34 35 36 37 38 39 $('.close-nav').on('click', function (e) { 40 e.stopPropagation(); 41 e.preventDefault(); 42 $('.navbar-toggler').attr('aria-expanded', false); 43 $('.close-nav').attr('aria-expanded', false); 44 $('.navbar-toggler').attr('aria-hidden', false); 45 46 $("#collapsibleNavbar").attr('aria-hidden', true); 47 $("a, button,input, textarea, main, footer").attr('aria-hidden', false); 48 $('.navbar-nav li a, .navbar-nav li button').attr('aria-hidden', true); 49 50 setTimeout(()=> { 51 $('.close-nav').hide(); 52 }, 500); 53 54 $('section').first().attr('tabindex', 0); 55 $('section').first().focus(); 56 //document.location.href="#maincontent"; 57 }); 58 59 60 61 $('.form-with-defaults .form-type-managed-file .form-managed-file').focusin(function(){ 62 $(this).addClass('activeFocus'); 63 }).focusout(function() { 64 $(this).removeClass('activeFocus'); 65 }) 66 67 setTimeout(function() { 68 cardCarouselStyle2Init(); 69 }, 500); 70 71 72 setNavTabIndex(); 73 //fixedHeaderBodyPadding(); 74 $(window).resize(function () { 75 setNavTabIndex(); 76 //fixedHeaderBodyPadding(); 77 }); 78 79 var idx = 2; 80 $('header .navbar-nav > li').each(function (index ) { 81 if(!$(this).hasClass('nav-header')) { 82 $(this).css('order',idx); 83 } 84 if($(this).hasClass('nav-header')) { 85 $(this).css('order',1); 86 } 87 idx ++; 88 }) 89 90 /** Accept Cookies */ 91 92 $(".agree-button").attr('tabindex', 1); 93 $(".decline-button").attr('tabindex', 1); 94 $(".agree-button").focus(); 95 $('.decline-button').focusout(function () { 96 97 if ($("#sliding-popup").css('bottom') == '0px') { 98 $(".agree-button").focus(); 99 } 100 101 }); 102 103 104 $('.eu-cookie-compliance-buttons .agree-button').on('keydown blur', function (e) { 105 if (e.shiftKey && e.keyCode === 9) { 106 if($("#sliding-popup").css('bottom') == '0px') { 107 $('.decline-button').focus(); 108 return false; 109 } 110 } 111 }); 112 113 $('.eu-cookie-compliance-buttons button').on('click', () => { 114 $(".agree-button").attr('tabindex', ''); 115 $(".decline-button").attr('tabindex', ''); 116 $('.navbar-brand').focus(); 117 $("header, main, footer").attr('aria-hidden', true); 118 }); 119 120 setTimeout(()=> { 121 122 if($("#sliding-popup")) { 123 if ($("#sliding-popup").css('bottom') == '0px') { 124 $("header, main, footer").attr('aria-hidden', true); 125 126 } 127 var cookiePopupText = $('#popup-text h2').text(); 128 $('#popup-text h2').replaceWith($(`<p class="h2">${cookiePopupText}</p>`)); 129 } 130 }, 1500); 131 132 133 134 135 136 137 138 /** Change Drupal Default span to a tag */ 139 $('header .navbar-nav .nav-item.dropdown > span').each(function () { 140 $(this).replaceWith($(`<a class="nav-link dropdown-toggle" data-toggle=dropdown 141 aria-haspopup="true" aria-expanded="false" href="javascript:void(0);">${this.innerHTML}</a>`)); 142 }) 143 144 145 146 /** Set Aria label for all Menu items */ 147 148 $('header .navbar-nav .nav-item a').each(function () { 149 $(this).attr('aria-label', $(this).text()); 150 }) 151 152 153 154 155$('.input-type-btn-arrow .fa').attr('aria-hidden',true); 156 157 jQuery('body').on('click','.alert-status button',function() { 158 jQuery(this).attr('aria-label','closed alert popup'); 159 document.location.href="#maincontent"; 160 }) 161 162 163 164 function setNavTabIndex() { 165 if ($(window).width() <= 991) { 166 $('.navbar-nav li a').attr('tabindex', -1); 167 $('.navbar-nav li button').attr('tabindex', -1); 168 $("#collapsibleNavbar").attr('aria-hidden',true); 169 } else { 170 $('.navbar-nav li a').attr('tabindex', ''); 171 $('.navbar-nav li button').attr('tabindex', ''); 172 $("#collapsibleNavbar").attr('aria-hidden',false); 173 } 174 } 175 function fixedHeaderBodyPadding() { 176 if (!jQuery("#toolbar-administration").length) { 177 if ($(window).width() <= 991) { 178 var t = jQuery('header.container-fluid').height(); 179 jQuery('body').css('padding-top', `calc(${t}px + 1.6rem)`); 180 }else { 181 jQuery('body').css('padding-top', '0px'); 182 } 183 } 184 } 185 186 187 188 function cardCarouselStyle2Init() { 189 190 const options = { 191 stagePadding: 50, 192 margin: 10, 193 nav: false, 194 loop: true, 195 dots: false, 196 responsive: { 197 0: { 198 items: 1, 199 margin: 20, 200 stagePadding: 50, 201 nav:true 202 }, 203 480: { 204 items: 1, 205 margin: 20, 206 stagePadding: 100, 207 nav:true 208 }, 209 600: { 210 items: 1, 211 stagePadding: 150, 212 margin: 50, 213 nav:true 214 }, 215 768: { 216 items: 1, 217 stagePadding: 150, 218 margin: 50, 219 nav:true 220 }, 221 1000: { 222 items: 3, 223 stagePadding: 0, 224 margin: 50, 225 dots: false, 226 loop: false, 227 nav:false 228 } 229 } 230 }; 231 var owl = $('.carousel-style-2 .owl-carousel'); 232 233 if ( $(window).width() < 768 ) { 234 var owlActive = owl.owlCarousel(options); 235 owl.addClass('mobile'); 236 cardCarouselStyle2Accessibility(owl) 237 238 239 240 } else { 241 owl.addClass('off desktop '); 242 } 243 244 $(window).resize(function() { 245 if ( $(window).width() < 768 ) { 246 if ( $('.owl-carousel').hasClass('off') ) { 247 var owlActive = owl.owlCarousel(options); 248 owl.removeClass('off desktop'); 249 owl.addClass('mobile'); 250 cardCarouselStyle2Accessibility(owl); 251 } 252 } else { 253 if ( !$('.owl-carousel').hasClass('off') ) { 254 owl.addClass('desktop'); 255 owl.addClass('off').trigger('destroy.owl.carousel'); 256 owl.find('.owl-stage-outer').children(':eq(0)').unwrap(); 257 owl.removeClass('mobile'); 258 } 259 } 260 }); 261 262 } 263 264 265 266 function cardCarouselStyle2Accessibility(owl) { 267 268 269 $('.carousel-style-2 .owl-prev').attr('aria-label','Previous'); 270 $('.carousel-style-2 .owl-next').attr('aria-label','Next'); 271 272 273 $('.carousel-style-2 .owl-carousel .owl-stage').children().each(function(i) { 274 var item = $(this); 275 if (item.hasClass('active')) { 276 item.attr('aria-hidden', 'false'); 277 } 278 else { 279 item.attr('aria-hidden', 'true'); 280 } 281 }); 282 283 284 owl.on('changed.owl.carousel', function(event) { 285 var currentItem = event.item.index; 286 287 setTimeout(()=> { 288 289 $('.owl-stage').children().each(function(i) { 290 var item = $(this); 291 292 if (item.hasClass('active')) { 293 item.attr('aria-hidden', 'false'); 294 item.find('a').focus(); 295 } 296 else { 297 item.attr('aria-hidden', 'true'); 298 299 } 300 }); 301 }, 500); 302 }) 303 304 } 305});
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.