PageSourceSearch

https://avtodom.by/assets/js/call-back.js

js avtodom.by collected 2026-10-05 05:19:19 UTC 2,412 bytes, 81 lines download raw bytes

1function showCallBackForm() {
2
3    var modalHtml = "<div class='modal-wrap'>";
4    modalHtml += "<div class='modal-form'>";
5
6    modalHtml += "<div class='modal-callback-header'>Перезвоним в ближайшее время и ответим на Ваши вопросы!</div>";
7
8    modalHtml += "<div class='modal-callback-despcription'>Менеджер перезвонит вам в ближайшее время</div>";
9
10    modalHtml += "<div class='modal-img-wrap'><img src='https://avtodom.by/assets/images/callback.jpg'></div>"
11
12
13    modalHtml += "<div class='modal-form-wrap'><div class='modal-form-input-phone'>+375<input type='phone' placeholder='xx xxx-xx-xx' maxlength='9'></div><button class='modal-form-button'>ЖДУ ЗВОНКА!</button></div>"
14
15    modalHtml += '</div>';
16    modalHtml += "</div>";
17
18
19    $( "body" ).append(modalHtml);
20
21
22    $('.modal-wrap').off('click');
23    $('.modal-wrap').on('click', function() {
24        $('.modal-wrap').remove();
25    });
26
27    $('.modal-form').on('click', function() {
28        return false;
29    });
30
31    $(".modal-form-input-phone input").keypress(function (e){
32        var charCode = (e.which) ? e.which : e.keyCode;
33        if (charCode > 31 && (charCode < 48 || charCode > 57)) {
34          return false;
35        }
36    });
37
38
39    $('.modal-form-button').off('click');
40    $('.modal-form-button').on('click', function() {
41        var phone  = "+375"+$('.modal-form-input-phone input').val();
42        if (phone.length != 13) {
43            alert("Не верно указан телефон");
44            return
45        }
46
47        if (sending == true) {
48            return;
49        }
50
51        var sending = true;
52
53        $.ajax({
54            url: '/api/leads',
55            type: 'POST',
56            data: JSON.stringify({
57                phone: phone, type: "call", name: "None"
58            }),
59            contentType: 'application/json; charset=utf-8',
60            dataType: 'json',
61            async: false,
62            success: function(msg) {
63                alert("Запрос отправлен. Мы свяжемся с вами в ближайшее время!");
64                sending = false
65            }
66        });
67    });
68
69}
70
71$(document).ready(function() {
72
73    $('.ph_zacaz').on('click', function() {
74        showCallBackForm();
75    })
76
77    $('.btn_zacaz').on('click', function() {
78        showCallBackForm();
79    });
80});
81

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.