PageSourceSearch

https://rozavetrov-ural.ru/local/templates/roza/components/bitrix/…/blog-filter/script.min.js?159782636914447

js rozavetrov-ural.ru collected 2026-09-29 23:33:38 UTC 14,447 bytes, 1 lines download raw bytes

1function JCSmartFilter(t,e,i){this.ajaxURL=t,this.form=null,this.timer=null,this.cacheKey="",this.cache=[],this.popups=[],this.viewMode=e,i&&i.SEF_SET_FILTER_URL&&(this.bindUrlToButton("set_filter",i.SEF_SET_FILTER_URL),this.sef=!0),i&&i.SEF_DEL_FILTER_URL&&this.bindUrlToButton("del_filter",i.SEF_DEL_FILTER_URL)}JCSmartFilter.prototype.keyup=function(t){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(BX.delegate(function(){this.reload(t)},this),500)},JCSmartFilter.prototype.click=function(t){this.timer&&clearTimeout(this.timer),document.querySelector(".ajax-wrapper").style.opacity="0.5",document.querySelector(".ajax-wrapper").style.pointerEvents="none",this.timer=setTimeout(BX.delegate(function(){this.reload(t)},this),500)},JCSmartFilter.prototype.reload=function(t){if(""!==this.cacheKey)return this.timer&&clearTimeout(this.timer),void(this.timer=setTimeout(BX.delegate(function(){this.reload(t)},this),1e3));if(this.cacheKey="|",this.position=BX.pos(t,!0),this.form=BX.findParent(t,{tag:"form"}),this.form){var e=[];e[0]={name:"ajax",value:"y"},this.gatherInputsValues(e,BX.findChildren(this.form,{tag:new RegExp("^(input|select)$","i")},!0));for(var i=0;i<e.length;i++)this.cacheKey+=e[i].name+":"+e[i].value+"|";if(this.cache[this.cacheKey])this.curFilterinput=t,this.postHandler(this.cache[this.cacheKey],!0);else{if(this.sef)BX("set_filter").disabled=!0;this.curFilterinput=t,BX.ajax.loadJSON(this.ajaxURL,this.values2post(e),BX.delegate(this.postHandler,this))}}},JCSmartFilter.prototype.updateItem=function(t,e){if("N"===e.PROPERTY_TYPE||e.PRICE){var i=window["trackBar"+t];!i&&e.ENCODED_ID&&(i=window["trackBar"+e.ENCODED_ID]),i&&e.VALUES&&(e.VALUES.MIN&&(e.VALUES.MIN.FILTERED_VALUE?i.setMinFilteredValue(e.VALUES.MIN.FILTERED_VALUE):i.setMinFilteredValue(e.VALUES.MIN.VALUE)),e.VALUES.MAX&&(e.VALUES.MAX.FILTERED_VALUE?i.setMaxFilteredValue(e.VALUES.MAX.FILTERED_VALUE):i.setMaxFilteredValue(e.VALUES.MAX.VALUE)))}else if(e.VALUES)for(var r in e.VALUES)if(e.VALUES.hasOwnProperty(r)){var s=e.VALUES[r],n=BX(s.CONTROL_ID);if(n){var l=document.querySelector('[data-role="label_'+s.CONTROL_ID+'"]');s.DISABLED?l?BX.addClass(l,"disabled"):BX.addClass(n.parentNode,"disabled"):l?BX.removeClass(l,"disabled"):BX.removeClass(n.parentNode,"disabled"),s.hasOwnProperty("ELEMENT_COUNT")&&(l=document.querySelector('[data-role="count_'+s.CONTROL_ID+'"]'))&&(l.innerHTML=s.ELEMENT_COUNT)}}},JCSmartFilter.prototype.postHandler=function(e,t){var i,r,s=BX("modef"),n=BX("modef_num");if(e&&e.ITEMS){for(var l in this.popups)this.popups.hasOwnProperty(l)&&this.popups[l].destroy();for(var a in this.popups=[],e.ITEMS)e.ITEMS.hasOwnProperty(a)&&this.updateItem(a,e.ITEMS[a]);s&&n&&(n.innerHTML=e.ELEMENT_COUNT,i=BX.findChildren(s,{tag:"A"},!0),e.FILTER_URL&&i&&(i[0].href=BX.util.htmlspecialcharsback(e.FILTER_URL)),e.FILTER_AJAX_URL&&e.COMPONENT_CONTAINER_ID&&(BX.unbindAll(i[0]),BX.bind(i[0],"click",function(t){return r=BX.util.htmlspecialcharsback(e.FILTER_AJAX_URL),BX.ajax.insertToNode(r,e.COMPONENT_CONTAINER_ID),BX.PreventDefault(t)})),e.INSTANT_RELOAD&&e.COMPONENT_CONTAINER_ID?(r=BX.util.htmlspecialcharsback(e.FILTER_AJAX_URL),BX.ajax.insertToNode(r,e.COMPONENT_CONTAINER_ID)):($.get(BX.util.htmlspecialcharsback(e.FILTER_AJAX_URL),function(t){$(".ajax-wrapper").html($(t).find(".ajax-wrapper").html()),document.querySelector(".ajax-wrapper").style.opacity="1",document.querySelector(".ajax-wrapper").style.pointerEvents="all"}),history.pushState(null,null,BX.util.htmlspecialcharsback(e.FILTER_AJAX_URL)),this.cacheKey="","VERTICAL"==this.viewMode&&BX.findChild(BX.findParent(this.curFilterinput,{class:"bx-filter-parameters-box"}),{class:"bx-filter-container-modef"},!0,!1).appendChild(s),e.SEF_SET_FILTER_URL&&this.bindUrlToButton("set_filter",e.SEF_SET_FILTER_URL)))}this.sef&&(BX("set_filter").disabled=!1);t||""===this.cacheKey||(this.cache[this.cacheKey]=e),this.cacheKey=""},JCSmartFilter.prototype.bindUrlToButton=function(t,e){var i,r,s=BX(t);if(s){"submit"==s.type&&(s.type="button"),BX.bind(s,"click",(i=e,r=function(t){return window.location.href=t,!1},function(){return r(i)}))}},JCSmartFilter.prototype.gatherInputsValues=function(t,e){if(e)for(var i=0;i<e.length;i++){var r=e[i];if(!r.disabled&&r.type)switch(r.type.toLowerCase()){case"text":case"textarea":case"password":case"hidden":case"select-one":r.value.length&&(t[t.length]={name:r.name,value:r.value});break;case"radio":case"checkbox":r.checked&&(t[t.length]={name:r.name,value:r.value});break;case"select-multiple":for(var s=0;s<r.options.length;s++)r.options[s].selected&&(t[t.length]={name:r.name,value:r.options[s].value})}}},JCSmartFilter.prototype.values2post=function(t){for(var e=[],i=e,r=0;r<t.length;){var s=t[r].name.indexOf("[");if(-1==s)i[t[r].name]=t[r].value,i=e,r++;else{var n=t[r].name.substring(0,s),l=t[r].name.substring(s+1);i[n]||(i[n]=[]);var a=l.indexOf("]");-1==a?(i=e,r++):0==a?(i=i[n],t[r].name=""+i.length):(i=i[n],t[r].name=l.substring(0,a)+l.substring(a+1))}}return e},JCSmartFilter.prototype.hideFilterProps=function(t){var e=t.parentNode,i=e.querySelector("[data-role='bx_filter_block']"),r=e.querySelector("[data-role='prop_angle']");if(BX.hasClass(e,"bx-active"))new BX.easing({duration:300,start:{opacity:1,height:i.offsetHeight},finish:{opacity:0,height:0},transition:BX.easing.transitions.quart,step:function(t){i.style.opacity=t.opacity,i.style.height=t.height+"px"},complete:function(){i.setAttribute("style",""),BX.removeClass(e,"bx-active")}}).animate(),BX.addClass(r,"fa-angle-down"),BX.removeClass(r,"fa-angle-up");else{i.style.display="block",i.style.opacity=0,i.style.height="auto";var s=i.offsetHeight;i.style.height=0,new BX.easing({duration:300,start:{opacity:0,height:0},finish:{opacity:1,height:s},transition:BX.easing.transitions.quart,step:function(t){i.style.opacity=t.opacity,i.style.height=t.height+"px"},complete:function(){}}).animate(),BX.addClass(e,"bx-active"),BX.removeClass(r,"fa-angle-down"),BX.addClass(r,"fa-angle-up")}},JCSmartFilter.prototype.showDropDownPopup=function(t,e){var i=t.querySelector('[data-role="dropdownContent"]');this.popups["smartFilterDropDown"+e]=BX.PopupWindowManager.create("smartFilterDropDown"+e,t,{autoHide:!0,offsetLeft:0,offsetTop:3,overlay:!1,draggable:{restrict:!0},closeByEsc:!0,content:BX.clone(i)}),this.popups["smartFilterDropDown"+e].show()}
1,JCSmartFilter.prototype.selectDropDownItem=function(t,e){this.keyup(BX(e)),BX.findParent(BX(e),{className:"bx-filter-select-container"},!1).querySelector('[data-role="currentOption"]').innerHTML=t.innerHTML,BX.PopupWindowManager.getCurrentPopup().close()},BX.namespace("BX.Iblock.SmartFilter"),BX.Iblock.SmartFilter=function(){function t(t){"object"==typeof t&&(this.leftSlider=BX(t.leftSlider),this.rightSlider=BX(t.rightSlider),this.tracker=BX(t.tracker),this.trackerWrap=BX(t.trackerWrap),this.minInput=BX(t.minInputId),this.maxInput=BX(t.maxInputId),this.minPrice=parseFloat(t.minPrice),this.maxPrice=parseFloat(t.maxPrice),this.curMinPrice=parseFloat(t.curMinPrice),this.curMaxPrice=parseFloat(t.curMaxPrice),this.fltMinPrice=t.fltMinPrice?parseFloat(t.fltMinPrice):parseFloat(t.curMinPrice),this.fltMaxPrice=t.fltMaxPrice?parseFloat(t.fltMaxPrice):parseFloat(t.curMaxPrice),this.precision=t.precision||0,this.priceDiff=this.maxPrice-this.minPrice,this.leftPercent=0,this.rightPercent=0,this.fltMinPercent=0,this.fltMaxPercent=0,this.colorUnavailableActive=BX(t.colorUnavailableActive),this.colorAvailableActive=BX(t.colorAvailableActive),this.colorAvailableInactive=BX(t.colorAvailableInactive),this.isTouch=!1,this.init(),"ontouchstart"in document.documentElement?(this.isTouch=!0,BX.bind(this.leftSlider,"touchstart",BX.proxy(function(t){this.onMoveLeftSlider(t)},this)),BX.bind(this.rightSlider,"touchstart",BX.proxy(function(t){this.onMoveRightSlider(t)},this))):(BX.bind(this.leftSlider,"mousedown",BX.proxy(function(t){this.onMoveLeftSlider(t)},this)),BX.bind(this.rightSlider,"mousedown",BX.proxy(function(t){this.onMoveRightSlider(t)},this))),BX.bind(this.minInput,"keyup",BX.proxy(function(t){this.onInputChange()},this)),BX.bind(this.maxInput,"keyup",BX.proxy(function(t){this.onInputChange()},this)))}return t.prototype.init=function(){var t;this.curMinPrice>this.minPrice&&(t=this.curMinPrice-this.minPrice,this.leftPercent=100*t/this.priceDiff,this.leftSlider.style.left=this.leftPercent+"%",this.colorUnavailableActive.style.left=this.leftPercent+"%"),this.setMinFilteredValue(this.fltMinPrice),this.curMaxPrice<this.maxPrice&&(t=this.maxPrice-this.curMaxPrice,this.rightPercent=100*t/this.priceDiff,this.rightSlider.style.right=this.rightPercent+"%",this.colorUnavailableActive.style.right=this.rightPercent+"%"),this.setMaxFilteredValue(this.fltMaxPrice)},t.prototype.setMinFilteredValue=function(t){if(this.fltMinPrice=parseFloat(t),this.fltMinPrice>=this.minPrice){var e=this.fltMinPrice-this.minPrice;this.fltMinPercent=100*e/this.priceDiff,this.leftPercent>this.fltMinPercent?this.colorAvailableActive.style.left=this.leftPercent+"%":this.colorAvailableActive.style.left=this.fltMinPercent+"%",this.colorAvailableInactive.style.left=this.fltMinPercent+"%"}else this.colorAvailableActive.style.left="0%",this.colorAvailableInactive.style.left="0%"},t.prototype.setMaxFilteredValue=function(t){if(this.fltMaxPrice=parseFloat(t),this.fltMaxPrice<=this.maxPrice){var e=this.maxPrice-this.fltMaxPrice;this.fltMaxPercent=100*e/this.priceDiff,this.rightPercent>this.fltMaxPercent?this.colorAvailableActive.style.right=this.rightPercent+"%":this.colorAvailableActive.style.right=this.fltMaxPercent+"%",this.colorAvailableInactive.style.right=this.fltMaxPercent+"%"}else this.colorAvailableActive.style.right="0%",this.colorAvailableInactive.style.right="0%"},t.prototype.getXCoord=function(t){var e=t.getBoundingClientRect(),i=document.body,r=document.documentElement,s=window.pageXOffset||r.scrollLeft||i.scrollLeft,n=r.clientLeft||i.clientLeft||0,l=e.left+s-n;return Math.round(l)},t.prototype.getPageX=function(t){t=t||window.event;var e=null;if(this.isTouch&&null!=event.targetTouches[0])e=t.targetTouches[0].pageX;else if(null!=t.pageX)e=t.pageX;else if(null!=t.clientX){var i=document.documentElement,r=document.body;e=t.clientX+(i.scrollLeft||r&&r.scrollLeft||0),e-=i.clientLeft||0}return e},t.prototype.recountMinPrice=function(){var t=this.priceDiff*this.leftPercent/100;(t=(this.minPrice+t).toFixed(this.precision))!=this.minPrice?this.minInput.value=t:this.minInput.value="",smartFilter.keyup(this.minInput)},t.prototype.recountMaxPrice=function(){var t=this.priceDiff*this.rightPercent/100;(t=(this.maxPrice-t).toFixed(this.precision))!=this.maxPrice?this.maxInput.value=t:this.maxInput.value="",smartFilter.keyup(this.maxInput)},t.prototype.onInputChange=function(){var t;if(this.minInput.value){var e=this.minInput.value;e<this.minPrice&&(e=this.minPrice),e>this.maxPrice&&(e=this.maxPrice),t=e-this.minPrice,this.leftPercent=100*t/this.priceDiff,this.makeLeftSliderMove(!1)}if(this.maxInput.value){var i=this.maxInput.value;i<this.minPrice&&(i=this.minPrice),i>this.maxPrice&&(i=this.maxPrice),t=this.maxPrice-i,this.rightPercent=100*t/this.priceDiff,this.makeRightSliderMove(!1)}},t.prototype.makeLeftSliderMove=function(t){t=!1!==t,this.leftSlider.style.left=this.leftPercent+"%",this.colorUnavailableActive.style.left=this.leftPercent+"%";var e=!1;100<=this.leftPercent+this.rightPercent&&(e=!0,this.rightPercent=100-this.leftPercent,this.rightSlider.style.right=this.rightPercent+"%",this.colorUnavailableActive.style.right=this.rightPercent+"%"),this.leftPercent>=this.fltMinPercent&&this.leftPercent<=100-this.fltMaxPercent?(this.colorAvailableActive.style.left=this.leftPercent+"%",e&&(this.colorAvailableActive.style.right=100-this.leftPercent+"%")):this.leftPercent<=this.fltMinPercent?(this.colorAvailableActive.style.left=this.fltMinPercent+"%",e&&(this.colorAvailableActive.style.right=100-this.fltMinPercent+"%")):this.leftPercent>=this.fltMaxPercent&&(this.colorAvailableActive.style.left=100-this.fltMaxPercent+"%",e&&(this.colorAvailableActive.style.right=this.fltMaxPercent+"%")),t&&(this.recountMinPrice(),e&&this.recountMaxPrice())},t.prototype.countNewLeft=function(t){var e=this.getPageX(t),i=this.getXCoord(this.trackerWrap),r=this.trackerWrap.offsetWidth,s=e-i;return s<0?s=0:r<s&&(s=r),s},t.prototype.onMoveLeftSlider=function(t){return this.isTouch||(this.leftSlider.ondragstart=function(){return!1}),this.isTouch?(document.ontouchmove=BX.proxy(function(t){this.leftPercent=100*this.countNewLeft(t)/this.trackerWrap.offsetWidth,this.makeLeftSliderMove()},this),document.ontouchend=function(){document.ontouchmove=document.touchend=null}):(document.onmousemove=BX.proxy(function(t){this.leftPercent=100*this.countNewLeft(t)/this.trackerWrap.offsetWidth,this.makeLeftSliderMove()},this),document.onmouseup=function(){document.onmousemove=document.onmouseup=null}),!1},t.prototype.makeRightSliderMove=function(t){t=!1!==t,this.rightSlider.style.right=this.rightPercent+"%",this.colorUnavailableActive.style.right=this.rightPercent+"%";var e=!1;100<=this.leftPercent+this.rightPercent&&(e=!0,this.leftPercent=100-this.rightPercent,this.leftSlider.style.left=this.leftPercent+"%",this.colorUnavailableActive.style.left=this.leftPercent+"%"),100-this.rightPercent>=this.fltMinPercent&&this.rightPercent>=this.fltMaxPercent?(this.colorAvailableActive.style.right=this.rightPercent+"%",e&&(this.colorAvailableActive.style.left=100-this.rightPercent+"%")):this.rightPercent<=this.fltMaxPercent?(this.colorAvailableActive.style.right=this.fltMaxPercent+"%",e&&(this.colorAvailableActive.style.left=100-this.fltMaxPercent+"%")):100-this.rightPercent<=this.fltMinPercent&&(this.colorAvailableActive.style.right=100-this.fltMinPercent+"%",e&&(this.colorAvailableActive.style.left=this.fltMinPercent+"%")),t&&(this.recountMaxPrice(),e&&this.recountMinPrice())},t.prototype.onMoveRightSlider=function(t){return this.isTouch||(this.rightSlider.ondragstart=function(){return!1}),this.isTouch?(document.ontouchmove=BX.proxy(function(t){this.rightPercent=100-100*this.countNewLeft(t)/this.trackerWrap.offsetWidth,this.makeRightSliderMove()},this),document.ontouchend=function(){document.ontouchmove=document.ontouchend=null}):(document.onmousemove=BX.proxy(function(t){this.rightPercent=100-100*this.countNewLeft(t)/this.trackerWrap.offsetWidth,this.makeRightSliderMove()},this),document.onmouseup=function(){document.onmousemove=document.onmouseup=null}),!1},t}();

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.