PageSourceSearch

https://radarproduktow.pl/static/js/custom.js?v=2

js radarproduktow.pl collected 2026-10-04 17:57:17 UTC 5,646 bytes, 171 lines download raw bytes

1$(document).ready(function () {
2
3    $('#search-main-page').submit(function () {
4        var prodlen = $(this).closest("form").find("input[name='product']").val();
5        if (prodlen.length < 3) {
6            alert("Musisz wpisać minimum 3 znaki");
7            return false;
8        } else if (prodlen == 'numer zamówieniowy lub typ') {
9            alert("Musisz podać numer zamówieniowy lub typ");
10            return false;
11        } else {
12            return true;
13        }
14    });
15
16    $('.slick-items').slick({
17        dots: false,
18        arrows: true,
19        infinite: true,
20        slidesToShow: 6,
21        slidesToScroll: 1,
22        autoplay: true,
23        autoplaySpeed: 800,
24        centerMode: false,
25        responsive: [
26            {
27                breakpoint: 1610,
28                settings: {
29                    slidesToShow: 4
30                }
31            },
32            {
33                breakpoint: 1200,
34                settings: {
35                    slidesToShow: 3
36                }
37            },
38            {
39                breakpoint: 700,
40                settings: {
41                    slidesToShow: 2
42                }
43            },
44            {
45                breakpoint: 350,
46                settings: {
47                    slidesToShow: 1
48                }
49            }
50        ]
51    });
52
53});
54
55function productQuestion(dystMail, productCode, productName, id){
56    onclick="productQuestion('{mail_contact}', '{product_code}', '{product_desc}', '{question_param}');return false;"
57    openDynamicModal("Wyślij zapytanie", `
58    <div class="form-group">
59        <label>Email Dystrybutora:</label>
60        <input type="email" name="dystemail" class="form-control" value="${dystMail}" readonly>
61      </div>
62      <div class="form-group">
63        <label>Numer zamówieniowy:</label>
64        <input type="text" name="productcode" class="form-control" value="${productCode}" readonly>
65      </div>
66      <div class="form-group">
67        <label>Opis:</label>
68        <input type="text" name="productname" class="form-control" value="${productName}" readonly>
69      </div>
70      <div class="form-group">
71        <label for="PopupEmailInput">Twój Email:</label>
72        <input type="email" class="form-control" id="PopupEmailInput" name="email" required>
73      </div>
74    <div class="form-group">
75    <label for="PopupQuestionInput">Zapytanie:</label>
76    <textarea class="form-control" id="PopupQuestionInput" rows="6" name="question" required></textarea>
77  </div>
78`, `${id}`)
79}
80function openDynamicModal(title, content, id) {
81    // Remove any existing modal to prevent duplication
82    $("#dynamicModal").remove();
83
84    // Create the modal structure dynamically
85    var modalHTML = `
86        <div id="dynamicModal" class="modal fade" role="dialog">
87          <div class="modal-dialog">
88            <div class="modal-content">
89              <div class="modal-header">
90                <button type="button" class="close" data-dismiss="modal">&times;</button>
91                <h4 class="modal-title">` + title + `</h4>
92              </div>
93              <div class="modal-body">
94                <form method="post">
95                ` + content + `
96                </form>
97              </div>
98              <div class="modal-footer">
99                <button type="button" class="btn btn-default" data-dismiss="modal">Zamknij</button>
100                <button type="button" class="btn btn-primary" onclick="sendDynamicModal('${id}')">Wyślij</button>
101              </div>
102            </div>
103          </div>
104        </div>
105      `;
106
107    // Append the modal to the body
108    $("body").append(modalHTML);
109
110    // Show the modal
111    $("#dynamicModal").modal('show');
112}
113
114function sendDynamicModal(id){
115    var form = $("#dynamicModal form");
116    if (!form[0].checkValidity()){
117        form[0].reportValidity()
118        return;
119    }
120    // Serialize form data
121    var formData = form.serialize();
122
123    $.ajax({
124        url: "/zapytaj.php?"+id,
125        type: 'POST',
126        data: formData, // Send the serialized form data
127        contentType: 'application/x-www-form-urlencoded; charset=UTF-8', // Ensure the correct content type
128        success: function(response) {
129            console.log('success');
130            $("#dynamicModal").modal('hide');
131            showToast('success', 'Wysłano pomyślnie')
132            // alert( "Data Loaded: " + response );
133        },
134        error: function(xhr, status, error) {
135            console.log(error);
136            $("#dynamicModal").modal('hide');
137            showToast('error', 'Wystąpił nieoczekiwany błąd')
138
139            // console.error('Error:', error);
140        }
141    });
142}
143
144function showToast(type, message) {
145    var toastId = 'toast' + Math.floor(Math.random() * 1000); // Generate unique ID
146    var alertClass = type === 'success' ? 'alert-success' : 'alert-danger';
147
148    var toastHtml = `
149    <div id="${toastId}" class="alert ${alertClass} alert-dismissible fade in" role="alert" style="display: none; position: fixed;bottom: 0;right: 0;">
150        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
151        ${message}
152    </div>`;
153
154    $('body').append(toastHtml);
155    $('#' + toastId).fadeIn();
156
157    setTimeout(function() {
158        $('#' + toastId).fadeOut(function() {
159            $(this).remove();
160        });
161    }, 3000); // Auto-hide after 3 seconds
162}
163function hamburwwgerMenu(x) {
164    x.classList.toggle('change');
165
166    if ($('#phone-cbp-hrmenu').is(':visible')) {
167        $('#phone-cbp-hrmenu').hide('slow');
168    } else {
169        $('#phone-cbp-hrmenu').show('slow');
170    }
171}

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.