1(function ($) { 2 3 SR_ROS = { 4 5 initOnDOMReady: function (rawRoot) { 6 7 var root = SR_ROS.getRootItem(rawRoot); 8 9 this.setConstants(); 10 this.addClasses(); 11 12 if (window.SR_ROS_loaded) { 13 SR_ROS.initOnLoad(root); 14 } else { 15 $(window).on('load', function () { 16 SR_ROS.initOnLoad(root); 17 }); 18 } 19 20 }, 21 22 initOnLoad: function (root) { 23 var $instagramFeed = $('.js_instagram-feed'); 24 25 window.SR_ROS_loaded = true; 26 27 // Init Instagram feed 28 if ($instagramFeed.length) { 29 this.initInstafeed($instagramFeed); 30 } 31 32 SR_ROS.showBXControls(); 33 SR_ROS.scrollToElem(); 34 SR_ROS.initMapOverlay(); 35 SR_ROS.initJobOffersAccordion(); 36 SR_ROS.initImageGallery(); 37 SR_ROS.showScrollToTop(); 38 39 }, 40 41 getRootItem: function (rawRoot) { 42 43 var root; 44 45 // use document.body as root or another element, eg. a container which was loaded with ajax 46 if (arguments.length === 0 || typeof rawRoot === 'undefined' || rawRoot === null) { 47 root = $(document.body); 48 } else { 49 root = $(rawRoot); 50 } 51 52 return root; 53 54 }, 55 56 setConstants: function () { 57 58 var deviceAgent = navigator.userAgent.toLowerCase(), 59 touchDevice = ('ontouchstart' in window) || deviceAgent.match(/iemobile/) || deviceAgent.match(/blackberry/i) || deviceAgent.match(/bada/i); 60 61 this.animationDuration = 200; 62 this.interactiveEvent = (touchDevice) ? 'touchend' : 'click'; 63 64 this.is_touchDevice = touchDevice; 65 this.is_iPhone = navigator.platform.indexOf('iPhone') >= 0; 66 this.is_iPad = navigator.platform.indexOf('iPad') >= 0; 67 this.is_iOS = this.is_iPhone || this.is_iPad; 68 this.is_iOS5 = this.is_iOS && window.navigator.appVersion.indexOf('OS 5_') >= 0; 69 this.is_iOS6 = this.is_iOS && window.navigator.appVersion.indexOf('OS 6_') >= 0; 70 this.is_webkit = 'webkitRequestAnimationFrame' in window; 71 72 }, 73 74 addClasses: function () { 75 76 // add touch-class to enable direct targeting of touch devices 77 // e.g. styles that shall only be active on touch-devices 78 if (SR_ROS.is_touchDevice) { 79 $('html').addClass('is-touch'); 80 if (SR_ROS.is_iOS5 || SR_ROS.is_iOS6) $('html').addClass('is-old-ios'); 81 } else { 82 $('html').addClass('is-not-touch'); 83 } 84 85 // MSIE 11 86 if ('-ms-scroll-limit' in document.documentElement.style && '-ms-ime-align' in document.documentElement 87 .style) { 88 $('html').addClass('is-ie is-ie11'); 89 } 90 91 }, 92 93 showBXControls: function () { 94 95 // show arrows when window is loaded 96 // => prevent showing arrows while images not already loaded 97 $('.swiper-controls').show(); 98 99 }, 100 101 equalBoxes: function (row, box) { 102 103 $(row).each(function () { 104 105 var $this = $(this), 106 max = 0; 107 108 $(box, $this).css('height', 'auto').each( 109 function () { 110 max = Math.max($(this).height(), max); 111 } 112 ).height(max); 113 114 }); 115 116 }, 117 118 scrollToElem: function () { 119 120 var $closeButton = $('.offcanvas__close'); 121 122 $('a[data-scrollto]') 123 .off('click') 124 .on( 125 'click', 126 function (e) { 127 e.preventDefault(); 128 129 var $trigger = $(this), 130 target = $trigger.attr('href'); 131 132 if (typeof $trigger.data('srtoggle') !== 'undefined') { 133 if (!$trigger.hasClass('is-active')) { 134 // set timeout if using it in conjunction with toggle feature 135 // to make sure that it scrolls to the correct position 136 setTimeout(function () { 137 _scrollToElem(target); 138 }, 200); 139 } 140 } else { 141 _scrollToElem(target); 142 } 143 } 144 ); 145 146 function _scrollToElem(target) { 147 var top = 0, 148 $mainHeader = $('#js_main-header'); 149 150 $closeButton.trigger('click'); 151 152 if (target != '#') { 153 let $target = $(target); 154 // get the dimensions with offset() 155 // tooltip has to be visible to do do 156 $target.show().css('visibility', 'hidden'); 157 top = $target.offset().top; 158 $target.removeAttr('style'); 159 } 160 161 if ($mainHeader.length && $mainHeader.css('position') === 'fixed') { 162 top = top - $('#js_main-header').height() - 50; 163 } 164 165 $('html, body').finish().animate({ 166 scrollTop: top 167 }, 600); 168 } 169 170 }, 171 172 showScrollToTop: function () { 173 174 $(document).scroll(function () { 175 if ($(this).scrollTop() > window.innerHeight * 2) { 176 $('#back-to-top').fadeIn(); 177 } else { 178 $('#back-to-top').fadeOut(); 179 } 180 }); 181 182 }, 183 184 getScrollbarWidth: function () { 185 186 var scrollbarWidth,
187 scrollDiv = $('<div />') 188 .css({ 189 width: '100%', 190 height: '100%', 191 overflow: 'scroll', 192 position: 'absolute', 193 top: '-9999px' 194 }) 195 .appendTo('body'); 196 197 scrollbarWidth = scrollDiv.get(0).offsetWidth - scrollDiv.get(0).clientWidth; 198 199 scrollDiv.remove(); 200 201 return scrollbarWidth; 202 203 }, 204 205 initInstafeed: function (instafeedObj) { 206 207 if (instafeedObj.data('userid') === '' || instafeedObj.data('accesstoken') === '' || instafeedObj.data('target') === '') { 208 return; 209 } 210 211 var userID = instafeedObj.data('userid'), 212 accessToken = instafeedObj.data('accesstoken'), 213 myTarget = instafeedObj.data('target'), 214 ros = new Instafeed({ 215 target: myTarget, 216 get: 'user', 217 userId: userID, 218 accessToken: accessToken, 219 template: '<li><a href="{{link}}" target="_blank"><img src="{{image}}" /></a></li>', 220 limit: instafeedObj.data('limit'), 221 resolution: 'low_resolution', 222 223 after: function () { 224 SR_ROS_SLIDER.initInstafeedSlider(); 225 SR_ROS.showBXControls(); 226 } 227 } 228 ); 229 230 ros.run(); 231 232 }, 233 234 // Overlay fix for scroll/zoom for Google Maps 235 initMapOverlay: function () { 236 var $mapOverlay = $('.js_map-overlay'), 237 $mapIframe = $('.js_map-iframe'); 238 239 // set the mouse events to none 240 $mapIframe.addClass('scroll-off'); 241 242 // lock it when mouse up 243 $mapOverlay.on("mouseup", function () { 244 $mapIframe.addClass('scroll-off'); 245 }); 246 247 // when mouse down, set the mouse events free 248 $mapOverlay.on("mousedown touchstart", function () { 249 $mapIframe.removeClass('scroll-off'); 250 }); 251 252 // set the pointer events to none when mouse leaves the map area 253 $mapIframe.mouseleave(function () { 254 $mapIframe.addClass('scroll-off'); 255 }); 256 }, 257 258 initJobOffersAccordion: function () { 259 var $sectionTitle = $('.js_section-title'), 260 $sectionContent = $('.js_section-content'); 261 262 function closeAccordionSection() { 263 $sectionTitle.removeClass('active'); 264 $sectionContent.slideUp(300).removeClass('open'); 265 } 266 267 $sectionTitle.click(function (e) { 268 // Grab current anchor value 269 var currentAttrValue = $(this).attr('href'); 270 271 if ($(e.target).is('.active')) { 272 closeAccordionSection(); 273 } else { 274 closeAccordionSection(); 275 276 // Add active class to section title 277 $(this).addClass('active'); 278 // Open up the hidden content panel 279 $('.js_accordion ' + currentAttrValue).slideDown(300).addClass('open'); 280 } 281 282 e.preventDefault(); 283 }); 284 }, 285 286 initImageGallery: function () { 287 $('.fancybox').fancybox({ 288 padding: 0, 289 }); 290 } 291 292 }; 293 294 SR_ROS.initOnDOMReady(); 295 296 $(document).on('mms:contentupdate', function (event) { 297 SR_ROS.initOnDOMReady(event.target); 298 }); 299 300})(jQuery); 301 302$(function () { 303 if (document.cookie.match(/^(.*;)?\s*wcag_debug_helper\s*=\s*[^;]+(.*)?$/)) { 304 const dupes = Object.entries( 305 [...document.querySelectorAll("[id]")] 306 .map((x) => x.id) /* get all ids */ 307 .reduce( 308 (acc, id) => ({...acc, [id]: (acc[id] || 0) + 1}), 309 {} 310 ) /*count them*/ 311 ).filter(([_key, val]) => val > 1); /* find the ones repeating more than once */ 312 313 if (dupes.length > 0) { 314 console.warn('duplicate ids:'); 315 console.table(dupes); 316 } 317 318 const imgNoAlt = [...document.querySelectorAll('img')].filter(i => !i.alt); 319 if (imgNoAlt.length > 0) { 320 console.table('img without alt:') 321 console.table(imgNoAlt, ['src']) 322 } 323 } 324});
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.