PageSourceSearch

https://chateaudetalu.ru/local/templates/chateaudetalu/components/…/our_contacts_v2/script.js?17912944483618

js chateaudetalu.ru collected 2026-10-06 22:59:29 UTC 3,618 bytes, 137 lines download raw bytes

1let footerMap = {};
2let isMapReady = false;
3let baloonContent = "";
4let coords = "";
5let center = "";
6let zoom = 10;
7let offset = 3;
8$(document).ready(function() {
9  //Б24 чат — грузим только после реального взаимодействия пользователя,
10  //чтобы не дёргать pull.config.get.json от JS-рендерящих краулеров/SEO-аудита
11  let b24ChatLoading = false;
12  function loadB24Chat() {
13    if (b24ChatLoading) {
14      return;
15    }
16    b24ChatLoading = true;
17    (function(w,d,u)
18      { var s=d.createElement('script');s.async=true;s.src=u+'?'+(Date.now()/60000|0); var h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h); }
19    )(window,document,'https://cdn-ru.bitrix24.ru/b7583805/crm/site_button/loader_24_r9uk8c.js');
20  }
21
22  ['scroll', 'mousemove', 'touchstart', 'keydown', 'click'].forEach(function(evt) {
23    document.addEventListener(evt, loadB24Chat, { once: true, passive: true });
24  });
25
26    baloonContent = BX.message("BALOON_CONTENT");
27    coords = BX.message("COORDS");
28    coords = coords.split(',');
29
30    abs = 0;
31    if (zoom > 10) {
32        abs = zoom/80;
33    }
34
35    if (zoom < 10 && zoom > 5) {
36        abs = -(zoom - zoom/1.1);
37    }
38
39    if (zoom <= 5) {
40        abs = -(zoom);
41    }
42
43    center = [coords[0], parseFloat(coords[1]) - parseFloat(offset/zoom - abs)];
44
45    if (typeof ymaps !== 'undefined') {
46      ymaps.ready(init);
47
48      window.onresize = () => {
49          footerAPIReadyHandler();
50      }
51    }
52
53  //Б24 чат
54  function waitForB24LiveChat(callback) {
55    if (window.BX && BX.LiveChat && typeof BX.LiveChat.openLiveChat === 'function') {
56      callback();
57    } else {
58      setTimeout(function() {
59        waitForB24LiveChat(callback);
60      }, 300);
61    }
62  }
63
64  document.getElementById('b24chat').addEventListener('click', function() {
65    loadB24Chat();
66    waitForB24LiveChat(function() {
67      BX.LiveChat.openLiveChat();
68    });
69  });
70
71});
72
73
74function init() {
75
76    footerMap = new ymaps.Map('footer-map', {
77            center: center,
78            zoom: zoom,
79            controls: [],
80        },
81        {
82            zoomControlFloat: 'right'
83        }),
84        placemark = new ymaps.Placemark(coords,
85            {
86                balloonContent: baloonContent
87            },
88            {
89                iconLayout: 'default#image',
90                iconImageSize: [30, 37],
91                iconImageHref: '/assets/images/icons/point.svg'
92            }
93        );
94
95    footerMap.geoObjects.add(placemark);
96    footerMap.behaviors.disable('scrollZoom');
97
98    //зум
99    footerMap.controls.add('zoomControl', {
100        float: 'none',
101        position: {
102            right: 40,
103            top: 350
104        },
105        size: "small"
106    });
107
108    //геолокация
109    var geolocationControl = new ymaps.control.GeolocationControl({
110        options: {noPlacemark: true}
111    });
112    geolocationControl.events.add('locationchange', function (event) {
113        var position = event.get('position'),
114            locationPlacemark = new ymaps.Placemark(position);
115
116        footerMap.geoObjects.add(locationPlacemark);
117        footerMap.panTo(position);
118    });
119    footerMap.controls.add(geolocationControl, {
120        position: {
121            right: 40,
122            top: 430
123        }
124    });
125	isMapReady = true;
126    footerAPIReadyHandler();
127}
128
129const footerAPIReadyHandler = () => {
130	if (isMapReady && typeof footerMap.setCenter === 'function') {
131		if (window.innerWidth <= 768) {
132			footerMap.setCenter(coords);
133		} else {
134			footerMap.setCenter(center);
135		}
136	}
137}

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.