PageSourceSearch

https://doctor-roshal.ru/local/templates/.default/components/bitrix/catalog.smart.filter/blog_filter/script.js

js doctor-roshal.ru collected 2026-10-02 06:58:12 UTC 21,928 bytes, 884 lines download raw bytes

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

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.