1(function( $ ) { 2 'use strict'; 3 4 /** 5 * All of the code for your admin-facing JavaScript source 6 * should reside in this file. 7 * 8 * Note: It has been assumed you will write jQuery code here, so the 9 * $ function reference has been prepared for usage within the scope 10 * of this function. 11 * 12 * This enables you to define handlers, for when the DOM is ready: 13 * 14 * $(function() { 15 * 16 * }); 17 * 18 * When the window is loaded: 19 * 20 * $( window ).load(function() { 21 * 22 * }); 23 * 24 * ...and/or other possibilities. 25 * 26 * Ideally, it is not considered best practise to attach more than a 27 * single DOM-ready or window-load handler for a particular page. 28 * Although scripts in the WordPress core, Plugins and Themes may be 29 * practising this, we should strive to set a better example in our own work. 30 */ 31 32 jQuery(document).ready(function() { 33 34 $('.aj--loadmore').click(function(e) { 35 36 console.log(event_codes); 37 38 e.preventDefault(); 39 $('#'+e.target.id).hide(); 40 41 var sc_params = window['event_codes_sc_atts_'+e.target.id] 42 sc_params._jilarx = true; 43 sc_params._api_nonce = event_codes.api_nonce; 44 45 if(event_codes.api_ver == 1) { 46 var url = event_codes.api_url; 47 sc_params.action = 'get_api_data'; 48 } else { 49 var url = event_codes.api_url + 'events/v1/get-more-events'; 50 } 51 52 //Send the AJAX call to the server 53 $.ajax({ 54 //The URL to process the request 55 'url' : url, 56 //The type of request, also known as the "method" in HTML forms 57 //Can be 'GET' or 'POST' 58 'type' : 'GET', 59 //Any post-data/get-data parameters 60 //This is optional 61 beforeSend : function ( xhr ) { 62 xhr.setRequestHeader( 'X-WP-Nonce', event_codes.api_nonce ); 63 }, 64 'data' : sc_params, 65 //The response from the server 66 'success' : function(data) { 67 68 console.log(data); 69 70 $('#'+e.target.id).show(); 71 72 var markup1 = $(data.markup); 73 $('#data-' + e.target.id).append(markup1); 74 window['event_codes_sc_atts_'+e.target.id] = data.atts; 75 76/* console.log(+data.atts.count + +data.atts.offset); 77 console.log(data.results_count);*/ 78 if(data.results_count <= (+data.atts.count + +data.atts.offset)) { 79 $('#'+e.target.id).remove(); 80 } 81 } 82 }); 83 }); 84 }); 85 86 87})( 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.