1/** 2 * Fix the aspect ratio of iframes, assuming CSS for overlay is defined. 3 * @package Twenty8teen 4 */ 5( function($) { 6 var ignore = [ 7 '.iframefix-ignore, .fitvidsignore', 8 '.iframe-wrapper iframe', 9 '.responsive-object iframe', 10 '.video-container iframe', 11 '.responsive-embed iframe', 12 '.embed-responsive iframe', 13 'iframe.wp-embedded-content', 14 'iframe:not([width])', 15 'iframe:not([height])' 16 ]; 17 $('iframe') 18 .not(ignore.join(',')).each(function() { 19 var $this = $(this), 20 height = ( $this.attr('height') && !isNaN(parseInt($this.attr('height'), 10)) ) 21 ? parseInt($this.attr('height'), 10) : null, 22 width = ( $this.attr('width') && !isNaN(parseInt($this.attr('width'), 10)) ) 23 ? parseInt($this.attr('width'), 10) : null, 24 ratio = (height && width) ? (height / width * 100).toPrecision(4) + '%' : ''; 25 $(this).wrap('<div class="iframe-wrapper"></div>') 26 .parent().css('padding-bottom', ratio); 27 } ); 28} )( window.jQuery || window.Zepto );
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.