1(function( $ ) { 2 'use strict'; 3 $(document).on('click', '.sl-button', function() { 4 var button = $(this); 5 var post_id = button.attr('data-post-id'); 6 var security = button.attr('data-nonce'); 7 var iscomment = button.attr('data-iscomment'); 8 var allbuttons; 9 if ( iscomment === '1' ) { /* Comments can have same id */ 10 allbuttons = $('.sl-comment-button-'+post_id); 11 } else { 12 allbuttons = $('.sl-button-'+post_id); 13 } 14 var loader = allbuttons.next('#sl-loader'); 15 if (post_id !== '') { 16 $.ajax({ 17 type: 'POST', 18 url: simpleLikes.ajaxurl, 19 data : { 20 action : 'process_simple_like', 21 post_id : post_id, 22 nonce : security, 23 is_comment : iscomment, 24 }, 25 beforeSend:function(){ 26 loader.html(' <div class="loader"></div>'); 27 }, 28 success: function(response){ 29 var icon = response.icon; 30 var count = response.count; 31 allbuttons.html(icon+count); 32 if(response.status === 'unliked') { 33 var like_text = simpleLikes.like; 34 allbuttons.prop('title', like_text); 35 allbuttons.removeClass('liked'); 36 } else { 37 var unlike_text = simpleLikes.unlike; 38 allbuttons.prop('title', unlike_text); 39 allbuttons.addClass('liked'); 40 } 41 loader.empty(); 42 } 43 }); 44 45 } 46 return false; 47 }); 48})( 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.