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