PageSourceSearch

https://nextlineonline.ru/bitrix/templates/universe_s1/components/…/mobile/script.js?153199569021683

js nextlineonline.ru collected 2026-10-07 17:51:08 UTC 21,683 bytes, 869 lines download raw bytes

1function JCSmartFilterM(ajaxURL, viewMode, params)
2{
3	this.ajaxURL = ajaxURL;
4	this.form = null;
5	this.timer = null;
6	this.cacheKey = '';
7	this.cache = [];
8	this.viewMode = viewMode;
9	if (params && params.SEF_SET_FILTER_URL)
10	{
11		this.bindUrlToButton('set_filter_m', params.SEF_SET_FILTER_URL);
12		this.sef = true;
13	}
14	if (params && params.SEF_DEL_FILTER_URL)
15	{
16		this.bindUrlToButton('del_filter_m', params.SEF_DEL_FILTER_URL);
17	}
18}
19
20$('document').ready(function(){
21    $(document).on('click', '.body-filter-m-click', function(){
22    	var headFormFilter = $(this);
23		var formFilter = $('.body-filter');
24        formFilter.slideToggle(500, function(){
25			if(formFilter.is(':visible')){
26                headFormFilter.children('i').removeClass('fa-angle-down');
27                headFormFilter.children('i').addClass('fa-angle-up');
28			}
29			else{
30                headFormFilter.children('i').removeClass('fa-angle-up');
31                headFormFilter.children('i').addClass('fa-angle-down');
32			}
33		})
34    })
35});
36
37
38JCSmartFilterM.prototype.keyup = function(input)
39{
40	if(!!this.timer)
41	{
42		clearTimeout(this.timer);
43	}
44	this.timer = setTimeout(BX.delegate(function(){
45		this.reload(input);
46	}, this), 500);
47};
48
49JCSmartFilterM.prototype.click = function(checkbox)
50{
51	if(!!this.timer)
52	{
53		clearTimeout(this.timer);
54	}
55
56	this.timer = setTimeout(BX.delegate(function(){
57		this.reload(checkbox);
58	}, this), 500);
59};
60
61JCSmartFilterM.prototype.reload = function(input)
62{
63	if (this.cacheKey !== '')
64	{
65		//Postprone backend query
66		if(!!this.timer)
67		{
68			clearTimeout(this.timer);
69		}
70		this.timer = setTimeout(BX.delegate(function(){
71			this.reload(input);
72		}, this), 1000);
73		return;
74	}
75	this.cacheKey = '|';
76
77	this.position = BX.pos(input, true);
78	this.form = BX.findParent(input, {'tag':'form'});
79	if (this.form)
80	{
81		var values = [];
82		values[0] = {name: 'ajax', value: 'y'};
83		this.gatherInputsValues(values, BX.findChildren(this.form, {'tag': new RegExp('^(input|select)$', 'i')}, true));
84
85		for (var i = 0; i < values.length; i++)
86			this.cacheKey += values[i].name + ':' + values[i].value + '|';
87
88		if (this.cache[this.cacheKey])
89		{
90			this.curFilterinput = input;
91			this.postHandler(this.cache[this.cacheKey], true);
92		}
93		else
94		{
95			if (this.sef)
96			{
97				var set_filter = BX('set_filter_m');
98				set_filter.disabled = true;
99			}
100
101			this.curFilterinput = input;
102			BX.ajax.loadJSON(
103				this.ajaxURL,
104				this.values2post(values),
105				BX.delegate(this.postHandler, this)
106			);
107		}
108	}
109};
110
111JCSmartFilterM.prototype.updateItem = function (PID, arItem)
112{
113	if (arItem.PROPERTY_TYPE === 'N' || arItem.PRICE)
114	{
115		var trackBar = window['trackBar' + PID];
116		if (!trackBar && arItem.ENCODED_ID)
117			trackBar = window['trackBar' + arItem.ENCODED_ID];
118
119		if (trackBar && arItem.VALUES)
120		{
121			if (arItem.VALUES.MIN)
122			{
123				if (arItem.VALUES.MIN.FILTERED_VALUE)
124					trackBar.setMinFilteredValue(arItem.VALUES.MIN.FILTERED_VALUE);
125				else
126					trackBar.setMinFilteredValue(arItem.VALUES.MIN.VALUE);
127			}
128
129			if (arItem.VALUES.MAX)
130			{
131				if (arItem.VALUES.MAX.FILTERED_VALUE)
132					trackBar.setMaxFilteredValue(arItem.VALUES.MAX.FILTERED_VALUE);
133				else
134					trackBar.setMaxFilteredValue(arItem.VALUES.MAX.VALUE);
135			}
136		}
137	}
138	else if (arItem.VALUES)
139	{
140		for (var i in arItem.VALUES)
141		{
142			if (arItem.VALUES.hasOwnProperty(i))
143			{
144				var value = arItem.VALUES[i];
145				var control = BX(value.CONTROL_ID + '_m');
146
147				if (!!control)
148				{
149					var label = document.querySelector('[data-role="label_'+value.CONTROL_ID+'_m"]');
150					if (value.DISABLED)
151					{
152						if (label)
153							BX.addClass(label, 'disabled');
154						else
155							BX.addClass(control.parentNode, 'disabled');
156					}
157					else
158					{
159						if (label)
160							BX.removeClass(label, 'disabled');
161						else
162							BX.removeClass(control.parentNode, 'disabled');
163					}
164
165					if (value.hasOwnProperty('ELEMENT_COUNT'))
166					{
167						label = document.querySelector('[data-role="count_'+value.CONTROL_ID+'"]');
168						if (label)
169							label.innerHTML = value.ELEMENT_COUNT;
170					}
171				}
172			}
173		}
174	}
175};
176
177JCSmartFilterM.prototype.postHandler = function (result, fromCache)
178{
179	var hrefFILTER, url, curProp;
180	var modef = BX('modef');
181	var modef_num = BX('modef_num');
182
183	if (!!result && !!result.ITEMS)
184	{
185		for(var PID in result.ITEMS)
186		{
187			if (result.ITEMS.hasOwnProperty(PID))
188			{
189				this.updateItem(PID, result.ITEMS[PID]);
190			}
191		}
192
193		if (!!modef && !!modef_num)
194		{
195			modef_num.innerHTML = result.ELEMENT_COUNT;
196			hrefFILTER = BX.findChildren(modef, {tag: 'A'}, true);
197
198			if (result.FILTER_URL && hrefFILTER)
199			{
200				hrefFILTER[0].href = BX.util.htmlspecialcharsback(result.FILTER_URL);
201			}
202
203			if (result.FILTER_AJAX_URL && result.COMPONENT_CONTAINER_ID)
204			{
205				BX.unbindAll(hrefFILTER[0]);
206				BX.bind(hrefFILTER[0], 'click', function(e)
207				{
208					url = BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL);
209					BX.ajax.insertToNode(url, result.COMPONENT_CONTAINER_ID);
210					return BX.PreventDefault(e);
211				});
212			}
213
214			if (result.INSTANT_RELOAD && result.COMPONENT_CONTAINER_ID)
215			{
216				url = BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL);
217				BX.ajax.insertToNode(url, result.COMPONENT_CONTAINER_ID);
218			}
219			else
220			{
221				if (modef.style.display === 'none')
222				{
223					modef.style.display = 'inline-block';
224				}
225
226				if (this.viewMode == "VERTICAL")
227				{
228					curProp = BX.findChild(BX.findParent(this.curFilterinput, {'class':'bx-filter-parameters-box'}), {'class':'bx-filter-container-modef'}, true, false);
229					curProp.appendChild(modef);
230				}
231
232				if (result.SEF_SET_FILTER_URL)
233				{
234					this.bindUrlToButton('set_filter_m', result.SEF_SET_FILTER_URL);
235				}
236			}
237		}
238	}
239
240	if (this.sef)
241	{
242		var set_filter = BX('set_filter_m');
243		set_filter.disabled = false;
244	}
245
246	if (!fromCache && this.cacheKey !== '')
247	{
248		this.cache[this.cacheKey] = result;
249	}
250	this.cacheKey = '';
251};
252
253JCSmartFilterM.prototype.bindUrlToButton = function (buttonId, url)
254{
255	var button = BX(buttonId);
256	if (button)
257	{
258		var proxy = function(j, func)
259		{
260			return function()
261			{
262				return func(j);
263			}
264		};
265
266		if (button.type == 'submit')
267			button.type = 'button';
268
269		BX.bind(button, 'click', proxy(url, function(url)
270		{
271			window.location.href = url;
272			return false;
273		}));
274	}
275};
276
277JCSmartFilterM.prototype.gatherInputsValues = function (values, elements)
278{
279	if(elements)
280	{
281		for(var i = 0; i < elements.length; i++)
282		{
283			var el = elements[i];
284			if (el.disabled || !el.type)
285				continue;
286
287			switch(el.type.toLowerCase())
288			{
289				case 'text':
290				case 'textarea':
291				case 'password':
292				case 'hidden':
293				case 'select-one':
294					if(el.value.length)
295						values[values.length] = {name : el.name, value : el.value};
296					break;
297				case 'radio':
298				case 'checkbox':
299					if(el.checked)
300						values[values.length] = {name : el.name, value : el.value};
301					break;
302				case 'select-multiple':
303					for (var j = 0; j < el.options.length; j++)
304					{
305						if (el.options[j].selected)
306							values[values.length] = {name : el.name, value : el.options[j].value};
307					}
308					break;
309				default:
310					break;
311			}
312		}
313	}
314};
315
316JCSmartFilterM.prototype.values2post = function (values)
317{
318	var post = [];
319	var current = post;
320	var i = 0;
321
322	while(i < values.length)
323	{
324		var p = values[i].name.indexOf('[');
325		if(p == -1)
326		{
327			current[values[i].name] = values[i].value;
328			current = post;
329			i++;
330		}
331		else
332		{
333			var name = values[i].name.substring(0, p);
334			var rest = values[i].name.substring(p+1);
335			if(!current[name])
336				current[name] = [];
337
338			var pp = rest.indexOf(']');
339			if(pp == -1)
340			{
341				//Error - not balanced brackets
342				current = post;
343				i++;
344			}
345			else if(pp == 0)
346			{
347				//No index specified - so take the next integer
348				current = current[name];
349				values[i].name = '' + current.length;
350			}
351			else
352			{
353				//Now index name becomes and name and we go deeper into the array
354				current = current[name];
355				values[i].name = rest.substring(0, pp) + rest.substring(pp+1);
356			}
357		}
358	}
359	return post;
360};
361
362JCSmartFilterM.prototype.hideFilterProps = function(element)
363{
364	var obj = element.parentNode,
365		filterBlock = obj.querySelector("[data-role='bx_filter_block']"),
366		propAngle = obj.querySelector("[data-role='prop_angle']");
367
368	if(BX.hasClass(obj, "bx-active"))
369	{
370		new BX.easing({
371			duration : 300,
372			start : { opacity: 1,  height: filterBlock.offsetHeight },
373			finish : { opacity: 0, height:0 },
374			transition : BX.easing.transitions.quart,
375			step : function(state){
376				filterBlock.style.opacity = state.opacity;
377				filterBlock.style.height = state.height + "px";
378			},
379			complete : function() {
380				filterBlock.setAttribute("style", "");
381				BX.removeClass(obj, "bx-active");
382			}
383		}).animate();
384
385		BX.addClass(propAngle, "fa-angle-down");
386		BX.removeClass(propAngle, "fa-angle-up");
387	}
388	else
389	{
390		filterBlock.style.display = "block";
391		filterBlock.style.opacity = 0;
392		filterBlock.style.height = "auto";
393
394		var obj_children_height = filterBlock.offsetHeight;
395		filterBlock.style.height = 0;
396
397		new BX.easing({
398			duration : 300,
399			start : { opacity: 0,  height: 0 },
400			finish : { opacity: 1, height: obj_children_height },
401			transition : BX.easing.transitions.quart,
402			step : function(state){
403				filterBlock.style.opacity = state.opacity;
404				filterBlock.style.height = state.height + "px";
405			},
406			complete : function() {
407			}
408		}).animate();
409
410		BX.addClass(obj, "bx-active");
411		BX.removeClass(propAngle, "fa-angle-down");
412		BX.addClass(propAngle, "fa-angle-up");
413	}
414};
415
416JCSmartFilterM.prototype.showDropDownPopup = function(element, popupId)
417{
418	var contentNode = element.querySelector('[data-role="dropdownContent"]');
419	BX.PopupWindowManager.create("smartFilterDropDown"+popupId, element, {
420		autoHide: true,
421		offsetLeft: 0,
422		offsetTop: 3,
423		overlay : false,
424		draggable: {restrict:true},
425		closeByEsc: true,
426		content: contentNode
427	}).show();
428};
429
430JCSmartFilterM.prototype.selectDropDownItem = function(element, controlId)
431{
432	this.keyup(BX(controlId));
433
434	var wrapContainer = BX.findParent(BX(controlId), {className:"bx-filter-select-container"}, false);
435
436	var currentOption = wrapContainer.querySelector('[data-role="currentOption"]');
437	currentOption.innerHTML = element.innerHTML;
438	BX.PopupWindowManager.getCurrentPopup().close();
439};
440
441BX.namespace("BX.Iblock.SmartFilterM");
442BX.Iblock.SmartFilterM = (function()
443{
444	var SmartFilterM = function(arParams)
445	{
446		if (typeof arParams === 'object')
447		{
448			this.leftSlider = BX(arParams.leftSlider);
449			this.rightSlider = BX(arParams.rightSlider);
450			this.tracker = BX(arParams.tracker);
451			this.trackerWrap = BX(arParams.trackerWrap);
452
453			this.minInput = BX(arParams.minInputId);
454			this.maxInput = BX(arParams.maxInputId);
455
456			this.minPrice = parseFloat(arParams.minPrice);
457			this.maxPrice = parseFloat(arParams.maxPrice);
458
459			this.curMinPrice = parseFloat(arParams.curMinPrice);
460			this.curMaxPrice = parseFloat(arParams.curMaxPrice);
461
462			this.fltMinPrice = arParams.fltMinPrice ? parseFloat(arParams.fltMinPrice) : parseFloat(arParams.curMinPrice);
463			this.fltMaxPrice = arParams.fltMaxPrice ? parseFloat(arParams.fltMaxPrice) : parseFloat(arParams.curMaxPrice);
464
465			this.precision = arParams.precision || 0;
466
467			this.priceDiff = this.maxPrice - this.minPrice;
468
469			this.leftPercent = 0;
470			this.rightPercent = 0;
471
472			this.fltMinPercent = 0;
473			this.fltMaxPercent = 0;
474
475			this.colorUnavailableActive = BX(arParams.colorUnavailableActive);//gray
476			this.colorAvailableActive = BX(arParams.colorAvailableActive);//blue
477			this.colorAvailableInactive = BX(arParams.colorAvailableInactive);//light blue
478
479			this.isTouch = false;
480
481			this.init();
482
483			if ('ontouchstart' in document.documentElement)
484			{
485				this.isTouch = true;
486
487				BX.bind(this.leftSlider, "touchstart", BX.proxy(function(event){
488					this.onMoveLeftSlider(event)
489				}, this));
490
491				BX.bind(this.rightSlider, "touchstart", BX.proxy(function(event){
492					this.onMoveRightSlider(event)
493				}, this));
494			}
495			else
496			{
497				BX.bind(this.leftSlider, "mousedown", BX.proxy(function(event){
498					this.onMoveLeftSlider(event)
499				}, this));
500
501				BX.bind(this.rightSlider, "mousedown", BX.proxy(function(event){
502					this.onMoveRightSlider(event)
503				}, this));
504			}
505
506			BX.bind(this.minInput, "keyup", BX.proxy(function(event){
507				this.onInputChange();
508			}, this));
509
510			BX.bind(this.maxInput, "keyup", BX.proxy(function(event){
511				this.onInputChange();
512			}, this));
513		}
514	};
515
516	SmartFilterM.prototype.init = function()
517	{
518		var priceDiff;
519
520		if (this.curMinPrice > this.minPrice)
521		{
522			priceDiff = this.curMinPrice - this.minPrice;
523			this.leftPercent = (priceDiff*100)/this.priceDiff;
524
525			this.leftSlider.style.left = this.leftPercent + "%";
526			this.colorUnavailableActive.style.left = this.leftPercent + "%";
527		}
528
529		this.setMinFilteredValue(this.fltMinPrice);
530
531		if (this.curMaxPrice < this.maxPrice)
532		{
533			priceDiff = this.maxPrice - this.curMaxPrice;
534			this.rightPercent = (priceDiff*100)/this.priceDiff;
535
536			this.rightSlider.style.right = this.rightPercent + "%";
537			this.colorUnavailableActive.style.right = this.rightPercent + "%";
538		}
539
540		this.setMaxFilteredValue(this.fltMaxPrice);
541	};
542
543	SmartFilterM.prototype.setMinFilteredValue = function (fltMinPrice)
544	{
545		this.fltMinPrice = parseFloat(fltMinPrice);
546		if (this.fltMinPrice >= this.minPrice)
547		{
548			var priceDiff = this.fltMinPrice - this.minPrice;
549			this.fltMinPercent = (priceDiff*100)/this.priceDiff;
550
551			if (this.leftPercent > this.fltMinPercent)
552				this.colorAvailableActive.style.left = this.leftPercent + "%";
553			else
554				this.colorAvailableActive.style.left = this.fltMinPercent + "%";
555
556			this.colorAvailableInactive.style.left = this.fltMinPercent + "%";
557		}
558		else
559		{
560			this.colorAvailableActive.style.left = "0%";
561			this.colorAvailableInactive.style.left = "0%";
562		}
563	};
564
565	SmartFilterM.prototype.setMaxFilteredValue = function (fltMaxPrice)
566	{
567		this.fltMaxPrice = parseFloat(fltMaxPrice);
568		if (this.fltMaxPrice <= this.maxPrice)
569		{
570			var priceDiff = this.maxPrice - this.fltMaxPrice;
571			this.fltMaxPercent = (priceDiff*100)/this.priceDiff;
572
573			if (this.rightPercent > this.fltMaxPercent)
574				this.colorAvailableActive.style.right = this.rightPercent + "%";
575			else
576				this.colorAvailableActive.style.right = this.fltMaxPercent + "%";
577
578			this.colorAvailableInactive.style.right = this.fltMaxPercent + "%";
579		}
580		else
581		{
582			this.colorAvailableActive.style.right = "0%";
583			this.colorAvailableInactive.style.right = "0%";
584		}
585	};
586
587	SmartFilterM.prototype.getXCoord = function(elem)
588	{
589		var box = elem.getBoundingClientRect();
590		var body = document.body;
591		var docElem = document.documentElement;
592
593		var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
594		var clientLeft = docElem.clientLeft || body.clientLeft || 0;
595		var left = box.left + scrollLeft - clientLeft;
596
597		return Math.round(left);
598	};
599
600	SmartFilterM.prototype.getPageX = function(e)
601	{
602		e = e || window.event;
603		var pageX = null;
604
605		if (this.isTouch && event.targetTouches[0] != null)
606		{
607			pageX = e.targetTouches[0].pageX;
608		}
609		else if (e.pageX != null)
610		{
611			pageX = e.pageX;
612		}
613		else if (e.clientX != null)
614		{
615			var html = document.documentElement;
616			var body = document.body;
617
618			pageX = e.clientX + (html.scrollLeft || body && body.scrollLeft || 0);
619			pageX -= html.clientLeft || 0;
620		}
621
622		return pageX;
623	};
624
625	SmartFilterM.prototype.recountMinPrice = function()
626	{
627		var newMinPrice = (this.priceDiff*this.leftPercent)/100;
628		newMinPrice = (this.minPrice + newMinPrice).toFixed(this.precision);
629
630		if (newMinPrice != this.minPrice)
631			this.minInput.value = newMinPrice;
632		else
633			this.minInput.value = "0";
634		smartFilterM.keyup(this.minInput);
635	};
636
637	SmartFilterM.prototype.recountMaxPrice = function()
638	{
639		var newMaxPrice = (this.priceDiff*this.rightPercent)/100;
640		newMaxPrice = (this.maxPrice - newMaxPrice).toFixed(this.precision);
641
642		if (newMaxPrice != this.maxPrice)
643			this.maxInput.value = newMaxPrice;
644		else
645			this.maxInput.value = this.maxPrice;
646		smartFilterM.keyup(this.maxInput);
647	};
648
649	SmartFilterM.prototype.onInputChange = function ()
650	{
651		var priceDiff;
652		if (this.minInput.value)
653		{
654			var leftInputValue = this.minInput.value;
655			if (leftInputValue < this.minPrice)
656				leftInputValue = this.minPrice;
657
658			if (leftInputValue > this.maxPrice)
659				leftInputValue = this.maxPrice;
660
661			priceDiff = leftInputValue - this.minPrice;
662			this.leftPercent = (priceDiff*100)/this.priceDiff;
663
664			this.makeLeftSliderMove(false);
665		}
666
667		if (this.maxInput.value)
668		{
669			var rightInputValue = this.maxInput.value;
670			if (rightInputValue < this.minPrice)
671				rightInputValue = this.minPrice;
672
673			if (rightInputValue > this.maxPrice)
674				rightInputValue = this.maxPrice;
675
676			priceDiff = this.maxPrice - rightInputValue;
677			this.rightPercent = (priceDiff*100)/this.priceDiff;
678
679			this.makeRightSliderMove(false);
680		}
681	};
682
683	SmartFilterM.prototype.makeLeftSliderMove = function(recountPrice)
684	{
685		recountPrice = (recountPrice !== false);
686
687		this.leftSlider.style.left = this.leftPercent + "%";
688		this.colorUnavailableActive.style.left = this.leftPercent + "%";
689
690		var areBothSlidersMoving = false;
691		if (this.leftPercent + this.rightPercent >= 100)
692		{
693			areBothSlidersMoving = true;
694			this.rightPercent = 100 - this.leftPercent;
695			this.rightSlider.style.right = this.rightPercent + "%";
696			this.colorUnavailableActive.style.right = this.rightPercent + "%";
697		}
698
699		if (this.leftPercent >= this.fltMinPercent && this.leftPercent <= (100-this.fltMaxPercent))
700		{
701			this.colorAvailableActive.style.left = this.leftPercent + "%";
702			if (areBothSlidersMoving)
703			{
704				this.colorAvailableActive.style.right = 100 - this.leftPercent + "%";
705			}
706		}
707		else if(this.leftPercent <= this.fltMinPercent)
708		{
709			this.colorAvailableActive.style.left = this.fltMinPercent + "%";
710			if (areBothSlidersMoving)
711			{
712				this.colorAvailableActive.style.right = 100 - this.fltMinPercent + "%";
713			}
714		}
715		else if(this.leftPercent >= this.fltMaxPercent)
716		{
717			this.colorAvailableActive.style.left = 100-this.fltMaxPercent + "%";
718			if (areBothSlidersMoving)
719			{
720				this.colorAvailableActive.style.right = this.fltMaxPercent + "%";
721			}
722		}
723
724		if (recountPrice)
725		{
726			this.recountMinPrice();
727			if (areBothSlidersMoving)
728				this.recountMaxPrice();
729		}
730	};
731
732	SmartFilterM.prototype.countNewLeft = function(event)
733	{
734		var pageX = this.getPageX(event);
735
736		var trackerXCoord = this.getXCoord(this.trackerWrap);
737		var rightEdge = this.trackerWrap.offsetWidth;
738
739		var newLeft = pageX - trackerXCoord;
740
741		if (newLeft < 0)
742			newLeft = 0;
743		else if (newLeft > rightEdge)
744			newLeft = rightEdge;
745
746		return newLeft;
747	};
748
749	SmartFilterM.prototype.onMoveLeftSlider = function(e)
750	{
751		if (!this.isTouch)
752		{
753			this.leftSlider.ondragstart = function() {
754				return false;
755			};
756		}
757
758		if (!this.isTouch)
759		{
760			document.onmousemove = BX.proxy(function(event) {
761				this.leftPercent = ((this.countNewLeft(event)*100)/this.trackerWrap.offsetWidth);
762				this.makeLeftSliderMove();
763			}, this);
764
765			document.onmouseup = function() {
766				document.onmousemove = document.onmouseup = null;
767			};
768		}
769		else
770		{
771			document.ontouchmove = BX.proxy(function(event) {
772				this.leftPercent = ((this.countNewLeft(event)*100)/this.trackerWrap.offsetWidth);
773				this.makeLeftSliderMove();
774			}, this);
775
776			document.ontouchend = function() {
777				document.ontouchmove = document.touchend = null;
778			};
779		}
780
781		return false;
782	};
783
784	SmartFilterM.prototype.makeRightSliderMove = function(recountPrice)
785	{
786		recountPrice = (recountPrice !== false);
787
788		this.rightSlider.style.right = this.rightPercent + "%";
789		this.colorUnavailableActive.style.right = this.rightPercent + "%";
790
791		var areBothSlidersMoving = false;
792		if (this.leftPercent + this.rightPercent >= 100)
793		{
794			areBothSlidersMoving = true;
795			this.leftPercent = 100 - this.rightPercent;
796			this.leftSlider.style.left = this.leftPercent + "%";
797			this.colorUnavailableActive.style.left = this.leftPercent + "%";
798		}
799
800		if ((100-this.rightPercent) >= this.fltMinPercent && this.rightPercent >= this.fltMaxPercent)
801		{
802			this.colorAvailableActive.style.right = this.rightPercent + "%";
803			if (areBothSlidersMoving)
804			{
805				this.colorAvailableActive.style.left = 100 - this.rightPercent + "%";
806			}
807		}
808		else if(this.rightPercent <= this.fltMaxPercent)
809		{
810			this.colorAvailableActive.style.right = this.fltMaxPercent + "%";
811			if (areBothSlidersMoving)
812			{
813				this.colorAvailableActive.style.left = 100 - this.fltMaxPercent + "%";
814			}
815		}
816		else if((100-this.rightPercent) <= this.fltMinPercent)
817		{
818			this.colorAvailableActive.style.right = 100-this.fltMinPercent + "%";
819			if (areBothSlidersMoving)
820			{
821				this.colorAvailableActive.style.left = this.fltMinPercent + "%";
822			}
823		}
824
825		if (recountPrice)
826		{
827			this.recountMaxPrice();
828			if (areBothSlidersMoving)
829				this.recountMinPrice();
830		}
831	};
832
833	SmartFilterM.prototype.onMoveRightSlider = function(e)
834	{
835		if (!this.isTouch)
836		{
837			this.rightSlider.ondragstart = function() {
838				return false;
839			};
840		}
841
842		if (!this.isTouch)
843		{
844			document.onmousemove = BX.proxy(function(event) {
845				this.rightPercent = 100-(((this.countNewLeft(event))*100)/(this.trackerWrap.offsetWidth));
846				this.makeRightSliderMove();
847			}, this);
848
849			document.onmouseup = function() {
850				document.onmousemove = document.onmouseup = null;
851			};
852		}
853		else
854		{
855			document.ontouchmove = BX.proxy(function(event) {
856				this.rightPercent = 100-(((this.countNewLeft(event))*100)/(this.trackerWrap.offsetWidth));
857				this.makeRightSliderMove();
858			}, this);
859
860			document.ontouchend = function() {
861				document.ontouchmove = document.ontouchend = null;
862			};
863		}
864
865		return false;
866	};
867
868	return SmartFilterM;
869})();

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.