1/** 2 * Common JS 3 * MSK 4 */ 5 6var urlParams = new URLSearchParams(window.location.search); 7var debug = urlParams.get('debug'); 8 9$(document).ready(function() { 10 var openmenu = false; 11 var currentMenuLevel = 1; 12 13 var user = detect.parse(navigator.userAgent); 14 15 if (navigator.userAgent.toLowerCase().match(/(ipad|iphone)/)) { 16 document.body.classList.add('safari'); 17 } 18 if (user.browser.family.toLowerCase().match(/(ie)/)) { 19 document.body.classList.add('safari'); 20 } 21 22 $('.Ñourse_instructors-bg').appendTo($('#instructors-block')); 23 24 $('.wave-coral').append('<div class="wave-decor"></div>'); 25 26 $('.slider .blocks-gallery-grid').removeClass('.blocks-gallery-grid'); 27 28 $('a[href*=".jpg"],a[href*=".png"],.modal a').fancybox(); 29 30 $('.slider.columns-6 .blocks-gallery-grid').removeClass('.blocks-gallery-grid').slick({ 31 infinite: true, 32 dots: false, 33 arrows: true, 34 slidesToShow: 6, 35 draggable: true, 36 slidesToScroll: 1, 37 prevArrow: '<button class="slick-arrow slick-prev"><i><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10px" height="17px" viewBox="0 0 10 17"><path fill-rule="evenodd" fill="currentColor" d="M9.523,2.536 L3.791,7.996 L9.523,13.457 C10.135,14.039 10.135,14.985 9.523,15.568 C8.911,16.151 7.918,16.151 7.306,15.568 L0.467,9.052 C-0.145,8.468 -0.145,7.523 0.467,6.940 L7.306,0.424 C7.918,-0.158 8.911,-0.158 9.523,0.424 C10.135,1.008 10.135,1.954 9.523,2.536 Z"/></svg></i></button>', 38 nextArrow: '<button class="slick-arrow slick-next"><i><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10px" height="17px" viewBox="0 0 10 17"><path fill-rule="evenodd" fill="currentColor" d="M9.523,9.052 L2.684,15.568 C2.072,16.151 1.080,16.151 0.468,15.568 C-0.144,14.985 -0.144,14.039 0.468,13.457 L6.199,7.996 L0.468,2.536 C-0.144,1.954 -0.144,1.008 0.468,0.424 C1.080,-0.158 2.072,-0.158 2.684,0.424 L9.523,6.940 C10.135,7.523 10.135,8.468 9.523,9.052 Z"/></svg></i></button>', 39 responsive: [ 40 { 41 breakpoint: 992, 42 settings: { 43 slidesToShow: 4, 44 slidesToScroll: 1, 45 } 46 }, 47 { 48 breakpoint: 767, 49 settings: { 50 slidesToShow: 3, 51 slidesToScroll: 3, 52 dots: true, 53 } 54 }, 55 { 56 breakpoint: 450, 57 settings: { 58 slidesToShow: 2, 59 slidesToScroll: 1, 60 } 61 }, 62 ] 63 }); 64 65 $('.slider.columns-3 .blocks-gallery-grid').removeClass('.blocks-gallery-grid').slick({ 66 infinite: true, 67 dots: false, 68 arrows: true, 69 slidesToShow: 3, 70 draggable: true, 71 slidesToScroll: 1, 72 prevArrow: '<button class="slick-arrow slick-prev"><i><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10px" height="17px" viewBox="0 0 10 17"><path fill-rule="evenodd" fill="currentColor" d="M9.523,2.536 L3.791,7.996 L9.523,13.457 C10.135,14.039 10.135,14.985 9.523,15.568 C8.911,16.151 7.918,16.151 7.306,15.568 L0.467,9.052 C-0.145,8.468 -0.145,7.523 0.467,6.940 L7.306,0.424 C7.918,-0.158 8.911,-0.158 9.523,0.424 C10.135,1.008 10.135,1.954 9.523,2.536 Z"/></svg></i></button>', 73 nextArrow: '<button class="slick-arrow slick-next"><i><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10px" height="17px" viewBox="0 0 10 17"><path fill-rule="evenodd" fill="currentColor" d="M9.523,9.052 L2.684,15.568 C2.072,16.151 1.080,16.151 0.468,15.568 C-0.144,14.985 -0.144,14.039 0.468,13.457 L6.199,7.996 L0.468,2.536 C-0.144,1.954 -0.144,1.008 0.468,0.424 C1.080,-0.158 2.072,-0.158 2.684,0.424 L9.523,6.940 C10.135,7.523 10.135,8.468 9.523,9.052 Z"/></svg></i></button>', 74 responsive: [ 75 { 76 breakpoint: 992, 77 settings: { 78 slidesToShow: 2, 79 slidesToScroll: 2, 80 } 81 }, 82 { 83 breakpoint: 400, 84 settings: { 85 slidesToShow: 1, 86 slidesToScroll: 1, 87 } 88 }, 89 ] 90 }); 91 92 $('.slider.columns-4 .blocks-gallery-grid').removeClass('.blocks-gallery-grid').slick({ 93 infinite: true, 94 dots: false, 95 arrows: true, 96 slidesToShow: 4, 97 draggable: true, 98 slidesToScroll: 1, 99 prevArrow: '<button class="slick-arrow slick-prev"><i><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10px" height="17px" viewBox="0 0 10 17"><path fill-rule="evenodd" fill="currentColor" d="M9.523,2.536 L3.791,7.996 L9.523,13.457 C10.135,14.039 10.135,14.985 9.523,15.568 C8.911,16.151 7.918,16.151 7.306,15.568 L0.467,9.052 C-0.145,8.468 -0.145,7.523 0.467,6.940 L7.306,0.424 C7.918,-0.158 8.911,-0.158 9.523,0.424 C10.135,1.008 10.135,1.954 9.523,2.536 Z"/></svg></i></button>', 100 nextArrow: '<button class="slick-arrow slick-next"><i><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10px" height="17px" viewBox="0 0 10 17"><path fill-rule="evenodd" fill="currentColor" d="M9.523,9.052 L2.684,15.568 C2.072,16.151 1.080,16.151 0.468,15.568 C-0.144,14.985 -0.144,14.039 0.468,13.457 L6.199,7.996 L0.468,2.536 C-0.144,1.954 -0.144,1.008 0.468,0.424 C1.080,-0.158 2.072,-0.158 2.684,0.424 L9.523,6.940 C10.135,7.523 10.135,8.468 9.523,9.052 Z"/></svg></i></button>', 101 responsive: [ 102 { 103 breakpoint: 992, 104 settings: { 105 slidesToShow: 3, 106 slidesToScroll: 1, 107 } 108 }, 109 { 110 breakpoint: 480, 111 settings: { 112 slidesToShow: 2, 113 slidesToScroll: 1, 114 } 115 }, 116 ] 117 }); 118 119 $('.course-slider').slick({ 120 infinite: false, 121 dots: false,
122 arrows: false, 123 slidesToShow: 3, 124 draggable: true, 125 slidesToScroll: 1, 126 responsive: [ 127 { 128 breakpoint: 992, 129 settings: { 130 slidesToShow: 2, 131 slidesToScroll: 2, 132 } 133 }, 134 { 135 breakpoint: 768, 136 settings: { 137 slidesToShow: 2, 138 slidesToScroll: 2, 139 variableWidth: true, 140 } 141 }, 142 { 143 breakpoint: 576, 144 settings: { 145 slidesToShow: 1, 146 slidesToScroll: 1, 147 variableWidth: false, 148 } 149 }, 150 ] 151 }); 152 153 $('.ttshowcase_wrap ').slick({ 154 infinite: true, 155 dots: false, 156 arrows: true, 157 slidesToShow: 1, 158 adaptiveHeight: true, 159 draggable: true, 160 slidesToScroll: 1, 161 prevArrow: '<button class="slick-arrow slick-prev"><i><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10px" height="15px" viewBox="0 0 10 15"><path fill-rule="evenodd" fill="currentColor" d="M8.605,2.382 L3.426,7.486 L8.605,12.589 C9.158,13.135 9.158,14.019 8.605,14.563 C8.052,15.109 7.155,15.109 6.602,14.563 L0.421,8.473 C-0.132,7.927 -0.132,7.044 0.421,6.498 L6.602,0.407 C7.155,-0.138 8.052,-0.138 8.605,0.407 C9.158,0.953 9.158,1.837 8.605,2.382 Z"/></svg></i></button>', 162 nextArrow: '<button class="slick-arrow slick-next"><i><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="9px" height="15px" viewBox="0 0 9 15"><path fill-rule="evenodd" fill="currentColor" d="M8.578,8.473 L2.397,14.563 C1.844,15.109 0.947,15.109 0.394,14.563 C-0.159,14.019 -0.159,13.135 0.394,12.589 L5.573,7.486 L0.394,2.382 C-0.159,1.837 -0.159,0.953 0.394,0.407 C0.947,-0.138 1.844,-0.138 2.397,0.407 L8.578,6.498 C9.132,7.044 9.132,7.927 8.578,8.473 Z"/></svg></i></button>', 163 responsive: [ 164 { 165 breakpoint: 768, 166 settings: { 167 dots: true, 168 slidesToShow: 1, 169 } 170 }, 171 ] 172 }); 173 174 $('.tabs-caption').slick({ 175 infinite: false, 176 dots: false, 177 arrows: true, 178 slidesToShow: 4, 179 draggable: true, 180 slidesToScroll: 1, 181 responsive: [ 182 { 183 breakpoint: 992, 184 settings: { 185 slidesToShow: 3, 186 } 187 }, 188 { 189 breakpoint: 768, 190 settings: { 191 slidesToShow: 2, 192 } 193 }, 194 { 195 breakpoint: 576, 196 settings: { 197 slidesToShow: 2, 198 arrows: false, 199 infinite: true, 200 } 201 }, 202 ] 203 }); 204 205 // Ð¢Ð°Ð±Ñ 206 $('.tabs-caption p').eq(0).addClass("tab-active"); 207 $('.tabs-content').eq(0).addClass("tab-active"); 208 $(function () { 209 $(".tabs-caption").on("click", "p:not(.tab-active)", function () { 210 var id = $(this).attr('data-tab'); 211 $(this) 212 .addClass("tab-active") 213 .siblings() 214 .removeClass("tab-active") 215 .closest(".tabs") 216 .find(".tabs-content") 217 .removeClass("tab-active") 218 .eq(id) 219 .addClass("tab-active"); 220 }); 221 }); 222 223 if ($('#menu-action').is('aside')) { 224 var htm = $('#menu-action').html(); 225 // $('.nav__menu>li>.sub-menu').each(function(index, el) { 226 // $(this).append(htm); 227 // }); 228 $('#menu-item-2874>.sub-menu').addClass('with-aside').append(htm); 229 $('#menu-action').remove(); 230 } 231 232 $('.nav-toggle').click(function (event) { 233 event.preventDefault(); 234 $('.nav').toggleClass('active'); 235 openmenu = !openmenu; 236 }); 237 238 $('.nav__menu .menu-item-has-children>a').click(function (event) { 239 if (openmenu) { 240 event.preventDefault(); 241 $(this).siblings('.sub-menu').addClass('active'); 242 $('.nav__title').addClass('active'); 243 $('.nav__menu').height($(this).siblings('.sub-menu').height()); 244 currentMenuLevel++; 245 currentMenu = $(this).siblings('.sub-menu'); 246 } 247 }); 248 249 $('.nav__title').click(function (event) { 250 if (currentMenuLevel == 3) { 251 $('.nav__menu .sub-menu .sub-menu').removeClass('active'); 252 $('.nav__menu').height($('.nav__menu .sub-menu.active').height()); 253 currentMenuLevel--; 254 } else if (currentMenuLevel == 2) { 255 $('.nav__menu .sub-menu').removeClass('active'); 256 $('.nav__menu').height('auto'); 257 $('.nav__title').removeClass('active'); 258 currentMenuLevel--; 259 } else { 260 $('.nav__title').removeClass('active'); 261 } 262 }); 263 264 $('.groups-menu>li>a').click(function (event) { 265 event.preventDefault(); 266 $(this).closest('li').toggleClass('active'); 267 }); 268 269 $('.tablepress').each(function (index, el) { 270 let captions = []; 271 let i = 0; 272 $(this).find('thead th').each(function (index, el) { 273 captions[i] = $(this).text(); 274 i++; 275 }); 276 console.log(captions); 277 //console.log( $(this).find('thead') ); 278 $(this).find('tbody tr').each(function (index, el) { 279 let j = 0; 280 $(this).find('td').each(function (index, el) { 281 $(this).attr('data-title', captions[j]); 282 j++; 283 }); 284 }); 285 }); 286 287 $('.page-nav .wp-block-button__link').click(function (event) { 288 event.preventDefault(); 289 let block = $(this).attr('href'); 290 $('.tab').removeClass('active'); 291 $(block).addClass('active'); 292 $(this).closest('.page-nav').find('.wp-block-button').removeClass('active'); 293 $(this).closest('.wp-block-button').addClass('active'); 294 }); 295 296 if ($('#ez-toc-container').length > 0 && $('.article__aside-ez-toc').length > 0) { 297 $('.article__aside-ez-toc').replaceWith($('#ez-toc-container')); 298 } 299 300 let alfa_url = new URL(location.href).origin + '/alfa_crm/events/'; 301 let pathName = new URL(location.href).pathname; 302 303 var enroll_id = '6051'; 304 var pay_id = '19318'; 305 var f_pay_id = 'f19317'; 306 var f_quiz_id = 'f19363'; 307 var quiz_id = '19364'; 308 309 var forms = document.querySelectorAll('.wpcf7'); 310 for (var i = forms.length - 1; i >= 0; i--) { 311 form = forms[i]; 312 if (form.id.includes(f_pay_id) || form.id.includes(f_quiz_id)) continue; 313 314 // form.addEventListener('wpcf7mailsent', function (event) { 315 // //yaCounter49524934.reachGoal('form1'); 316 // document.location.href = '/thank/'; 317 // }, false); 318 var postData = ''; 319 320 form.addEventListener('submit', function(event) { 321 // Data 322 var formData = $(this).serialize(); 323 // console.log(formData); 324 var flag = true; 325// $.ajax({ 326// url: 'https://shmmoscow.ru/bot/index.php', 327// type: 'POST', 328 329// data: formData, 330// success: function(response) { 331// console.log('success'); 332// // var url = "/thank/"; 333// // $(location).attr('href',url); 334// }, 335// error: function() { 336// console.log('error'); 337// }, 338// }) 339 $(this).find('.wpcf7-validates-as-required').each(function (index, el) { 340 console.log($(this)); 341 if ($(this).val() == '') { 342 flag = false;
343 return false; 344 } 345 }); 346 347 // if (flag == true) { 348 //document.location.href = '/thank/'; 349 // } 350 }, false); 351 352 353 /* Massage Master */ 354 355 /* 356 if ('/massagemaster/' === pathName) { 357 document.addEventListener('wpcf7mailsent', function(event) { 358 setTimeout(() => { 359 location = 'https://shmmoscow.ru/vy-uspeshno-zaregistrirovalis/'; 360 window.location.href = 'https://shmmoscow.ru/vy-uspeshno-zaregistrirovalis/'; 361 }, 3000); 362 }, false); 363 } 364 */ 365 366 367 /* РаÑÑÑоÑка */ 368 369 var fn = form.querySelector('input[name="name_form"]'); 370 371 if (fn && fn.value.indexOf('аÑÑÑоÑк') > -1) { 372 form.addEventListener('submit', function (event) { 373 let course = JSON.parse(sessionStorage.getItem('course')); 374 let enroll_form = $('#popmake-' + enroll_id); 375 let pay_form = $('#popmake-' + pay_id); 376 377 let data = new FormData(event.target); 378 data.set("url", location.href); 379 //data.set("url_success", window.pageWA || new URL(location.href).origin + '/thank'); 380 data.set("url_success", new URL(location.href).origin + '/thank'); 381 382 console.log('loan: ', course, enroll_form, pay_form, data); 383 384 for (let key in course) 385 if (course.hasOwnProperty(key)) data.set(key, course[key]); 386 387 $.ajax({ 388 url: alfa_url + 'course_loan.php', 389 type: 'POST', 390 dataType: 'json', 391 data: data, 392 cache : false, 393 contentType: false, 394 processData: false, 395 success: function (response) { 396 console.log(response); 397 //document.location.href = window.pageWA || '/thank/'; 398 document.location.href = '/thank/'; 399 } 400 }); 401 }, false); 402 } 403 else { 404 form.addEventListener('submit', function(event) { 405 let course = JSON.parse(sessionStorage.getItem('course')); 406 let enroll_form = $('#popmake-' + enroll_id); 407 let pay_form = $('#popmake-' + pay_id); 408 409 let data = new FormData(event.target); 410 data.set("url", location.href); 411 data.set("cookies", document.cookie || false); 412 413 if ('/massagemaster/' === pathName || '/professiya-pod-klyuch/' === pathName) data.set('url_success', 'https://shmmoscow.ru/vy-uspeshno-zaregistrirovalis/'); 414 // else data.set("url_success", window.pageWA || new URL(location.href).origin + '/thank'); 415 else data.set("url_success", new URL(location.href).origin + '/thank'); 416 417 for (let key in course) { 418 if (course.hasOwnProperty(key)) data.set(key, course[key]); 419 } 420 421 422 // Validate 423 424 if (data.has('your-name') && data.get('your-name').trim() == '') { 425 alert('ÐÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ð¾ ÑказаÑÑ Ð¸Ð¼Ñ!'); 426 return; 427 } 428 429 if (data.has('your-subject') && data.get('your-subject').trim() == '') { 430 alert('ÐÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ð¾ ÑказаÑÑ ÑелеÑон!'); 431 return; 432 } 433 434 // Check blocking 435 if (window.processing) { 436 alert('ÐÐ´ÐµÑ Ð¾ÑпÑавка запÑоÑа, пожалÑйÑÑа подождиÑе...'); 437 return; 438 } 439 else { 440 // Set blocking 441 $(this).find('.wpcf7-submit').prop('disabled', true); 442 window.processing = true; 443 } 444 445 // Nimb Manager 446 if (typeof ym !== "undefined" && '/massagemaster/' === pathName) { 447 /* 448 if (debug) { 449 event.preventDefault(); 450 return; 451 } 452 */ 453 454 var fName = $(event.target).find('input[name="name_form"]').val(); 455 if (fName !== 'ÐаказаÑÑ Ð·Ð²Ð¾Ð½Ð¾Ðº') ym(79504120, 'reachGoal', 'nimbsendform'); 456 } 457 458 459 $.ajax({ 460 url: alfa_url + 'course_enroll.php', 461 type: 'POST', 462 dataType: 'json', 463 data: data, 464 cache : false, 465 contentType: false, 466 processData: false, 467 success: function (response) { 468 if (!!response['lead_id']) localStorage.setItem('alfa_lead_id', response['lead_id']); 469 470 if (response.hasOwnProperty('redirect')) { 471 console.log('RR: ' + response['redirect']); 472 window.location.href = response['redirect']; 473 } 474 475 if (response.hasOwnProperty('type') && response.type === 'paid') { 476 enroll_form.popmake('close'); 477 478 setTimeout(function() { 479 pay_form.popmake('open'); 480 }, 750); 481 482 pay_form.find('form')[0].addEventListener('submit', function (event) { 483 switch (event.submitter.id) { 484 case 'pay_course_full': 485 if (response.hasOwnProperty('payform_link') && !!response.payform_link) { 486 $.post(alfa_url + 'pay_course_full.php', response, function () { 487 document.location = response['payform_link']; 488 }, 'json'); 489 } 490 break; 491 492 case 'pay_course_loan_10': 493 $.post(alfa_url + 'pay_course_loan_10.php', response, function () { 494 tinkoff.create( 495 { 496 sum: response['sum'], 497 items: [{name: 'ÐплаÑа обÑÑÐµÐ½Ð¸Ñ Ð² Школе ÐаÑÑеÑов ÐаÑÑажа', price: response['sum'], quantity: 1}], 498 orderNumber: response['task_id'], 499 //demoFlow: 'sms', 500 promoCode: 'default', 501 webhookURL: response['t_webhook'], 502 // successURL: window.pageWA || 'https://shmmoscow.ru/thank/', 503 successURL: 'https://shmmoscow.ru/thank/', 504 shopId: 'ac060434-0e3e-4f9c-a988-e6024f4a72de', 505 showcaseId: '4991dc2f-24f5-42cc-98a2-5ccb4e0013be', 506 values: { 507 contact: { 508 mobilePhone: course['your-subject'] 509 } 510 } 511 }, 512 {view: 'self'} 513 ); 514 }, 'json'); 515 break; 516 517 case 'pay_course_loan_end': 518 $.post(alfa_url + 'pay_course_loan_end.php', response, function () { 519 // document.location.href = window.pageWA || '/thank/'; 520 document.location.href = '/thank/'; 521 }, 'json'); 522 break; 523 524 case 'pay_otpbank': 525 $.post(alfa_url + 'pay_course_loan_10.php', response, function() { 526 var product = response['course'] ? 'ÐплаÑа кÑÑÑа "' + response['course'] + '"' : 'ÐплаÑа обÑÑÐµÐ½Ð¸Ñ Ð² Школе ÐаÑÑеÑов ÐаÑÑажа'; 527 528 if (response['sum']) document.location.href = 'https://ecom.otpbank.ru/smart-form?tradeID=590103174000001&creditType=2&firstPayment=1&promoCode=PKP19_M_6_36&successURL=https%3A%2F%2Fshmmoscow.ru%2Fthank%2F&creditPeriodFrom=3&creditPeriodTo=12&goods%5B0%5D%5Bcategory%5D=RGB_GOODS_CATEGORY_130&goods%5B0%5D%5Bname%5D='
528+ encodeURIComponent(product) + '&goods%5B0%5D%5Bprice%5D=' + response['sum'] + '&goods%5B0%5D%5Bquantity%5D=1'; 529 else alert('Ðо вÑÐµÐ¼Ñ Ð¾ÑпÑавки даннÑÑ Ð¿ÑоизоÑла оÑибка, попÑобÑйÑе повÑоÑиÑÑ Ð·Ð°Ð¿ÑоÑ.'); 530 }, 'json'); 531 break; 532 } 533 }); 534 } 535 else { 536 // Master + Key 537 if (pathName == '/professiya-pod-klyuch/' || pathName == '/massagemaster/') document.location.href = 'https://shmmoscow.ru/vy-uspeshno-zaregistrirovalis/'; 538 else document.location.href = window.pageWA || '/success/'; 539 } 540 } 541 }); 542 }, false); 543 544 } 545 } 546 547 if ('/thank/' === pathName) { 548 let quiz_form = $('#popmake-' + quiz_id); 549 550 setTimeout(function() { 551 quiz_form.popmake('open'); 552 }, 1000); 553 554 quiz_form.find('form')[0].addEventListener('submit', function (event) { 555 let lead_id = localStorage.getItem('alfa_lead_id'); 556 if (!!lead_id) { 557 let data = new FormData(event.target); 558 data.set('lead_id', lead_id); 559 560 $.ajax({ 561 url: alfa_url + 'quiz.php', 562 type: 'POST', 563 dataType: 'json', 564 data: data, 565 cache : false, 566 contentType: false, 567 processData: false, 568 success: function (response) { 569 quiz_form.popmake('close'); 570 document.location = 'https://shop.shkolamm.ru'; 571 } 572 }); 573 } else { 574 quiz_form.popmake('close'); 575 } 576 }); 577 578 quiz_form.parent().on('pumAfterClose', function (event) { 579 console.log(event); 580 //TODO - ÑедиÑÐµÐºÑ Ð½Ð° ÑÑÑаниÑÑ Ð²Ð¸Ð´Ð¶ÐµÑа 581 }); 582 } 583 584 document.addEventListener('wpcf7submit', function (event) { 585 setTimeout(function () { 586 jQuery('.wpcf7-submit').prop("disabled", false); 587 window.processing = false; 588 }, 5000); 589 }, false); 590 591 592 /* Call Popup */ 593 594 document.querySelector('div#callback .wpcf7').addEventListener('submit', function(e) { 595 // console.log('cbPopup submit'); 596 if (typeof ym !== "undefined") ym(79504120, 'reachGoal', 'obrzvonnimb'); 597 }); 598 599 600 /* Calltouch */ 601 602 jQuery(document).on('submit', 'form', function() { 603 if (debug) return; 604 605 var m = jQuery(this); 606 var fio = m.find('input[name="your-name"],input[placeholder*="ÐмÑ"').val(); 607 var phone = m.find('input[name*="tel"],input[type*="tel"]').val(); 608 var mail = m.find('input[name*="email"],input[type*="email"]').val(); 609 var formId = m.find('input[name="_wpcf7"]').val(); 610 var sub = 'ÐаÑвка Ñ ÑоÑÐ¼Ñ [' + formId + ']'; // location.hostname 611 612 var ct_data = { 613 fio: fio, 614 phoneNumber: phone, 615 email: mail, 616 subject: sub, 617 requestUrl: location.href, 618 sessionId: window.call_value 619 }; 620 621 if (!!phone && !!fio) { 622 // if (typeof ym !== "undefined") ym(79504120,'reachGoal','0'); 623 624 jQuery.ajax({ 625 url: 'https://api.calltouch.ru/calls-service/RestAPI/requests/47270/register/', 626 dataType: 'json', 627 type: 'POST', 628 data: ct_data, 629 async: false, 630 631 /* 632 success: function(response) { 633 console.log('CT: success'); 634 console.log('ST: ' + response); 635 636 if ('/massagemaster/' === new URL(location.href).pathname) window.location.href = 'https://shmmoscow.ru/vy-uspeshno-zaregistrirovalis/'; 637 }, 638 639 error: function() { 640 console.log('CT: error'); 641 console.log('ST: ' + response); 642 643 if ('/massagemaster/' === new URL(location.href).pathname) window.location.href = 'https://shmmoscow.ru/vy-uspeshno-zaregistrirovalis/'; 644 }, 645 */ 646 647 }); 648 649 } 650 }); 651 652 653 /* UTM's Save */ 654 655 $('a[href*="https://wa.me/"]').click(function(e) { 656 jQuery.ajax({ 657 url: 'https://shmmoscow.ru/alfa_crm/events/utms.php', 658 dataType: 'json', 659 type: 'POST', 660 data: { 661 url: window.location.href 662 }, 663 async: false 664 }); 665 }); 666 667}); 668 669 670/* Onload */ 671 672// $(window).load(function() { // }); 673 674(function() { 675 676 /* Save Cookies (Shadow) */ 677 678 var getParams = []; 679 location.search.substr(1).split("&").forEach(function(item) { 680 getParams[item.split("=")[0]] = item.split("=")[1]; 681 }); 682 683 if (getParams['utm_source']) { 684 document.cookie = "utm_source=" + (getParams['utm_source'] ? getParams['utm_source'] : '') + "; max-age=" + 86400 * 99 + "; path=/"; 685 document.cookie = "utm_campaign=" + (getParams['utm_campaign'] ? getParams['utm_campaign'] : '') + "; max-age=" + 86400 * 99 + "; path=/"; 686 document.cookie = "utm_medium=" + (getParams['utm_medium'] ? getParams['utm_medium'] : '') + "; max-age=" + 86400 * 99 + "; path=/"; 687 document.cookie = "utm_content=" + (getParams['utm_content'] ? getParams['utm_content'] : '') + "; max-age=" + 86400 * 99 + "; path=/"; 688 document.cookie = "utm_term=" + (getParams['utm_term'] ? getParams['utm_term'] : '') + "; max-age=" + 86400 * 99 + "; path=/"; 689 } 690 691 692 /* WA */ 693
694 function ChangeLinkWA() { 695 this.text = "ÐдÑавÑÑвÑйÑе! ÐÐ¾Ð¼ÐµÑ Ð·Ð°Ñвки: {wz_metric}"; 696 this.cookieSource = "_ym_uid"; 697 } 698 699 ChangeLinkWA.prototype.editLink = function (url, id) { 700 if (decodeURIComponent(url.split("text=")[1]) === this.text.replace(/{wz_metric}/gi, id)) return; 701 var regexNumberPhone = /\d+/; 702 if (!regexNumberPhone.test(url)) return; 703 704 var phone = url.match(regexNumberPhone)[0]; 705 var host = url.split(phone)[0]; 706 var newUrl = host === "https://wa.me/" ? host.toString()+phone.toString()+"?text="+(this.text.replace(/{wz_metric}/gi, id)) : host.toString()+phone.toString()+"&text="+(this.text.replace(/{wz_metric}/gi, id)); 707 708 return newUrl; 709 }; 710 711 ChangeLinkWA.prototype.getCookie = function (name) { 712 var cookie = document.cookie; 713 var matches = cookie.match(new RegExp("(?:^|; )" + (name.replace(/([.$?*|{}()[]\/+^])/g, "\\$1")) + "=([^;]*)")); 714 return matches ? decodeURIComponent(matches[1]) : undefined; 715 }; 716 717 ChangeLinkWA.prototype.censusLinks = function () { 718 var links = document.querySelectorAll('[href*="//wa.me"], [href*="//api.whatsapp.com/send"], [href*="//web.whatsapp.com/send"], [href^="whatsapp://send"]'); 719 var id = this.getCookie(this.cookieSource); 720 var that = this; 721 links.forEach(function (link) { 722 var newLink = that.editLink(link.href, id); 723 if (newLink) window.pageWA = link.href = newLink; 724 }); 725 }; 726 727 window.addEventListener("DOMContentLoaded", function () { 728 if (!(window.__wz_scripts && window.__wz_scripts.scriptsChangeLinkWA)) { 729 if (!window.__wz_scripts) window.__wz_scripts = {}; 730 window.__wz_scripts.scriptsChangeLinkWA = new ChangeLinkWA(); 731 var interval = setInterval(function() { 732 var id = window.__wz_scripts.scriptsChangeLinkWA.getCookie(window.__wz_scripts.scriptsChangeLinkWA.cookieSource); 733 if (id) { 734 clearInterval(interval); 735 window.__wz_scripts.scriptsChangeLinkWA.censusLinks(); 736 } 737 }, 750); 738 } 739 }); 740 741})(); 742
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.