Вход Регистрация
Файл: touchSpace/js/Likes_ajax.js
Строк: 56
<?php
$(function(){$(document.body).delegate(".vote_button","click",function(t){var o,n,e,a,s,d,i,c,l,p,v,r,f,C,_,g,u;t.stopImmediatePropagation(),t.preventDefault(),t.stopPropagation(),o=$(this),o.hasClass("disabled_button")||(n=o.data("vote_id"),e=o.hasClass("voteUpCnt"),a=$("#"+n+"_vt_full_cnt"),s=$("#"+n+"_vote_wrapper"),d=parseInt(a.text()),i=o.find(".vote_ico"),c=e?o:s.find(".voteUpCnt"),l=e?s.find(".voteDownCnt"):o,p=l.data("cnt"),v=c.data("cnt"),f={CK:null,Oid:o.data("oid"),Ot:o.data("ot")},C=i.hasClass("on"),_=s.find(e?".voteDownCnt":".voteUpCnt"),g=s.find(".vote_ico.on").removeClass("on").length>0&&!C,C?(d+=e?-1:1,e?--v:--p,r="voting.delete"):g?(d+=e?2:-2,v+=e?1:-1,p+=e?-1:1,i.addClass("on"),r="voting.like",f.Down=e?0:1):(d+=e?1:-1,e?++v:++p,i.addClass("on"),r="voting.like",f.Down=e?0:1),a.text(d),d>0?a.css("color","green"):0>d?a.css("color","red"):a.css("color",""),c.data("cnt",v).prop("title","За "+v),l.data("cnt",p).prop("title","Против "+p),u=$("#"+n+"_vt_cnt"),u.find(".voteUpInfo").text(v),u.find(".voteDownInfo").text(p),Spaces.api(r,f,function(t){0!=t.code&&Spaces.showError(Spaces.services.processingCodes(t))}))})});
?>
Онлайн: 0
Реклама