https://policiapenal.rs.gov.br/matriz_common/versions/2.1.5/js/procergs/matriz.lgpd.js?2.1.5.161.6+5
1function LGPDAgreementManager() { 2 3 var STATUS_CONSENTIDO = 1; 4 var STATUS_PENDENTE = 2; 5 var STATUS_BASICO = 3; 6 var VALOR_BASICO = "basico"; 7 var VALOR_ACEITO = "aceito"; 8 9 return { 10 isPending: isPending, 11 statusConsentimento: statusConsentimento, 12 salvaConsentimento: salvaConsentimento, 13 bloqueiaCookiesJs: bloqueiaCookiesJs 14 }; 15 16 function isPending() { 17 return statusConsentimento() === STATUS_PENDENTE && window.isconsentimentoativo; 18 } 19 20 function statusConsentimento() { 21 if (temConsentimentoCookie()) { 22 var valorConsentimento = valorConsentimentoCookie().status; 23 24 if (valorConsentimento === VALOR_ACEITO) { 25 return STATUS_CONSENTIDO; 26 } else if (valorConsentimento === VALOR_BASICO) { 27 return STATUS_BASICO; 28 } 29 } 30 31 return STATUS_PENDENTE; 32 } 33 34 function temConsentimentoCookie() { 35 var cookies = document.cookie.split(';'); 36 for (var i = 0; i < cookies.length; i++) { 37 var cookie = cookies[i]; 38 if (cookie.indexOf('consentimento-lgpd', 0) > -1) { 39 return true; 40 } 41 } 42 return false; 43 } 44 45 function valorConsentimentoCookie() { 46 var cookies = document.cookie.split(';'); 47 for (var i = 0; i < cookies.length; i++) { 48 var cookie = cookies[i]; 49 if (cookie.indexOf('consentimento-lgpd', 0) > -1) { 50 return JSON.parse(atob(decodeURIComponent(cookie.split('=')[1]))); 51 } 52 } 53 return null; 54 } 55 56 function salvaConsentimento(acao) { 57 return $.ajax({ 58 type: 'POST', 59 url: '/_service/lgpd/consentimento/' + acao, 60 context: this 61 }); 62 } 63 64 function bloqueiaCookiesJs() { 65 document.__defineGetter__("cookie", function () { 66 return ''; 67 }); 68 document.__defineSetter__("cookie", function () { 69 }); 70 } 71 72}
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.