PageSourceSearch

https://sautikubwa.org/wp-content/plugins/rating-system/assets/js/like-or-dislike-comments.js?ver=1.0

js sautikubwa.org collected 2026-10-02 12:36:42 UTC 3,712 bytes, 111 lines download raw bytes

1	function like_comment(event){
2		event.preventDefault();
3		var has_id = jQuery(this).parent().children('input');
4		var id = has_id.val();
5		like_ajax_comment(id);
6	}
7	
8	function like_ajax_comment(id){
9		jQuery.ajax({
10			type: "post",
11			url: vortex_ajax_comment.url,
12			dataType: "json",
13			data:{
14				action:'vortex_system_comment_like_button',
15				post_id:id,
16				nonce: vortex_ajax_comment.nonce
17			},
18			success: function(response){
19				if(response.both == 'no'){
20				var like = jQuery('.vortex-p-like-counter-comment.'+id);
21				like.text(response.likes);
22				var like_toggle = jQuery('.vortex-p-like-comment.'+id);
23				like_toggle.toggleClass('vortex-p-like-active-comment');
24				}else{
25					
26				var dislike = jQuery('.vortex-p-dislike-counter-comment.'+id);
27				dislike.text(response.dislikes);
28				
29				var dislike_toggle = jQuery('.vortex-p-dislike-comment.'+id);
30				dislike_toggle.toggleClass('vortex-p-dislike-active-comment');
31				
32				var like = jQuery('.vortex-p-like-counter-comment.'+id);
33				like.text(response.likes);
34				
35				var like_toggle = jQuery('.vortex-p-like-comment.'+id);
36				like_toggle.toggleClass('vortex-p-like-active-comment');
37				
38				}
39			},
40			complete:function(){
41				jQuery(document.body).one('click.vortexlikecomment','.vortex-p-like-comment',like_comment);
42			}
43		});
44	}
45	
46	
47	function dislike_comment(event){
48		event.preventDefault();
49		var has_id = jQuery(this).parent().children('input');
50		var id = has_id.val();
51		dislike_ajax_comment(id);
52	}
53	
54	function dislike_ajax_comment(id){
55			jQuery.ajax({
56			type: "post",
57			url: vortex_ajax_comment.url,
58			dataType: "json",
59			data:{
60				action:'vortex_system_comment_dislike_button',
61				post_id:id,
62				nonce: vortex_ajax_comment.nonce
63			},
64			success: function(response){
65				if(response.both == 'no'){
66				var dislike = jQuery('.vortex-p-dislike-counter-comment.'+id);
67				dislike.text(response.dislikes);
68				var dislike_toggle = jQuery('.vortex-p-dislike-comment.'+id);
69				dislike_toggle.toggleClass('vortex-p-dislike-active-comment');
70				}else{
71					
72				var dislike = jQuery('.vortex-p-dislike-counter-comment.'+id);
73				dislike.text(response.dislikes);
74				var dislike_toggle = jQuery('.vortex-p-dislike-comment.'+id);
75				dislike_toggle.toggleClass('vortex-p-dislike-active-comment');
76				
77				var like = jQuery('.vortex-p-like-counter-comment.'+id);
78				like.text(response.likes);	
79				var like_toggle = jQuery('.vortex-p-like-comment.'+id);
80				like_toggle.toggleClass('vortex-p-like-active-comment');
81				
82				}
83			},
84			complete:function(){
85				jQuery(document.body).one('click.vortexdislikecomment','.vortex-p-dislike-comment',dislike_comment);
86			}
87		});
88	}
89
90jQuery(document).ready(function() {
91	if(Modernizr.touchevents){
92		jQuery(document.body).on('mouseleave touchmove click', '.vortex-p-like-comment', function( event ) {
93			if(jQuery(this).hasClass('vortex-p-like-active-comment')){
94				var color = jQuery('.vortex-p-dislike-comment').css('color');
95				jQuery(this).css('color',color);
96			}else{
97				jQuery(this).removeAttr('style');
98			};
99		});
100		jQuery(document.body).on('mouseleave touchmove click', '.vortex-p-dislike-comment', function( event ) {
101			if(jQuery(this).hasClass('vortex-p-dislike-active-comment')){
102				var color = jQuery('.vortex-p-like-comment').css('color');
103				jQuery(this).css('color',color);
104			}else{
105				jQuery(this).removeAttr('style');
106			};
107		});
108	}
109	jQuery(document.body).off('click.vortexlikecomment','.vortex-p-like-comment').one('click.vortexlikecomment','.vortex-p-like-comment',like_comment);
110	jQuery(document.body).off('click.vortexdislikecomment','.vortex-p-dislike-comment').one('click.vortexdislikecomment','.vortex-p-dislike-comment',dislike_comment);
111});

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.