1/** 2 * @package QT Loveit 3 * Script for the Qantumthemes Love It plugin 4 */ 5 6 7(function($) { 8 "use strict"; 9 $.fn.qtLoveitInit = function(){ 10 var post_id, heart; 11 $("body").on("click","a.qt-loveit-link", function(e){ 12 e.preventDefault(); 13 heart = $(this); 14 // Retrieve post ID from data attribute 15 post_id = heart.data("post_id"); 16 // Ajax call 17 $.ajax({ 18 type: "post", 19 url: ajax_var.url, 20 data: "action=post-like&nonce="+ajax_var.nonce+"&post_like=&post_id="+post_id, 21 success: function(count){ 22 // If vote successful 23 if(count != "already") 24 { 25 heart.addClass("qt-disabled"); 26 heart.find(".count").text(count); 27 } 28 } 29 }); 30 return false; 31 }); 32 }; 33 34 $(document).ready(function() { 35 $.fn.qtLoveitInit(); 36 }); 37 38 39})(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.