1var tabsApp; 2var expandApp; 3var scrollmenuApp; 4( function($) { 5 'use strict'; 6 $(document).ready( function() { 7 MM.init(); 8 MS.init(); 9 MC.init(); 10 MA.init(); 11 MV.ready(); 12 if( typeof $.fancybox == 'object' ) { 13 $( '[data-lightbox], .gallery-icon a' ).attr( 'data-fancybox', 'gallery' ).fancybox( { 14 hideScrollbar: false, 15 buttons: [ 16 'close' 17 ], 18 animationEffect: 'fade', 19 transitionEffect: 'zoom-in-out' 20 } ); 21 } 22 $( '[data-popup]' ).addPopups(); 23 $( '[data-videopopup]' ).addVideoPopup(); 24 $( '[data-iframe]' ).addIFrame(); 25 $( '[data-mp3]' ).addMp3(); 26 if( check_capabilities() ) { 27 $( 'html' ).addClass( 'old' ); 28 } 29 } ); 30 $( window ).on( 'load', function() { 31 setTimeout( function() { 32 MV.init(); 33 }, 20); 34 } ); 35 var MM = { 36 Open: false, 37 Created: false, 38 init: function() { 39 $( '.mobile-toggle' ).click ( function( e ) { 40 e.preventDefault(); 41 if( MM.Open ) { 42 $( 'html' ).removeClass( 'menu-open' ); 43 $( '#menu-mobile-items' ).removeClass( 'hide' ); 44 } else { 45 if( ! MM.Created ) { 46 MM.create(); 47 } 48 setTimeout( function() { 49 $( 'html' ).addClass( 'menu-open' ); 50 }, 0); 51 } 52 MM.Open = ! MM.Open; 53 MV.cover( MM.Open ); 54 } ); 55 }, 56 create: function() { 57 var n = 0; 58 $( '#menu-mobile-items li' ).each( function() { 59 var l = $( this ).find( 'ul' ), 60 a; 61 if( l.length ) { 62 n += 1; 63 a = $( this ).find( 'a:first' ); 64 $( this ).find( 'a:first' ).after( '<i id="mm-icon-' + n + '" class="fas fa-chevron-right fam"></i>' ); 65 $( '#mm-icon-' + n).attr( 'data-mmid', n).attr( 'data-open', 'no' ).click( function( e ) { 66 e.preventDefault(); 67 var o = $( this ).attr( 'data-open' ); 68 var i = $( this ).attr( 'data-mmid' ); 69 if(o === 'no' ) { 70 $( this ).attr( 'data-open', 'yes' ); 71 $( '#mm-icon-' + i).removeClass( 'fa-chevron-right' ).addClass( 'fa-chevron-down' ); 72 $( '#mm-sub-' + i).addClass( 'mm-show' ); 73 } else { 74 $( this ).attr( 'data-open', 'no' ); 75 $( '#mm-icon-' + i).removeClass( 'fa-chevron-down' ).addClass( 'fa-chevron-right' ); 76 $( '#mm-sub-' + i).removeClass( 'mm-show' ); 77 } 78 } ); 79 l.attr( 'id', 'mm-sub-' + n ); 80 } 81 } ); 82 $( '#menu-mobile-items li.current-menu-ancestor > i' ).trigger( 'click' ); 83 MM.Created = true; 84 } 85 }; 86 var MS = { 87 Open: false, 88 init: function() { 89 $( '.heading-search button' ).click( function( e ) { 90 e.preventDefault(); 91 $( 'html' ).toggleClass( 'search-open' ); 92 $( '.heading-search button i' ).toggleClass( 'fa-search fa-times' ); 93 if( ! MS.Open ) { 94 $( '.heading-search-input' ).focus(); 95 } 96 MS.Open = ! MS.Open; 97 } ); 98 } 99 }; 100 var MV = { 101 setup: false, 102 scrolling: false, 103 scroller: {}, 104 data: { 105 storage: {}, 106 inviews: [], 107 positions: [], 108 lags: [] 109 }, 110 height: 0, 111 previous: 0, 112 difference: 0, 113 modal: false, 114 ready: function() { 115 if( $( '.inview' ).length ) { 116 $( '.inview' ).each( function() { 117 var type = $( this ).attr( 'data-inview' ); 118 switch( type ) { 119 case 'counter' : { 120 $( '.inview-counter' ).each( function() { 121 var num = $( this ).text(); 122 $( this ).attr( 'data-inviewcount', num ); 123 $( this ).text( 0 ); 124 } ); 125 break; 126 } 127 } 128 } ); 129 } 130 }, 131 init: function() { 132 if( $( '.inview' ).length ) { 133 MV.setup = true; 134 if( window.matchMedia( '(min-width: 960px)' ).matches ) { 135 MV.mobile = false; 136 } else { 137 MV.mobile = true; 138 } 139 $( '.inview' ).each( function() { 140 var id = $( this ).attr( 'id' ); 141 var type = $( this ).attr( 'data-inview' ); 142 var percent = $( this ).attr( 'data-inviewpercent' ); 143 MV.data.storage[id] = { 144 id: id, 145 view: false, 146 type: type 147 }; 148 if( percent != undefined ) { 149 percent = percent.split( ',' ); 150 MV.data.storage[id]['method'] = 'percentage'; 151 MV.data.storage[id]['top'] = Number( percent[0] ) / 100; 152 MV.data.storage[id]['bottom'] = 1 - ( Number( percent[1] ) / 100 ); 153 } else { 154 MV.data.storage[id]['method'] = 'normal'; 155 } 156 MV.data.inviews.push( id ); 157 switch( type ) { 158 case 'video' : { 159 var controls = $( this ).attr( 'data-controls' ); 160 var showcontrols = ( typeof controls !== typeof undefined && controls !== 'no' ) ? true : false; 161 MV.data.storage[id]['loaded'] = false; 162 MV.data.storage[id]['playing'] = false; 163 MV.data.storage[id]['controls'] = showcontrols; 164 MV.data.lags.push( id ); 165 MV.data.positions.push( id ); 166 MV.video_setup( $( this ), showcontrols ); 167 break; 168 } 169 case 'counter' : { 170 MV.data.storage[id]['ran'] = false; 171 MV.data.positions.push( id ); 172 break; 173 } 174 case 'trigger' : { 175 MV.data.storage[id]['triggered'] = false; 176 MV.data.positions.push( id ); 177 break; 178 } 179 default : { 180 MV.data.positions.push( id ); 181 } 182 } 183 } ); 184 MV.dimensions(); 185 MV.inview(); 186 MV.position(); 187 MV.lag(); 188 $( window ).on( 'scroll.mv', function() { 189 if( ! MV.scrolling ) { 190 MV.scrolling = true; 191 } 192 MV.inview(); 193 MV.position(); 194 clearTimeout( MV.scroller ); 195 MV.scroller = setTimeout( function() { MV.lag(); }, 250 ); 196 } ); 197 $( window ).on( 'resize.mv', function() { 198 MV.dimensions(); 199 } ); 200 } 201 }, 202 dimensions: function() { 203 MV.height = window.innerHeight || document.documentElement.clientHeight; 204 $.each( MV.data.inviews, function( i, id ) { 205 switch( MV.data.storage[id]['type'] ) { 206 default : { 207 break; 208 } 209 } 210 } ); 211 }, 212 inview: function() { 213 $.each( MV.data.inviews, function( i, id ) { 214 var rect = $( '#' + id )[0].getBoundingClientRect(); 215 var rect_top = rect.top; 216 var rect_bottom = rect.bottom; 217 var top, bottom; 218 switch( MV.data.storage[id]['method'] ) { 219 case 'normal' : { 220 top = 0; 221 bottom = MV.height; 222 MV.data.storage[id]['view'] = ( ( rect_bottom >= top && rect_bottom <= bottom ) || ( rect_top >= top && rect_top <= bottom ) || ( rect_top <= top && rect_bottom >= bottom ) ) && $( '#' + id ).is( ':visible' ); 223 break; 224 } 225 case 'percentage' : { 226 top = MV.height * MV.data.storage[id]['top']; 227 bottom = MV.height * MV.data.storage[id]['bottom']; 228 MV.data.storage[id]['view'] = ( rect_top <= top && rect_bottom >= bottom ); 229 break; 230 } 231 } 232 } ); 233 }, 234 position: function() { 235 var positions = Array.from( MV.data.positions ); 236 MV.scrollposition = window.scrollY; 237 MV.difference = Math.abs( MV.previous - MV.scrollposition ); 238 MV.previous = MV.scrollposition; 239 $.each( positions, function( i, id ) { 240 switch( MV.data.storage[id]['type'] ) { 241 case 'counter' : { 242 if( MV.data.storage[id]['view'] ) { 243 MV.data.positions.splice( i, 1 ); 244 $( '.inview-counter', '#' + id ).each( function () { 245 var $this = $(this); 246 $( { Counter: 0 } ).animate( { Counter: $this.attr( 'data-inviewcount' ) }, { 247 duration: 1000, 248 easing: 'swing', 249 step: function ( now ) { 250 $this.text( Math.ceil( now ) ); 251 } 252 } ); 253 } ); 254 } 255 break; 256 } 257 case 'video' : { 258 if( MV.data.storage[id]['view'] || ( MV.scrollposition > 0 && ! MV.data.storage[id]['loaded'] ) ) { 259 MV.data.positions.splice( i, 1 ); 260 if( ! MV.data.storage[id]['loaded'] ) { 261 MV.data.storage[id]['loaded'] = true; 262 $( 'video', '#' + id )[0].load(); 263 } 264 } 265 break; 266 } 267 case 'trigger' : { 268 if( MV.data.storage[id]['view'] ) { 269 if( ! MV.data.storage[id]['triggered'] ) { 270 MV.data.storage[id]['triggered'] = true; 271 $( '.inview-trigger-' + id ).addClass( 'inview-triggered' ); 272 } 273 } else { 274 if( MV.data.storage[id]['triggered'] ) { 275 MV.data.storage[id]['triggered'] = false; 276 $( '.inview-trigger-' + id ).removeClass( 'inview-triggered' ); 277 } 278 } 279 break; 280 } 281 } 282 } ); 283 }, 284 lag: function() { 285 if( ! MV.modal ) { 286 $.each( MV.data.lags, function( i, id ) { 287 switch( MV.data.storage[id]['type'] ) { 288 case 'video' : { 289 if( MV.data.storage[id]['view'] ) { 290 if( ! MV.data.storage[id]['loaded'] ) { 291 MV.data.storage[id]['loaded'] = true; 292 $( 'video', '#' + id )[0].load(); 293 } 294 if( ! MV.data.storage[id]['playing'] && ! MV.data.storage[id]['controls'] ) { 295 MV.data.storage[id]['playing'] = true; 296 $( 'video', '#' + id )[0].play(); 297 } 298 } else { 299 if( MV.data.storage[id]['playing'] && ! MV.data.storage[id]['controls'] ) { 300 MV.data.storage[id]['playing'] = false; 301 $( 'video', '#' + id )[0].pause(); 302 } 303 } 304 break; 305 } 306 } 307 } ); 308 } 309 MV.scrolling = false; 310 }, 311 cover: function( c ) { 312 if( c ) { 313 MV.modal = true; 314 MV.stop(); 315 } else { 316 MV.modal = false; 317 MV.lag(); 318 } 319 }, 320 stop: function() { 321 if( MV.data.lags.length ) { 322 $.each( MV.data.lags, function( i, id ) { 323 switch( MV.data.storage[id]['type'] ) { 324 case 'video' : { 325 if( MV.data.storage[id]['playing'] ) { 326 MV.data.storage[id]['playing'] = false; 327 $( 'video', '#' + id )[0].pause(); 328 } 329 break; 330 } 331 } 332 } ); 333 } 334 MV.scrolling = false; 335 }, 336 video_setup: function( player, showcontrols ) { 337 var v, t, p ='';
338 var videofull = player.attr( 'data-videofull' ); 339 var videomobile = player.attr( 'data-videomobile' ); 340 var placeholderfull = player.attr( 'data-placeholderfull' ); 341 var placeholdermobile = player.attr( 'data-placeholdermobile' ); 342 var placeholder = ( typeof placeholderfull !== typeof undefined && placeholderfull !== false ) ? true : false; 343 if( ! MV.mobile ) { 344 v = videofull; 345 if( placeholder ) { 346 p = ' poster="' + placeholderfull + '"'; 347 } 348 } else { 349 if( videomobile ) { 350 v = videomobile; 351 } else { 352 v = videofull; 353 } 354 if( placeholdermobile ) { 355 p = ' poster="' + placeholdermobile + '"'; 356 } 357 } 358 if( ! showcontrols ) { 359 t = '<video webkit-playsinline playsinline muted loop' + p + ' preload="auto">'; 360 } else { 361 t = '<video webkit-playsinline playsinline controls loop' + p + ' preload="auto">'; 362 } 363 t += '<source src="' + v + '" type="video/mp4">'; 364 t += '</video>'; 365 player.append( t ); 366 } 367 }; 368 var MC = { 369 init: function() { 370 $( '.scrollthis' ).each( function() { 371 $( this ).addClass( 'slick-parent' ).removeClass( 'slick-parent-ready' ); 372 var vals = $( this ).attr( 'data-scrollsetup' ).split( ',' ); 373 var style = $( this ).attr( 'data-scrollstyle' ); 374 var height = $( this ).attr( 'data-scrollheight' ); 375 var s = Number( vals[0] ); 376 var t = Number( vals[1] ); 377 var p = Number( vals[2] ); 378 var m = Number( vals[3] ); 379 if( style == 'peek' ) { 380 if( s ) { 381 s += 0.5; 382 } 383 if( t ) { 384 t += 0.4; 385 } 386 if( p ) { 387 p += 0.3; 388 } 389 if( m ) { 390 m += 0.3; 391 } 392 } 393 var mm = Math.ceil( m / 2 ); 394 var r = []; 395 if( t ) { 396 var pp = Math.ceil( p / 2 ); 397 r[r.length] = { 398 breakpoint: 639, 399 settings: { 400 arrows: true, 401 slidesToShow: p, 402 slidesToScroll: pp 403 } 404 } 405 var tt = Math.ceil( t / 2 ); 406 r[r.length] = { 407 breakpoint: 959, 408 settings: { 409 arrows: true, 410 slidesToShow: t, 411 slidesToScroll: tt 412 } 413 } 414 if( s ) { 415 var ss = Math.ceil( s / 2 ); 416 r[r.length] = { 417 breakpoint: 1279, 418 settings: { 419 arrows: true, 420 slidesToShow: s, 421 slidesToScroll: ss 422 } 423 } 424 } else { 425 r[r.length] = { 426 breakpoint: 1279, 427 settings: 'unslick' 428 } 429 } 430 } else { 431 r[r.length] = { 432 breakpoint: 959, 433 settings: 'unslick' 434 } 435 } 436 var slick = { 437 mobileFirst: true, 438 arrows: false, 439 dots: true, 440 infinite: false, 441 speed: 300, 442 slidesToShow: m, 443 slidesToScroll: mm, 444 responsive: r 445 }; 446 if( height == 'adaptive' ) { 447 slick['adaptiveHeight'] = true; 448 slick['infinite'] = true; 449 } 450 $( this ).find( '.scrollthis-items' ).slick( slick ); 451 } ); 452 } 453 }; 454 var MA = { 455 top: 0, 456 last: 0, 457 p1: false, 458 d1: 120, 459 p2: false, 460 d2: 300, 461 up: false, 462 init: function() { 463 $( window ).on( 'scroll.direction', function() { 464 MA.last = MA.top; 465 MA.top = $( this ).scrollTop(); 466 MA.up = (MA.top < MA.last) ? true : false; 467 if( ! MA.p1 ) { 468 if( MA.top > MA.d1 ) { 469 MA.p1 = true; 470 $( 'body' ).addClass( 'scrolled' ); 471 } 472 } else { 473 if( MA.top <= MA.d1 ) { 474 MA.p1 = false; 475 $( 'body' ).removeClass( 'scrolled' ); 476 } 477 } 478 if( ! MA.p2 ) { 479 if( MA.top > MA.d2 ) { 480 MA.p2 = true; 481 $( 'body' ).addClass( 'scrolled-menu' ); 482 } 483 } else { 484 if( MA.top <= MA.d2 ) { 485 MA.p2 = false; 486 $( 'body' ).removeClass( 'scrolled-menu' ); 487 } 488 } 489 $( 'body' ).toggleClass( 'scrolled-up', MA.up ); 490 } ); 491 } 492 }; 493 tabsApp = { 494 tab: function(id, t) { 495 $( '#tabs-' + id).attr( 'data-current', t); 496 } 497 }; 498 expandApp = { 499 init: function() { 500 $( '.expandapp-button' ).on( 'click', function( e ) { 501 e.stopPropagation(); 502 var id = $( this ).attr( 'data-id' ); 503 expandApp.toggle(id); 504 } ); 505 }, 506 toggle: function( id ) { 507 var open = Number( $( '#expandapp' + id ).attr( 'data-open' ) ); 508 if( open ) { 509 $( '#expandapp' + id ).attr( 'data-open', 0 ); 510 } else { 511 $( '#expandapp' + id ).attr( 'data-open', 1 ); 512 } 513 } 514 }; 515 scrollmenuApp = { 516 Open: false, 517 init: function() { 518 $( '.scroll-menu-mobile-button' ).click ( function( e ) { 519 e.preventDefault(); 520 if( scrollmenuApp.Open ) { 521 $( 'html' ).removeClass( 'scroll-menu-open' ); 522 } else { 523 $( 'html' ).addClass( 'scroll-menu-open' ); 524 } 525 scrollmenuApp.Open = ! scrollmenuApp.Open; 526 } ); 527 $( '.scroll-menu-anchor' ).on( 'click', function( e ) { 528 e.preventDefault(); 529 let targetId = $( this ).attr( 'href' ).substring( 1 ); 530 let targetElement = $( '#' + targetId ); 531 let scrollMenu = $( '.scroll-menu' ); 532 if( targetElement.length ) { 533 let menuHeight = scrollMenu.length ? scrollMenu.outerHeight() : 0; 534 let targetPosition = targetElement.offset().top; 535 let offsetPosition = targetPosition - menuHeight; 536 $( 'html, body' ).animate( { 537 scrollTop: offsetPosition 538 }, 600 ); 539 } 540 } ); 541 } 542 }; 543 $.fn.addPopups = function() { 544 return this.each( function() { 545 $( this ).click( function(t) { 546 t.preventDefault(); 547 var e = Math.min($(window).height(), 800); 548 return window.open($( this ).attr( 'href' ), 'SitePopup', 'width=600, height=' + e + ', resizable=yes, scrollbars=yes' ); 549 } ); 550 } ); 551 }; 552 $.fn.addVideoPopup = function() { 553 return this.each( function() { 554 $( this ).fancybox( { 555 hideScrollbar: false, 556 afterShow: function() { 557 MV.cover( true ); 558 }, 559 afterClose: function() { 560 MV.cover( false ); 561 } 562 } ); 563 } ); 564 }; 565 $.fn.addIFrame = function() { 566 return this.each( function() { 567 $( this ).click( function () { 568 var a = $( this ).attr( 'href' ); 569 $.fancybox.open( { 570 hideScrollbar: false, 571 src : a, 572 type : 'iframe', 573 iframe : { 574 preload : false, 575 css : {
576 'height' : '80vh', 577 'max-width' : '50%' 578 } 579 } 580 } ); 581 return false; 582 } ); 583 } ); 584 }; 585 $.fn.addMp3 = function() { 586 return this.each( function() { 587 $( this ).click( function () { 588 var a = $( this ).attr( 'href' ); 589 $.fancybox.open( { 590 hideScrollbar: false, 591 src : a, 592 type : 'iframe', 593 iframe : { 594 preload : false, 595 css : { 596 'height' : '40px', 597 'max-width' : '40em' 598 } 599 } 600 } ); 601 return false; 602 } ); 603 } ); 604 }; 605 function check_capabilities() { 606 var div = document.createElement('div'); 607 div.style.display = 'grid'; 608 return div.style.display !== 'grid'; 609 } 610} )(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.