1(function($) { 2 'use strict'; 3 4 var like = {}; 5 6 like.qodeOnDocumentReady = qodeOnDocumentReady; 7 8 $(document).ready(qodeOnDocumentReady); 9 10 /** 11 * All functions to be called on $(document).ready() should be in this function 12 **/ 13 function qodeOnDocumentReady() { 14 qodeNewsLikes(); 15 } 16 17 function qodeNewsLikes() { 18 var likeDislike = $('.qode-news-like-dislike'); 19 20 $(document).on('click','.qode-news-like, .qode-news-dislike', function() { 21 var clicked = $(this), 22 id = likeDislike.attr('id'), 23 type, 24 reaction = 'like'; 25 26 if ( likeDislike.hasClass('liked') ) { 27 return false; 28 } 29 30 if (typeof likeDislike.data('type') !== 'undefined') { 31 type = likeDislike.data('type'); 32 } 33 34 if (clicked.hasClass('qode-news-dislike')){ 35 reaction = 'dislike'; 36 } 37 38 var dataToPass = { 39 action: 'qode_news_like', 40 likes_id: id, 41 type: type, 42 reaction: reaction 43 }; 44 45 var like = $.post(QodeAdminAjax.ajaxurl, dataToPass, function( data ) { 46 likeDislike.html(data).addClass('liked').attr('title', 'You already like/dislike this!'); 47 }); 48 49 return false; 50 }); 51 } 52 53})(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.