PageSourceSearch

https://fapesp.br/assets/cookie/cookie.js?v=1790190617

js fapesp.br collected 2026-09-24 08:27:41 UTC 3,824 bytes, 192 lines download raw bytes

1(function () {
2    'use strict';
3
4    /*
5     * Configuração padrão
6     */
7    const config = Object.assign({
8
9        cookieName: 'cookie_consent',
10
11        cookieDays: 365,
12
13        message: 'Este site utiliza cookies para melhorar sua experiência.',
14
15        policyUrl: '#',
16
17        policyText: 'Política de Privacidade',
18
19        acceptText: 'Aceitar',
20
21        showCloseButton: true
22
23    }, window.CookieBannerConfig || {});
24
25
26    function getCookie(name) {
27
28        var match = document.cookie.match(
29            new RegExp(
30                '(?:^|;\\s*)' +
31                name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') +
32                '=([^;]*)'
33            )
34        );
35
36        return match ? decodeURIComponent(match[1]) : null;
37
38    }
39
40
41    function setCookie(name, value, days) {
42
43        var expires = '';
44
45        if (days) {
46
47            var date = new Date();
48
49            date.setTime(
50                date.getTime() + (days * 24 * 60 * 60 * 1000)
51            );
52
53            expires = '; expires=' + date.toUTCString();
54
55        }
56
57        document.cookie =
58            name + '=' + encodeURIComponent(value) +
59            expires +
60            '; path=/' +
61            '; SameSite=Lax';
62
63    }
64
65
66    function iniciar() {
67
68        if (document.getElementById('cookie-banner')) {
69            return;
70        }
71
72        var banner = document.createElement('div');
73
74        banner.id = 'cookie-banner';
75        banner.setAttribute('role', 'dialog');
76        banner.setAttribute('aria-label', 'Aviso de Cookies');
77
78        var textComp = "Para mais informações consulte a";
79        
80       if (config?.lang == "en") {
81           var textComp = "";
82        }
83
84        banner.innerHTML = `
85        <div class="painel">
86            <div class="cookie-text">
87                ${config.message}
88                ${textComp} <a href="${config.policyUrl}" target="_blank" rel="noopener">${config.policyText}</a>.
89            </div>
90
91            <div class="cookie-actions">
92
93                <button id="cookie-accept" type="button">
94                    ${config.acceptText}
95                </button>
96
97                ${
98                    config.showCloseButton
99                    ? '<button id="cookie-close" type="button" aria-label="Fechar">&times;</button>'
100                    : ''
101                }
102
103            </div>
104            </div>
105        `;
106
107        document.body.appendChild(banner);
108
109        var btnAceitar = document.getElementById('cookie-accept');
110
111        var btnFechar = document.getElementById('cookie-close');
112
113
114        function esconder() {
115
116            banner.classList.remove('show');
117
118            setTimeout(function () {
119
120                banner.style.display = 'none';
121
122            },300);
123
124        }
125
126
127        if (btnAceitar) {
128
129            btnAceitar.addEventListener('click', function () {
130
131                /* setCookie(
132                    config.cookieName,
133                    'accepted',
134                    config.cookieDays
135                ); */
136
137                if(config.cookieDays == 365){
138                    config.cookieDays = 1;
139                }
140
141                setCookie(
142                    config.cookieName,
143                    'accepted',
144                    config.cookieDays
145                );
146
147
148                esconder();
149
150            });
151
152        }
153
154
155        if (btnFechar) {
156
157            btnFechar.addEventListener('click', esconder);
158
159        }
160
161
162        if (getCookie(config.cookieName)) {
163
164            banner.style.display='none';
165
166            return;
167
168        }
169
170        setTimeout(function(){
171
172            banner.classList.add('show');
173
174        },300);
175
176    }
177
178
179    if(document.readyState==='loading'){
180
181        document.addEventListener(
182            'DOMContentLoaded',
183            iniciar
184        );
185
186    }else{
187
188        iniciar();
189
190    }
191
192})();

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.