PageSourceSearch

https://aromaty-taygi.ru/bitrix/templates/concept_phoenix_s1/compo…/main/script.js?157121575422498

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

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.