1jQuery(document).ready(function($) 2 { 3 4 5 6 $(window).resize(function() { 7 8 //var windowWidth = $(window).width(); 9 //var width = $('#post-grid-7 .grid-items').width(); 10 11 //$('.post-grid-debug').html(width+' - '+windowWidth); 12 13 }); 14 15 16 17 $(document).on('keyup', '.post-grid .nav-search .search', function(e){ 18 var keyword = $(this).val(); 19 var grid_id = $(this).attr('grid_id'); 20 21 var key = e.which; 22 if(key == 13){ 23 // the enter key code 24 var is_reset = 'yes'; 25 26 $(this).addClass('loading'); 27 28 $('.pagination').fadeOut(); 29 30 $.ajax({ 31 type: 'POST', 32 context: this, 33 url:post_grid_ajax.post_grid_ajaxurl, 34 data: {"action": "post_grid_ajax_search", "grid_id":grid_id,"keyword":keyword,"is_reset":is_reset,}, 35 success: function(data){ 36 37 $('#post-grid-'+grid_id+' .grid-items').html(data); 38 $(this).removeClass('loading'); 39 } 40 }); 41 42 } 43 else{ 44 var is_reset = 'no'; 45 if(keyword.length>3){ 46 $(this).addClass('loading'); 47 48 $('.pagination').fadeOut(); 49 50 $.ajax({
51 type: 'POST', 52 context: this, 53 url:post_grid_ajax.post_grid_ajaxurl, 54 data: {"action": "post_grid_ajax_search", "grid_id":grid_id,"keyword":keyword,"is_reset":is_reset,}, 55 success: function(data){ 56 57 $('#post-grid-'+grid_id+' .grid-items').html(data); 58 $(this).removeClass('loading'); 59 } 60 }); 61 } 62 63 } 64 65 }) 66 67 68 69 70 71 $(document).on('click', '.post-grid .nav-filter .filter', function() 72 { 73 $('.post-grid .nav-filter .filter').removeClass('active'); 74 75 76 if($(this).hasClass('active')) 77 { 78 //$(this).removeClass('active'); 79 } 80 else 81 { 82 $(this).addClass('active'); 83 } 84 85 }) 86 87 $(document).on('click', '.post-grid .load-more', function() 88 { 89 90 91 var paged = parseInt($(this).attr('paged')); 92 var per_page = parseInt($(this).attr('per_page')); 93 var grid_id = parseInt($(this).attr('grid_id')); 94 var terms = $('#post-grid-'+grid_id+' .nav-filter .filter.active').attr('terms-id'); 95 96 //alert(terms); 97 98 if(terms == null || terms == '') 99 { 100 terms = ''; 101 } 102 103 $(this).addClass('loading'); 104 105 106 $.ajax( 107 { 108 type: 'POST', 109 context: this, 110 url:post_grid_ajax.post_grid_ajaxurl, 111 data: {"action": "post_grid_ajax_load_more", "grid_id":grid_id,"per_page":per_page,"paged":paged,"terms":terms,}, 112 success: function(data) 113 { 114 115 //$('.grid-items').append(data); 116 117 118 var $grid = $('#post-grid-'+grid_id+' .grid-items').masonry({}); 119 120 121 122 123 // append items to grid 124 $grid.append( data ) 125 // add and lay out newly appended items 126 .masonry( 'appended', data, true ); 127 128 129 $grid.masonry( 'reloadItems' ); 130 $grid.masonry( 'layout' ); 131 $grid.masonry('destroy'); 132 133 $('#post-grid-'+grid_id+' .grid-items').masonry({}); 134 135 136 $(this).attr('paged',(paged+1)); 137 138 if($(this).hasClass('loading')) 139 { 140 $(this).removeClass('loading'); 141 } 142 143 } 144 }); 145 146 //alert(per_page); 147 }) 148 149 150 151 152 }); 153 154 155 156 157 158
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.