Your IP : 18.223.239.65


Current Path : /var/www/www-root/data/www/monolith-realty.ru/local/templates/monolitsochi/js/
Upload File :
Current File : /var/www/www-root/data/www/monolith-realty.ru/local/templates/monolitsochi/js/rating_likes.min.js

if(!BXRL)var BXRL={},BXRLW=null;RatingLikes=function(t,e,i,n,o,p,s,a,u){return this.enabled=!0,this.likeId=t,this.entityTypeId=e,this.entityId=i,this.available="Y"==n,this.userId=o,this.localize=p,this.template=s,this.pathToUserProfile=a,this.pathToAjax="string"==typeof u?u:"/bitrix/components/bitrix/rating.vote/vote.ajax.php",this.box=BX("bx-ilike-button-"+t),null===this.box?(this.enabled=!1,!1):(this.button=BX.findChild(this.box,{className:"bx-ilike-left-wrap"},!0,!1),this.wrapp=BX.findChild(this.box,{className:"all-wrapper"},!0,!1),this.buttonText=BX.findChild(this.button,{className:"bx-ilike-text"},!0,!1),this.count=BX.findChild(this.box,{tagName:"span",className:"bx-ilike-right-wrap"},!0,!1),this.countText=BX.findChild(this.count,{tagName:"span",className:"bx-ilike-right"},!0,!1),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"},!0,!1),this.popupContentPage=1,this.popupListProcess=!1,this.popupTimeout=!1,this.likeTimeout=!1,void(this.lastVote=BX.hasClass("standart"==s?this.button:this.count,"bx-you-like")?"plus":"cancel"))},RatingLikes.LiveUpdate=function(t){if(t.USER_ID==BX.message("USER_ID"))return!1;for(var e in BXRL)if(BXRL.hasOwnProperty(e)&&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:"ADD"==t.TYPE?"+1":"-1"}),i.count.firstChild),i.popup&&(i.popup.close(),i.popupContentPage=1)}},RatingLikes.Set=function(t,e,i,n,o,p,s,a,u){if(void 0===s&&(s="standart"),!BXRL[t]||BXRL[t].tryToSet<=5){var l=BXRL[t]&&BXRL[t].tryToSet?BXRL[t].tryToSet:1;BXRL[t]=new RatingLikes(t,e,i,n,o,p,s,a,u),BXRL[t].enabled?RatingLikes.Init(t):setTimeout(function(){BXRL[t].tryToSet=l+1,RatingLikes.Set(t,e,i,n,o,p,s,a,u)},500)}},RatingLikes.Init=function(t){BXRL[t].available?(BX.bind("standart"==BXRL[t].template?BXRL[t].button:BXRL[t].buttonText,"click",function(e){clearTimeout(BXRL[t].likeTimeout),BX.hasClass("standart"==BXRL[t].template?this:BXRL[t].count,"bx-you-like")?(BXRL[t].buttonText.innerHTML=BXRL[t].localize.LIKE_N,BXRL[t].countText.innerHTML=parseInt(BXRL[t].countText.innerHTML)-1,BX.removeClass("standart"==BXRL[t].template?this:BXRL[t].count,"bx-you-like"),BXRL[t].likeTimeout=setTimeout(function(){"cancel"!=BXRL[t].lastVote&&RatingLikes.Vote(t,"cancel")},1e3)):(BXRL[t].buttonText.innerHTML=BXRL[t].localize.LIKE_Y,BXRL[t].countText.innerHTML=parseInt(BXRL[t].countText.innerHTML)+1,BX.addClass("standart"==BXRL[t].template?this:BXRL[t].count,"bx-you-like"),BXRL[t].likeTimeout=setTimeout(function(){"plus"!=BXRL[t].lastVote&&RatingLikes.Vote(t,"plus")},1e3)),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")})):void 0!=BXRL[t].buttonText&&(BXRL[t].buttonText.innerHTML=BXRL[t].localize.LIKE_D),RatingLikes.PopupScroll(t),console.log(),BX.bind(BXRL[t].wrapp,"mouseover",function(){clearTimeout(BXRL[t].popupTimeoutId),BXRL[t].popupTimeoutId=setTimeout(function(){return BXRLW==t?!1:(1==BXRL[t].popupContentPage&&RatingLikes.List(t,1),void(BXRL[t].popupTimeoutId=setTimeout(function(){RatingLikes.OpenWindow(t)},400)))},400)}),BX.bind(BXRL[t].wrapp,"mouseout",function(){clearTimeout(BXRL[t].popupTimeoutId)}),BX.bind(BXRL[t].box,"mouseover",function(){clearTimeout(BXRL[t].popupTimeout)}),BX.bind(BXRL[t].box,"mouseout",function(){clearTimeout(BXRL[t].popupTimeout),BXRL[t].popupTimeout=setTimeout(function(){null!==BXRL[t].popup&&(BXRL[t].popup.close(),BXRLW=null)},1e3)})},RatingLikes.OpenWindow=function(t){return 0==parseInt(BXRL[t].countText.innerHTML)?!1:(null==BXRL[t].popup&&(BXRL[t].popup=new BX.PopupWindow("ilike-popup-"+t,"standart"==BXRL[t].template?BXRL[t].count:BXRL[t].box,{lightShadow:!0,offsetLeft:5,autoHide:!0,closeByEsc:!0,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)})),null!=BXRLW&&BXRL[BXRLW].popup.close(),BXRLW=t,BXRL[t].popup.show(),void RatingLikes.AdjustWindow(t))},RatingLikes.Vote=function(t,e){return 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,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),RatingLikes.AdjustWindow(t),BX("ilike-popup-"+t)&&"block"==BX("ilike-popup-"+t).style.display&&RatingLikes.List(t,null)},onfailure:function(t){}}),!1},RatingLikes.List=function(t,e){return 0==parseInt(BXRL[t].countText.innerHTML)?!1:(null==e&&(e=BXRL[t].popupContentPage),BXRL[t].popupListProcess=!0,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){if(BXRL[t].countText.innerHTML=i.items_all,0==parseInt(i.items_page))return!1;1==e&&(BXRL[t].popupContent.innerHTML="",spanTag0=document.createElement("span"),spanTag0.className="bx-ilike-bottom_scroll",BXRL[t].popupContent.appendChild(spanTag0)),BXRL[t].popupContentPage+=1;for(var n=null,o=0;o<i.items.length;o++)n=i.items[o].PHOTO_SRC.length>0?BX.create("IMG",{attrs:{src:i.items[o].PHOTO_SRC},props:{className:"bx-ilike-popup-avatar-img"}}):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("div",{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})]}));RatingLikes.AdjustWindow(t),RatingLikes.PopupScroll(t),BXRL[t].popupListProcess=!1},onfailure:function(t){}}),!1)},RatingLikes.AdjustWindow=function(t){null!=BXRL[t].popup&&(BXRL[t].popup.bindOptions.forceBindPosition=!0,BXRL[t].popup.adjustPosition(),BXRL[t].popup.bindOptions.forceBindPosition=!1)},RatingLikes.PopupScroll=function(t){BX.bind(BXRL[t].popupContent,"scroll",function(){this.scrollTop>(this.scrollHeight-this.offsetHeight)/1.5&&(RatingLikes.List(t,null),BX.unbindAll(this))})};