PageSourceSearch

https://gazoptika.ru/local/templates/main/script.js

js gazoptika.ru collected 2026-09-28 14:39:08 UTC 2,857 bytes, 93 lines download raw bytes

1
2$(document).ready(function(){
3    loaderCnt = 0;
4
5    // Прокидываем название услуги в форму записи
6    /*$('#order_window').on('show.bs.modal', function (event) {
7      const button = $(event.relatedTarget);
8      const serviceName = button.data('service-name');
9      const modal = $(this);
10      modal.find('.modal-body input[name="service"]').val(serviceName);
11    });*/
12});
13
14// Отправка форм аяксом
15function sendFormByAjax(form, successFunc, errorFunc){
16    var data = {};
17    $.each($(form).serializeArray(), function(key, field){
18        data[field.name] = field.value;
19    });
20
21    data['formName'] = $(form).data('name');
22
23    $.ajax({
24        type: 'POST',
25        url: '/includes/ajax.php',
26        data: {
27            action: 'sendFormByAjax',
28            params: data
29        },
30        dataType: 'json',
31        beforeSend: function(){
32            showLoader(true);
33        },
34        complete: function(){
35            showLoader(false);
36        },
37        success: function(result){
38            showLoader(false);
39            showMessage(result.success, result.message, result.title);
40            if (result.success) {
41                if (typeof successFunc == 'function') {
42                    successFunc();
43                }
44                // Очистка полей
45                $.each($('input, textarea', form), function(key, field){
46                    $(field).val('');
47                });
48            } else {
49                if (typeof errorFunc == 'function') {
50                    errorFunc();
51                }
52            }
53        }
54    });
55}
56
57// Всплывающие сообщения
58function showMessage(success, message, title){
59    var dialog = $('#messageWindow');
60    dialog.find('.modal-body').html('<p>' + message + '</p>');
61    if(success){
62        var title = title ? title : 'Успех';
63        dialog.find('.modal-title').text(title);
64        dialog.find('.modal-body p').addClass('text-success');
65    }else{
66        var title = title ? title : 'Ошибка';
67        dialog.find('.modal-title').text(title);
68        dialog.find('.modal-body p').addClass('text-danger');
69    }
70    dialog.modal('show');
71}
72
73// Загрузчик
74function showLoader(show){
75    if(show){
76        loaderCnt++;
77        if(loaderCnt == 1) $('.loader').fadeIn();
78    }else{
79        loaderCnt--;
80        if(loaderCnt == 0) $('.loader').fadeOut();
81    }
82}
83$(document).ready(function(){
84$(".navbar-toggler").click(function(){  
85$(".sticky-top.header-blur").addClass("activezindex"); 
86});
87$(".btn-close").click(function(){  
88$(".sticky-top.header-blur").removeClass("activezindex");
89});
90
91$(".bottom-nav__item--active.navbar-toggler").click(function(e){e.preventDefault();});
92});
93

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.