1(function($) { 2 $.like = {version: '0.1'}; 3 $.fn.extend({ 4 like: function(options) { 5 var defaults = { 6 7 likeMsg: "Like", 8 dislikeMsg: "Unlike", 9 10 likeTitle: "Like it", 11 dislikeTitle: "Unlike this element", 12 13 likeClass: 'pleaseLike', 14 dislikeClass: 'noMoreLike', 15 16 clickableType: 'div', 17 clickableSelector: '.likeButton', 18 19 showPersonneWhoLikeClass: "showLikers", 20 showPersonneWhoLikeTitle: "Click to see the people who like this publication", 21 showPersonneWhoLikeUrl: "/global/module/like/ajax/showLike.php" 22 }; 23 24 var opts = $.extend(defaults, options); 25 26 $(this).each(function() 27 { 28 var item = $(this); 29 30 if (item.data('likeReady')) { 31 return item; 32 } 33 item.data('likeReady', true); 34 35 item.find(opts.clickableType + opts.clickableSelector).each(function() 36 { 37 var clickableItem = $(this); 38 39 if (clickableItem.is("." + opts.likeClass)) 40 { 41 clickableItem.find(opts.clickableSelector + 'Content span') 42 .html(opts.likeMsg) 43 clickableItem.attr("title", opts.likeTitle); 44 } 45 46 else if (clickableItem.is("." + opts.dislikeClass)) 47 { 48 clickableItem.find(opts.clickableSelector + 'Content span') 49 .html(opts.dislikeMsg) 50 clickableItem.attr("title", opts.dislikeTitle); 51 } 52 }); 53 item.find(opts.clickableType + opts.clickableSelector).unbind('click').click(function() { 54 55 var item = $(this); 56 if (!item.is("." + opts.showPersonneWhoLikeClass)) 57 { 58 var container = item.closest("div.likeLine"); 59 60 $.post("/global/module/like/ajax/changeLike.php", { param : container.attr("id") }, function(data) { 61 var line = $(data); 62 container.replaceWith(line); 63 line.like(); 64 container = false; 65 }); 66 } 67 }); 68 return item; 69 }); 70 } 71 }); 72})(jQuery); 73 74$(function() { 75 if( $(".likeLine").length ) { 76 $(".likeLine").like(); 77 } 78})
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.