PageSourceSearch

https://testyotvety.ru/wp-content/themes/citynews-3/assets/js/simple-likes-public.js?ver=0.5

js testyotvety.ru collected 2026-10-04 23:54:57 UTC 1,462 bytes, 52 lines download raw bytes

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