1$(function () { 2 3 //masked input 4 //$('input[name="phone"]').intlTelInput({ 5 // preferredCountries: ["ru", "by", "ua", "kz"], 6 // separateDialCode: true, 7 // initialCountry: "ru" 8 // }) 9 10 $('input[name="phone"]').each(function(){ 11 intlTelInput($(this)[0], { 12 preferredCountries: ["ru", "kz", "tr"], 13 separateDialCode: true, 14 initialCountry: "ru", 15 hiddenInput : "phone" 16 }); 17 }); 18 19 var phone_errorMap = ["ÐепÑавилÑнÑй номеÑ", "ÐепÑавилÑнÑй код ÑÑÑанÑ", "СлиÑком коÑоÑкий номеÑ", "СлиÑком длиннÑй номеÑ", "ÐепÑавилÑнÑй номеÑ","ÐепÑавилÑнÑй номеÑ"]; 20 jQuery.validator.addMethod("itiPhoneValidation", function (phone_number, element) { 21 var iti = window.intlTelInputGlobals.getInstance(element); 22 if (iti.isValidNumber()) { 23 } else { 24 25 var errorMsgReg = $(element).parent().find('.error'); 26 var errorCode = iti.getValidationError(); 27 errorMsgReg.text(phone_errorMap[errorCode]); 28 setTimeout(function(){ 29 errorMsgReg.text(phone_errorMap[errorCode]); 30 },50) 31 } 32 return iti.isValidNumber(); 33 }); 34 35 36 // RECAPCHA 37 var widgetRecapchaCallback; 38 var widgetRecapchaDirector; 39 var widgetRecapchaRequest; 40 var widgetRecapchaQuestion; 41 var widgetRecapchaContacts; 42 var widgetRecapchaRequestForTest; 43 var widgetRecapchaOlimpReg; 44 var widgetRecapchaSubscribe; 45 var widgetRecapchaEvent; 46 47 48 var widgetRecapchaProductPageForm1; 49 var widgetRecapchaProductPageForm2; 50 var widgetRecapchaProductPageForm3; 51 var widgetRecapchaProductPageForm4; 52 var widgetRecapchaProductPageForm5; 53 54 if (window.smartCaptcha) { 55 56 if( $("#recapcha-callback").length ){ 57 widgetRecapchaCallback = window.smartCaptcha.render('recapcha-callback', { 58 sitekey: yaRecapchaSiteKeyModx, 59 invisible: true, 60 callback: onSubmitCallback, 61 hideShield: true 62 }); 63 } 64 65 if( $("#recapcha-director").length ){ 66 widgetRecapchaDirector = window.smartCaptcha.render('recapcha-director', { 67 sitekey: yaRecapchaSiteKeyModx, 68 invisible: true, 69 callback: onSubmitDirector, 70 hideShield: true 71 }); 72 } 73 74 if( $("#recapcha-request").length ){ 75 widgetRecapchaRequest = window.smartCaptcha.render('recapcha-request', { 76 sitekey: yaRecapchaSiteKeyModx, 77 invisible: true, 78 callback: onSubmitRequest, 79 hideShield: true 80 }); 81 } 82 83 if( $("#recapcha-request-for-test").length ){ 84 widgetRecapchaRequestForTest = window.smartCaptcha.render('recapcha-request-for-test', { 85 sitekey: yaRecapchaSiteKeyModx, 86 invisible: true, 87 callback: onSubmitRequestForTest, 88 hideShield: true 89 }); 90 } 91 92 if( $("#recapcha-question").length ){ 93 widgetRecapchaQuestion = window.smartCaptcha.render('recapcha-question', { 94 sitekey: yaRecapchaSiteKeyModx, 95 invisible: true, 96 callback: onSubmitQuestion, 97 hideShield: true 98 }); 99 } 100 101 if( $("#recapcha-contacts").length ){ 102 widgetRecapchaContacts = window.smartCaptcha.render('recapcha-contacts', { 103 sitekey: yaRecapchaSiteKeyModx, 104 invisible: true, 105 callback: onSubmitContacts, 106 hideShield: true 107 }); 108 } 109 110 if( $("#recapcha-pp-reg-olimp").length ){ 111 widgetRecapchaOlimpReg = window.smartCaptcha.render('recapcha-pp-reg-olimp', { 112 sitekey: yaRecapchaSiteKeyModx, 113 invisible: true, 114 callback: onSubmitOlimpReg, 115 hideShield: true 116 }); 117 } 118 119 if( $("#recapcha-subscribe-bigbox").length ){ 120 // console.log('onSubmitSubscribe'); 121 widgetRecapchaSubscribe = window.smartCaptcha.render('recapcha-subscribe-bigbox', { 122 sitekey: yaRecapchaSiteKeyModx, 123 invisible: true, 124 callback: onSubmitSubscribe, 125 hideShield: true 126 }); 127 } 128 129 if( $("#recapcha-event").length ){ 130 // console.log('onSubmitSubscribe'); 131 widgetRecapchaEvent = window.smartCaptcha.render('recapcha-event', { 132 sitekey: yaRecapchaSiteKeyModx, 133 invisible: true, 134 callback: onSubmitEvent, 135 hideShield: true 136 }); 137 } 138 139 140 if( $("#pageForm1").length ){ 141 widgetRecapchaProductPageForm1 = window.smartCaptcha.render('recapcha-productform-pageForm1', { 142 sitekey: yaRecapchaSiteKeyModx, 143 invisible: true, 144 callback: onSubmitProductForm1, 145 hideShield: true 146 }); 147 } 148 if( $("#pageForm2").length ){ 149 widgetRecapchaProductPageForm2 = window.smartCaptcha.render('recapcha-productform-pageForm2', { 150 sitekey: yaRecapchaSiteKeyModx, 151 invisible: true, 152 callback: onSubmitProductForm2, 153 hideShield: true 154 }); 155 } 156 if( $("#pageForm3").length ){ 157 widgetRecapchaProductPageForm3 = window.smartCaptcha.render('recapcha-productform-pageForm3', { 158 sitekey: yaRecapchaSiteKeyModx, 159 invisible: true, 160 callback: onSubmitProductForm3, 161 hideShield: true 162 }); 163 } 164 if( $("#pageForm4").length ){ 165 widgetRecapchaProductPageForm4 = window.smartCaptcha.render('recapcha-productform-pageForm4', { 166 sitekey: yaRecapchaSiteKeyModx, 167 invisible: true, 168 callback: onSubmitProductForm4, 169 hideShield: true 170 }); 171 } 172 if( $("#pageForm5").length ){ 173 widgetRecapchaProductPageForm5 = window.smartCaptcha.render('recapcha-productform-pageForm5', { 174 sitekey: yaRecapchaSiteKeyModx, 175 invisible: true, 176 callback: onSubmitProductForm5, 177 hideShield: true 178 }); 179 } 180 181 } 182 183 184 function onSubmitEvent(response){ 185 $('.js-event-form input[name="g-recaptcha-response"').val(response); 186 submitFormWithRecapcha('.js-event-form'); 187 } 188 189 190 191 function onSubmitSubscribe(response){ 192 //console.log('onSubmitSubscribe'); 193 $('.js-subscribe-form input[name="g-recaptcha-response"').val(response); 194 submitFormWithRecapcha('.js-subscribe-form'); 195 // $('.js-callback-form').submit(); 196 } 197 198 function onSubmitCallback(response){ 199 $('.js-callback-form input[name="g-recaptcha-response"').val(response); 200 submitFormWithRecapcha('.js-callback-form'); 201 // $('.js-callback-form').submit(); 202 203 } 204 205 function onSubmitDirector(response){ 206 $('.js-director-form input[name="g-recaptcha-response"').val(response); 207 submitFormWithRecapcha('.js-director-form'); 208 } 209 210 function onSubmitRequest(response){ 211 $('.js-request-form input[name="g-recaptcha-response"').val(response); 212 submitFormWithRecapcha('.js-request-form'); 213 } 214 215 function onSubmitRequestForTest(response){ 216 $('.js-request-for-test-form input[name="g-recaptcha-response"').val(response); 217 submitFormWithRecapcha('.js-request-for-test-form'); 218 } 219 220 function onSubmitQuestion(response){ 221 $('.js-question-form input[name="g-recaptcha-response"').val(response); 222 submitFormWithRecapcha('.js-question-form'); 223 } 224 225 function onSubmitContacts(response){ 226 $('.js-contacts-page-form input[name="g-recaptcha-response"').val(response); 227 submitFormWithRecapcha('.js-contacts-page-form'); 228 } 229 230 function onSubmitOlimpReg(response){ 231 $('.js-olimpiada-registration input[name="g-recaptcha-response"').val(response); 232 submitFormWithRecapcha('.js-olimpiada-registration'); 233 } 234 235 236 function onSubmitProductForm1(response){ 237 $('.js-pageForm1 input[name="g-recaptcha-response"').val(response); 238 submitFormWithRecapcha('.js-pageForm1'); 239 } 240 function onSubmitProductForm2(response){ 241 $('.js-pageForm2 input[name="g-recaptcha-response"').val(response); 242 submitFormWithRecapcha('.js-pageForm2'); 243 } 244 function onSubmitProductForm3(response){ 245 $('.js-pageForm3 input[name="g-recaptcha-response"').val(response); 246 submitFormWithRecapcha('.js-pageForm3'); 247 } 248 function onSubmitProductForm4(response){ 249 $('.js-pageForm4 input[name="g-recaptcha-response"').val(response); 250 submitFormWithRecapcha('.js-pageForm4'); 251 } 252 function onSubmitProductForm5(response){ 253 $('.js-pageForm5 input[name="g-recaptcha-response"').val(response); 254 submitFormWithRecapcha('.js-pageForm5'); 255 } 256 257 258 259 260 $.validator.addMethod("isEmailValid", 261 function(value, element) { 262 value = value.replace(/\s/g, ''); 263 $(element).val(value); 264 var EmailRegex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 265 return EmailRegex.test(value); 266 }, 267 ); 268 269 $.validator.addMethod("isCodeValid", 270 function(value, element) { 271 var CodeRegex = /^\d{4}$/; 272 return CodeRegex.test(value); 273 }, 274 ); 275 276 277 $.validator.addMethod("isPassStrong", 278 function(value, element) { 279 return $(element).hasClass('js-iam-strong'); 280 }, 281 ); 282 283 $('.js-registration input[name="user[email]"]').on( "focus", function() { 284 $('.js-registration .email-tip-box').slideDown(300); 285 }); 286 $('.js-registration input[name="user[email]"]').on( "focusout", function() {
287 $('.js-registration .email-tip-box').slideUp(300); 288 }); 289 290 291 292 $('.js-registration input[name="user[password]"]').on( "focus", function() { 293 294 let thCriteriaBox = $(this).parents('form').find('.password-tips-box'); 295 if( !thCriteriaBox.parents('form').find('input[name="user[password]"]').hasClass('js-iam-strong') ){ 296 thCriteriaBox.slideDown(300); 297 } 298 299 }); 300 301 $('.js-registration input[name="user[password]"]').on( "focusout", function(){ 302 let thCriteriaBox = $(this).parents('form').find('.password-tips-box'); 303 checkPasswordCriteria($(this)); 304 setTimeout(function(){ 305 if( $('.js-registration input[name="user[password]"]').hasClass('js-iam-strong') ){ 306 thCriteriaBox.slideUp(300); 307 $('.js-registration input[name="user[password]"]').removeClass('error'); 308 } else { 309 thCriteriaBox.slideDown(300); 310 $('.js-registration input[name="user[password]"]').addClass('error'); 311 } 312 },200) 313 }); 314 315 $('.js-prefooter-registration input[name="user[password]"]').on( "focus", function() { 316 let thCriteriaBox = $(this).parents('form').find('.password-tips-box'); 317 if( !thCriteriaBox.parents('form').find('input[name="user[password]"]').hasClass('js-iam-strong') ){ 318 thCriteriaBox.addClass('show'); 319 } 320 321 }); 322 323 $('.js-prefooter-registration input[name="user[password]"]').on( "focusout", function(){ 324 let thCriteriaBox = $(this).parents('form').find('.password-tips-box'); 325 checkPasswordCriteria($(this)); 326 setTimeout(function(){ 327 if( $('.js-prefooter-registration input[name="user[password]"]').hasClass('js-iam-strong') ){ 328 329 $('.js-prefooter-registration input[name="user[password]"]').removeClass('error'); 330 } else { 331 //thCriteriaBox.addClass('show'); 332 $('.js-prefooter-registration input[name="user[password]"]').addClass('error'); 333 } 334 thCriteriaBox.removeClass('show'); 335 336 },200) 337 }); 338 339 340 341 function checkPasswordCriteria(input){ 342 // console.log(input.val()); 343 344 let isMeValid = false; 345 346 let isCriteriaValidLength = false; 347 let isCriteriaValidUC = false; 348 let isCriteriaValidLC = false; 349 let isCriteriaValidDigit = false; 350 let isCriteriaValidChar = false; 351 let isCriteriaValidDigitSeq = false; 352 353 let thCriteriaBox = input.parents('form').find('.password-tips-box'); 354 let value = input.val(); 355 356 357 358 let lengthMin = 8; 359 let alphabetsCriteriaUC = /([A-Z])/; 360 let alphabetsCriteriaLC = /([a-z])/; 361 let numberCriteria = /([0-9])/; 362 let charsCriteria = /[!"$%&'()+,\-.\/:;<=>?@\[\]^_{|}~`]+/; 363 364 365 if( value.length < lengthMin ){ 366 thCriteriaBox.find('.password-criteria[data-criteria="1"]').removeClass('password-criteria-ok'); 367 isCriteriaValidLength = false; 368 } else { 369 thCriteriaBox.find('.password-criteria[data-criteria="1"]').addClass('password-criteria-ok'); 370 isCriteriaValidLength = true; 371 } 372 373 if( !value.match(alphabetsCriteriaUC)){ 374 thCriteriaBox.find('.password-criteria[data-criteria="2"]').removeClass('password-criteria-ok'); 375 isCriteriaValidUC = false; 376 } else { 377 thCriteriaBox.find('.password-criteria[data-criteria="2"]').addClass('password-criteria-ok'); 378 isCriteriaValidUC = true; 379 } 380 381 if( !value.match(alphabetsCriteriaLC)){ 382 thCriteriaBox.find('.password-criteria[data-criteria="3"]').removeClass('password-criteria-ok'); 383 isCriteriaValidLC = false; 384 } else { 385 thCriteriaBox.find('.password-criteria[data-criteria="3"]').addClass('password-criteria-ok'); 386 isCriteriaValidLC = true; 387 } 388 389 if( !value.match(numberCriteria)){ 390 thCriteriaBox.find('.password-criteria[data-criteria="4"]').removeClass('password-criteria-ok'); 391 isCriteriaValidDigit = false; 392 } else { 393 thCriteriaBox.find('.password-criteria[data-criteria="4"]').addClass('password-criteria-ok'); 394 isCriteriaValidDigit = true; 395 } 396 397 if( !value.match(charsCriteria)){ 398 thCriteriaBox.find('.password-criteria[data-criteria="5"]').removeClass('password-criteria-ok'); 399 isCriteriaValidChar = false; 400 } else { 401 thCriteriaBox.find('.password-criteria[data-criteria="5"]').addClass('password-criteria-ok'); 402 isCriteriaValidChar = true; 403 } 404 405 if(checkPasswordSequence(value)){ 406 thCriteriaBox.find('.password-criteria[data-criteria="6"]').removeClass('password-criteria-ok'); 407 isCriteriaValidDigitSeq = false;
408 } else { 409 thCriteriaBox.find('.password-criteria[data-criteria="6"]').addClass('password-criteria-ok'); 410 isCriteriaValidDigitSeq = true; 411 } 412 413 if( value.length == 0 ){ 414 isCriteriaValidDigitSeq = false; 415 thCriteriaBox.find('.password-criteria[data-criteria="6"]').removeClass('password-criteria-ok'); 416 } 417 418 419 420 421 if( isCriteriaValidLength && isCriteriaValidUC && isCriteriaValidLC && isCriteriaValidDigit && isCriteriaValidChar && isCriteriaValidDigitSeq ){ 422 input.addClass('js-iam-strong'); 423 if( input.attr('id') == "prefooterpassword" ){ 424 thCriteriaBox.removeClass('show'); 425 } else { 426 thCriteriaBox.slideUp(300); 427 } 428 } else { 429 input.removeClass('js-iam-strong'); 430 if( input.attr('id') == "prefooterpassword" ){ 431 thCriteriaBox.addClass('show'); 432 } else { 433 thCriteriaBox.slideDown(300); 434 } 435 } 436 } 437 438 439 function checkPasswordSequence(value){ 440 let possbleSeqs = ["01234","12345","23456","34567","45678","56789","67890"]; 441 let isContain = false; 442 $.each(possbleSeqs, function(key, posSeq) { 443 if( value.indexOf(posSeq) != -1 ){ 444 isContain = true; 445 } 446 }); 447 return isContain; 448 } 449 450 451 let validPassLengthAuth = 6; 452 let validPassLengthAuthMessage = 'Ðлина паÑÐ¾Ð»Ñ Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¼ÐµÐ½ÑÑе 6-Ñи Ñимволов'; 453 454 let validPassLengthReg = 8; 455 let validPassLengthRegMessage = "Ðлина паÑÐ¾Ð»Ñ Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¼ÐµÐ½ÑÑе 8-ми Ñимволов"; 456 457 458 try { 459 $('.js-callback-form').validate({ 460 rules: { 461 ['name']: { 462 required: true, 463 }, 464 ['phone']: { 465 required: true, 466 itiPhoneValidation: true 467 }, 468 ['callbackForm-agree']: { 469 required: true, 470 } 471 }, 472 473 messages: { 474 ['name']: { 475 required: 'ÐаполниÑе ÑÑо поле', 476 }, 477 ['phone']: { 478 required: 'ÐаполниÑе ÑÑо поле', 479 itiPhoneValidation: 'ÐепÑавилÑнÑй номеÑ' 480 }, 481 ['callbackForm-agree']: { 482 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 483 } 484 }, 485 submitHandler: function(form) { 486 window.smartCaptcha.execute(widgetRecapchaCallback); 487 } 488 }) 489 } catch (e) {} 490 491 try { 492 $('.js-contacts-page-form').validate({ 493 rules: { 494 ['name']: { 495 required: true, 496 }, 497 ['phone']: { 498 required: true, 499 itiPhoneValidation: true 500 }, 501 ['contactsPageForm-agree']: { 502 required: true, 503 } 504 }, 505 506 messages: { 507 ['name']: { 508 required: 'ÐаполниÑе ÑÑо поле', 509 }, 510 ['phone']: { 511 required: 'ÐаполниÑе ÑÑо поле', 512 itiPhoneValidation: 'ÐепÑавилÑнÑй номеÑ' 513 }, 514 ['contactsPageForm-agree']: { 515 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 516 } 517 }, 518 submitHandler: function(form) { 519 window.smartCaptcha.execute(widgetRecapchaContacts); 520 } 521 }) 522 } catch (e) {} 523 524 525 try { 526 $('.js-request-form').validate({ 527 rules: { 528 ['name']: { 529 required: true, 530 }, 531 ['email']: { 532 required: true, 533 isEmailValid: true, 534 }, 535 ['phone']: { 536 required: true, 537 itiPhoneValidation: true 538 }, 539 ['requestForm-agree']: { 540 required: true, 541 } 542 }, 543 544 messages: { 545 ['name']: { 546 required: 'ÐаполниÑе ÑÑо поле', 547 }, 548 ['email']: { 549 required: 'ÐаполниÑе ÑÑо поле', 550 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 551 }, 552 ['phone']: { 553 required: 'ÐаполниÑе ÑÑо поле', 554 itiPhoneValidation: 'ÐепÑавилÑнÑй номеÑ' 555 }, 556 ['requestForm-agree']: { 557 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 558 }, 559 }, 560 submitHandler: function(form) { 561 window.smartCaptcha.execute(widgetRecapchaRequest); 562 } 563 }) 564 } catch (e) {} 565 566 try { 567 $('.js-request-for-test-form').validate({ 568 rules: { 569 ['name']: { 570 required: true, 571 }, 572 ['email']: { 573 required: true, 574 isEmailValid: true, 575 }, 576 ['phone']: { 577 required: true, 578 itiPhoneValidation: true 579 }, 580 ['requestForTestForm-agree']: { 581 required: true, 582 } 583 }, 584 585 messages: { 586 ['name']: { 587 required: 'ÐаполниÑе ÑÑо поле', 588 }, 589 ['email']: { 590 required: 'ÐаполниÑе ÑÑо поле', 591 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 592 }, 593 ['phone']: { 594 required: 'ÐаполниÑе ÑÑо поле', 595 itiPhoneValidation: 'ÐепÑавилÑнÑй номеÑ' 596 }, 597 ['requestForTestForm-agree']: { 598 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 599 } 600 }, 601 submitHandler: function(form) { 602 window.smartCaptcha.execute(widgetRecapchaRequestForTest); 603 } 604 }) 605 } catch (e) {} 606 607 608 try { 609 $('.js-olimpiada-registration').validate({ 610 //ignore: ":hidden:not([name='tours[]'],[name='subjects[]'])", 611 rules: { 612 ['surname']: { 613 required: true, 614 }, 615 ['email']: { 616 required: true, 617 isEmailValid: true, 618 }, 619 ['name']: { 620 required: true, 621 }, 622 ['middlename']: { 623 required: true, 624 }, 625 ['class']: { 626 required: true, 627 }, 628 ['city']: { 629 required: true, 630 }, 631 ['subjects']: { 632 required: true, 633 }, 634 ['tours']: { 635 required: true, 636 }, 637 ['olimpiadaRegistrationForm-agree']: { 638 required: true, 639 } 640 }, 641 642 messages: { 643 ['surname']: { 644 required: 'ÐаполниÑе ÑÑо поле', 645 }, 646 ['name']: { 647 required: 'ÐаполниÑе ÑÑо поле', 648 }, 649 ['middlename']: { 650 required: 'ÐаполниÑе ÑÑо поле', 651 }, 652 ['class']: { 653 required: 'ÐаполниÑе ÑÑо поле', 654 }, 655 ['city']: { 656 required: 'ÐаполниÑе ÑÑо поле', 657 }, 658 ['subjects']: { 659 required: 'ÐаполниÑе ÑÑо поле', 660 }, 661 ['tours']: { 662 required: 'ÐаполниÑе ÑÑо поле', 663 }, 664 ['email']: { 665 required: 'ÐаполниÑе ÑÑо поле', 666 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 667 }, 668 ['olimpiadaRegistrationForm-agree']: { 669 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 670 } 671 }, 672 submitHandler: function(form) { 673 window.smartCaptcha.execute(widgetRecapchaOlimpReg); 674 } 675 }) 676 } catch (e) {} 677 678 679 680 try { 681 $('.js-director-form').validate({ 682 rules: { 683 684 ['name']: { 685 required: true, 686 }, 687 ['email']: { 688 required: true, 689 isEmailValid: true, 690 }, 691 ['message']: { 692 required: true, 693 }, 694 ['directorForm-agree']: { 695 required: true, 696 } 697 698 }, 699 700 messages: { 701 ['name']: { 702 required: 'ÐаполниÑе ÑÑо поле', 703 }, 704 ['message']: { 705 required: 'ÐаполниÑе ÑÑо поле', 706 }, 707 ['email']: { 708 required: 'ÐаполниÑе ÑÑо поле', 709 isEmailValid: true, 710 }, 711 ['directorForm-agree']: { 712 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 713 } 714 }, 715 submitHandler: function(form) { 716 window.smartCaptcha.execute(widgetRecapchaDirector); 717 } 718 }) 719 } catch (e) {} 720 721 722 try { 723 $('.js-question-form').validate({ 724 rules: { 725 726 ['name']: { 727 required: true, 728 }, 729 ['email']: { 730 required: true, 731 isEmailValid: true, 732 }, 733 ['question']: { 734 required: true, 735 }, 736 ['questionForm-agree']: { 737 required: true, 738 } 739 740 }, 741 742 messages: { 743 ['name']: { 744 required: 'ÐаполниÑе ÑÑо поле', 745 }, 746 ['question']: { 747 required: 'ÐаполниÑе ÑÑо поле', 748 }, 749 ['email']: { 750 required: 'ÐаполниÑе ÑÑо поле', 751 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 752 }, 753 ['questionForm-agree']: { 754 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 755 } 756 }, 757 submitHandler: function(form) { 758 window.smartCaptcha.execute(widgetRecapchaQuestion); 759 } 760 }) 761 } catch (e) {} 762 763 764 765 try { 766 $('.js-pp-password-restore').validate({ 767 rules: { 768 ['email']: { 769 required: true, 770 isEmailValid: true, 771 }, 772 }, 773 774 messages: { 775 ['email']: { 776 required: 'ÐаполниÑе ÑÑо поле', 777 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 778 }, 779 }, 780 }) 781 } catch (e) {} 782 783 784 try { 785 $('.js-auth').validate({ 786 rules: { 787 "user[email]": { 788 required: true, 789 isEmailValid: true, 790 }, 791 "user[password]": { 792 required: true, 793 minlength: validPassLengthAuth 794 }, 795 }, 796 797 messages: { 798 "user[email]": { 799 required: "ÐÑо поле должно бÑÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¾", 800 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 801 }, 802 "user[password]": { 803 required: "ÐÑо поле должно бÑÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¾", 804 minlength: validPassLengthAuthMessage 805 }, 806 }, 807 }) 808 } catch (e) {} 809 810 811 try { 812 $('.js-registration').validate({ 813 ignore: ( 814 typeof hideSelectInRegister !== 'undefined' && 815 hideSelectInRegister == true 816 ) 817 ? ":hidden" 818 : ":hidden:not([name='reg-interest-select'])", 819 820 highlight: function(element) { 821 $(element).addClass('error'); 822 823 if (element.name === 'reg-interest-select') { 824 $(element).siblings('.select-styled').addClass('error'); 825 } 826 }, 827 828 unhighlight: function(element) { 829 $(element).removeClass('error'); 830 831 if (element.name === 'reg-interest-select') { 832 $(element).siblings('.select-styled').removeClass('error'); 833 } 834 }, 835 836 errorPlacement: function(error, element) { 837 if (element.attr('name') === 'reg-interest-select') { 838 error.insertAfter(element.siblings('.select-styled')); 839 } else { 840 error.insertAfter(element); 841 } 842 }, 843 rules: { 844 "user[email]": { 845 required: true, 846 isEmailValid: true, 847 }, 848 "user[password]": { 849 required: true, 850 isPassStrong: true 851 }, 852 "user[phone]": { 853 required: true, 854 itiPhoneValidationRegPP: true 855 }, 856 "reg-interest-select": { 857 required: true, 858 }, 859 ['registrationForm-agree']: { 860 required: true, 861 } 862 863 }, 864 onkeyup: function(element){ 865 if (element.name == 'user[password]') { 866 checkPasswordCriteria($('.js-registration input[name="user[password]"]')); 867 } 868 869 870 }, 871 messages: { 872 "user[email]": { 873 required: "ÐÑо поле должно бÑÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¾", 874 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 875 }, 876 "user[password]": { 877 required: "ÐÑо поле должно бÑÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¾", 878 isPassStrong: "СоздайÑе безопаÑнÑй паÑолÑ" 879 }, 880 "user[phone]": { 881 required: "ÐÑо поле должно бÑÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¾", 882 itiPhoneValidationRegPP: "ÐведиÑе коÑÑекÑнÑй Ð½Ð¾Ð¼ÐµÑ ÑелеÑона" 883 }, 884 "reg-interest-select": { 885 required: "ÐÑо поле должно бÑÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¾", 886 }, 887 ['registrationForm-agree']: { 888 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 889 } 890 }, 891 }) 892 } catch (e) {} 893 894 895 try { 896 $('.js-prefooter-registration').validate({ 897 rules: { 898 "user[email]": { 899 required: true, 900 isEmailValid: true, 901 }, 902 "user[password]": { 903 required: true, 904 isPassStrong: true 905 }, 906 "user[phone]": { 907 required: true, 908 itiPhoneValidationRegPrefooter: true 909 }, 910 ['prefooterRegistrationForm-agree']: { 911 required: true, 912 } 913 }, 914 onkeyup: function(element){ 915 if (element.name == 'user[password]') { 916 checkPasswordCriteria($('.js-prefooter-registration input[name="user[password]"]')); 917 } 918 919 }, 920 messages: { 921 "user[email]": { 922 required: "ÐÑо поле должно бÑÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¾", 923 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 924 }, 925 "user[password]": { 926 required: "ÐÑо поле должно бÑÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¾", 927 isPassStrong: "" 928 }, 929 "user[phone]": { 930 required: "ÐÑо поле должно бÑÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¾", 931 itiPhoneValidationRegPrefooter: "ÐведиÑе коÑÑекÑнÑй Ð½Ð¾Ð¼ÐµÑ ÑелеÑона" 932 }, 933 ['prefooterRegistrationForm-agree']: { 934 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 935 } 936 }, 937 }) 938 } catch (e) {} 939 940 941 942 try { 943 setTimeout(function(){ //изза ÑендеÑа внÑÑÑи конÑенÑа ÑÑаÑÑи 944 $('.js-subscribe-article').validate({ 945 rules: { 946 "email": { 947 required: true, 948 isEmailValid: true, 949 }, 950 ['subscribeArticleForm-agree']: { 951 required: true, 952 } 953 }, 954 955 messages: { 956 "email": { 957 required: "ÐÑо поле должно бÑÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¾", 958 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 959 }, 960 ['subscribeArticleForm-agree']: { 961 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 962 } 963 } 964 }) 965 }, 500); 966 967 } catch (e) {} 968 969 970 try { 971 972 $('.js-subscribe-form').validate({ 973 rules: { 974 "email": { 975 required: true, 976 isEmailValid: true, 977 }, 978 ['subscribeForm-agree']: { 979 required: true, 980 } 981 }, 982 983 messages: { 984 "email": { 985 required: "ÐÑо поле должно бÑÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¾", 986 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 987 }, 988 ['subscribeForm-agree']: { 989 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 990 } 991 }, 992 submitHandler: function(form) { 993 // console.log('1'); 994 window.smartCaptcha.execute(widgetRecapchaSubscribe); 995 } 996 }) 997 998 } catch (e) {} 999 1000 1001 1002 try { 1003 $('.js-event-form').validate({ 1004 rules: { 1005 ['name']: { 1006 required: true, 1007 }, 1008 ['email']: { 1009 required: true, 1010 isEmailValid: true, 1011 }, 1012 ['class']: { 1013 required: true 1014 }, 1015 ['eventForm-agree']: { 1016 required: true, 1017 } 1018 }, 1019 1020 messages: { 1021 ['name']: { 1022 required: 'ÐаполниÑе ÑÑо поле', 1023 }, 1024 ['email']: { 1025 required: 'ÐаполниÑе ÑÑо поле', 1026 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 1027 }, 1028 ['class']: { 1029 required: 'ÐаполниÑе ÑÑо поле', 1030 }, 1031 ['eventForm-agree']: { 1032 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 1033 } 1034 }, 1035 submitHandler: function(form) { 1036 window.smartCaptcha.execute(widgetRecapchaEvent); 1037 } 1038 }) 1039 } ca
1039tch (e) {} 1040 1041 1042 1043 1044 try { 1045 $('.js-pageForm1').validate({ 1046 rules: { 1047 ['name']: { 1048 required: true, 1049 }, 1050 ['email']: { 1051 required: true, 1052 isEmailValid: true, 1053 }, 1054 ['phone']: { 1055 required: true, 1056 itiPhoneValidation: true 1057 }, 1058 ['pageForm1-agree']: { 1059 required: true, 1060 } 1061 }, 1062 1063 messages: { 1064 ['name']: { 1065 required: 'ÐаполниÑе ÑÑо поле', 1066 }, 1067 ['email']: { 1068 required: 'ÐаполниÑе ÑÑо поле', 1069 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 1070 }, 1071 ['phone']: { 1072 required: 'ÐаполниÑе ÑÑо поле', 1073 itiPhoneValidation: 'ÐепÑавилÑнÑй номеÑ' 1074 }, 1075 ['pageForm1-agree']: { 1076 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 1077 } 1078 }, 1079 submitHandler: function(form) { 1080 window.smartCaptcha.execute(widgetRecapchaProductPageForm1); 1081 } 1082 }) 1083 } catch (e) {} 1084 1085 1086 try { 1087 $('.js-pageForm2').validate({ 1088 rules: { 1089 ['name']: { 1090 required: true, 1091 }, 1092 ['email']: { 1093 required: true, 1094 isEmailValid: true, 1095 }, 1096 ['phone']: { 1097 required: true, 1098 itiPhoneValidation: true 1099 }, 1100 ['pageForm2-agree']: { 1101 required: true, 1102 } 1103 }, 1104 1105 messages: { 1106 ['name']: { 1107 required: 'ÐаполниÑе ÑÑо поле', 1108 }, 1109 ['email']: { 1110 required: 'ÐаполниÑе ÑÑо поле', 1111 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 1112 }, 1113 ['phone']: { 1114 required: 'ÐаполниÑе ÑÑо поле', 1115 itiPhoneValidation: 'ÐепÑавилÑнÑй номеÑ' 1116 }, 1117 ['pageForm2-agree']: { 1118 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 1119 } 1120 }, 1121 submitHandler: function(form) { 1122 window.smartCaptcha.execute(widgetRecapchaProductPageForm2); 1123 } 1124 }) 1125 } catch (e) {} 1126 1127 1128 try { 1129 $('.js-pageForm3').validate({ 1130 rules: { 1131 ['name']: { 1132 required: true, 1133 }, 1134 ['email']: { 1135 required: true, 1136 isEmailValid: true, 1137 }, 1138 ['phone']: { 1139 required: true, 1140 itiPhoneValidation: true 1141 }, 1142 ['pageForm3-agree']: { 1143 required: true, 1144 } 1145 }, 1146 1147 messages: { 1148 ['name']: { 1149 required: 'ÐаполниÑе ÑÑо поле', 1150 }, 1151 ['email']: { 1152 required: 'ÐаполниÑе ÑÑо поле', 1153 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 1154 }, 1155 ['phone']: { 1156 required: 'ÐаполниÑе ÑÑо поле', 1157 itiPhoneValidation: 'ÐепÑавилÑнÑй номеÑ' 1158 }, 1159 ['pageForm3-agree']: { 1160 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 1161 } 1162 }, 1163 submitHandler: function(form) { 1164 window.smartCaptcha.execute(widgetRecapchaProductPageForm3); 1165 } 1166 }) 1167 } catch (e) {} 1168 1169 1170 try { 1171 $('.js-pageForm4').validate({ 1172 rules: { 1173 ['name']: { 1174 required: true, 1175 }, 1176 ['email']: { 1177 required: true, 1178 isEmailValid: true, 1179 }, 1180 ['phone']: { 1181 required: true, 1182 itiPhoneValidation: true 1183 }, 1184 ['pageForm4-agree']: { 1185 required: true, 1186 } 1187 }, 1188 1189 messages: { 1190 ['name']: { 1191 required: 'ÐаполниÑе ÑÑо поле', 1192 }, 1193 ['email']: { 1194 required: 'ÐаполниÑе ÑÑо поле', 1195 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 1196 }, 1197 ['phone']: { 1198 required: 'ÐаполниÑе ÑÑо поле', 1199 itiPhoneValidation: 'ÐепÑавилÑнÑй номеÑ' 1200 }, 1201 ['pageForm4-agree']: { 1202 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 1203 } 1204 }, 1205 submitHandler: function(form) { 1206 window.smartCaptcha.execute(widgetRecapchaProductPageForm4); 1207 } 1208 }) 1209 } catch (e) {} 1210 1211 1212 try { 1213 $('.js-pageForm5').validate({ 1214 rules: { 1215 ['name']: { 1216 required: true, 1217 }, 1218 ['email']: { 1219 required: true, 1220 isEmailValid: true, 1221 }, 1222 ['phone']: { 1223 required: true, 1224 itiPhoneValidation: true 1225 }, 1226 ['pageForm5-agree']: { 1227 required: true, 1228 } 1229 }, 1230 1231 messages: { 1232 ['name']: { 1233 required: 'ÐаполниÑе ÑÑо поле', 1234 }, 1235 ['email']: { 1236 required: 'ÐаполниÑе ÑÑо поле', 1237 isEmailValid: "ÐведиÑе коÑÑекÑнÑй email" 1238 }, 1239 ['phone']: { 1240 required: 'ÐаполниÑе ÑÑо поле', 1241 itiPhoneValidation: 'ÐепÑавилÑнÑй номеÑ' 1242 }, 1243 ['pageForm5-agree']: { 1244 required: 'ÐодÑвеÑдиÑе ÑÐ²Ð¾Ñ ÑоглаÑие на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ ', 1245 } 1246 }, 1247 submitHandler: function(form) { 1248 window.smartCaptcha.execute(widgetRecapchaProductPageForm5); 1249 } 1250 }) 1251 } catch (e) {} 1252 1253 1254 1255 1256 1257 function submitFormWithRecapcha(selector){ 1258 var form = $(selector); 1259 $(selector).ajaxSubmit({ 1260 method: 'POST', 1261 dataType: 'json', 1262 // data: data,
1263 url: '/assets_hs/components/ajaxform/action.php', 1264 beforeSerialize: function () { 1265 if( !form.find('input[name="productId"]').length ){ 1266 $(form).append( 1267 $('<input type="hidden">').attr({ 1268 name: "productId", 1269 value: $('.headermenu-js').attr('data-mb-product') 1270 }) 1271 ); 1272 } 1273 1274 if( form.find('input[name="productId"]').val() == '' ){ 1275 form.find('input[name="productId"]').val($('.headermenu-js').attr('data-mb-product')); 1276 } 1277 1278 form.find(':submit').each(function () { 1279 if (!form.find('input[type="hidden"][name="' + $(this).attr('name') + '"]').length) { 1280 $(form).append( 1281 $('<input type="hidden">').attr({ 1282 name: $(this).attr('name'), 1283 value: $(this).attr('value') 1284 }) 1285 ); 1286 } 1287 }) 1288 }, 1289 beforeSubmit: function (fields) { 1290 //noinspection JSUnresolvedVariable 1291 if (typeof(afValidated) != 'undefined' && afValidated == false) { 1292 return false; 1293 } 1294 form.find('.error').html(''); 1295 form.find('.error').removeClass('error'); 1296 form.find('input,textarea,select,button').attr('disabled', true); 1297 1298 1299 1300 return true; 1301 }, 1302 success: function (response, status, xhr) { 1303 form.find('input,textarea,select,button').attr('disabled', false); 1304 response.form = form; 1305 $(document).trigger('af_complete', response); 1306 if (!response.success) { 1307 AjaxForm.Message.error(response.message); 1308 if (response.data) { 1309 var key, value, focused; 1310 for (key in response.data) { 1311 if (response.data.hasOwnProperty(key)) { 1312 if (!focused) { 1313 form.find('[name="' + key + '"]').focus(); 1314 focused = true; 1315 } 1316 value = response.data[key]; 1317 form.find('.error_' + key).html(value).addClass('error'); 1318 form.find('[name="' + key + '"]').addClass('error'); 1319 } 1320 } 1321 } 1322 } 1323 else { 1324 1325 if( form.hasClass('js-callback-form') ){ 1326 $('.pp[data-pp="callback"]').removeClass('show'); 1327 $('.pp[data-pp="callback-thanks"]').addClass('show'); 1328 1329 if( form.attr('data-yatargetsubmit') && form.attr('data-yatargetsubmit') != '' ){ 1330 if(typeof ym != 'undefined'){ 1331 ym(39474735, 'reachGoal', form.attr('data-yatargetsubmit')); 1332 } 1333 } 1334 1335 if(typeof ym != 'undefined'){ 1336 ym(39474735, 'reachGoal', 'CALLBACKOK'); 1337 //if(typeof gtag != 'undefined'){ 1338 // gtag('event', 'CALLBACKOK', { 1339 // 'event_category': 'callbackok', 1340 // 'event_label': 'request', 1341 // 'value': 2 1342 // }); 1343 //} 1344 1345 } 1346 } 1347 1348 if( form.hasClass('js-request-form') ){ 1349 $('.pp[data-pp="request"]').removeClass('show'); 1350 $('.pp[data-pp="request-thanks"]').addClass('show'); 1351 1352 if( form.attr('data-yatargetsubmit') && form.attr('data-yatargetsubmit') != '' ){ 1353 if(typeof ym != 'undefined'){ 1354 ym(39474735, 'reachGoal', form.attr('data-yatargetsubmit')); 1355 1356 let event_category = ''; 1357 let event_label = ''; 1358 1359 if( form.attr('data-yatargetsubmit') == 'REQTUTOK') { 1360 event_category = 'reqtutok'; 1361 event_label = 'request'; 1362 } 1363 1364 if( form.attr('data-yatargetsubmit') == 'REQPRESCHOK') { 1365 event_category = 'reqpreschok'; 1366 event_label = 'request'; 1367 } 1368 if( form.attr('data-yatargetsubmit') == 'REQGIAOK') { 1369 event_category = 'reqgiaok'; 1370 event_label = 'request'; 1371 } 1372 1373 //if(typeof gtag != 'undefined'){ 1374 // gtag('event', form.attr('data-yatargetsubmit'), { 1375 // 'event_category': event_category, 1376 // 'event_label': event_label, 1377 // 'value': 4 1378 // }); 1379 //} 1380 } 1381 } 1382 1383 if( form.find('input[name="flocktorySpot"]').val() !='' && isFlocktoryImpactcForms){ 1384 let thSpot = form.find('input[name="flocktorySpot"]').val(); 1385 let thName = form.find('input[name="name"]').val(); 1386 let thPhone = form.find('input[name="phone"]').val(); 1387 let thEmail = form.find('input[name="email"]').val(); 1388 $('body').append('<div class="i-flocktory" data-fl-action="exchange" data-fl-spot="'+thSpot+'" data-fl-user-name="'+thName+'" data-fl-user-email="'+thEmail+'" data-fl-user-phone="'+thPhone+'"></div>'); 1389 } 1390 1391 1392 } 1393 1394 1395 if( form.hasClass('js-request-for-test-form') ){ 1396 $('.pp[data-pp="request-for-test"]').removeClass('show'); 1397 $('.pp[data-pp="request-for-test-thanks"]').addClass('show'); 1398 1399 if( form.attr('data-yatargetsubmit') && form.attr('data-yatargetsubmit') != '' ){ 1400 if(typeof ym != 'undefined'){ 1401 ym(39474735, 'reachGoal', form.attr('data-yatargetsubmit')); 1402 1403 let event_category = ''; 1404 let event_label = ''; 1405 1406 //if(typeof gtag != 'undefined'){ 1407 // gtag('event', form.attr('data-yatargetsubmit'), { 1408 // 'event_category': event_category, 1409 // 'event_label': event_label, 1410 // 'value': 4 1411 // }); 1412 //} 1413 } 1414 } 1415 1416 if( form.find('input[name="flocktorySpot"]').val() !='' && isFlocktoryImpactcForms){ 1417 let thSpot = form.find('input[name="flocktorySpot"]').val(); 1418 let thName = form.find('input[name="name"]').val(); 1419 let thPhone = form.find('input[name="phone"]').val(); 1420 let thEmail = form.find('input[name="email"]').val(); 1421 $('body').append('<div class="i-flocktory" data-fl-action="exchange" data-fl-spot="'+thSpot+'" data-fl-user-name="'+thName+'" data-fl-user-email="'+thEmail+'" data-fl-user-phone="'+thPhone+'"></div>'); 1422 } 1423 1424 1425 } 1426 1427 1428 1429 if( form.hasClass('js-director-form') ){ 1430 $('.pp[data-pp="director-request"]').removeClass('show'); 1431 $('.pp[data-pp="director-request-thanks"]').addClass('show'); 1432 } 1433 1434 1435 1436 if( form.hasClass('js-question-form') ){ 1437 $('.pp[data-pp="question"]').removeClass('show'); 1438 $('.pp[data-pp="question-thanks"]').addClass('show'); 1439 } 1440 1441 if( form.hasClass('js-event-form') ){ 1442 $('.pp[data-pp="event"]').removeClass('show'); 1443 $('.pp[data-pp="event-thanks"]').addClass('show'); 1444 1445 if(form.find('input[name="productId"]').val() !="" && form.find('input[name="productId"]').length){ 1446 if( typeof mindbox != 'undefined' && $('.headermenu-js').attr('data-mb-product') != form.find('input[name="productId"]').val() ){ 1447 mindbox("sync", { 1448 operation: "Website.ViewProduct", 1449 data: { 1450 viewProduct: { 1451 price: "", 1452 product: { 1453 ids: { 1454 interneturokWebsite: form.find('input[name="productId"]').val(), 1455 } 1456 } 1457 } 1458 } 1459 }); 1460 1461 } 1462 } 1463 1464 1465 1466 1467 } 1468 1469 if( form.hasClass('js-contacts-page-form') ){ 1470 $('.pp[data-pp="callback"]').removeClass('show'); 1471 $('.pp[data-pp="callback-thanks"]').addClass('show'); 1472 } 1473 1474 if( form.hasClass('js-form-show-thx-after') ){ 1475 $('.pp[data-pp="request-thanks"]').addClass('show'); 1476 } 1477 1478 if( form.hasClass('js-olimpiada-registration') ){ 1479 $('.pp[data-pp="olimp-registration"]').removeClass('show'); 1480 $('.pp[data-pp="olimp-registration-thanks"]').addClass('show'); 1481 1482 $('.js-olimpiada-reg-step[data-step="2"]').removeClass('active'); 1483 $('.js-olimpiada-reg-step[data-step="1"]').addClass('active'); 1484 $('.js-olimp-back').removeClass('active'); 1485 1486 if(typeof ym != 'undefined'){ 1487 ym(39474735, 'reachGoal', 'REGOLYMPOK'); 1488 } 1489 1490 1491 } 1492 1493 if( form.hasClass('js-subscribe-form') ){ 1494 // console.log('subscribe'); 1495 let thParent = form.parents('.js-subscribe-form-parent'); 1496 thParent.find('.subsribe-bigbox-title').text('СпаÑибо! ФоÑма ÑÑпеÑно оÑпÑавлена!'); 1497 } 1498 1499 1500 if( form.hasClass('js-subscribe-bigbox-form-serial') ){ 1501 if(typeof ym != 'undefined'){ 1502 ym(39474735, 'reachGoal', 'SERIAL'); 1503 } 1504 } 1505 1506 1507 if( form.hasClass('js-subsribe-bigbox-psychology') ){ 1508 if(typeof ym != 'undefined'){ 1509 ym(39474735, 'reachGoal', 'PSY'); 1510 } 1511 } 1512 1513 1514 if( form.hasClass('js-subsribe-bigbox-psychology') ){ 1515 if(typeof ym != 'undefined'){ 1516 ym(39474735, 'reachGoal', 'PSY'); 1517 } 1518 } 1519 1520 1521 1522 1523 1524 if( form.hasClass('js-pageForm1') || form.hasClass('js-pageForm2') || form.hasClass('js-pageForm3') || form.hasClass('js-pageForm4') || form.hasClass('js-pageForm5') ){ 1525 let thParent = form.parents('.section-form-wrapper'); 1526 thParent.find('.section-form-title').html("ÐаÑе ÑообÑение оÑпÑавлено.<br/>ÐÑ ÑвÑжемÑÑ Ñ Ð²Ð°Ð¼Ð¸ в ближайÑее вÑемÑ.").addClass('sent'); 1527 thParent.find('.section-form-fields').hide(); 1528 if( form.attr('data-yatargetsubmit') && form.attr('data-yatargetsubmit') != '' ){ 1529 if(typeof ym != 'undefined'){ 1530 ym(39474735, 'reachGoal', form.attr('data-yatargetsubmit')); 1531 } 1532 } 1533 1534 if( form.find('input[name="flocktorySpot"]').val() !='' && isFlocktoryImpactcForms){ 1535 let thSpot = form.find('input[name="flocktorySpot"]').val(); 1536 let thName = form.find('input[name="name"]').val(); 1537 let thPhone = form.find('input[name="phone"]').val(); 1538 let thEmail = form.find('input[name="email"]').val(); 1539 $('body').append('<div class="i-flocktory" data-fl-action="exchange" data-fl-spot="'+thSpot+'" data-fl-user-name="'+thName+'" data-fl-user-email="'+thEmail+'" data-fl-user-phone="'+thPhone+'"></div>'); 1540 } 1541 1542 if( form.hasClass('css-isbigview') ){ 1543 let thParentbv = form.parents('.subsribe-bigbox'); 1544 thParentbv.find('.subsribe-bigbox-title').text(thParentbv.find('.subsribe-bigbox-title').attr('data-tnx')); 1545 thParentbv.find('.subsribe-bigbox-text').text(thParentbv.find('.subsribe-bigbox-text').attr('data-tnx')); 1546 thParentbv.find('.subsribe-bigbox-form').hide(); 1547 1548 } 1549 1550 } 1551 1552 //if( form.hasClass('js-request-form') || form.hasClass('js-request-for-test-form')){ 1553 // let name = form.find('input[name="name"]').val(); 1554 // let email = form.find('input[name="email"]').val(); 1555 // let productId = $('.headermenu-js').attr('data-mb-product'); 1556 // let phone = form.find('input[type="hidden"][name="phone"]').val(); 1557 // let interestedInProduct = form.find('input[name="interestedIn"]').val(); 1558 // 1559 // if( form.find('input[name="productId"]').val() && form.find('input[name="productId"]').val() != '' ){ 1560 // productId = form.find('input[name="productId"]').val(); 1561 // } 1562 // 1563 // if( typeof mindbox != 'undefined' ){ 1564 // mindbox("sync", { 1565 // operation: "Website.RegisterCustomer", 1566 // data: { 1567 // customer: { 1568 // email: email, 1569 // firstName: name, 1570 // mobilePhone: phone, 1571 // customFields: { 1572 // formOnThePage: { 1573 // formOnThePage: { 1574 // value: productId 1575 // } 1576 // }, 1577 // interestedInProduct: { 1578 // value: interestedInProduct 1579 // } 1580 // }, 1581 // subscriptions: [ 1582 // { 1583 // pointOfContact: "Email" 1584 // } 1585 // ] 1586 // } 1587 // } 1588 // }); 1589 // } 1590 // 1591 // 1592 // 1593 //} 1594 1595 1596 form.find('.error').removeClass('error'); 1597 form[0].reset(); 1598 1599 form.find('select').each(function(){ 1600 var thTitle = $(this).attr('data-title'); 1601 if( thTitle && thTitle != '' ){ 1602 $(this).parent().find('.select-styled').removeClass('cho
1602osed').text(thTitle); 1603 $(this).val(''); 1604 } else { 1605 $(this).parent().find('.select-styled').removeClass('choosed').text($(this).children('option').eq(0).text()); 1606 $(this).val($(this).children('option').eq(0).attr('value')); 1607 } 1608 // $(this).parent().find('.select-styled').removeClass('choosed').text(thTitle); 1609 }) 1610 1611 1612 if (window.smartCaptcha) { 1613 // console.log('smart Captcha reset'); 1614 window.smartCaptcha.reset; 1615 $('input[name="smart-token"]').val(''); 1616 } 1617 } 1618 } 1619 }); 1620 1621 1622} 1623 1624 1625 1626 1627 1628$.extend($.validator.messages, { 1629 required: "ÐаполниÑе ÑÑо поле", 1630 remote: "ÐожалÑйÑÑа, иÑпÑавÑÑе ÑÑо поле", 1631 email: "ÐведиÑе коÑÑекÑнÑй email", 1632 url: "ÐожалÑйÑÑа, введиÑе дейÑÑвиÑелÑнÑй URL", 1633 date: "ÐожалÑйÑÑа, введиÑе пÑавилÑнÑÑ Ð´Ð°ÑÑ", 1634 dateISO: "ÐожалÑйÑÑа, введиÑе пÑавилÑнÑÑ Ð´Ð°ÑÑ (ISO)", 1635 number: "ÐожалÑйÑÑа, введиÑе дейÑÑвиÑелÑнÑй номеÑ", 1636 digits: "ÐожалÑйÑÑа, введиÑе ÑолÑко ÑиÑÑÑ", 1637 creditcard: "ÐожалÑйÑÑа, введиÑе дейÑÑвиÑелÑнÑй Ð½Ð¾Ð¼ÐµÑ ÐºÑедиÑной каÑÑÑ", 1638 equalTo: "ÐожалÑйÑÑа, введиÑе Ñо же знаÑение еÑе Ñаз", 1639 accept: "ÐожалÑйÑÑа, введиÑе знаÑение Ñ Ð´Ð¾Ð¿ÑÑÑимÑм ÑаÑÑиÑением", 1640 maxlength: $.validator.format("ÐведиÑе не более {0} Ñимволов"), 1641 minlength: $.validator.format("ÐведиÑе не менее {0} Ñимволов"), 1642 rangelength: $.validator.format("ÐведиÑе знаÑение Ð¾Ñ {0} до {1} Ñимволов"), 1643 range: $.validator.format("ÐведиÑе знаÑение Ð¾Ñ {0} до {1}"), 1644 max: $.validator.format("ÐожалÑйÑÑа, введиÑе знаÑение, менÑÑее или Ñавное {0}"), 1645 min: $.validator.format("ÐожалÑйÑÑа, введиÑе знаÑение болÑÑе или Ñавное {0}") 1646}); 1647 1648 1649})
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.