1jQuery(function($) { 2 "use strict"; 3 $('html').removeClass('no-js'); 4 5 /* => Responsive video */ 6 function rVideo() { 7 var n = 0; 8 $("iframe[src*='//player.vimeo.com'], iframe[src*='//www.youtube.com']").each(function(){ 9 $('<div class="video-wrap v-w-'+n+'"></div>').insertAfter(this); 10 $(this).appendTo($('.v-w-'+n)); 11 n++; 12 }); 13 } 14 rVideo(); 15 16 /* => Archive */ 17 var year = $('.block.archive').data('year'); 18 $('.block.archive').find('a:contains('+year+')').parent().addClass('current-menu-item'); 19 20 /* => Gallery */ 21 $(".article a[href$='.jpg'],.article a[href$='.png'],.article a[href$='.gif'],.article a[href$='.JPG'],.article a[href$='.PNG'],.article a[href$='.GIF']").addClass('fancybox'); 22 $('.gallery').each(function(index, el){ 23 $(this).find('a').attr('rel', 'gallery-'+index); 24 }); 25 $('.fancybox').fancybox({ 26 margin: 0, 27 padding: 0, 28 nextEffect : 'fade', 29 prevEffect : 'fade' 30 }); 31 32 /* => Responsive */ 33 responsive_1(); 34 $(window).on('load resize', this, function() { 35 setTimeout(function(){ 36 responsive_1(); 37 }, 50); 38 }); 39 function responsive_1() { 40 var docWidth = $(document).width(); 41 if ( docWidth <= 800 ) { 42 $('.sidebar .block.news').insertAfter( $('.article') ); 43 } else { 44 $('.block.news').insertBefore( $('.sidebar .block.archive') ); 45 } 46 } 47 48 // Panel 49 $(document).on('click', '.btn-open-panel', function(e) { 50 e.preventDefault(); 51 52 $('html, body').toggleClass('m-panel-open'); 53 54 if ( $('.m-panel-open').length ) { 55 56 if ( !$('.m-panel .lang-list').length ) { 57 $('.header').find('.lang-list').clone().appendTo( $('.m-panel') ); 58 } 59 if ( !$('.m-panel .search-form').length ) { 60 $('.header').find('.search-form').clone().appendTo( $('.m-panel') ); 61 } 62 if ( !$('.m-panel .main-nav').length ) { 63 $('.main-nav-wrap').find('.main-nav').clone().appendTo( $('.m-panel') ); 64 } 65 66 equalHeight($('.page-wrap, .m-panel')); 67 68 } else { 69 $('.page-wrap, .m-panel').css('min-height', 'inherit'); 70 } 71 }); 72 $(document).on('click', '.m-panel .btn-close', function(event) { 73 event.preventDefault(); 74 $('html, body').removeClass('m-panel-open'); 75 }); 76 77 // Quiz 78 $(document).on('change', '.wpProQuiz_questionList[data-type="multiple"] input', function(event) { 79 event.preventDefault(); 80 $(this).parent().toggleClass('checked'); 81 }); 82 $(document).on('change', '.wpProQuiz_questionList[data-type="single"] input', function(event) { 83 event.preventDefault(); 84 $('.wpProQuiz_questionList[data-type="single"] label').removeClass('checked'); 85 $(this).parent().addClass('checked'); 86 }); 87 $('.wpProQuiz_content .wpProQuiz_button.wpProQuiz_QuestionButton').css('float', 'none'); 88 89 if ( $('.wpProQuiz_content').length ) { 90 $('.wpProQuiz_correct').each(function(index, el) { 91 if ( !$.trim( $(this).find('p').html() ) ) { 92 $(this).find('p').remove(); 93 } 94 }); 95 $('.wpProQuiz_incorrect').each(function(index, el) { 96 if ( !$.trim( $(this).find('p').html() ) ) { 97 $(this).find('p').remove(); 98 } 99 }); 100 } 101 102}); 103 104function equalHeight(group) { 105 var tallest = 0; 106 group.css('min-height', tallest); 107 group.each(function() { 108 var thisHeight = $(this).height(); 109 if(thisHeight > tallest) { 110 tallest = thisHeight; 111 } 112 }); 113 group.load(function() { 114 var thisHeight = $(this).height(); 115 if(thisHeight > tallest) { 116 tallest = thisHeight; 117 } 118 }); 119 group.css('min-height', tallest); 120}
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.