PageSourceSearch

https://dposs.ru/static/js/init.js

js dposs.ru collected 2026-10-09 22:44:15 UTC 2,789 bytes, 92 lines download raw bytes

1/**
2 * Created by Mike86k on 16.06.2014.
3 */
4
5
6function defaultErrorHandler(){
7    var msg = 'Ошибка!\nОшибка сервера или проблемы с интернет-соиденеием.\nПовторите попытку позже или свяжитесь снами.';
8    alert(msg);
9}
10
11
12$(function(){
13
14    $(".fancybox").fancybox({
15//		openEffect	: 'none',
16//		closeEffect	: 'none'
17	});
18
19    if( $(window).width() >= 1200 ){
20        $(".mobile-menu").unstick();
21        $(".sticky").sticky();
22    }else{
23        $(".sticky").unstick();
24        $(".mobile-menu").sticky();
25    }
26
27
28
29    $(document).on('click', '.js-close', function(event){
30        event.preventDefault();
31        $.fancybox.close( true );
32    });
33
34
35    $('.js-reverse-call').fancybox({
36        type: 'ajax',
37        beforeShow: afterReverseCallFormLoaded,
38        helpers: {
39            overlay : {
40                closeClick : false
41            }
42        }
43    });
44
45
46    function afterReverseCallFormLoaded(){
47        var $form = $('.js-reverse-call-form');
48        $form.validate({
49            rules: {
50                name: {required: true},
51                phone: {required: true}
52            },
53            errorPlacement: function(){}
54        });
55        $form.find('input[name=phone]').mask("+d (ddd) ddd-dd-dd",{placeholder:"_"});
56        $form.on('submit', onReverseCallFormSubmit);
57
58    }
59
60
61    function onReverseCallFormSubmit(event){
62        event.preventDefault();
63        var $form = $(this);
64        if( $form.valid() ){
65            var data = $form.serialize();
66            $form.find('input, button, a').prop('disabled', true);
67            $.ajax({
68                url: $form.prop('action'),
69                data: data,
70                type: 'post',
71                dataType: 'json',
72                success: function(response){
73                    if( response.status == 'ok' ){
74                        $form.hide();
75                        $form.next('div').show();
76                        yaCounter29458435.reachGoal('order_call');
77                        console.log('ya reach goal order_call');
78//                        $.fancybox.close( true );
79//                        alert( 'Спасибо за ваш заказ!\nВ ближайшее время с Вами свяжется наш оператор.' );
80                    }else{
81                        alert(response.message);
82//                        defaultErrorHandler();
83                    }
84                },
85                error: defaultErrorHandler,
86                complete: function(){
87                    $form.find('input, button, a').prop('disabled', false);
88                }
89            })
90        }
91    }
92});

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.