1(function($) { 2 'use strict'; 3 4 var like = {}; 5 edgtf.modules.like = like; 6 7 like.edgtfLikes = edgtfLikes; 8 9 like.edgtfOnDocumentReady = edgtfOnDocumentReady; 10 like.edgtfOnWindowLoad = edgtfOnWindowLoad; 11 like.edgtfOnWindowResize = edgtfOnWindowResize; 12 like.edgtfOnWindowScroll = edgtfOnWindowScroll; 13 14 $(document).ready(edgtfOnDocumentReady); 15 $(window).load(edgtfOnWindowLoad); 16 $(window).resize(edgtfOnWindowResize); 17 $(window).scroll(edgtfOnWindowScroll); 18 19 /* 20 All functions to be called on $(document).ready() should be in this function 21 */ 22 function edgtfOnDocumentReady() { 23 edgtfLikes(); 24 } 25 26 /* 27 All functions to be called on $(window).load() should be in this function 28 */ 29 function edgtfOnWindowLoad() { 30 31 } 32 33 /* 34 All functions to be called on $(window).resize() should be in this function 35 */ 36 function edgtfOnWindowResize() { 37 38 } 39 40 /* 41 All functions to be called on $(window).scroll() should be in this function 42 */ 43 function edgtfOnWindowScroll() { 44 45 } 46 47 48 function edgtfLikes() { 49 50 $(document).on('click','.edgtf-like', function() { 51 52 var likeLink = $(this), 53 id = likeLink.attr('id'), 54 postID = likeLink.data('post-id'), 55 type = ''; 56 57 if ( likeLink.hasClass('liked') ) { 58 return false; 59 } 60 61 if(typeof likeLink.data('type') !== 'undefined') { 62 type = likeLink.data('type'); 63 } 64 65 var dataToPass = { 66 action: 'xpo_edge_like', 67 likes_id: id, 68 type: type, 69 like_nonce: $('#edgtf_like_nonce_'+postID).val() 70 }; 71 72 var like = $.post(edgtfLike.ajaxurl, dataToPass, function( data ) { 73 74 likeLink.html(data).addClass('liked').attr('title','You already like this!'); 75 76 if(type !== 'portfolio_list') { 77 likeLink.children('span').css('opacity',1); 78 } 79 80 }); 81 82 return false; 83 }); 84 85 } 86 87 88})(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.