PageSourceSearch

https://reforma-sk.ru/cache/js/dad82e686f48190e2449f16d9e62787c.js

js reforma-sk.ru collected 2026-10-07 00:33:34 UTC 13,556 bytes, 40 lines download raw bytes

1(function(){if(!window.MapManager||typeof window.MapManager!=='function'){function MapManager(mapContainerId,jsonData){this.geoPoints=typeof jsonData=='string'?JSON.parse(jsonData):jsonData;this.mapContainerNode=document.getElementById(mapContainerId);this.mapContainerParentNode=this.mapContainerNode.parentNode;this.mapSliderUpdateTimer=null;return this}
2MapManager.prototype.init=function(){if(!ymaps){return}
3this.getStartingValuesFromQuery();this.initMap();this.initGeoPointsObjectManager();this.buildMapFilter();this.initGeoRegionsObjectManager();this.bindEvents()}
4MapManager.prototype.initMap=function(){this.map=new ymaps.Map(this.mapContainerNode.id,{behaviors:['drag','multiTouch'],center:[55.75,37.62],zoom:2,margin:20,controls:['zoomControl'],},{autoFitToViewport:'always',suppressMapOpenBlock:!0,suppressObsoleteBrowserNotifier:!0,yandexMapAutoSwitch:!1,maxZoom:17,minZoom:1,})}
5MapManager.prototype.initGeoPointsObjectManager=function(){this.geoPointsObjectManager=new ymaps.ObjectManager({clusterize:!1,preset:'islands#redClusterIcons',zoomMargin:20,geoObjectIconLayout:"default#image",geoObjectIconImageHref:window.location.origin+"/img/svg/geo_placemark_small.svg",geoObjectIconImageSize:[34,41],geoObjectIconImageOffset:[-17,-37],geoObjectIconShadow:!0,geoObjectIconShadowLayout:"default#image",geoObjectIconShadowImageHref:window.location.origin+"/img/svg/geo_placemark_shadow_small.svg",geoObjectIconShadowImageSize:[70,85],geoObjectIconShadowImageOffset:[-35,-55],geoObjectHideIconOnBalloonOpen:!1,geoObjecthintCloseTimeout:0,geoObjecthintOpenTimeout:0});this.geoPointsObjectManager.add(this.geoPoints);this.map.geoObjects.add(this.geoPointsObjectManager)}
6MapManager.prototype.initGeoRegionsObjectManager=function(){let countriesCodes=['RU','KZ'];let completeCount=0;this.geoRegionsObjectManager=new ymaps.ObjectManager({geoObjectStrokeWidth:1,geoObjectStrokeColor:'#CE1F48',geoObjectStrokeOpacity:.5,geoObjectFill:!0,geoObjectFillColor:'#CE1F48',geoObjectFillOpacity:.1,geoObjectHintCloseTimeout:0,geoObjectHintOpenTimeout:0,});for(let i=0;i<countriesCodes.length;i++){ymaps.borders.load(countriesCodes[i],{lang:'ru',quality:1}).then(function(regionsJSON){let countryRegions=regionsJSON.features.map(function(feature){feature.id=feature.properties.iso3166;feature.properties.balloonContentHeader='Объекты:';feature.properties.balloonContentBody='';return feature});this.geoRegionsObjectManager.add(countryRegions);completeCount++;if(completeCount==countriesCodes.length){this.geoRegions=this.geoRegionsObjectManager.objects.getAll();this.setConnetcionsBetweenRegionAndrGeoPoints();this.filterGeoRegionsByActiveGeoPoints();this.map.geoObjects.add(this.geoRegionsObjectManager);this.makeFinalActionsAfterMapIsFullyLoaded()}}.bind(this))}}
7MapManager.prototype.setConnetcionsBetweenRegionAndrGeoPoints=function(){this.geoRegionsObjectManager.objects.each(function(geoRegion){let regionGeometry=null;regionGeometry=new ymaps.geometry.Polygon(geoRegion.geometry.coordinates);regionGeometry.options.setParent(this.map.options);regionGeometry.setMap(this.map);this.geoPointsObjectManager.objects.each(function(geoPoint){if(!geoPoint.properties.hasOwnProperty('regionId')&&regionGeometry.contains(geoPoint.geometry.coordinates)){geoPoint.properties.regionId=geoRegion.id;let geoPointName=geoPoint.properties.balloonContentHeader;if(!!geoPointName){geoRegion.properties.balloonContentBody=geoRegion.properties.balloonContentBody+'<a href="'+geoPoint.properties.objectLink+'">'+this.utilities.capitalizeFirstLetter(geoPointName)+'</a><br/>'}}},this)},this)}
8MapManager.prototype.buildMapFilter=function(){let filterValues={},arrfilterValues=[],mapFilterMarkup=document.createElement('div');mapFilterMarkup.innerHTML='<form action=""></form>';mapFilterMarkup.className='map-filter';this.mapFilter=this.mapContainerParentNode.appendChild(mapFilterMarkup);this.geoPointsObjectManager.objects.each(function(geoPoint){if(!filterValues.hasOwnProperty(geoPoint.properties.filterValueId)){filterValues[geoPoint.properties.filterValueId]={id:geoPoint.properties.filterValueId,name:geoPoint.properties.filterValueName,objectsCount:1,}}else{filterValues[geoPoint.properties.filterValueId].objectsCount++}});for(const filterValueId in filterValues){if(filterValues.hasOwnProperty(filterValueId)){arrfilterValues.push(filterValues[filterValueId])}}
9arrfilterValues.sort(function(a,b){let nameA=a.name.toLowerCase(),nameB=b.name.toLowerCase();if(nameA<nameB)
10return-1;else if(nameA>nameB)
11return 1
12else{return 0}});
12arrfilterValues.forEach(function(filterValueData){let filterItemMarkup=document.createElement('div'),filterItemCheckbox;filterItemMarkup.className='map_item';filterItemMarkup.innerHTML=['<input type="checkbox" id="map_filter_item_'+filterValueData.id+'" value="'+filterValueData.id+'">','<label for="map_filter_item_'+filterValueData.id+'">','<span> '+filterValueData.name+'</span>','<span class="count"> ('+filterValueData.objectsCount+')</span>','</label>',].join('');filterItemCheckboxCheckedState=this.startingValuesFromQuery.isNeedToSetStartingValues?this.startingValuesFromQuery.activeFilterValues.indexOf(filterValueData.id)!=-1:!0;filterItemCheckbox=this.mapFilter.appendChild(filterItemMarkup).getElementsByTagName('input')[0];filterItemCheckbox.checked=filterItemCheckboxCheckedState;filterItemCheckbox.addEventListener('change',function(){this.filterGeoPointsByValue()}.bind(this),!1)},this)}
13MapManager.prototype.filterGeoPointsByValue=function(firstInit=!1){const filterCheckboxes=this.mapFilter.querySelectorAll('input[type="checkbox"]:checked');if(!filterCheckboxes.length){this.geoPointsObjectManager.setFilter(function(){return!1})}else{let appliedValuesIds=[];appliedValuesIds=Array.prototype.slice.call(filterCheckboxes).map(function(checkbox){return checkbox.value});this.geoPointsObjectManager.setFilter(function(geoPoint){return appliedValuesIds.indexOf(String(geoPoint.properties.filterValueId))!=-1})}
14this.filterGeoRegionsByActiveGeoPoints();this.setMapBoundsToFitAllGeoObjects(firstInit);if(!!this.mapSlider){this.updateMapSliderBasedOnGeoPointsState()}}
15MapManager.prototype.setMapBoundsToFitAllGeoObjects=function(isNeedToChangeMapBounds=!1){const objectsManager=(this.mapContainerNode.id=="projectsByRegionMap"?this.geoRegionsObjectManager:this.geoPointsObjectManager),geoObjects=objectsManager.objects.getAll();if(!isNeedToChangeMapBounds){for(let i=0;i<geoObjects.length;i++){const geoObject=objectsManager.objects.getById(geoObjects[i].id),geoObjectState=objectsManager.getObjectState(geoObjects[i].id);let isGeoObjectFullyVisible=!1;if(!geoObjectState.isFilteredOut){if(geoObject.geometry.type==="Polygon"){let regionGeometry=new ymaps.geometry.Polygon(geoObject.geometry.coordinates);regionGeometry.options.setParent(this.map.options);regionGeometry.setMap(this.map);isGeoObjectFullyVisible=ymaps.util.bounds.containsBounds(this.map.getBounds(),regionGeometry.getBounds())}else if(geoObject.geometry.type==="Point"){isGeoObjectFullyVisible=ymaps.util.bounds.containsPoint(this.map.getBounds(),geoObject.geometry.coordinates)}
16if(/*!isShown ||*/!isGeoObjectFullyVisible){isNeedToChangeMapBounds=!0;break}}}}
17if(isNeedToChangeMapBounds){this.map.setBounds(objectsManager.getBounds(),{duration:200,useMapMargin:!0,checkZoomRange:!0,})}}
18MapManager.prototype.filterGeoRegionsByActiveGeoPoints=function(){let activeGeoPointsRegions=[];this.geoPointsObjectManager.objects.each(function(geoPoint){const geoPointState=this.geoPointsObjectManager.getObjectState(geoPoint.id);if(!geoPointState.isFilteredOut){activeGeoPointsRegions.push(geoPoint.properties.regionId)}},this);this.geoRegionsObjectManager.setFilter(function(geoRegion){return activeGeoPointsRegions.indexOf(geoRegion.id)!==-1})}
19MapManager.prototype.initMapSlider=function(){if(!jQuery.fn.slick||typeof jQuery.fn.slick!=='function'){return}
20let mapSliderContainer=this.buildMapSlider();const slickOptions={slidesToShow:5,slidesToScroll:1,arrows:!0,prevArrow:'<button class="next-slide"></button>',nextArrow:'<button class="prev-slide"></button>',fade:!1,infinite:!1,useTransform:!0,speed:400,cssEase:"cubic-bezier(0.77, 0, 0.18, 1)",};this.mapSlider=jQuery(mapSliderContainer).slick(slickOptions);this.updateMapSliderBasedOnGeoPointsState(!0)}
21MapManager.prototype.buildMapSlider=function(){let mapSliderContainer,mapSliderMarkup=document.createElement('div');mapSliderMarkup.id='sliderItems';mapSliderMarkup.className='map-slider';mapSliderContainer=this.mapContainerParentNode.appendChild(mapSliderMarkup);return mapSliderContainer}
22MapManager.prototype.updateMapSliderBasedOnGeoPointsState=function(firstInit){if(!this.mapSlider){return}
23this.geoPointsObjectManager.objects.each(function(geoPoint){const geoPointState=this.geoPointsObjectManager.getObjectState(geoPoint.id);if(!geoPoint.properties.imgUrl){return}
24let geoPointSlide=this.mapSlider[0].querySelector('.slider__item[data-geo-point-id="'+geoPoint.id+'"]');if((!geoPointState.isFilteredOut)||!!firstInit){if(!geoPointSlide){this.addSlide(geoPoint)}}else{if(!!geoPointSlide){this.removeSlide($(geoPointSlide).index())}}})}
25MapManager.prototype.removeSlide=function(slideIndex){this.mapSlider.slick('slickRemove',slideIndex)}
26MapManager.prototype.addSlide=function(geoPointData){if(!geoPointData.properties.imgUrl){return}
27let slideMarkup=document.createElement('div');slideMarkup.className='slider__item';slideMarkup.dataset.geoPointId=geoPointData.id;slideMarkup.innerHTML=['<img src="'+geoPointData.properties.imgUrl+'">',].join('');this.mapSlider.slick('slickAdd',slideMarkup)}
28MapManager.prototype.bindEvents=function(){if(this.mapSlider){this.mapSlider[0].addEventListener('click',function(e){let clickedSlide=this.utilities.getClosest(e.target,'.slider__item'),geoPoint,geoPointId,mapNewZoom;if(clickedSlide==null){return!1}
29geoPointId=clickedSlide.dataset.geoPointId;if(typeof geoPointId=='undefined'){return!1}
30geoPoint=this.geoPointsObjectManager.objects.getById(geoPointId);mapNewZoom=this.geoPointsObjectManager.getObjectState(geoPointId).isClustered?this.map.zoomRange.getCurrent()[1]:this.map.getZoom();this.map.setCenter(geoPoint.geometry.coordinates,mapNewZoom,{checkZoomRange:!0,duration:200,useMapMargin:!0,}).then(function(){this.geoPointsObjectManager.objects.balloon.open(geoPointId);this.geoPointsObjectManager.objects.balloon.autoPan();this.map.fitToViewport()}.bind(this))}.bind(this))}
31this.map.events.add('sizechange',function(event){mapOldSize=event.get('oldSize');mapNewSize=event.get('newSize');if(mapNewSize[0]!==0&&mapNewSize[1]!==0){let isNeedToForceSetBounds=(mapOldSize[0]===0||mapOldSize[1]===0);this.setMapBoundsToFitAllGeoObjects(isNeedToForceSetBounds)}}.bind(this))}
32MapManager.prototype.getStartingValuesFromQuery=function(){const query=window.location.search.substring(1),queryValues=this.utilities.parseQueryString(query),queryMapContainerIdProp=(queryValues.hasOwnProperty("mapContainerId")?queryValues.mapContainerId:null),queryMapFilterValueIdProp=(queryValues.hasOwnProperty("mapFilterValueId")?queryValues.mapFilterValueId:null);this.startingValuesFromQuery={isNeedToSetStartingValues:!1,activeFilterValues:[],};if(typeof queryMapContainerIdProp==="string"&&queryMapContainerIdProp.length>0&&queryMapContainerIdProp==this.mapContainerNode.id){this.startingValuesFromQuery.isNeedToSetStartingValues=!0;if(queryMapFilterValueIdProp!=undefined){if(typeof queryMapFilterValueIdProp==="string"){this.startingValuesFromQuery.activeFilterValues.push(queryMapFilterValueIdProp)}else if(Array.isArray(queryMapFilterValueIdProp)){for(let i=0;i<queryMapFilterValueIdProp.length;i++){this.startingValuesFromQuery.activeFilterValues.push(queryMapFilterValueIdProp[i])}}}}}
33MapManager.prototype.makeFinalActionsAfterMapIsFullyLoaded=function(){if(this.startingValuesFromQuery.isNeedToSetStartingValues){let $mapParentTab=$(this.mapContainerParentNode).closest('.js_id_full');if($mapParentTab.length>0){let $tabs=$('.js_id_full'),$tabsSwitchers=$('.js_id_preview');$tabs.removeClass('visible');$tabsSwitchers.removeClass('active');$tabs.filter('[data-id="'+$mapParentTab.data("id")+'"]').addClass('visible');$tabsSwitchers.filter('[data-id="'+$mapParentTab.data("id")+'"]').addClass('active')}
34this.mapContainerNode.scrollIntoView({behavior:"smooth",block:"start",})}
35this.filterGeoPointsByValue(!0);this.mapContainerParentNode.classList.remove('h-geomap-loading')}
36MapManager.prototype.utilities={getClosest:function(elem,selector){if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(s){var matches=(this.document||this.ownerDocument).querySelectorAll(s),i=matches.length;while(--i>=0&&matches.item(i)!==this){}
37return i>-1}}
38for(;elem&&elem!==document;elem=elem.parentNode){if(elem.matches(selector)){return elem}}
39return null},capitalizeFirstLetter:function(string){return string.charAt(0).toUpperCase()+string.slice(1).toLowerCase()},parseQueryString:function(query){var vars=query.split("&"),queryString={};for(var i=0;i<vars.length;i++){var pair=vars[i].split("="),key=decodeURIComponent(pair[0]),value=decodeURIComponent(pair[1]);if(typeof queryString[key]==="undefined"){queryString[key]=decodeURIComponent(value)}else if(typeof queryString[key]==="string"){var arr=[queryString[key],decodeURIComponent(value)];queryString[key]=arr}else{queryString[key].push(decodeURIComponent(value))}}
40return queryString}};window.MapManager=MapManager}})()

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.