1(function ($) { 2 $.plhgMain = function () { 3 this.zinit(); 4 }; 5 6 $.plhgMain.prototype = { 7 zinit : function() { 8 var fw = this; 9 10 // Bind this to document in case the content is loaded with ajax 11 $( document ).on('click', '.plhg-love-action', function(e){ 12 e.preventDefault(); 13 14 // Don't do anything if the user already loved 15 if( $(this).hasClass('plhg-loved') ){ 16 return; 17 } 18 19 var el = $(this), 20 love_count_container = el.find('.plhg-love-count'), 21 current_loves = love_count_container.text(), 22 post_id = el.data('post-id'), 23 user_id = el.data('user-id'); 24 25 var post_data = { 26 action: 'plhg_process_post_love', 27 post_id: post_id, 28 user_id: user_id, 29 plhg_nonce: plhg_script_vars.nonce 30 }; 31 32 $.post(plhg_script_vars.ajaxurl, post_data, function(response) { 33 if( response.success === true ) { 34 el.addClass('plhg-loved'); 35 love_count_container.text( parseInt(current_loves) + 1 ); 36 } else { 37 alert(plhg_script_vars.error_message); 38 console.log(response) 39 } 40 }); 41 42 }); 43 }, 44 } 45 46 $(document).ready(function () { 47 // Call this on document ready 48 $.plhgMain = new $.plhgMain(); 49 }); 50 51})(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.