PageSourceSearch

https://www.sulniac.fr/wp-content/plugins/creasit-rgpd/assets/front/js/rgpd-public.js?ver=6.8.7

js sulniac.fr collected 2026-10-02 12:43:25 UTC 3,556 bytes, 98 lines download raw bytes

1ready = (callback) => {
2    if (document.readyState !== 'loading') {
3        callback()
4    } else {
5        document.addEventListener('DOMContentLoaded', callback)
6    }
7}
8
9function checkRGPDValidation(checkbox, button) {
10    if (checkbox.checked === true) {
11        button.removeAttribute('disabled')
12    } else {
13        button.setAttribute('disabled', 'true')
14    }
15}
16
17ready(() => {
18
19    // Disable submit button
20    let $rgpdCheckboxes = document.querySelectorAll('.rgpd-checkbox')
21
22    $rgpdCheckboxes.forEach(function ($rgpdCheckbox) {
23        if ($rgpdCheckbox) {
24            let $form = $rgpdCheckbox.closest('form')
25            let $submit = $form.querySelector('[type="submit"]')
26            checkRGPDValidation($rgpdCheckbox, $submit)
27
28            $rgpdCheckbox.addEventListener('change', () => {
29                checkRGPDValidation($rgpdCheckbox, $submit)
30            })
31        }
32
33
34        // Handle control for the RGPD request form
35        let $RGPDForm = document.getElementById('rgpd-form');
36        let $RGPDSubmit = document.getElementById('rgpd-submit-button');
37
38
39        !!$RGPDForm &&
40        $RGPDSubmit.addEventListener('click', function (e) {
41            let formInput = Object.fromEntries(new FormData($RGPDForm));
42
43            // Request Type
44            let $requestTypeError = document.getElementById('rgpdTypeError')
45            let requestType = formInput.rgpd_data_type ?? ''
46
47            if (requestType === '') {
48                e.preventDefault()
49                $RGPDSubmit.setAttribute('disabled', 'true')
50                $requestTypeError.classList.remove("hide")
51                $requestTypeError.classList.add("showX")
52            } else {
53                $requestTypeError.classList.add("hide")
54                $requestTypeError.classList.remove("showX")
55            }
56
57            // Request Email
58            let $requestEmailError = document.getElementById('rgpdEmailError')
59            let $requestEmailWarning = document.getElementById('rgpdEmailWarning')
60            let requestEmail = formInput.rgpd_data_email ?? ''
61
62            if (requestEmail === '') {
63                e.preventDefault()
64                $RGPDSubmit.setAttribute('disabled', 'true')
65                $requestEmailError.classList.remove("hide")
66                $requestEmailError.classList.add("showX")
67            } else {
68                $requestEmailError.classList.add("hide")
69                $requestEmailError.classList.remove("showX")
70            }
71
72            if (requestEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(requestEmail)) {
73                e.preventDefault()
74                $RGPDSubmit.setAttribute('disabled', 'true')
75                $requestEmailWarning.classList.remove("hide")
76                $requestEmailWarning.classList.add("showX")
77            } else {
78                $requestEmailWarning.classList.add("hide")
79                $requestEmailWarning.classList.remove("showX")
80            }
81
82
83            // Request Human
84            let $requestHumanError = document.getElementById('rgpdHumanError')
85            let $requestHumanWarning = document.getElementById('rgpdHumanWarning')
86            let requestHuman = formInput.rgpd_data_human ?? ''
87
88            if (requestHuman === '') {
89                e.preventDefault()
90                $requestHumanError.classList.remove("hide")
91                $requestHumanError.classList.add("showX")
92            } else {
93                $requestHumanError.classList.add("hide")
94                $requestHumanError.classList.remove("showX")
95            }
96        })
97    })
98})

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.