1jQuery(document).ready(function ($) { 2 // Cache body and ms-likes elements 3 var $body = $('body'); 4 var $msLikes = $('.ms-likes'); 5 6 // Event delegation for click event 7 $body.on('click', '.ms-likes', function () { 8 var $link = $(this); 9 if ($link.hasClass('active')) return false; 10 11 var id = $link.attr('id'); 12 var postfix = $link.find('.ms-likes-postfix').text(); 13 14 $.post(ms_likes.ajaxurl, { action: 'ms-likes', likes_id: id, postfix: postfix }, function (data) { 15 $link.html(data).addClass('active').attr('title', 'You already like this'); 16 }); 17 18 return false; 19 }); 20 21 if ($body.hasClass('ajax-ms-likes')) { 22 $msLikes.each(function () { 23 var $this = $(this); 24 var id = $this.attr('id'); 25 $this.load(ms_likes.ajaxurl, { action: 'ms-likes', post_id: id }); 26 }); 27 } 28});
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.