1(function( $ ) { 2 'use strict'; 3 4 $( '.wp-block-pdf-viewer-block-standard' ).each( function() { 5 var href = encodeURI( $( this ).find( '.uploaded-pdf > a' ).attr( 'href' ) ); 6 if ( href != undefined && href != '' ) { 7 var widthValue = $( this ).find( '.uploaded-pdf > a' ).attr( 'data-width' ); 8 var heightValue = $( this ).find( '.uploaded-pdf > a' ).attr( 'data-height' ); 9 10 var width = '100%'; 11 if ( $.isNumeric( widthValue ) && widthValue > 0 ) { 12 width = $( this ).find( '.uploaded-pdf > a' ).attr( 'data-width' ) + 'px'; 13 } 14 var height = '700px'; 15 if ( $.isNumeric( heightValue ) && heightValue > 0 ) { 16 height = $( this ).find( '.uploaded-pdf > a' ).attr( 'data-height' ) + 'px'; 17 } 18 $( '<iframe class="pdfjs-viewer" style="width:' + width + ';height:' + height + '" src="' + pdfViewerUrl + '?file=' + href + '"></iframe>' ).appendTo( $( this ) ); 19 $( this ).find( '.uploaded-pdf' ).remove(); 20 } 21 }); 22 23})( 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.