PageSourceSearch

https://barrafunda.rs.gov.br/js/site.js?v=1757678258

js barrafunda.rs.gov.br collected 2026-10-02 13:51:02 UTC 4,417 bytes, 158 lines download raw bytes

1$(function () {
2
3    //Formulários contatos
4    $(document).on('submit', '.form-contato, .form-dinamico', function (e) {
5        var form = this;
6        e.preventDefault();
7        var postData = new FormData(form);
8
9        $.ajax({
10            url: $(this).prop('action'),
11            type: 'POST',
12            data: postData,
13            contentType: false,
14            cache: false,
15            processData: false,
16            dataType: 'json',
17            beforeSend: function () {
18                $.LoadingOverlay("show");
19            },
20            success: function (result) {
21                if (result.success) {
22                    Swal.fire({
23                        icon: "success",
24                        title: "Sucesso",
25                        text: result.message
26                    });
27                    $(form)[0].reset();
28                    return true;
29                }
30                Swal.fire({
31                    icon: "error",
32                    title: "Erro",
33                    text: result.message
34                });
35            },
36            error: function (error) {
37                const msg = 'Não foi possível enviar a requisição. Por favor, tente mais tarde.';
38                Swal.fire({
39                    icon: "error",
40                    title: "Erro",
41                    text: msg
42                });
43                console.log(error.responseText);
44            },
45            complete: function () {
46                $.LoadingOverlay("hide");
47            }
48        });
49    });
50});
51
52function fecharImpressao() {
53    $('#conteudoImpressao').empty();
54    $('#divImpressao').hide();
55    $('#divImpressao').modal('hide');
56}
57
58function showCategories(value, controller, param) {
59
60    var id = (value) ? value : '';
61    var param = (param) ? param : 'cat';
62
63    if (!id) {
64        document.location.href = DynamikaBaseUrl + "/" + controller + '/index';
65        return true;
66    }
67
68    document.location.href = DynamikaBaseUrl + "/" + controller + "/" + param + "/" + id;
69}
70
71// SUBMENUS
72var acc = document.getElementsByClassName("accordion");
73var i;
74
75for (i = 0; i < acc.length; i++) {
76    acc[i].onclick = function () {
77        /* Toggle between adding and removing the "active" class,
78        to highlight the button that controls the panel */
79        this.classList.toggle("active");
80
81        /* Toggle between hiding and showing the active panel */
82        var panel = this.nextElementSibling;
83        if (panel.style.display === "block") {
84            panel.style.display = "none";
85        } else {
86            panel.style.display = "block";
87        }
88    }
89}
90
91function openNav() {
92    document.getElementById("mySidenav").style.width = "250px";
93}
94
95function closeNav() {
96    document.getElementById("mySidenav").style.width = "0";
97}
98
99$(document).ready(function () {
100    var scrollTop = $(".scrollTop");
101    $(window).scroll(function () {
102        var topPos = $(this).scrollTop();
103        if (topPos > 100) {
104            $(scrollTop).css("opacity", "1");
105
106        } else {
107            $(scrollTop).css("opacity", "0");
108        }
109
110    });
111    $(scrollTop).click(function () {
112        $('html, body').animate({
113            scrollTop: 0
114        }, 800);
115        return false;
116
117    });
118});
119
120const tempo_intervalo = 10; //ms -> define a velocidade da animação
121
122$('.dynamika-counter-up').each(function () {
123    let count_to = parseInt($(this).data('to'));
124    let time = parseInt($(this).data('time'));
125    let intervalos = time / tempo_intervalo; //quantos passos de animação tem
126    let incremento = count_to / intervalos; //quanto cada contador deve aumentar
127    let valor = 0;
128    let el = $(this);
129
130    let timer = setInterval(function () {
131        if (valor >= count_to) { //se já contou tudo tem de parar o timer
132            valor = count_to;
133            clearInterval(timer);
134        }
135
136        let texto = valor.toFixed(0).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1.");
137        el.text(texto);
138        valor += incremento;
139    }, tempo_intervalo);
140});
141
142
143
144/* --- MOSTRAR/ESCONDER MENU ACESSIBILIDADE -- */
145
146var ativo = false;
147
148document.getElementById("icone-cr").addEventListener("click", onClick);
149
150function onClick() {
151    if(ativo == false){
152        document.getElementById("texto").classList.add("blocked");
153        ativo = true;
154    } else {
155        document.getElementById("texto").classList.remove("blocked");
156        ativo = false;
157    }
158}

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.