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