PageSourceSearch

https://camper-market.ru/bitrix/templates/concept_phoenix_s1/js/forms.js

js camper-market.ru collected 2026-10-07 19:40:21 UTC 30,362 bytes, 986 lines download raw bytes

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

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.