1$('.like-button').on('click', function(e) { 2 e.preventDefault(); 3 var self = $(this), 4 is_like = Number(self.hasClass('fa-heart-o')), 5 news_id = self.data('blogid'), 6 counter = $('.like-button[data-blogid="'+news_id+'"]').parent().find('.likes_counter'); 7 8 if ('undefined' != typeof(news_id)) { 9 10 if (typeof algolia_query_id !== 'undefined') { 11 var type = 'listing'; 12 if (typeof algolia_autocomplete_search !== 'undefined') { 13 type = 'autocomplete'; 14 } 15 var data = { 16 'query_id': algolia_query_id, 17 'type': type 18 }; 19 if (window.algolia && typeof window.algolia.saveEventData === 'function') { 20 algolia.saveEventData(data); 21 } 22 } 23 24 $.ajax({ 25 type: 'POST', 26 url: baseDir + 'modules/prestablog/ajax_like_button.php', 27 data:{id_prestablog_news: news_id, is_like: is_like} 28 }); 29 $('.like-button[data-blogid="'+news_id+'"]').toggleClass('fa-heart', is_like).toggleClass('fa-heart-o', !is_like); 30 counter.text(function(index, value){ 31 value = Number($.trim(value)); 32 return (is_like ? value + 1 : value - 1); 33 }); 34 } 35})
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.