1(function($) { 2"use strict"; 3 $(document).on('ready', function() { 4 $( '.portfolio-content' ).each( function() { 5 var portfolio_grid_container = $(this), 6 portfolio_grid_container_id = $(this).attr('id'), 7 portfolio_grid = $('#' + portfolio_grid_container_id + ' .portfolio-grid'), 8 load_more_button = $( '#' + portfolio_grid_container_id + ' .pf-load-more' ), 9 start_page_count = 1; 10 11 load_more_button.click(function(e){ 12 e.preventDefault(); 13 14 var button = $(this), 15 pages = portfolio_grid.attr('data-pages-num'), 16 categories = portfolio_grid_container.attr('data-categories'), 17 categories_array = categories.split(','), 18 data = { 19 'action': 'loadmore', 20 'query': start_page_count, 21 'page' : start_page_count, 22 'categories': categories_array, 23 }; 24 25 $.ajax({ 26 url : ajaxurl, 27 data : data, 28 type : 'POST', 29 beforeSend : function ( xhr ) { 30 button.text(button.attr('data-load-text')); 31 }, 32 success : function( data, html ){ 33 if( data ) { 34 button.text(button.attr('data-more-text')); 35 start_page_count++; 36 37 portfolio_grid.append(data); 38 39 var $figure = portfolio_grid.find('figure:not(.shuffle-item)'); 40 41 $figure.imagesLoaded().always( function() { 42 portfolio_grid.shuffle('appended', $figure); 43 }); 44 45 if ( start_page_count == pages ) { 46 button.remove(); // if last page, remove the button 47 } 48 } else { 49 button.remove(); // if no data, remove the button as well 50 } 51 } 52 }); 53 }); 54 }); 55 }); 56})(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.