1(function($){ 2 3 $(document).ready( function() { 4 5 $( 'body' ).delegate( '.ts-load-more', 'click' , function() { 6 7 const $this = $(this); 8 9 const action = $this.data( 'action' ) || 'ts_load_more', 10 template = $this.data( 'template' ), 11 args = $(this).data( 'args' ), 12 settings = $this.data( 'settings' ), 13 jsmethod = $this.data( 'jsmethod' ) || 'replace', 14 target = $this.data( 'target' ); 15 16 // hide the button we just clicked 17 $this.find( '.ts-load-more-text' ).addClass( 'uk-hidden' ); 18 // unhide the loading more div 19 $this.find( '.ts-load-more-whileloading' ).removeClass( 'uk-hidden' ); 20 21 $.ajax( { 22 type: 'POST', 23 url: `/wp-admin/admin-ajax.php?action=${action}&template=${template}`, 24 data: { ...settings , args: args }, 25 success: (data) => { 26 27 data = JSON.parse( data ); 28 // remove the loading more 29 //$loadingMore.remove(); 30 // remove the load more button 31 if ( settings.removeSelf || false == true ) $this.remove(); 32 // add the data 33 if ( jsmethod === 'append' ) $( target ).append( data.data ); 34 if ( jsmethod === 'replace' ) $( target ).replaceWith( data.data ); 35 if ( jsmethod === 'replacecontent' ) $( target ).html( '' ).append( data.data ); 36 37 } 38 }) 39 40 41 } ); 42 }); 43})(jQuery); 44 45( function() { 46 47 var youtube = document.querySelectorAll( ".youtube" ); 48 49 for (var i = 0; i < youtube.length; i++) { 50 51 var source = "https://img.youtube.com/vi/"+ youtube[i].dataset.embed +"/hqdefault.jpg"; 52 53 var image = new Image(); 54 image.src = source; 55 image.addEventListener( "load", function() { 56 youtube[ i ].appendChild( image ); 57 }( i ) ); 58 59 youtube[i].addEventListener( "click", function() { 60 61 var iframe = document.createElement( "iframe" ); 62 63 iframe.setAttribute( "frameborder", "0" ); 64 iframe.setAttribute( "allowfullscreen", "" ); 65 iframe.setAttribute( "src", "https://www.youtube.com/embed/"+ this.dataset.embed +"?rel=0&showinfo=0&autoplay=1" ); 66 67 this.innerHTML = ""; 68 this.appendChild( iframe ); 69 } ); 70 }; 71 72} )();
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.