1jQuery( document ).ready( function ( $ ) { 2 $( document ).on( 'click', '.uplp-list-button', function( e ) { 3 4 // set vars 5 var ulist_id = this.id.match( /[0-9]+/ ); 6 var container_id = '#uplp-list-' + ulist_id; 7 var form_id = '#uplp-list-' + ulist_id + '-form'; 8 var button_id = '#uplp-list-' + ulist_id + '-button'; 9 var spinner_id = '#uplp-list-' + ulist_id + '-spinner'; 10 var message_id = '#uplp-list-' + ulist_id + '-no-more-label'; 11 var pagenum_id = '#uplp-list-' + ulist_id + '-page-number'; 12 13 // feedback: hide waiting symbol, disable submit button 14 $( spinner_id ).show(); 15 $( button_id ).attr( 'disabled', true ); 16 17 // parameters for POST 18 data = { 19 action: 'uplp_ajax_load_more', 20 list_id: ulist_id, 21 number_items: $( container_id + ' > ul' ).find( 'li' ).length, 22 page_number: $( pagenum_id ).val(), 23 uplp_nonce: uplp_vars.uplp_nonce 24 }; 25 26 // request further posts 27 jQuery.post( uplp_vars.ajaxurl, data, function( response ) { 28 // if there is a valid (non-empty) response 29 if ( response ) { 30 // append them to current list 31 $( container_id + ' > ul' ).append( response ); 32 // remove focus state from clicked element 33 $( button_id ).blur(); 34 } else { 35 // print error message after last element of the container 36 $( container_id ).append( '<p>' + $( message_id ).val() + '</p>' ); 37 // remove form 38 $( form_id ).remove(); 39 } 40 // feedback: hide waiting symbol, enable submit button 41 $( spinner_id ).hide(); 42 $( button_id ).attr( 'disabled', false ); 43 }); 44 45 // prevent form to submit 46 return false; 47 }); 48});
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.