1/* global acmedecineScreenReaderText */ 2(function( $ ) { 3 4 // Variables and DOM Caching. 5 var $body = $( 'body' ), 6 $customHeader = $body.find( '.custom-header' ), 7 $branding = $customHeader.find( '.site-branding' ), 8 $navigation = $body.find( '.navigation-top' ), 9 $navWrap = $navigation.find( '.wrap' ), 10 $navMenuItem = $navigation.find( '.menu-item' ), 11 $menuToggle = $navigation.find( '.menu-toggle' ), 12 $menuScrollDown = $body.find( '.menu-scroll-down' ), 13 $sidebar = $body.find( '#secondary' ), 14 $entryContent = $body.find( '.entry-content' ), 15 $formatQuote = $body.find( '.format-quote blockquote' ), 16 isFrontPage = $body.hasClass( 'acmedecine-front-page' ) || $body.hasClass( 'home blog' ), 17 navigationFixedClass = 'site-navigation-fixed', 18 navigationHeight, 19 navigationOuterHeight, 20 navPadding, 21 navMenuItemHeight, 22 idealNavHeight, 23 navIsNotTooTall, 24 headerOffset, 25 menuTop = 0, 26 resizeTimer; 27 28 // Ensure the sticky navigation doesn't cover current focused links. 29 $( 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]', '.site-content-contain' ).filter( ':visible' ).focus( function() { 30 if ( $navigation.hasClass( 'site-navigation-fixed' ) ) { 31 var windowScrollTop = $( window ).scrollTop(), 32 fixedNavHeight = $navigation.height(), 33 itemScrollTop = $( this ).offset().top, 34 offsetDiff = itemScrollTop - windowScrollTop; 35 36 // Account for Admin bar. 37 if ( $( '#wpadminbar' ).length ) { 38 offsetDiff -= $( '#wpadminbar' ).height(); 39 } 40 41 if ( offsetDiff < fixedNavHeight ) { 42 $( window ).scrollTo( itemScrollTop - ( fixedNavHeight + 50 ), 0 ); 43 } 44 } 45 }); 46 47 // Set properties of navigation. 48 function setNavProps() { 49 navigationHeight = $navigation.height(); 50 navigationOuterHeight = $navigation.outerHeight(); 51 navPadding = parseFloat( $navWrap.css( 'padding-top' ) ) * 2; 52 navMenuItemHeight = $navMenuItem.outerHeight() * 2; 53 idealNavHeight = navPadding + navMenuItemHeight; 54 navIsNotTooTall = navigationHeight <= idealNavHeight; 55 } 56 57 // Make navigation 'stick'. 58 function adjustScrollClass() { 59 60 // Make sure we're not on a mobile screen. 61 if ( 'none' === $menuToggle.css( 'display' ) ) { 62 63 // Make sure the nav isn't taller than two rows. 64 if ( navIsNotTooTall ) { 65 66 // When there's a custom header image or video, the header offset includes the height of the navigation. 67 if ( isFrontPage && ( $body.hasClass( 'has-header-image' ) || $body.hasClass( 'has-header-video' ) ) ) { 68 headerOffset = $customHeader.innerHeight() - navigationOuterHeight; 69 } else { 70 headerOffset = $customHeader.innerHeight(); 71 } 72 73 // If the scroll is more than the custom header, set the fixed class. 74 if ( $( window ).scrollTop() >= headerOffset ) { 75 $navigation.addClass( navigationFixedClass ); 76 } else { 77 $navigation.removeClass( navigationFixedClass ); 78 } 79 80 } else { 81 82 // Remove 'fixed' class if nav is taller than two rows. 83 $navigation.removeClass( navigationFixedClass ); 84 } 85 } 86 } 87 88 // Set margins of branding in header. 89 function adjustHeaderHeight() { 90 if ( 'none' === $menuToggle.css( 'display' ) ) { 91 92 // The margin should be applied to different elements on front-page or home vs interior pages. 93 if ( isFrontPage ) { 94 $branding.css( 'margin-bottom', navigationOuterHeight ); 95 } else { 96 $customHeader.css( 'margin-bottom', navigationOuterHeight ); 97 } 98 99 } else { 100 $customHeader.css( 'margin-bottom', '0' ); 101 $branding.css( 'margin-bottom', '0' ); 102 } 103 } 104 105 // Set icon for quotes. 106 function setQuotesIcon() { 107 $( acmedecineScreenReaderText.quote ).prependTo( $formatQuote ); 108 } 109 110 // Add 'below-entry-meta' class to elements. 111 function belowEntryMetaClass( param ) { 112 var sidebarPos; 113 var sidebarPosBottom; 114 115 if ( ! $body.hasClass( 'has-sidebar' ) || ( 116 $body.hasClass( 'search' ) || 117 $body.hasClass( 'single-attachment' ) || 118 $body.hasClass( 'error404' ) || 119 $body.hasClass( 'acmedecine-front-page' ) 120 ) ) { 121 return; 122 } 123 124 sidebarPos = $sidebar.offset(); 125 if ( undefined != undefined ) 126 sidebarPosBottom = sidebarPos.top() + ( $sidebar.height() + 28 ); 127 128 $entryContent.find( param ).each( function() { 129 var $element = $( this ), 130 elementPos = $element.offset(), 131 elementPosTop = elementPos.top; 132 133 // Add 'below-entry-meta' to elements below the entry meta. 134 if ( elementPosTop > sidebarPosBottom ) { 135 $element.addClass( 'below-entry-meta' ); 136 } else { 137 $element.removeClass( 'below-entry-meta' ); 138 } 139 }); 140 } 141 142 /* 143 * Test if inline SVGs are supported. 144 * @link https://github.com/Modernizr/Modernizr/ 145 */ 146 function supportsInlineSVG() { 147 var div = document.createElement( 'div' ); 148 div.innerHTML = '<svg/>'; 149 return 'http://www.w3.org/2000/svg' === ( 'undefined' !== typeof SVGRect && div.firstChild && div.firstChild.namespaceURI ); 150 } 151 152 /** 153 * Test if an iOS device. 154 */ 155 function checkiOS() { 156 return /iPad|iPhone|iPod/.test(navigator.userAgent) && ! window.MSStream; 157 } 158 159 /* 160 * Test if background-attachment: fixed is supported. 161 * @link http://stackoverflow.com/questions/14115080/detect-support-for-background-attachment-fixed 162 */
163 function supportsFixedBackground() { 164 var el = document.createElement('div'), 165 isSupported; 166 167 try { 168 if ( ! ( 'backgroundAttachment' in el.style ) || checkiOS() ) { 169 return false; 170 } 171 el.style.backgroundAttachment = 'fixed'; 172 isSupported = ( 'fixed' === el.style.backgroundAttachment ); 173 return isSupported; 174 } 175 catch (e) { 176 return false; 177 } 178 } 179 180 // Fire on document ready. 181 $( document ).ready( function() { 182 183 /* Prise de position et Communication formatage des données */ 184 185 if ($('body').hasClass('home')) { 186 var $articleWidget = $(this).find('.article-widget'); 187 var $postItem = $articleWidget.find('.cat-post-item'); 188 var $publication = $postItem.find('#academie_type_publication'); 189 } else if ($('body').hasClass('category') || $('body').hasClass('archive')) { 190 191 var $postItem = $(this).find('.cat-post-item'); 192 193 $postItem.each(function() { 194 if($('#academie_type_publication').length) { 195 var $this = $(this); 196 var $publication = $this.find('#academie_type_publication'); 197 var $postPublication = $this.find('.post-publication'); 198 var $postEnglishtitle = $this.find('.post-english-title'); 199 var $postTitle = $this.find('#academie_title'); 200 var $postMotcle = $this.find('#academie_mots_cles'); 201 var $postKeyword = $this.find('#academie_keywords'); 202 203 $postMotcle.css({ display: 'none' }); 204 $postKeyword.css({ display: 'none' }); 205 206 $postPublication.append($publication); 207 $postEnglishtitle.append($postTitle); 208 } 209 }); 210 } else { 211 var $postItem = $('body').find('.post'); 212 213 if($('#academie_type_publication').length) { 214 215 var $targetPublication = $postItem.find('.publication'); 216 var $targetEnglishtitle = $postItem.find('.english-title'); 217 var $targetAuthor = $postItem.find('.author'); 218 var $targetMotcle = $postItem.find('.mot-cle'); 219 var $targetKeyword = $postItem.find('.keywords'); 220 221 var $postpublication = $postItem.find('#academie_type_publication'); 222 var $postTitle = $postItem.find('#academie_title'); 223 var $postMotcle = $postItem.find('#academie_mots_cles'); 224 var $postKeyword = $postItem.find('#academie_keywords'); 225 var $postAuthor = $postItem.find('#academie_auteurs'); 226 227 $targetPublication.append($postpublication); 228 $targetEnglishtitle.append($postTitle); 229 230 if ($postAuthor.text() == '') { 231 $targetAuthor.css({ display: 'none' }); 232 } else { 233 $targetAuthor.append($postAuthor); 234 } 235 236 if ($postMotcle.text() == '') { 237 $targetMotcle.css({ display: 'none' }); 238 } else { 239 $targetMotcle.append($postMotcle); 240 } 241 242 if ($postKeyword.text() == '') { 243 $targetKeyword.css({ display: 'none' }); 244 } else { 245 $targetKeyword.append($postKeyword); 246 } 247 } 248 } 249 250 /*Page actualités meme hauteur des blocks*/ 251 252 var $catItem = $('.category-actualites').find('.cat-post-item'); 253 var $catItemH = 0; 254 255 $catItem.each(function() { 256 var $eachH = $(this).outerHeight(); 257 if($catItemH < $eachH) { 258 $catItemH = $(this).outerHeight(); 259 } 260 $(this).css({ height : $catItemH }); 261 }) 262 263 /* Navigation on mobile */ 264 265 var mainNav = $('.main-nav'); 266 267 $('.menu-icon').on('click', function() { 268 mainNav.toggleClass('left'); 269 $('body').toggleClass('no-overflow'); 270 if($('#search-bar').attr('class') == 'on'){ 271 $('#search-bar').toggleClass('on'); 272 } 273 }) 274 275 if($('body').width() <= 812) { 276 277 $('#searchsubmit').on('click', function(e) { 278 var input = $('#search-bar input[type="text"]'); 279 280 if(input.val() == '') { 281 e.preventDefault(); 282 $('#search-bar').toggleClass('on'); 283 } 284 285 /* Ajout pour faire disparaitre le menu si clic sur le bouton search en mobile ou tablet */ 286 var menuMobile = $('.main-nav'); 287 if(menuMobile.attr('class') == 'main-nav left'){ 288 mainNav.toggleClass('left'); 289 } 290 }) 291 292 $('.main-navigation ul .menu-item-type-custom').each(function() { 293 $(this).addClass('off'); 294 }) 295 296 $('.main-navigation ul li').on('click touch', function() { 297 var $this = $(this); 298 var show = $(this).find('.show'); 299 var subMenu = $(this).find('ul'); 300 301 $('.main-navigation ul ul.show').removeClass('show'); 302 $('.main-navigation ul li').removeClass('on'); 303 304 if(show.length == 0) { 305 $this.addClass('on'); 306 subMenu.addClass('show'); 307 } else { 308 subMenu.removeClass('show'); 309 } 310 }); 311 } 312 313 /* Back to top function */ 314 315 $(window).on('scroll', function() { 316 if ($(window).scrollTop() > 0) { 317 $('.back-to-top').addClass('show'); 318 } else { 319 $('.back-to-top').removeClass('show'); 320 } 321 }); 322 323 $('.back-to-top').on('click', function() { 324 if ($(this).hasClass('show')) { 325 $("html, body").animate({ scrollTop: 0 }, "slow"); 326 } 327 }) 328 329 /* Slick init */ 330 331 $('.slick-home').slick(); 332 333 if($('body').outerHeight() > 1200) { 334 $(window).on('scroll', function() { 335 if(!$(window).scrollTop() == 0 && $('body').width() > 1024) { 336 $('.site-header').addClass('sticky-header'); 337 $('.main-nav').addClass('sticky-nav'); 338 339 } else { 340 $('.site-header').removeClass('sticky-header'); 341 $('.main-nav').removeClass('sticky-nav'); 342 343 } 344 }); 345 } 346 347 /* Brand image position */ 348 349 350 // If navigation menu is present on page, setNavProps and adjustScrollClass. 351 if ( $navigation.length ) { 352 setNavProps();
353 adjustScrollClass(); 354 } 355 356 // If 'Scroll Down' arrow in present on page, calculate scroll offset and bind an event handler to the click event. 357 if ( $menuScrollDown.length ) { 358 359 if ( $( 'body' ).hasClass( 'admin-bar' ) ) { 360 menuTop -= 32; 361 } 362 if ( $( 'body' ).hasClass( 'blog' ) ) { 363 menuTop -= 30; // The div for latest posts has no space above content, add some to account for this. 364 } 365 if ( ! $navigation.length ) { 366 navigationOuterHeight = 0; 367 } 368 369 $menuScrollDown.click( function( e ) { 370 e.preventDefault(); 371 $( window ).scrollTo( '#primary', { 372 duration: 600, 373 offset: { top: menuTop - navigationOuterHeight } 374 }); 375 }); 376 } 377 378 adjustHeaderHeight(); 379 setQuotesIcon(); 380 if ( true === supportsInlineSVG() ) { 381 document.documentElement.className = document.documentElement.className.replace( /(\s*)no-svg(\s*)/, '$1svg$2' ); 382 } 383 384 if ( true === supportsFixedBackground() ) { 385 document.documentElement.className += ' background-fixed'; 386 } 387 388 //var membre = ''; 389 390 function rechercheMembre(membre) { 391 392 $.ajax({ 393 url: '/search_membre.php', 394 data: 'membre='+membre, 395 type: 'post', 396 dataType: 'json', 397 success: function(data) { 398 399 var html = '<h3>Résultat(s) pour votre recherche :</h3>'; 400 401 html += '<ul class="col-md-10 col-md-offset-1">'; 402 403 if ( data.length > 0 ) { 404 405 for ( i in data ) { 406 407 html += '<li id="'+data[i].id+'" class="view">'; 408 409 html += '<img src="/membres/'+data[i].old_membres_id+'.jpg" onError="this.onerror=null;this.src=\'/membres/6.jpg\';" />'; 410 html += '<br />'; 411 html += '<p><span>'+data[i].nom+'</span> <span>'+data[i].prenom+'</span></p>'; 412 413 html += '</li>'; 414 415 } 416 417 } 418 else { 419 html += '<li><span>Pas de résultat pour votre recherche</span></li>'; 420 } 421 422 html += '</ul>'; 423 424 $('.result').html(html); 425 $('.view').off(); 426 $('.view').on('click', function() { 427 428 var url = '/fiche-membre/?id='+$(this).prop('id'); 429 $(location).attr('href', url); 430 431 }); 432 } 433 434 }); 435 436 } 437 438 /** 439 RECHERCHE DE MEMBRES par mots clés 440 **/ 441 442 $('#membre-form').submit(function(event){ 443 444 event.preventDefault(); 445 event.stopPropagation(); 446 447 var membre = $('#keyword').val(); 448 449 rechercheMembre(membre); 450 451 return false; 452 }); 453 454 /** 455 456 RECHERCHE DE TOUS LES MEMBRES 457 458 **/ 459 460 $('.lien-membres').click(function(){ 461 462 rechercheMembre(); 463 464 }); 465 466 /** 467 468 RECHERCHE DES MEMBRES PAR LETTRE 469 470 **/ 471 472 $('.abc span').click(function(){ 473 474 rechercheMembre($(this).text()); 475 476 }); 477 478 /** 479 480 RECHERCHE DES MEMBRES PAR TYPE 481 482 **/ 483 484 $('.types_membre').click(function() { 485 var x = location.href; 486 window.location.href = x+$(this).data('url'); 487 //window.location.href = '/'+$(this).data('url')+'/?id='+$(this).prop('id'); 488 489 }); 490 491 492 /** 493 494 RECHERCHE DES MEMBRES PAR DIVISION 495 496 **/ 497 498 $('.divisions_membre').click(function() { 499 var x = location.href; 500 window.location.href = x+$(this).data('url'); 501 //window.location.href = '/'+$(this).data('url')+'/?id='+$(this).prop('id'); 502 503 }); 504 505 506 507 /** 508 509 FILTRE PAR DIVISION 510 511 **/ 512 513 $('.division').click(function() { 514 515 var ids = $(this).prop('id').split('-'); 516 517 var division = ids[0]; 518 var type = ids[1]; 519 520 $.ajax({ 521 url: '/search_membre.php', 522 data: 'division='+division+'&type='+type, 523 type: 'post', 524 dataType: 'json', 525 success: function(data) { 526 527 var html = ''; 528 529 if ( data.length > 0 ) { 530 531 for ( i in data ) { 532 533 html += '<li id="'+data[i].id+'" class="view">'; 534 535 html += '<img src="/membres/'+data[i].old_membres_id+'.jpg" onError="this.onerror=null;this.src=\'/membres/6.jpg\';" />'; 536 html += '<br />'; 537 html += '<p><span>'+data[i].nom+'</span> <span>'+data[i].prenom+'</span></p>'; 538 539 html += '</li>'; 540 541 } 542 543 } 544 else { 545 html += '<li><span>Pas de résultat pour votre recherche</span></li>'; 546 } 547 548 $('.liste_membre').html(html); 549 $('.view').off(); 550 $('.view').on('click', function() { 551
552 var url = '/fiche-membre/?id='+$(this).prop('id'); 553 554 $(location).attr('href', url); 555 556 }); 557 558 } 559 560 }); 561 562 }); 563 564 565 566 /** 567 568 FILTRE PAR SECTION 569 570 **/ 571 572 $('.section').click(function() { 573 574 var ids = $(this).prop('id').split('-'); 575 576 var section = ids[0]; 577 var div = ids[1]; 578 579 $.ajax({ 580 url: '/search_membre.php', 581 data: 'section='+section+'&div='+div, 582 type: 'post', 583 dataType: 'json', 584 success: function(data) { 585 586 var html = ''; 587 588 if ( data.length > 0 ) { 589 590 for ( i in data ) { 591 592 html += '<li id="'+data[i].id+'" class="view">'; 593 594 html += '<img src="/membres/'+data[i].old_membres_id+'.jpg" onError="this.onerror=null;this.src=\'/membres/6.jpg\';" />'; 595 html += '<br />'; 596 html += '<p><span>'+data[i].nom+'</span> <span>'+data[i].prenom+'</span></p>'; 597 598 html += '</li>'; 599 600 } 601 602 } 603 else { 604 html += '<li><span>Pas de résultat pour votre recherche</span></li>'; 605 } 606 607 //$('#count').text(data.length); 608 $('.liste_membre').html(html); 609 $('.view').off(); 610 $('.view').on('click', function() { 611 612 var url = '/fiche-membre/?id='+$(this).prop('id'); 613 614 $(location).attr('href', url); 615 616 }); 617 618 } 619 620 }); 621 622 }); 623 624 625 if ( $('.view') != undefined ) { 626 627 $('.view').off(); 628 $('.view').on('click', function() { 629 630 var url = '/fiche-membre/?id='+$(this).prop('id'); 631 $(location).attr('href', url); 632 633 }); 634 } 635 636 637 /** 638 Gestion du bandeau de la home 639 **/ 640 $('.bandeau-home-title').click(function(){ 641 window.location = $(this).next().prop('href'); 642 }); 643 644 /** 645 Supprimer les p vides pour les articles 646 **/ 647 648 var academie_auteurs = true; 649 var academie_resume = true; 650 651 $('.cat-post-item').each(function(){ 652 653 $(this).find('.post-author').eq(0).show(); 654 $(this).find('.post-english-title').eq(0).show(); 655 656 657 $(this).find('.academie_summary').eq(0).parent('p').show(); 658 $(this).find('.academie_corps').eq(0).parent('p').show(); 659 660 if ( '' == $(this).find('.post-author').eq(0).html() ) 661 $(this).find('.post-author').eq(0).hide(); 662 663 // if ( '' == $(this).find('.academie_title').eq(0).html() || '' == $(this).find('.post-english-title').eq(0).html() ) 664 // $(this).find('.post-english-title').eq(0).hide(); 665 666 if ( '' == $(this).find('.academie_auteurs').eq(0).html() ) { 667 $(this).find('.academie_auteurs').eq(0).hide(); 668 academie_auteurs = false; 669 } 670 671 if ( '' == $(this).find('.academie_resume').eq(0).html() ) { 672 $(this).find('.academie_resume').eq(0).hide(); 673 academie_resume = false; 674 } 675 676 if ( !academie_auteurs && !academie_resume ) { 677 $(this).find('.academie_mots_cles').eq(0).parent('p').hide(); 678 } 679 680 681 if ( '' == $(this).find('.academie_summary').eq(0).text() ) 682 $(this).find('.academie_summary').eq(0).parent('p').hide(); 683 684 if ( '' == $(this).find('.academie_corps').eq(0).text() ) 685 $(this).find('.academie_corps').eq(0).parent('p').hide(); 686 687 }); 688 689 690 /** 691 Suppression du point pour les auteurs dans communiqués de presse 692 **/ 693 694 $('.author').show(); 695 if ( '' == $('.author').text() ) 696 $('.author').hide(); 697 698 /** 699 700 Suppression des <p> vides 701 702 **/ 703 704/* $('.cat-post-item').find('p').each(function() { 705 706 if ( 0 == $(this).html().trim().length ) { 707 console.log('p = ',$(this).html()); 708 $(this).hide(); 709 } 710 711 }); */ 712 713 /** 714 Mise en forme de la date des séances 715 Si 0 devant unité, supprimer 0 716 **/ 717 718 $('.cat-post-date').each(function() { 719 720 var date = $(this).text().trim(); 721 //console.log(date); 722 if ( '' != date ) { 723 724 var dateSeance = date.split(' '); 725 726 if ( !isNaN(dateSeance[0]) ) { 727 728 var d = dateSeance[0]; 729 730/* if(d <= 9 && d.length == 2) { 731 d = d.substr(1); 732 } */ 733 734 var jour = '<span class="jour">'+d+'</span>'; 735 var mois = '<span class="mois">'+dateSeance[1]+'</span>'; 736 var annee = '<span class="annee">'+dateSeance[2].substr(0,4)+'</span>'; 737 738 $(this).html(jour+mois+annee); 739 740 } 741 742 } 743 }); 744 745 /** 746 affichage date article bulletin 747 **/ 748 749/* if ( $('.date-seance').length > 0 ) { 750 751 var dateTotale = $('.date-seance').html(); 752 var dateFinale = ''; 753 754 if ( '-1' != dateTotale.indexOf(':') ) { 755 756 var date = dateTotale.split(' : '); 757 var dateSeance = date[1].split(' '); 758 var d = dateSeance[0]; 759 var m = dateSeance[1]; 760 var y = dateSeance[2]; 761 762 if(d <= 9 && d.length == 2) { 763 d = d.substr(1); 764 } 765 766 dateFinale = date[0] + ' : ' + d + ' ' + m + ' ' + y; 767 768 } 769 else { 770 771 var date = dateTotale.split(' '); 772 console.log('date' + date); 773 var d = date[2]; 774 var m = date[3]; 775 var y = date[4]; 776 777 if(d <= 9 && d.length == 2) { 778 d = d.substr(1); 779 } 780 781 dateFinale = date[0] + ' ' + date[1] + ' ' + d + ' ' + m + ' ' + y; 782 783 } 784 785 $('.date-seance').html(dateFinale); 786 787 } */ 788 789 /** 790 desactivation des liens menu pour media query 791 **/ 792 793 if (screen.width <= 812) { 794 $('ul#top-menu > li a').off(); 795 $('ul#top-menu > li a').on('click', function (event) { 796 if ( $(this).parent().find('.sub-menu').length > 0 ) 797 event.preventDefault(); 798 }); 799 } 800 801 /** 802 Affichage du mot "resultats" en italique à côté du nombre pour la recherche des articles du bulletion et prises de position 803 **/ 804 805/* if ( $('.sf-field-tag select').length > 0 ) { 806 807 var val = ''; 808 var exp = /^.*?\([^\d]*(\d+)[^\d]*\).*$/; 809 var result = ''; 810 var nb = ''; 811 var annee; 812 var tab = undefined; 813 814 $('.sf-field-tag select > option').each(function(){ 815 816 result = exp.exec($(this).text()); 817 818 if ( null != result ) { 819 820 nb = result[1]; 821 tab = result[0].substr(0,4); 822 console.log(tab); 823 val = tab + ' (' + nb + ' résultats)'; 824 825 $(this).text(val); 826 827 } 828 829 }); 830 831 } */ 832 833 }); 834 835 // If navigation menu is present on page, adjust it on scroll and screen resize. 836 if ( $navigation.length ) { 837 838 // On scroll, we want to stick/unstick the navigation. 839 $( window ).on( 'scroll', function() {
840 adjustScrollClass(); 841 adjustHeaderHeight(); 842 }); 843 844 // Also want to make sure the navigation is where it should be on resize. 845 $( window ).resize( function() { 846 setNavProps(); 847 setTimeout( adjustScrollClass, 500 ); 848 }); 849 } 850 851 $( window ).resize( function() { 852 clearTimeout( resizeTimer ); 853 resizeTimer = setTimeout( function() { 854 belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); 855 }, 300 ); 856 setTimeout( adjustHeaderHeight, 1000 ); 857 }); 858 859 // Add header video class after the video is loaded. 860 $( document ).on( 'wp-custom-header-video-loaded', function() { 861 $body.addClass( 'has-header-video' ); 862 }); 863 $('.mashsb-container.mashsb-main:last-of-type').appendTo('.entry-content'); 864 865 $('.mashsb-container.mashsb-main:first-of-type').prependTo('.entry-header'); 866 867 868})( jQuery ); 869
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.