Your IP : 3.141.193.54


Current Path : /home/bitrix/ext_www/dev.shuft.com.ua/bitrix/js/main/
Upload File :
Current File : /home/bitrix/ext_www/dev.shuft.com.ua/bitrix/js/main/rating_like.min.js

if(!BXRL){var BXRL={};var BXRLW=null;var lastVoteRepo={};var BXRLParams={pathToUserProfile:null}}RatingLike=function(t,e,i,n,o,s,a,p,l){this.enabled=true;this.likeId=t;this.entityTypeId=e;this.entityId=i;this.available=n=="Y";this.userId=o;this.localize=s;this.template=a;this.pathToUserProfile=p;this.pathToAjax=typeof l=="string"?l:"/bitrix/components/bitrix/rating.vote/vote.ajax.php";this.box=BX("bx-ilike-button-"+t);if(this.box===null){this.enabled=false;return false}this.button=BX.findChild(this.box,{className:"bx-ilike-left-wrap"},true,false);this.buttonText=BX.findChild(this.button,{className:"bx-ilike-text"},true,false);this.count=BX.findChild(this.box,{tagName:"span",className:"bx-ilike-right-wrap"},true,false);this.countText=BX.findChild(this.count,{tagName:"span",className:"bx-ilike-right"},true,false);this.popup=null;this.popupId=null;this.popupOpenId=null;this.popupTimeoutId=null;this.popupContent=BX.findChild(BX("bx-ilike-popup-cont-"+t),{tagName:"span",className:"bx-ilike-popup"},true,false);this.popupContentPage=1;this.popupListProcess=false;this.popupTimeout=false;this.likeTimeout=false;if(typeof lastVoteRepo[e+"_"+i]!="undefined"){this.lastVote=lastVoteRepo[e+"_"+i];var u=a=="standart"?this.button:this.count;if(this.lastVote=="plus"){BX.addClass(u,"bx-you-like")}else{BX.removeClass(u,"bx-you-like")}}else{this.lastVote=BX.hasClass(a=="standart"?this.button:this.count,"bx-you-like")?"plus":"cancel";lastVoteRepo[e+"_"+i]=this.lastVote}};RatingLike.LiveUpdate=function(t){if(t.USER_ID==BX.message("USER_ID"))return false;for(var e in BXRL){if(BXRL.hasOwnProperty(e)){if(BXRL[e].entityTypeId==t.ENTITY_TYPE_ID&&BXRL[e].entityId==t.ENTITY_ID){var i=BXRL[e];i.countText.innerHTML=parseInt(t.TOTAL_POSITIVE_VOTES);i.count.insertBefore(BX.create("span",{props:{className:"bx-ilike-plus-one"},style:{width:i.countText.clientWidth-8+"px",height:i.countText.clientHeight-8+"px"},html:t.TYPE=="ADD"?"+1":"-1"}),i.count.firstChild);if(i.popup){i.popup.close();i.popupContentPage=1}}}}};RatingLike.Set=function(t,e,i,n,o,s,a,p,l){if(a===undefined)a="standart";if(BXRLParams.pathToUserProfile){p=BXRLParams.pathToUserProfile}if(!BXRL[t]||BXRL[t].tryToSet<=5){var u=BXRL[t]&&BXRL[t].tryToSet?BXRL[t].tryToSet:1;BXRL[t]=new RatingLike(t,e,i,n,o,s,a,p,l);if(BXRL[t].enabled){RatingLike.Init(t)}else{setTimeout(function(){BXRL[t].tryToSet=u+1;RatingLike.Set(t,e,i,n,o,s,a,p,l)},500)}}};RatingLike.Init=function(t){if(BXRL[t].available){BX.bind(BXRL[t].template=="standart"?BXRL[t].button:BXRL[t].buttonText,"click",function(e){var i=null,n=null,o=null;clearTimeout(BXRL[t].likeTimeout);var s=BX.hasClass(BXRL[t].template=="standart"?this:BXRL[t].count,"bx-you-like");if(s){BXRL[t].buttonText.innerHTML=BXRL[t].localize["LIKE_N"];BXRL[t].countText.innerHTML=parseInt(BXRL[t].countText.innerHTML)-1;BX.removeClass(BXRL[t].template=="standart"?this:BXRL[t].count,"bx-you-like");BXRL[t].likeTimeout=setTimeout(function(){if(BXRL[t].lastVote!="cancel")RatingLike.Vote(t,"cancel")},1e3)}else{BXRL[t].buttonText.innerHTML=BXRL[t].localize["LIKE_Y"];BXRL[t].countText.innerHTML=parseInt(BXRL[t].countText.innerHTML)+1;BX.addClass(BXRL[t].template=="standart"?this:BXRL[t].count,"bx-you-like");BXRL[t].likeTimeout=setTimeout(function(){if(BXRL[t].lastVote!="plus")RatingLike.Vote(t,"plus")},1e3)}if(BXRL[t].template=="light"){i=BXRL[t].box;n=i.cloneNode(true);n.id="like_anim";var a=BX.findParent(i,{className:"feed-com-informers"})?"comment":"post";BX.removeClass(n,"bx-ilike-button-hover");BX.addClass(n,"bx-like-anim");BX.adjust(i.parentNode,{style:{position:"relative"}});BX.adjust(n,{style:{position:"absolute",whiteSpace:"nowrap",top:(a=="comment"?-1:1)+"px"}});BX.adjust(i,{style:{visibility:"hidden"}});BX.prepend(n,i.parentNode);new BX.easing({duration:140,start:{scale:100},finish:{scale:a=="comment"?110:115},transition:BX.easing.transitions.quad,step:function(t){n.style.transform="scale("+t.scale/100+")"},complete:function(){o=BX.create("SPAN",{props:{className:s?"bx-ilike-icon":"bx-ilike-icon bx-ilike-icon-orange"}});BX.adjust(o,{style:{position:"absolute",whiteSpace:"nowrap"}});BX.prepend(o,i.parentNode);new BX.easing({duration:140,start:{scale:a=="comment"?110:115},finish:{scale:100},transition:BX.easing.transitions.quad,step:function(t){n.style.transform="scale("+t.scale/100+")"},complete:function(){}}).animate();new BX.easing({duration:200,start:{opacity:100,scale:a=="comment"?110:115,left:-5,top:0},finish:{opacity:0,scale:200,left:-13,top:a=="comment"?-3:-2},transition:BX.easing.transitions.linear,step:function(t){o.style.transform="scale("+t.scale/100+")";o.style.opacity=t.opacity/100;o.style.left=t.left+"px";o.style.top=t.top+"px"},complete:function(){n.parentNode.removeChild(n);o.parentNode.removeChild(o);BX.adjust(i.parentNode,{style:{position:"static"}});BX.adjust(i,{style:{visibility:"visible"}})}}).animate()}}).animate()}BX.removeClass(this.box,"bx-ilike-button-hover");BX.PreventDefault(e)});BX.bind(BXRL[t].box,"mouseover",function(){BX.addClass(this,"bx-ilike-button-hover")});BX.bind(BXRL[t].box,"mouseout",function(){BX.removeClass(this,"bx-ilike-button-hover")})}else{if(BXRL[t].buttonText!=undefined)BXRL[t].buttonText.innerHTML=BXRL[t].localize["LIKE_D"]}RatingLike.PopupScroll(t);BX.bind(BXRL[t].count,"mouseover",function(){clearTimeout(BXRL[t].popupTimeoutId);BXRL[t].popupTimeoutId=setTimeout(function(){if(BXRLW==t)return false;if(BXRL[t].popupContentPage==1)RatingLike.List(t,1);BXRL[t].popupTimeoutId=setTimeout(function(){RatingLike.OpenWindow(t)},400)},400)});BX.bind(BXRL[t].count,"mouseout",function(){clearTimeout(BXRL[t].popupTimeoutId)});BX.bind(BXRL[t].count,"click",function(){clearTimeout(BXRL[t].popupTimeoutId);if(BXRL[t].popupContentPage==1)RatingLike.List(t,1);RatingLike.OpenWindow(t)});BX.bind(BXRL[t].box,"mouseout",function(){clearTimeout(BXRL[t].popupTimeout);BXRL[t].popupTimeout=setTimeout(function(){if(BXRL[t].popup!==null){BXRL[t].popup.close();BXRLW=null}},1e3)});BX.bind(BXRL[t].box,"mouseover",function(){clearTimeout(BXRL[t].popupTimeout)})};RatingLike.OpenWindow=function(t){if(parseInt(BXRL[t].countText.innerHTML)==0)return false;if(BXRL[t].popup==null){BXRL[t].popup=new BX.PopupWindow("ilike-popup-"+t,BXRL[t].template=="standart"?BXRL[t].count:BXRL[t].box,{lightShadow:true,offsetLeft:5,autoHide:true,closeByEsc:true,zIndex:2005,bindOptions:{position:"top"},events:{onPopupClose:function(){BXRLW=null},onPopupDestroy:function(){}},content:BX("bx-ilike-popup-cont-"+t)});BXRL[t].popup.setAngle({});BX.bind(BX("ilike-popup-"+t),"mouseout",function(){clearTimeout(BXRL[t].popupTimeout);BXRL[t].popupTimeout=setTimeout(function(){BXRL[t].popup.close()},1e3)});BX.bind(BX("ilike-popup-"+t),"mouseover",function(){clearTimeout(BXRL[t].popupTimeout)})}if(BXRLW!=null)BXRL[BXRLW].popup.close();BXRLW=t;BXRL[t].popup.show();RatingLike.AdjustWindow(t)};RatingLike.Vote=function(t,e){BX.ajax({url:BXRL[t].pathToAjax,method:"POST",dataType:"json",data:{RATING_VOTE:"Y",RATING_VOTE_TYPE_ID:BXRL[t].entityTypeId,RATING_VOTE_ENTITY_ID:BXRL[t].entityId,RATING_VOTE_ACTION:e,sessid:BX.bitrix_sessid()},onsuccess:function(e){BXRL[t].lastVote=e.action;lastVoteRepo[BXRL[t].entityTypeId+"_"+BXRL[t].entityId]=e.action;BXRL[t].countText.innerHTML=e.items_all;BXRL[t].popupContentPage=1;BXRL[t].popupContent.innerHTML="";spanTag0=document.createElement("span");spanTag0.className="bx-ilike-wait";BXRL[t].popupContent.appendChild(spanTag0);RatingLike.AdjustWindow(t);if(BX("ilike-popup-"+t)&&BX("ilike-popup-"+t).style.display=="block")RatingLike.List(t,null)},onfailure:function(t){}});return false};RatingLike.List=function(t,e){if(parseInt(BXRL[t].countText.innerHTML)==0)return false;if(e==null)e=BXRL[t].popupContentPage;BXRL[t].popupListProcess=true;BX.ajax({url:BXRL[t].pathToAjax,method:"POST",dataType:"json",data:{RATING_VOTE_LIST:"Y",RATING_VOTE_TYPE_ID:BXRL[t].entityTypeId,RATING_VOTE_ENTITY_ID:BXRL[t].entityId,RATING_VOTE_LIST_PAGE:e,PATH_TO_USER_PROFILE:BXRL[t].pathToUserProfile,sessid:BX.bitrix_sessid()},onsuccess:function(i){BXRL[t].countText.innerHTML=i.items_all;if(parseInt(i.items_page)==0)return false;if(e==1){BXRL[t].popupContent.innerHTML="";spanTag0=document.createElement("span");spanTag0.className="bx-ilike-bottom_scroll";BXRL[t].popupContent.appendChild(spanTag0)}BXRL[t].popupContentPage+=1;var n=null;for(var o=0;o<i.items.length;o++){if(i.items[o]["PHOTO_SRC"].length>0){n=BX.create("IMG",{attrs:{src:i.items[o]["PHOTO_SRC"]},props:{className:"bx-ilike-popup-avatar-img"}})}else{n=BX.create("IMG",{attrs:{src:"/bitrix/images/main/blank.gif"},props:{className:"bx-ilike-popup-avatar-img bx-ilike-popup-avatar-img-default"}})}BXRL[t].popupContent.appendChild(BX.create("A",{attrs:{href:i.items[o]["URL"],target:"_blank"},props:{className:"bx-ilike-popup-img"+(!!i.items[o]["USER_TYPE"]?" bx-ilike-popup-img-"+i.items[o]["USER_TYPE"]:"")},children:[BX.create("SPAN",{props:{className:"bx-ilike-popup-avatar-new"},children:[n,BX.create("SPAN",{props:{className:"bx-ilike-popup-avatar-status-icon"}})]}),BX.create("SPAN",{props:{className:"bx-ilike-popup-name-new"},html:i.items[o]["FULL_NAME"]})]}))}RatingLike.AdjustWindow(t);RatingLike.PopupScroll(t);BXRL[t].popupListProcess=false},onfailure:function(t){}});return false};RatingLike.AdjustWindow=function(t){if(BXRL[t].popup!=null){BXRL[t].popup.bindOptions.forceBindPosition=true;BXRL[t].popup.adjustPosition();BXRL[t].popup.bindOptions.forceBindPosition=false}};RatingLike.PopupScroll=function(t){BX.bind(BXRL[t].popupContent,"scroll",function(){if(this.scrollTop>(this.scrollHeight-this.offsetHeight)/1.5){RatingLike.List(t,null);BX.unbindAll(this)}})};RatingLike.setParams=function(t){if(typeof t!="undefined"){if(typeof t.pathToUserProfile!="undefined"){BXRLParams.pathToUserProfile=t.pathToUserProfile}}};
//# sourceMappingURL=rating_like.map.js