PageSourceSearch

https://civitadibagnoregio.cloud/assets/mail/contact.js

js civitadibagnoregio.cloud collected 2026-09-24 10:15:43 UTC 2,802 bytes, 71 lines download raw bytes

1$(function () {
2
3    $("#contactForm input, #contactForm textarea").jqBootstrapValidation({
4        preventSubmit: true,
5
6        submitError: function ($form, event, errors) {
7        },
8        submitSuccess: function ($form, event) {
9            event.preventDefault();
10            var name = $("input#name").val();
11            var email = $("input#email").val();
12            var subject = $("input#subject").val();
13            var message = $("textarea#message").val();
14            var captchaResponse = $("textarea#g-recaptcha-response").val();
15
16
17            if(captchaResponse === ''){
18                $('#captcha_error').append('<span>Captcha required</span>');
19                return;
20            }
21
22            $this = $("#sendMessageButton");
23            $this.prop("disabled", true);
24
25            $.ajax({
26                url: "/send-mail",
27                type: "POST",
28                data: $form.serialize(),
29                dataType: 'json',
30                cache: false,
31                success: function () {
32                    $('#success').html("<div class='alert alert-success'>");
33                    $('#success > .alert-success').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;")
34                            .append("</button>");
35                    $('#success > .alert-success')
36                            .append("<strong>Your message has been sent. </strong>");
37                    $('#success > .alert-success')
38                            .append('</div>');
39                    $('#contactForm').trigger("reset");
40                    grecaptcha.reset();
41                },
42                error: function () {
43                    $('#success').html("<div class='alert alert-danger'>");
44                    $('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;")
45                            .append("</button>");
46                    $('#success > .alert-danger').append($("<strong>").text("Sorry " + name + ", it seems that our mail server is not responding. Please try again later!"));
47                    $('#success > .alert-danger').append('</div>');
48                    $('#contactForm').trigger("reset");
49                    grecaptcha.reset();
50                },
51                complete: function () {
52                    setTimeout(function () {
53                        $this.prop("disabled", false);
54                    }, 1000);
55                }
56            });
57        },
58        filter: function () {
59            return $(this).is(":visible");
60        },
61    });
62
63    $("a[data-toggle=\"tab\"]").click(function (e) {
64        e.preventDefault();
65        $(this).tab("show");
66    });
67});
68
69$('#name').focus(function () {
70    $('#success').html('');
71});

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.