1/*ÑÐ»Ð°Ð¹Ð´ÐµÑ Ð½Ð° ÑÑÑаниÑе о компании*/ 2function checkTouchCoordinates(touchX, touchY, X, Y, width, height) { 3 return ((touchX > X) && (touchX < (X + width))) && ((touchY > Y) && (touchY < (Y + height))) 4} 5 6$(document).ready(function(){ 7 8 $('.calc-form').on('click', '.calc-fieldset-opener', function(){ 9 $(this).closest('.calc-container-main').slideToggle(); 10 }) 11}) 12 13/*ÑÑнкÑии оÑкÑÑваÑек в калÑкÑлÑÑоÑе*/ 14 15 $('document').ready(function(){ 16 17 $('.calc-form-top').on('click', '.about-marker', function(){ 18 $(this).parent().parent().find('.calc-container-packages').addClass('is-open'); 19 $(this).parent().parent().find('.calc-container-measures').removeClass('is-open'); 20 }) 21 22 $('.calc-form-top').on('click', '.measures-marker', function(){ 23 $(this).parent().parent().find('.calc-container-packages').removeClass('is-open'); 24 $(this).parent().parent().find('.calc-container-measures').addClass('is-open'); 25 }) 26 27 $('.calc-form-top').on('click', '.tip-trigger', function(){ 28 $(this).parent().find('.calc-vol-mass-tip').toggle(); 29 }) 30 31 $('.calc-fieldset-header').click(function(){ 32 $(this).parent().find('.calc-container-main').slideToggle(); 33 $(this).find('.calc-fieldset-opener').toggleClass('closed'); 34 }) 35 }) 36 37/*плавнÑй пеÑÐµÑ Ð¾Ð´ по ÑкоÑÑм*/ 38 39$(document).ready(function(){ 40 $("tariff-anchors-container").on("click","a", function (event) { 41 event.preventDefault(); 42 var id = $(this).attr('href'), 43 top = $(id).offset().top; 44 $('body,html').animate({scrollTop: top}, 1500); 45 }); 46}); 47 48 49/*оÑкÑÑваÑки в менÑ*/ 50 51 52function openMenu () { 53 scrollLock.disablePageScroll(document.querySelector('.right-menu')) 54 $('.header-menu-button').css('display', 'none'); 55 $('.header-menu-close-button').css('display', 'flex'); 56 57 $('.right-menu').css('margin-right', '0'); 58 59 $('body').addClass('fixed'); 60} 61 62function closeMenu () { 63 scrollLock.enablePageScroll(document.querySelector('.right-menu')) 64 $('.header-menu-button').css('display', 'flex'); 65 $('.header-menu-close-button').css('display', 'none'); 66 67 $('.right-menu').css('margin-right', '-100%'); 68 69 $('body').removeClass('fixed'); 70} 71 72$(document).ready(function () { 73 $('.right-menu-title-container').click(function () { 74 const target = $(this) 75 const next = target.next() 76 77 if (next.hasClass('right-menu-tab-slider') && target.hasClass('active')) { 78 next.css('display', 'flex') 79 } else if (next.hasClass('right-menu-tab-slider') && !target.hasClass('active')) { 80 next.css('display', 'none') 81 } 82 83 target.toggleClass('active') 84 next.slideToggle() 85 }) 86 87 $('.header-menu-button').click(function () { 88 // ÐÑли ÑÑо айÑон, Ñо Ð¼ÐµÐ½Ñ Ð²ÑзÑваеÑÑÑÑ ÑеÑез коÑÑÑлÑ, коÑоÑÑй в home/js/script.js 89 if (navigator.userAgent.toLowerCase().match(/(ipad|iphone)/)) { 90 return 91 } 92 openMenu() 93 }) 94 95 $('.header-menu-close-button').click(function () { 96 if (navigator.userAgent.toLowerCase().match(/(ipad|iphone)/)) { 97 return 98 } 99 closeMenu() 100 }) 101}); 102 103// Чиним неÑабоÑаÑÑÑÑ ÐºÐ½Ð¾Ð¿ÐºÑ Ð¼ÐµÐ½Ñ Ð½Ð° айÑÐ¾Ð½Ð°Ñ Ñак как на главной она не ÑабоÑÐ°ÐµÑ 104 105$(function () { 106 if (navigator.userAgent.toLowerCase().match(/(ipad|iphone)/)) { 107 const menu = $('.header-menu-button'); 108 // УзнаÑм кооÑдинаÑÑ ÐºÐ½Ð¾Ð¿ÐºÐ¸ Ð¼ÐµÐ½Ñ 109 const menuX = menu.offset().left; 110 const menuY = menu.offset().top; 111 // УзнаÑм ÑÐ°Ð·Ð¼ÐµÑ ÐºÐ½Ð¾Ð¿ÐºÐ¸ 112 const menuWidth = menu.outerWidth(); 113 const menuHeight = menu.outerHeight(); 114 115 $('header').on('touchstart', (e) => { 116 let touchX = e.originalEvent.targetTouches[0].clientX; 117 let touchY = e.originalEvent.targetTouches[0].clientY; 118 // ÐдеÑÑ Ð¼Ñ Ð¿ÑовеÑÑем, попала ли кооÑдинаÑа нажаÑÐ¸Ñ Ð² диапозон кнопки Ð¼ÐµÐ½Ñ 119 if (checkTouchCoordinates(touchX, touchY, menuX, menuY, menuWidth, menuHeight) 120 && $('.header-menu-button').css('display') !== 'none') { 121 openMenu(); 122 } else if (checkTouchCoordinates(touchX, touchY, menuX, menuY, menuWidth, menuHeight) 123 && $('.header-menu-button').css('display') === 'none') { 124 closeMenu(); 125 } 126 }) 127 } 128}); 129 130/*ÑменÑÑение планеÑÑ*/ 131 132$(document).ready(function() { 133 if (window.matchMedia("(max-width: 650px)").matches){ 134 $('#rotatingGlobe').attr('style', 'width: 260px; height: 260px; cursor: move;'); 135 } 136}) 137 138/*вÑвод новоÑÑей по годам*/ 139 140$(document).ready(function() { 141 142 $.getJSON( `https://vestovoy.ru/ajax/newsBlock.php?date=2023-2021`, function( data ) { 143 if (data.length > 0) { 144 145 data.forEach(function(i) { 146 const newsDate = i.news_create_date; 147 const newsTitle = i.news_title; 148 const newsUrl = i.news_url; 149 const newsId = i.news_id; 150 151 const newsCardEl = $(`<a class="news-years-item" href="/novosti/${newsUrl}">` + 152 `<img class="news-years-item-img" src="/pictures/width273/news_id${newsId}.jpg">`+ 153 `<span class="news-years-item-title">${newsTitle}</span>`+ 154 `<span class="news-item-date">${newsDate}</span>` + 155 `</a>`); 156 157 $('.news-years-result-container').append(newsCardEl); 158 }); 159 } 160 }); 161 $('.news-years-tab-item').click(function() { 162 163 $('.news-years-result-container').empty(); 164 165 const apiEndPoint = $(this).text(); 166 $.getJSON( `https://vestovoy.ru/ajax/newsBlock.php?date=${apiEndPoint}`, function( data ) { 167 168 if (data.length > 0) { 169 170 data.forEach(function(i) { 171 const newsDate = i.news_create_date; 172 const newsTitle = i.news_title; 173 const newsUrl = i.news_url; 174 const newsId = i.news_id; 175 176 const newsCardEl = $(`<a class="news-years-item" href="/novosti/${newsUrl}">` + 177 `<img class="news-years-item-img" src="/pictures/width273/news_id${newsId}.jpg">`+ 178 `<span class="news-years-item-title">${newsTitle}</span>`+ 179 `<span class="news-item-date">${newsDate}</span>` + 180 `</a>`); 181 182 $('.news-years-result-container').append(newsCardEl); 183 }); 184 }; 185 }); 186 187 $('.show-all-news-button').css('display', 'block'); 188 189 }) 190 191 $('.show-all-news-button').click(function(){ 192 $('.news-years-result-container').empty(); 193 194 $.getJSON( `https://vestovoy.ru/ajax/newsBlock.php?date`, function( data ) { 195 196 if (data.length > 0) { 197 198 data.forEach(function(i) { 199 const newsDate = i.news_create_date; 200 const newsTitle = i.news_title; 201 const newsUrl = i.news_url; 202 const newsId = i.news_id; 203 204 const newsCardEl = $(`<a class="news-years-item" href="/novosti/${newsUrl}">` + 205 `<img class="news-years-item-img" src="/pictures/width273/news_id${newsId}.jpg">`+ 206 `<span class="news-years-item-title">${newsTitle}</span>`+ 207 `<span class="news-item-date">${newsDate}</span>` + 208 `</a>`); 209 210 $('.news-years-result-container').append(newsCardEl); 211 }); 212 }; 213 }) 214 215 $(this).css('display', 'none'); 216 217 }) 218}) 219 220/*калÑкÑлÑÑоÑ*/ 221 222$(document).ready(function(){ 223 224 $('.calc-form').on('keyup', '.calc-container-measures-inner', function(){ 225 const length = $(this).find('.calc-label.length input').val(); 226 const width = $(this).find('.calc-label.width input').val(); 227 const depth = $(this).find('.calc-label.depth input').val(); 228 229 if (length > 0 && width > 0 && depth > 0) { 230 const volume = +length * +width * +depth; 231 const volumeFinal = +volume / 5000; 232 $(this).parent().find('.volume-result').text(volumeFinal); 233 } 234 }) 235 236 $('.one-more-package').click(function(){ 237 var items = $(".parameters-container").length; 238 var newPackage = $('.dop-package-example').clone().removeClass('dop-package-example').attr('data-id', +items); 239 240 var newPackageId = $(newPackage).attr('data-id'); 241 242 $(newPackage).find('.calc-param > .calc-input').attr('name', `param-choose${newPackageId}`); 243 $(newPackage).find('.calc-option-button').attr('name', `packages-choose${newPackageId}`); 244 245 $(newPackage).appendTo('.dop-packages-container'); 246 }) 247 248 $('.dop-packages-container').on('click', '.dop-package-delete', function(){ 249 $(this).parent().remove(); 250 }) 251 252 $('form[form-marker="calculator"]').addClass('calc-form'); 253 $('input[name="user_form[6]"]').addClass('calc-input').attr('id', 'addressFrom'); 254 $('input[name="user_form[7]"]').addClass('calc-input').attr('id', 'addressTo'); 255 $('.calc-form button[type="submit"]').text('ÐÑпÑавиÑÑ Ð·Ð°ÑвкÑ'); 256}) 257 258/*маÑинки*/ 259 260$(function(){ 261 // Newmain uses normal document flow; legacy skrollr pins body height and 262 // leaves empty space below the footer when the page or form changes height. 263 if (document.getElementById('newmain-page')) return; 264 265 var lastScroll = 0; 266 var s = skrollr.init({ 267 mobileCheck: function() { 268 return false;
269 } 270 }); 271 272 $('html').scroll(function(){ 273 let currentScroll = document.documentElement.scrollTop || document.body.scrollTop; // Get Current Scroll Value 274 if (currentScroll > 0 && lastScroll <= currentScroll){ 275 lastScroll = currentScroll; 276 console.log("Scrolling DOWN"); 277 $('body').addClass('scroll-down').removeClass('scroll-up'); 278 }else{ 279 lastScroll = currentScroll; 280 $('body').addClass('scroll-up').removeClass('scroll-down'); 281 } 282 283 }); 284 285 if (window.matchMedia("(max-width: 1273px)").matches){ 286 $('.truck').attr('style', 'top: 30px; transform: translateX(472.079px);'); 287 $('.blue-car').attr('style', 'top: 70px; transform: translateX(472.079px);'); 288 $('.red-car').attr('style', 'top: 175px; transform: translateX(472.079px);'); 289 } 290}); 291 292function isScrolledIntoView(elem) 293{ 294 var docViewTop = $(window).scrollTop(); 295 var docViewBottom = docViewTop + $(window).height(); 296 297 var elemTop = $(elem).offset().top + $(elem).height() + 50; 298 var elemBottom = $(elem).offset().top - 50; 299 300 return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop)); 301} 302 303function scrollDetect(){ 304 var lastScroll = 0; 305 306 window.onscroll = function() { 307 let currentScroll = document.documentElement.scrollTop || document.body.scrollTop; // Get Current Scroll Value 308 309 if (currentScroll > 0 && lastScroll <= currentScroll){ 310 lastScroll = currentScroll; 311 document.getElementById("scrollLoc").innerHTML = "Scrolling DOWN"; 312 }else{ 313 lastScroll = currentScroll; 314 document.getElementById("scrollLoc").innerHTML = "Scrolling UP"; 315 } 316 }; 317} 318 319/*ÑоÑма обÑаÑного звонка*/ 320 321$(document).ready(function(){ 322 $('input[name = "user_form[3]"]').attr('placeholder', 'ÐведиÑе ваÑе имÑ'); 323 $('input[name = "user_form[4]"], input[name = "user_form[18]"], input[name = "user_form[66]"], input[name = "user_form[25]"]').attr('placeholder', 'ÐведиÑе Ð²Ð°Ñ ÑелеÑон').attr("type", "tel"); 324 $('input[name = "user_form[5]"], input[name = "user_form[64]"]').attr('placeholder', 'ÐведиÑе адÑÐµÑ ÑлекÑÑонной поÑÑÑ').attr('data-inputmask', "'alias': 'email'").attr('inputmode', 'email'); 325 326 $('input[name = "user_form[5]"], input[name = "user_form[64]"]').inputmask(); 327 $('input[name = "user_form[4]"], input[name = "user_form[18]"], input[name = "user_form[66]"], input[name = "user_form[25]"]').inputmask({"mask": "9(999) 999-9999"}); 328 329 $('.footer-backcall-button').click(function(){ 330 $('.popup-backcall').css('display', 'block'); 331 $('.popup-backcall-content').css('display', 'flex'); 332 }) 333 334 $('.to-backcall-form').click(function(){ 335 $('.popup-backcall').css('display', 'block'); 336 $('.popup-backcall-content').css('display', 'flex'); 337 }) 338 339 $('.popup-backcall-content').on('click', '.popup-backcall-close', function(){ 340 $('.popup-backcall').css('display', 'none'); 341 $('.popup-backcall-content').css('display', 'none'); 342 }) 343 344 $('.popup-backcall').click(function(){ 345 $(this).css('display', 'none'); 346 $('.popup-backcall-content').css('display', 'none'); 347 }) 348 349 $(function() { 350 let form = $('[form-marker="backcall"]'), 351 fotmContent = form.find('.popup-backcall-content'); 352 353 form.on('submit', function(e) { 354 e.preventDefault(); 355 let body = $(this).serialize(); 356 357 $.ajax({ 358 type: this.method, 359 data: body, 360 success: data => { 361 let result = JSON.parse(data); 362 fotmContent.html(`<div>${result.tpl}</div>`); 363 } 364 }); 365 }) 366 }) 367})
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.