1jQuery(function($) { 2 "use strict"; 3 4 5 /** 6 * Tables responsive 7 */ 8 $('.entry-content table').wrap( $("<div class='table-responsive' />") ); 9 10 11 /** 12 * Single paged 13 */ 14 if ( $('body').hasClass('single-paged') ) { 15 var destination = $('#main').offset().top; 16 $('html,body').animate( { scrollTop: destination }, 800 ); 17 } 18 19 20 /** 21 * Menu 22 */ 23 var $hamburger = $('.mob-hamburger'); 24 var $menu = $('#site-navigation'); 25 var $header_menu = $('#header_menu'); 26 var $top_menu = $('#top_menu'); 27 28 var $to_mob_menu = $top_menu.clone(); 29 $to_mob_menu.find('li').addClass('only-hamburger'); 30 31 $hamburger.on('click', function(){ 32 $hamburger.toggleClass('active'); 33 $menu.slideToggle(); 34 }); 35 36 37 /** 38 * Mob menu transfer 39 */ 40 $header_menu.prepend( $to_mob_menu.html() ); 41 42 43 /** 44 * Scroll to top 45 */ 46 $(".js-scrolltop").click(function () { 47 return $("body,html").animate({ 48 scrollTop: 0 49 }, 500), !1 50 }), $(window).scroll(function () { 51 $(this).scrollTop() > 100 ? $(".js-scrolltop").fadeIn() : $(".js-scrolltop").fadeOut() 52 }); 53 54 55 /** 56 * Dropdown menu 57 */ 58 var timer; 59 var width = $(window).width(); 60 61 if ( width > 991 ) { 62 63 jQuery('#site-navigation .menu-item a, #site-navigation .menu-item .removed-link').hover( 64 function () { 65 jQuery(this).parent().parent().find('.sub-menu:visible').hide(); 66 jQuery(this).parent().find('.sub-menu:first').show(); 67 clearTimeout(timer); 68 }, 69 function () { 70 } 71 ); 72 73 jQuery('#site-navigation').hover(function () { 74 clearTimeout(timer); 75 }, function () { 76 timer = setTimeout(hideMenu, 400); 77 }); 78 79 } 80 81 function hideMenu() { 82 jQuery('#site-navigation .menu-item .sub-menu').slideUp(200); 83 } 84 85 86 87 if ( width <= 991 ) { 88 89 $(document).on('click', '#site-navigation .menu-item-has-children', function (e) { 90 if ( e.target.nodeName != 'A' && e.target.nodeName != 'a' ) { 91 e.stopPropagation(); 92 $(this).toggleClass('open'); 93 $(this).find('.sub-menu:first').slideToggle(); 94 console.log($(this).html()) 95 } 96 }); 97 98 } 99 100 /** 101 * Social link share 102 */ 103 $('.js-share-link').click(function(){ 104 if ( ! $(this).hasClass('js-share-link-no-window') ) { 105 openWin($(this).data("uri")); 106 } else { 107 window.location.href = $(this).data("uri"); 108 } 109 }); 110 111 function openWin( url ) { 112 var features, w = 626, h = 436; 113 var top = (screen.height - h)/2, left = (screen.width - w)/2; 114 if(top < 0) top = 0; 115 if(left < 0) left = 0; 116 features = 'top=' + top + ',left=' +left; 117 features += ',height=' + h + ',width=' + w + ',resizable=no'; 118 open(url, 'displayWindow', features); 119 } 120 121 /** 122 * Smiles 123 */ 124 $('.js-comment-smiles img').click(function(){ 125 var $this = $(this); 126 $('#comment').val( $('#comment').val() + ' ' + $this.prop('alt') + '' ); 127 }); 128 129 130 /** 131 * Adaptive videos 132 */ 133 responsiveIframe(); 134 $(window).on('resize', function(){ 135 responsiveIframe(); 136 }); 137 138 function responsiveIframe() { 139 $('.entry-content iframe, .responsive-iframe iframe').each(function(){ 140 141 if ( $(this).parents('.not-responsive').length ) return; 142 if ( $(this).width() <= $(this).parent().width() ) return; 143 144 var iw = $(this).width(); 145 var ih = $(this).height(); 146 var ip = $(this).parent().width(); 147 var ipw = ip/iw; 148 var ipwh = Math.round(ih*ipw); 149 $(this).css({ 150 'width': ip, 151 'height' : ipwh 152 }); 153 }); 154 } 155 156});
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.