1$(document).ready(function(){ 2 3 $("input[type='email'], input[type='text'], input[type='password'], textarea", "form").focus(function() 4 { 5 $(this).parent().removeClass("has-error"); 6 }); 7}); 8 9$(window).on("load", function() { 10 cur_pos = $(document).scrollTop(); 11 $("input.urlpage").val(location.href); 12}); 13 14 15$(document).on('change', "form input[type='file'].flat", 16 function() 17 { 18 var inp = $(this); 19 var btn = inp.parent(); 20 var lbl = btn.find("span.ex-file"); 21 var file_api = (window.File && window.FileReader && window.FileList && window.Blob) ? true : false; 22 23 if (file_api && inp[0].files[0]) 24 file_name = inp[0].files[0].name; 25 else{ 26 file_name = inp.val().replace("C:\\fakepath\\", ''); 27 } 28 29 if (!file_name.length) 30 return; 31 32 if (lbl.is(":visible")) { 33 lbl.text(file_name); 34 35 } 36 else{ 37 btn.text(file_name); 38 } 39 40 inp.parents(".clearfile-parent").find('input.phoenix_file_del').val(''); 41 42 43 btn.addClass('focus-anim for-download'); 44 inp.parents(".clearfile-parent").find(".clearfile").addClass('on'); 45 } 46); 47 48$(document).on('change', ".form.send input[type='file']", 49 function(){ 50 51 var inp = $(this); 52 var file_list_name = ""; 53 54 $(inp[0].files).each( 55 function(key){ 56 file_list_name += "<span>"+inp[0].files[key].name+"</span><br/>"; 57 } 58 ); 59 60 61 if(!file_list_name.length) 62 return; 63 64 inp.parents('form.send').addClass('file-download'); 65 inp.parents('label').find('.area-files-name').html(file_list_name); 66 inp.parents('label').removeClass("area-file"); 67 inp.closest('.load-file').removeClass("has-error"); 68 69 } 70); 71 72$(document).on("click", "div.wrap-agree input[type='checkbox']", function() { 73 $(this).parents("div.wrap-agree").removeClass("has-error"); 74}); 75 76function validGroupCheckbox(arParams){ 77 78 var error = 0; 79 80 for (key in arParams){ 81 82 var cheked = false; 83 84 for (var i = 0; i < arParams[key].length; i++){ 85 86 if(arParams[key][i].checked) 87 cheked = true; 88 } 89 90 if(!cheked) 91 { 92 if(error == 0) 93 error = 1; 94 95 for (var i = 0; i < arParams[key].length; i++){ 96 97 $(arParams[key][i]).addClass('has-error'); 98 } 99 } 100 } 101 102 return error; 103} 104 105function validGroupSelect(arParams){ 106 var error = 0; 107 108 for (key in arParams){ 109 110 var cheked = false; 111 112 for (var i = 0; i < arParams[key].length; i++){ 113 114 if(arParams[key][i].checked) 115 cheked = true; 116 } 117 118 if(!cheked) 119 { 120 if(error == 0) 121 error = 1; 122 123 $(arParams[key][0]).parents(".form-select").addClass('has-error'); 124 } 125 } 126 return error; 127} 128 129function sendForm(arParams) 130{ 131 var error = 0, 132 formSendAll = new FormData(); 133 134 135 formSendAll.append("send", "Y"); 136 formSendAll.append("element", arParams.form_block.attr("id").replace("form-", "")); 137 formSendAll.append("tmpl_path", $("input.tmpl_path").val()); 138 formSendAll.append("typeForm", arParams.typeForm); 139 formSendAll.append("fromBasket", arParams.fromBasket); 140 formSendAll.append("site_id", $("input.site_id").val()); 141 formSendAll.append("url", location.href); 142 143 144 145 for (var i = 1; i <= 10; i++) { 146 if($("input#custom-input-"+i).val().length>0) 147 formSendAll.append("custom-input-"+i, $("input#custom-input-"+i).val()); 148 } 149 150 for (var i = 1; i <= 3; i++) { 151 if($("input#custom-dynamic-input-"+i).val().length>0) 152 formSendAll.append("custom-dynamic-input-"+i, $("input#custom-dynamic-input-"+i).val()); 153 } 154 155 156 if (typeof(arParams.agreecheck.val()) != "undefined") { 157 if (!arParams.agreecheck.prop("checked")) { 158 arParams.agreecheck.parents("div.wrap-agree").addClass("has-error"); 159 error = 1; 160 } 161 } 162 163 $("input[type='email'], input[type='text'], input[type='password'], textarea", arParams.form_block).each( 164 function(key, value) 165 { 166 if ($(this).hasClass("email") && $(this).val().length > 0) { 167 if (!( 168 /^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,15}$/i 169 ).test($(this).val())) { 170 $(this).parent("div.input").addClass("has-error"); 171 error = 1; 172 } 173 } 174 if ($(this).hasClass("require")) { 175 if ($(this).val().trim().length <= 0){ 176 $(this).val(""); 177 $(this).parent("div.input").addClass("has-error"); 178 error = 1; 179 } 180 } 181 } 182 ); 183 184 $("input[type='file']", arParams.form_block).each(function(key, value) 185 { 186 187 if ($(this).hasClass("require")) 188 { 189 190 if ($(this).closest('.load-file').find('.area-file').length>0) { 191 $(this).closest('.load-file').addClass("has-error"); 192 error = 1; 193 } 194 } 195 }); 196 197 if (!$('.phoenix-modal').hasClass('form-modal')) 198 { 199 var otherHeight = 0; 200 if ($('header').hasClass('fixed')) 201 otherHeight = $('.fix-board').outerHeight( 202 true); 203 } 204 205 206 var arChecbox = {}, newKey = null; 207 208 $("input.check-require[type='checkbox']", arParams.form_block).each( 209 function(key, value) 210 { 211 newKey = $(this).attr('name').replace("[]", ""); 212 213 if(typeof arChecbox[newKey] == "undefined") 214 arChecbox[newKey] = []; 215 216 arChecbox[newKey].push(this); 217 } 218 ); 219 220 if(newKey && !error) 221 error = validGroupCheckbox(arChecbox); 222 223 delete arChecbox; 224 newKey = null; 225 226 var arRadio = {}; 227 $(".select-require input.opinion[type='radio']", arParams.form_block).each( 228 function(key, value) 229 { 230 newKey = $(this).attr('name'); 231 232 if(typeof arRadio[newKey] == "undefined") 233 arRadio[newKey] = []; 234 235 arRadio[newKey].push(this); 236 } 237 ); 238 239 if(newKey && !error) 240 error = validGroupSelect(arRadio); 241 242 delete arRadio; 243 newKey = null; 244 245 246 if (error == 1) 247 { 248 249 if ($('.phoenix-modal').hasClass('form-modal')) 250 { 251 formAttentionScroll( 252 arParams.form_block.find('.has-error:first').offset().top - arParam
252s.form_block.parents('.phoenix-modal-dialog').offset().top, 253 ".phoenix-modal"); 254 } 255 else if (arParams.form_block.hasClass('form-cart')) 256 { 257 formAttentionScroll( 258 arParams.form_block.find('.has-error:first').offset().top - arParams.form_block.find(".body").offset().top, 259 ".cart-parent"); 260 } 261 else 262 { 263 formAttentionScroll(arParams.form_block.find('.has-error:first').offset().top - otherHeight, 264 "html:not(:animated), body:not(:animated)"); 265 266 } 267 } 268 269 if (error == 0) 270 { 271 272 273 arParams.form_block.css({ 274 "height": arParams.form_block.outerHeight() + "px" 275 }); 276 277 278 var form_arr = arParams.form_block.find(':input,select,textarea').serializeArray(); 279 280 for (var i = 0; i < form_arr.length; i++) 281 { 282 if (form_arr[i].value.length > 0) 283 { 284 formSendAll.append(form_arr[i].name, form_arr[i].value); 285 } 286 }; 287 288 if (arParams.form_block.hasClass('file-download')) 289 { 290 arParams.form_block.find('input[type=file]').each(function(key) 291 { 292 293 var inp = $(this); 294 var file_list_name = ""; 295 296 $(inp[0].files).each( 297 function(k){ 298 formSendAll.append(inp.attr('name'), inp[0].files[k], inp[0].files[k].name); 299 } 300 ); 301 302 }); 303 } 304 305 if(arParams.captchaToken.length>0) 306 formSendAll.append("captchaToken", arParams.captchaToken); 307 308 309 arParams.button.removeClass("active"); 310 arParams.load.addClass("active"); 311 312 setTimeout(function() 313 { 314 $.ajax({ 315 url: arParams.path, 316 method: 'POST', 317 contentType: false, 318 processData: false, 319 data: formSendAll, 320 dataType: 'json', 321 success: function(json) 322 { 323 if(typeof (json.OK) != "undefined" ) 324 { 325 console.log(json.CAPTCHA_SCORE); 326 327 if(json.OK == "N") 328 { 329 arParams.button.addClass("active"); 330 arParams.load.removeClass("active"); 331 } 332 333 if (json.OK == "Y") 334 { 335 336 if(arParams.typeForm != "fast_order") 337 { 338 arParams.questions.removeClass("active"); 339 arParams.thank.addClass("active"); 340 341 if(typeof(arParams.linkHREF) != "undefined") 342 { 343 if(typeof(arParams.linkHREFNew) != "undefined") 344 { 345 if(arParams.linkHREFNew == "Y") 346 { 347 setTimeout(function() { 348 window.open(arParams.linkHREF, '_blank'); 349 }, 1000); 350 } 351 } 352 else 353 { 354 setTimeout(function() { 355 window.location.href = arParam
355s.linkHREF; 356 }, 3300); 357 } 358 359 } 360 } 361 $.ajax({ 362 url: "/bitrix/tools/concept.phoenix/ajax/ajax_hit_page.php", 363 method: 'POST', 364 success: function(json) {} 365 }); 366 367 368 setTimeout(function() 369 { 370 if ($('.phoenix-modal').hasClass('form-modal')) 371 formAttentionScroll(arParams.form_block.find('.thank').offset().top - arParams.form_block.parents( 372 '.phoenix-modal-dialog').offset().top, ".phoenix-modal"); 373 else if (arParams.form_block.hasClass('form-cart')) { 374 formAttentionScroll(arParams.form_block.find('.thank').offset().top - arParams.form_block.find( 375 ".body").offset().top, ".cart-parent"); 376 } else { 377 formAttentionScroll(arParams.form_block.find('.thank').offset().top - 378 otherHeight, "html:not(:animated),body:not(:animated)"); 379 } 380 }, 300); 381 382 383 if(typeof(json.SCRIPTS) != "undefined") 384 { 385 if (json.SCRIPTS.length > 0) 386 { 387 $('body').append("<script>"+json.SCRIPTS+"</script>"); 388 } 389 } 390 391 resetCustomDynamicInputs(); 392 393 } 394 395 if(arParams.typeForm == "fast_order") 396 { 397 if (arParams.fromBasket == "Y") 398 { 399 400 if (typeof(json.CUR_PAGE) != "undefined") 401 { 402 if(json.CUR_PAGE.length>0) 403 { 404 window.location.href = json.CUR_PAGE; 405 } 406 } 407 } 408 else 409 { 410 411 if (typeof(json.TEXT_THANK) != "undefined") 412 { 413 if(json.TEXT_THANK.length>0) 414 { 415 arParams.questions.removeClass("active"); 416 arParams.thank.html(json.TEXT_THANK); 417 arParams.thank.addClass("active"); 418 } 419 } 420 } 421 } 422 423 424 } 425 } 426 }); 427 428 }, 1000); 429 } 430 431} 432 433$(document).on("click", ".btn-submit", function() 434{ 435 var form = $(this).parents("form.send"), 436 typeForm = "", 437 fromBasket = "", 438 paramsForm = {}; 439 440 if(form.length>0) 441 { 442 443 if($(this).hasClass('fast-order')) 444 typeForm = "fast_order"; 445 446 if($(this).hasClass('fast-order-basket')) 447 { 448 fromBasket = "Y"; 449 typeForm = "fast_order"; 450 } 451 452 453 paramsForm = 454 { 455 form_block: form, 456 typeForm: typeForm, 457 fromBasket: fromBasket, 458 path: "/bitrix/tools/concept.phoenix/ajax/form_send.php", 459 button: $(this), 460 linkHREF: $(this).attr("data-link"), 461 linkHREFNew: $(this).attr("data-link-new"), 462 header: $("input[name='header']", form), 463 agreecheck: $("input.agreecheck", form), 464 questions: $("div.questions", form), 465 load: $("div.load", form), 466 thank: $("div.thank", form), 467 captchaToken: "" 468 }; 469 470 471 if($("body").hasClass('captcha')) 472 { 473 grecaptcha.execute($(".captcha-site-key").val(), {action: 'homepage'}).then(function(token) { 474 475 paramsForm.captchaToken = token; 476 sendForm(paramsForm); 477 }); 478 } 479 else{ 480 sendForm(paramsForm); 481 } 482 483 } 484 485 486 487}); 488 489 490 491$(document).on("focus", "input[type='email'], input[type='text'], input[type='password'], textarea", function() { 492 $(this).parent("div.input").removeClass("has-error"); 493 if ($(this).val().length <= 0 && !$(this).hasClass("phone")) { 494 $(this).attr("data-placeholder", $(this).attr("placeholder")); 495 $(this).attr("placeholder", ""); 496 } 497}); 498$(document).on("blur", "input[type='email'], input[type='text'], input[type='password'], textarea", function() { 499 if ($(this).val().length <= 0 && !$(this).hasClass("phone")) $(this).attr( 500 "placeholder", $(this).attr("data-placeholder")); 501}); 502$(document).on("keypress", "form.form div.count input", function(e) { 503 e = e || event; 504 if (e.ctrlKey || e.altKey || e.metaKey) return; 505 var chr = getChar(e); 506 if (chr == null) return; 507 if (chr < '0' || chr > '9') { 508 return false;
509 } 510}); 511$(document).on("keyup", "form.form div.count input", function(e) { 512 var value = $(this).val().toString(); 513 var newVal = ""; 514 for (var i = 0; i < value.length; i++) { 515 if (value[i] == "0" || value[i] == "1" || value[i] == "2" || value[i] == 516 "3" || value[i] == "4" || value[i] == "5" || value[i] == "6" || value[i] == 517 "7" || value[i] == "8" || value[i] == "9") newVal += value[i]; 518 } 519 if (newVal == 0) newVal = 1; 520 $(this).val(newVal); 521 if ($(this).val() == "") $(this).parent().addClass('in-focus'); 522}); 523$(document).on("click", "form.form div.count span.plus", function(e) { 524 var input = $(this).parent("div.count").find("input"); 525 var value = parseFloat(input.val()); 526 if (isNaN(value)) value = 0; 527 value += 1; 528 input.val(value); 529 if ($(this).val() == "") $(this).parent().addClass('in-focus'); 530}); 531$(document).on("click", "form.form div.count span.minus", function(e) { 532 var input = $(this).parent("div.count").find("input"); 533 var value = parseFloat(input.val()); 534 if (isNaN(value)) value = 0; 535 value -= 1; 536 if (value < 0) value = ''; 537 if (value == 0) value = 1; 538 input.val(value); 539}); 540$(document).on("keypress", ".only-num", function(e) { 541 e = e || event; 542 if (e.ctrlKey || e.altKey || e.metaKey) return; 543 var chr = getChar(e); 544 if (chr == null) return; 545 if (chr < '0' || chr > '9') { 546 return false; 547 } 548}); 549$(document).on("focus", "input.focus-anim, textarea.focus-anim", function() { 550 if ($(this).val() == "") $(this).parent().addClass('in-focus'); 551}); 552$(document).on("blur", "input.focus-anim, textarea.focus-anim", function() { 553 element = $(this); 554 setTimeout(function() { 555 if (element.val() == "") element.parent().removeClass('in-focus'); 556 }, 200); 557}); 558 559function showModalDialog(target){ 560 startBlurWrapperContainer(); 561 $(".phx-modal-dialog[data-target='"+target+"']").addClass('active'); 562 var timer = setTimeout(function() { 563 $(".phx-modal-dialog[data-target='"+target+"']").addClass('show'); 564 clearTimeout(timer); 565 }, 300); 566} 567function closeModalDialog(target){ 568 569 $(".phx-modal-dialog[data-target='"+target+"']").removeClass('show'); 570 var timer = setTimeout(function() { 571 $(".phx-modal-dialog[data-target='"+target+"']").removeClass('active'); 572 stopBlurWrapperContainer(); 573 clearTimeout(timer); 574 }, 300); 575} 576 577$(document).on("click", ".show-phx-modal-dialog", function() 578{ 579 showModalDialog($(this).attr("data-target")); 580}); 581$(document).on("click", ".close-phx-modal-dialog", function() 582{ 583 closeModalDialog($(this).attr("data-target")); 584}); 585 586 587 588$(document).on("click", ".auth-submit", function() 589{ 590 var form = $(this).parents("form.auth"), 591 er_block = $("div.errors", form), 592 login = $("input[name='auth-login']", form), 593 password = $("input[name='auth-password']", form), 594 error = 0, 595 count = 0, 596 button = $("button", form), 597 load = $("div.load", form); 598 599 $("input[type='text'], input[type='password']", form).each( 600 function() 601 { 602 603 if($(this).hasClass("email") && $(this).val().length > 0) 604 { 605 if(!(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,15}$/i).test($(this).val())) 606 { 607 $(this).parent("div.input").addClass("has-error"); 608 error = 1; 609 610 count++; 611 612 if(count == 1) 613 { 614 $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500); 615 } 616 } 617 } 618 619 620 if($(this).hasClass("require")) 621 { 622 if($(this).val().length <= 0) 623 { 624 $(this).parent("div.input").addClass("has-error"); 625 error = 1; 626 627 count++; 628 629 if(count == 1) 630 { 631 $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500); 632 } 633 } 634 } 635 } 636 ); 637 638 639 if(error == 0) 640 { 641 button.removeClass('active'); 642 load.addClass('active'); 643 644 $.post( 645 "/bitrix/tools/concept.phoenix/ajax/personal/auth.php", 646 { 647 "send": "Y", 648 "login": login.val(), 649 "password": password.val(), 650 "site_id": $("input.site_id").val() 651 }, 652 function(data) 653 { 654 if(data.OK == "N") 655 { 656 er_block.html(data.ERROR); 657 button.addClass('active'); 658 load.removeClass('active'); 659 } 660 661 if(data.OK == "Y") 662 { 663 location.href = location.href; 664 } 665 }, 666 "json" 667 ); 668 } 669 670 return false;
671}); 672 673$(document).on("click", ".register-submit", function() 674{ 675 var form = $(this).parents("form.reg-form"), 676 wr_form = form.parents("div.reg-page"), 677 er_block = $("div.errors", wr_form), 678 name = $("input[name='bx-name']", form), 679 password = $("input[name='bx-password']", form), 680 email = $("input[name='bx-email']", form), 681 error = 0, 682 count = 0, 683 button = $("button", form), 684 load = $("div.load", form); 685 686 687 688 if($("input.agreecheck", form).length>0) 689 { 690 agreecheck = $("input.agreecheck", form); 691 692 if (!agreecheck.prop("checked")) { 693 agreecheck.parents("div.wrap-agree").addClass("has-error"); 694 error = 1; 695 } 696 } 697 698 699 $("input[type='email'], input[type='text'], input[type='password']", form).each( 700 function() 701 { 702 703 if($(this).hasClass("email") && $(this).val().length > 0) 704 { 705 if(!(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,15}$/i).test($(this).val())) 706 { 707 $(this).parent("div.input").addClass("has-error"); 708 error = 1; 709 710 count++; 711 712 if(count == 1) 713 { 714 $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500); 715 } 716 } 717 } 718 719 720 if($(this).hasClass("require")) 721 { 722 if($(this).val().length <= 0) 723 { 724 $(this).parent("div.input").addClass("has-error"); 725 error = 1; 726 727 count++; 728 729 if(count == 1) 730 { 731 $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500); 732 } 733 } 734 } 735 } 736 ); 737 738 var captchaToken = ""; 739 740 if(error == 0) 741 { 742 743 button.removeClass("active"); 744 load.addClass('active'); 745 746 if($("body").hasClass('captcha')) 747 { 748 grecaptcha.execute($(".captcha-site-key").val(), {action: 'homepage'}).then(function(token) { 749 captchaToken = token; 750 751 $.post( 752 "/bitrix/tools/concept.phoenix/ajax/personal/reg.php", 753 { 754 "send": "Y",
755 "bx-name": name.val(), 756 "bx-email": email.val(), 757 "bx-password": password.val(), 758 "site_id": $("input.site_id").val(), 759 "captchaToken": captchaToken 760 }, 761 function(data) 762 { 763 if(data.OK == "N") 764 { 765 er_block.html(data.ERROR); 766 $('html, body').animate({ scrollTop: er_block.offset().top - 100 }, 500); 767 button.addClass("active"); 768 load.removeClass('active'); 769 } 770 771 if(data.OK == "Y") 772 { 773 location.href = data.HREF; 774 } 775 776 }, 777 "json" 778 ); 779 }); 780 } 781 782 else 783 { 784 $.post( 785 "/bitrix/tools/concept.phoenix/ajax/personal/reg.php", 786 { 787 "send": "Y",
788 "bx-name": name.val(), 789 "bx-email": email.val(), 790 "bx-password": password.val(), 791 "site_id": $("input.site_id").val() 792 }, 793 function(data) 794 { 795 if(data.OK == "N") 796 { 797 er_block.html(data.ERROR); 798 $('html, body').animate({ scrollTop: er_block.offset().top - 100 }, 500); 799 button.addClass("active"); 800 load.removeClass('active'); 801 } 802 803 if(data.OK == "Y") 804 { 805 location.href = data.HREF; 806 } 807 808 }, 809 "json" 810 ); 811 } 812 813 814 815 } 816 817 return false; 818 819}); 820 821 822 823$(document).on("click", ".changepassword-submit", function() 824{ 825 var form = $(this).parents("form.changepassword"), 826 wr_form = form.parents("div.changepassword"), 827 er_block = $("div.errors", wr_form), 828 suc_block = $("div.success", wr_form), 829 login = $("input[name='USER_LOGIN']", form), 830 checkword = $("input[name='USER_CHECKWORD']", form), 831 password = $("input[name='USER_PASSWORD']", form), 832 password_confirm = $("input[name='USER_CONFIRM_PASSWORD']", form), 833 error = 0, 834 count = 0, 835 button = $("button", form), 836 load = $("div.load", form); 837 838 839 $("input[type='password']", form).each( 840 function() 841 { 842 if($(this).hasClass("require")) 843 { 844 if($(this).val().length <= 0) 845 { 846 $(this).parent("div.input").addClass("has-error"); 847 error = 1; 848 849 count++; 850 851 if(count == 1) 852 { 853 $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500); 854 } 855 } 856 } 857 } 858 ); 859 860 861 862 if(error == 0) 863 { 864 865 button.removeClass("active"); 866 load.addClass('active'); 867 868 $.post( 869 "/bitrix/tools/concept.phoenix/ajax/personal/changepassword.php", 870 { 871 "send": "Y", 872 "login": login.val(), 873 "password": password.val(), 874 "password_confirm": password_confirm.val(), 875 "checkword": checkword.val(), 876 "site_id": $("input.site_id").val() 877 }, 878 function(data) 879 { 880 if(data.OK == "N") 881 { 882 if(data.ERRORS) 883 { 884 var errors_html = ""; 885 886 for( var i in data.ERRORS ) 887 { 888 errors_html += "<div class='er-policy-item'>"+data.ERRORS[i]+"</div>"; 889 } 890 891 er_block.show().html('<div class="er-policy">'+errors_html+"</div>"); 892 893 $('html, body').animate({ scrollTop: er_block.offset().top - 100 }, 500); 894 } 895 896 897 suc_block.hide(); 898 form.show(); 899 button.addClass("active"); 900 load.removeClass('active'); 901 } 902 903 if(data.OK == "Y") 904 { 905 er_block.hide(); 906 form.hide(); 907 suc_block.show().html(data.SUCCESS); 908 909 $.ajax({ 910 url: "/bitrix/tools/concept.phoenix/ajax/ajax_hit_page.php", 911 method: 'POST', 912 success: function(json) {} 913 }); 914 } 915 916 }, 917 "json" 918 ); 919 } 920 921 return false; 922 923}); 924 925 926$(document).on("click", ".forgotpassword-submit", function() 927{ 928 var form = $(this).parents("form.forgotpassword"), 929 wr_form = form.parents("div.forgetpass"), 930 er_block = $("div.errors", wr_form), 931 suc_block = $("div.success", wr_form), 932 desc_block = $(".description-change-form", wr_form), 933 login = $("input[name='USER_LOGIN']", form), 934 error = 0, 935 count = 0, 936 button = $("button", form), 937 load = $("div.load", form); 938 939 940 $("input[type='text']", form).each( 941 function() 942 { 943 if($(this).hasClass("require")) 944 { 945 if($(this).val().length <= 0) 946 { 947 $(this).parent("div.input").addClass("has-error"); 948 error = 1; 949 950 count++; 951 952 if(count == 1) 953 { 954 $('html, body').animate({ scrollTop: $(this).offset().top - 100 }, 500); 955 } 956 } 957 } 958 } 959 ); 960 961 if(error == 0) 962 { 963 964 button.removeClass("active"); 965 load.addClass('active'); 966 967 $.post( 968 "/bitrix/tools/concept.phoenix/ajax/personal/forgotpassword.php", 969 { 970 "send": "Y", 971 "login": login.val(), 972 "site_id": $("input.site_id").val() 973 }, 974 function(data) 975 { 976 977 if(data.OK == "N") 978 { 979 er_block.show().html(data.ERRORS); 980 suc_block.hide(); 981 desc_block.show(); 982 form.show(); 983 button.addClass("active"); 984 load.removeClass('active'); 985 } 986 987 if(data.OK == "Y") 988 { 989 desc_block.hide(); 990 er_block.hide(); 991 form.hide(); 992 suc_block.show().html(data.SUCCESS); 993 } 994 995 }, 996 "json" 997 ); 998 } 999 1000 return false;
1001 1002});
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.