1(function($){ 2 3 $(document).on( 'click', '.comi-like-btn', function(e){ 4 5 if( typeof comi_cl_params === 'undefined' ){ 6 return; 7 } 8 9 e.preventDefault(); 10 11 var self = $(this); 12 13 self.toggleClass( 'liked' ); 14 15 if( self.hasClass( 'liked' ) ){ 16 $.ajax({ 17 url : comi_cl_params.ajaxurl, 18 method : 'POST', 19 data : { 20 action: 'comi_like_comment', 21 comment: self.data( 'comment' ), 22 user: self.data( 'user' ), 23 nonce : comi_cl_params.nonce 24 }, 25 beforeSend : function(){ 26 var total = self.find( 'span' ); 27 totalVal = parseInt( total.text() ); 28 total.text( ++totalVal ); 29 }, 30 success : function( response ){ 31 if( ! response.success ){ 32 self.toggleClass( 'liked' ); 33 } 34 } 35 }); 36 }else{ 37 $.ajax({
38 url : comi_cl_params.ajaxurl, 39 method : 'POST', 40 data : { 41 action: 'comi_unlike_comment', 42 comment: self.data( 'comment' ), 43 user: self.data( 'user' ), 44 nonce : comi_cl_params.nonce 45 }, 46 beforeSend : function(){ 47 var total = self.find( 'span' ); 48 totalVal = parseInt( total.text() ); 49 total.text( --totalVal ); 50 }, 51 success : function( response ){ 52 // if( ! response.success ){ 53 // self.toggleClass( 'liked' ); 54 // } 55 } 56 }); 57 } 58 59 } ); 60 61})(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.