1function product_reputation(id, shop, like) { 2 var cookieKey = like ? 'reputation_y' : 'reputation_n'; 3 var reputation = $.cookie(cookieKey); 4 if ($(".cll"+(like ? "n" : "y")+id).hasClass("active")) { 5 $(".cll"+(like ? "n" : "y")+id).click(); 6 } 7 if (!$(".cll"+(like ? "y" : "n")+id).hasClass('active')) { 8 $(".cll"+(like ? "y" : "n")+id).addClass('active'); 9 if (reputation != null) { 10 var reputations = reputation.split(';'); 11 reputations.push(id); 12 var cookie_reputations = []; 13 for (var i = 0; i < reputations.length; i++) { 14 if (reputations[i] != '') { 15 cookie_reputations.push(reputations[i]); 16 } 17 } 18 var reputations_string = cookie_reputations.join(';'); 19 $.cookie(cookieKey,reputations_string,{ 20 expires: 1000, 21 path: '/', 22 }); 23 } 24 else { 25 $.cookie(cookieKey, id,{ 26 expires: 1000, 27 path: '/', 28 }); 29 } 30 } 31 else { 32 $(".cll"+(like ? "y" : "n")+id).removeClass('active'); 33 if (reputation != null) { 34 var reputations = reputation.split(';'); 35 if (reputations.indexOf(id) != -1) { 36 for (var i = 0; i < reputations.length; i++) { 37 if (reputations[i] == id) { 38 delete reputations[i]; 39 } 40 } 41 var cookie_reputations = []; 42 for (var i = 0; i < reputations.length; i++) { 43 if (reputations[i] != '') { 44 cookie_reputations.push(reputations[i]); 45 } 46 } 47 var reputations_string = cookie_reputations.join(';'); 48 $.cookie(cookieKey,reputations_string,{ 49 expires: 1000, 50 path: '/', 51 }); 52 } 53 } 54 } 55 $.post(shop+"change_reputation/",{id:id,type:(($(".cll"+(like ? "y" : "n")+id).hasClass('active'))? 1 : 0),like:like ? 1 : 0},function(res){ 56 if (res.status == 'ok') { 57 $(".cll"+(like ? "y" : "n")+id).find(like ? '.prcy' : '.prcn').html(res.data.count); 58 } 59 },"json"); 60} 61 62$(function(){ 63 var reputation_y = $.cookie('reputation_y'); 64 if (reputation_y != null) { 65 var reputations_y = reputation_y.split(';'); 66 $.each(reputations_y, function(){ 67 $(".clly"+this).addClass('active'); 68 }); 69 } 70 var reputation_n = $.cookie('reputation_n'); 71 if (reputation_n != null) { 72 var reputations_n = reputation_n.split(';'); 73 $.each(reputations_n, function(){ 74 $(".clln"+this).addClass('active'); 75 }); 76 } 77});
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.