PageSourceSearch

https://www.verticcio.sk/modules/requestprice/views/js/front.js

js verticcio.sk collected 2026-10-06 20:04:37 UTC 6,761 bytes, 151 lines download raw bytes

1/**
2* 2007-2021 PrestaShop
3*
4* NOTICE OF LICENSE
5*
6* This source file is subject to the Academic Free License (AFL 3.0)
7* that is bundled with this package in the file LICENSE.txt.
8* It is also available through the world-wide-web at this URL:
9* http://opensource.org/licenses/afl-3.0.php
10* If you did not receive a copy of the license and are unable to
11* obtain it through the world-wide-web, please send an email
12* to [email protected] so we can send you a copy immediately.
13*
14* DISCLAIMER
15*
16* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
17* versions in the future. If you wish to customize PrestaShop for your
18* needs please refer to http://www.prestashop.com for more information.
19*
20*  @author    PrestaShop SA <[email protected]>
21*  @copyright 2007-2021 PrestaShop SA
22*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
23*  International Registered Trademark & Property of PrestaShop SA
24*
25* Don't forget to prefix your containers with your own identifier
26* to avoid any conflicts with others containers.
27*/
28
29
30document.addEventListener('DOMContentLoaded', function() {
31
32console.log(1);
33
34    $(document).on('click', '.form-requestprice input[name=suhlasim]', function(e){
35        if ($('.form-requestprice input[name=suhlasim]').prop("checked")) {
36            $('.form-requestprice input[name=suhlasim]').removeClass('is-invalid').parent().find('label').removeClass('text-danger');
37            $('.form-requestprice .form-check-label').removeClass('text-danger');
38        } else {
39            $('.form-requestprice input[name=suhlasim]').addClass('is-invalid').parent().find('label').addClass('text-danger');
40            $('.form-requestprice .form-check-label').addClass('text-danger');
41        }
42    });
43
44    $(document).on('click', '.btn-requestprice', function(e){
45
46console.log(2);
47
48        e.preventDefault();
49
50        $('.form-requestprice').addClass('was-validated');
51
52        var no_errror = true;
53        if ($('.form-requestprice input[name=meno_priezvisko]').val() == '') {
54            no_errror = false;
55        }
56        if ($('.form-requestprice input[name=email]').val() == '') {
57            no_errror = false;
58        }
59        if ($('.form-requestprice input[name=mesto]').val() == '') {
60            no_errror = false;
61        }
62        if ($('.form-requestprice input[name=suhlasim]').prop("checked")) {
63            $('.form-requestprice input[name=suhlasim]').removeClass('is-invalid').parent().find('label').removeClass('text-danger');
64            $('.form-requestprice .form-check-label').removeClass('text-danger');
65        } else {
66            no_errror = false;
67            $('.form-requestprice input[name=suhlasim]').addClass('is-invalid').parent().find('label').addClass('text-danger');
68            $('.form-requestprice .form-check-label').addClass('text-danger');
69        }
70
71        if (no_errror) {
72        /* grecaptcha.ready(function() {
73            grecaptcha.execute('6LfQD_AbAAAAAAHEdDJa19VB8XeAg01jtO_zBZu5', {action: 'submit'}).then(function(token) {
74                // Add your logic to submit to your backend server here.
75                //console.log(token);
76                if (token === "") {
77                    // problem with recaptcha
78                } else { */
79                    //console.log(baseUrl);
80                    // var ajax_url = baseUrl + 'modules/requestprice/mail.php';
81                    var ajax_url = requestpriceUrl;
82                    //var serializedData = $('.form-requestprice').serialize();
83                    //console.log(serializedData);
84
85                    var form = $('.form-requestprice')[0];
86                    //var data = new FormData(form);
87                    //data.append("CustomField", "This is some extra data, testing");
88                    //$("#btnSubmit").prop("disabled", true);
89                    var data = new FormData();
90                    data.append('product', $('.h1.page-title span').text());
91                    data.append('url', window.location.href);
92                    data.append('name', $('.form-requestprice input[name=meno_priezvisko]').val());
93                    data.append('email', $('.form-requestprice input[name=email]').val());
94                    data.append('tel', $('.form-requestprice input[name=telefon]').val());
95                    data.append('mesto', $('.form-requestprice input[name=mesto]').val());
96                    data.append('poznamka', $('.form-requestprice textarea[name=poznamka]').val());
97                    // $.ajax({
98                    //     type: "POST",
99                    //     enctype: 'multipart/form-data',
100                    //     processData: false,
101                    //     contentType: false,
102                    //     cache: false,
103                    //     timeout: 600000,
104                    //     url: ajax_url,
105                    //     data: data,
106                    //     //data: serializedData,
107                    //     success: function (response) {
108                    //         console.log(response);
109                    //         response = $.parseJSON(response);
110                    //         if (response['success'] == true) {
111                    //             console.log('success');
112                    //             $('.requestprice-holder .step1').addClass('hidden');
113                    //             $('.requestprice-holder .step2').removeClass('hidden');
114                    //         }
115                    //     },
116                    //     error: function(jqXHR, textStatus, errorThrown) {
117                    //         //console.log(textStatus, errorThrown);
118                    //     }
119                    // });
120                    $.ajax({
121                        type: 'POST',
122                        url: ajax_url,
123                        data: data,
124                        processData: false,
125                        contentType: false,
126                        dataType: 'json',
127                        success: function (response) {
128                            console.log(response);
129                            if (response && response.success) {
130                                $('.requestprice-holder .step1').addClass('hidden');
131                                $('.requestprice-holder .step2').removeClass('hidden');
132                            } else {
133                                console.log('mail failed', response);
134                            }
135                        },
136                        error: function (jqXHR) {
137                            console.log('ajax error', jqXHR.status, jqXHR.responseText);
138                        }
139                    });
140              /*  }
141            });
142        });
143        */
144        }
145
146
147
148    });
149
150});
151

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.