PageSourceSearch

https://pmirs.org.br/site/custom/default/js/site.js?v=2.2.2

js pmirs.org.br collected 2026-09-26 18:56:51 UTC 9,408 bytes, 317 lines download raw bytes

1$(function() {
2    $('#slider.bannerPmi .swiper-slide.hidden-title').on('click', function(){
3        url = $(this).data('url');
4        target = $(this).data('target');
5        if (url) {
6            window.open(url, target);
7        }
8    })
9
10    $('#divPoliticaPrivacidade .aceitar').on('click', function(){
11        localStorage.setItem("politicaAceita", true);
12        $('#divPoliticaPrivacidade').hide();
13    });
14
15    //politica de privacidade
16    politicaPrivacidade = $('#divPoliticaPrivacidade');
17	if (politicaPrivacidade.html()) {
18        if (localStorage.getItem("politicaAceita")) {
19            politicaPrivacidade.hide();
20        }
21    }
22
23    _visaoi_slider_full();
24    // On Resize
25    jQuery(window).resize(function() {
26        _visaoi_slider_full();
27    });
28
29    //abre modal de envio email
30    $('.enviaConteudo').click(function() {
31        $('#modalEnviarEmail').modal('show');
32        return false;
33    });
34
35    $('button.infoProjeto').click(function() {
36        target = $(this).data('target');
37        $(target).modal('show');
38        return false;
39    });
40
41    $('a.infoParceiro').click(function() {
42        target = $(this).data('target');
43        $(target).modal('show');
44        return false;
45    });
46
47    $('.copiarLink').click(function() {
48        text = $(this).attr('data-link');
49        var dummy = document.createElement("textarea");
50        document.body.appendChild(dummy);
51        dummy.value = text;
52        dummy.select();
53        document.execCommand("copy");
54        document.body.removeChild(dummy);
55
56        return false;
57    });
58
59    $('.linkPopup').click(function() {
60        href = $(this).attr('href');
61        title = $(this).attr('title');
62        abrePopUp(href, title, 800, 600, 0, 0);
63        return false;
64    });
65
66    $('.datepicker-agenda').each(function() {
67        var _t = jQuery(this);
68        var _lang =	_t.attr('data-lang') || 'pt-BR';
69        tooltipTitle = '';
70        url = _t.attr('data-url');
71        _mes = _t.attr('data-mes');
72        _ano = _t.attr('data-ano');
73        _menor_data = _t.attr('data-menor_data');
74        _maior_data = _t.attr('data-maior_data');
75        $(this).datepicker({
76            language: _lang,
77            //defaultViewDate: {year :_ano, month: _mes},
78            format: "dd/mm/yyyy",
79            viewMode: "months",
80            startView: "months",
81            minViewMode: "months",
82            todayHighlight: true,
83            startDate: _menor_data,
84            endDate: _maior_data,
85            beforeShowMonth: function(date) {
86                //highlightMonth(date);
87            }
88        }).on('show',function(e) {
89            //highlightMonth();
90            tooltipTitle = $('.datepicker-agenda').data('original-title');
91            $('.datepicker-agenda').removeAttr('data-original-title');
92            $(this).datepicker("update", '1/'+_mes+'/'+_ano);
93        }).on('hide',function(event) {
94            $('.datepicker-agenda').attr('data-original-title', tooltipTitle);
95        }).on('changeDate', function(e) {
96            data = e.date;
97            mes = data.getMonth() + 1;
98            ano = data.getFullYear();
99            url += '/mes/'+mes+'/ano/'+ano;
100            window.location.href = url;
101            $(this).datepicker('hide');
102        });
103    });
104
105  function highlightMonth() {
106    $('.datepicker-months table tbody tr:first td span.month').addClass('active');
107  }
108
109  $('[data-toggle="tooltip"]').click(function() {
110    $('.tooltip').remove();
111  });
112
113	// Count To
114	jQuery(".countToNumero").appear(function() {
115		var _t = jQuery(this),
116		_from = _t.attr('data-from') || 0,
117		_speed = _t.attr('data-speed') || 1300,
118		_refreshInterval = _t.attr('data-refreshInterval') || 60;
119
120		_t.countTo({
121			from: parseInt(_from),
122			to: _t.html(),
123			speed: parseInt(_speed),
124			refreshInterval: parseInt(_refreshInterval),
125			formatter: function (value, options) {
126				return value.toFixed(options.decimals).replace('.', ',');
127			}
128		});
129	});
130
131	//envia formulário de newslleter
132	$('#formNewsletter').submit(function(){
133		enviaNewsletter();
134
135		return false;
136	});
137});
138
139
140/** 00. Visãoi Slider Full Height
141**************************************************************** **/
142function _visaoi_slider_full() {
143    if (jQuery("#slider.visaoifullheight").html() != undefined) {
144        if(window.visaoiAfterResizeApp) {
145            clearTimeout(window.visaoiAfterResizeApp);
146        }
147
148        window.visaoiAfterResizeApp = setTimeout(function() {
149            //jQuery("#slider.visaoifullheight").height(0);
150            _headerHeight = 0;
151
152            if(jQuery("#header").hasClass('transparent') || jQuery("#header").hasClass('translucent')) {
153                _headerHeight = 0;
154            } else {
155                _headerHeight = jQuery("#header").outerHeight();
156
157                if(jQuery("#topBar").length > 0) {
158                    _headerHeight = _headerHeight + jQuery("#topBar").outerHeight();
159                }
160            }
161
162            _screenHeight = jQuery(window).height() - _headerHeight;
163            _sliderHeight = jQuery("#slider.visaoifullheight").outerHeight();
164            console.log('size screen: '+_screenHeight);
165            console.log('size slider: '+_sliderHeight);
166
167            _newHeight = _screenHeight;
168            if (_sliderHeight && _sliderHeight < _screenHeight) {
169                _newHeight = _sliderHeight;
170            }
171            //jQuery("#slider.visaoifullheight").height(_screenHeight);
172        }, 300);
173    }
174}
175
176//funcão para enviar email
177function enviarEmail() {
178	$('#formEnvioEmail #enviar').attr('disabled', 'disabled');
179	$('#formEnvioEmail #div_enviar').append(
180		'<img src="'+baseurl+'/default/img/carregando.gif" />Enviando email.'
181	);
182	$.post(
183		baseurl+'/site/index/enviar-email/',
184		$('#formEnvioEmail').serialize(),
185		function(data
186		) {
187			$('#modalEnviarEmail .modal-body').html(data);
188		}
189	);
190}
191
192/********* INICIO FUNCOES ENQUETE ***************/
193//carrega a enquete
194function carregarEnquete(idEnquete) {
195	url = baseurl+'/site/enquete/ver/';
196
197	if (idEnquete) {
198			url += 'idEnquete/'+idEnquete;
199	}
200
201	$.get(url, function(data){
202		if (data) {
203			$('#sectionEnquete').html(data);
204			$('#sectionEnquete').removeClass('hidden');
205		}
206	});
207}
208
209//mostra o resultado da enquete
210function resultadoEnquete(idEnquete) {
211	$.post(
212		baseurl+'/site/enquete/resultado/',
213		{idEnquete: idEnquete},
214		function(data) {
215			$('#sectionEnquete').html(data);
216		}
217	);
218}
219
220//acao do voto
221function votarEnquete(idEnquete) {
222	var opcao = null;
223	// verifica a opção selecionada
224	$('#sectionEnquete input:radio').each(function() {
225		if ($(this).is(':checked')) {
226			opcao = $(this).val();
227		}
228	});
229
230	if (opcao != null) {
231		$.post(
232			baseurl+'/site/enquete/votar/',
233			{idEnquete:idEnquete, opcao:opcao},
234			function(data) {
235				$('#sectionEnquete').html(data);
236			}
237		);
238	} else {
239	}
240}
241/********* FIM FUNCOES ENQUETE ***************/
242
243/********* INICIO FUNCOES NEWSLETTER ***************/
244function enviaNewsletter() {
245	nome = $('#nomeNewsletter').val();
246	email = $('#emailNewsletter').val();
247	id_pmi = $('#idPmiNewsletter').val();
248	$('.divModalBootsrap').remove('');
249
250	$.post(
251		baseurl+"/site/home/newsletter",
252		{nome:nome, email:email, id_pmi:id_pmi},
253		function(data) {
254			$('body').append(data);
255		}
256	);
257}
258/********* FIM FUNCOES NEWSLETTER ***************/
259
260/** 00. Atributos do namespace visaoi
261**************************************************************** **/
262$(document).ready(() => {
263    /**
264     * visaoi:typingFormatter=< @see formatter >
265     */
266    const formatter = { //possíveis formatadores
267        "social": {
268            linkedin(txt) {
269				if (txt.length <= 3) return false; //menor que o minimo do linkedin.
270                
271                const regex = /((((https?:\/\/?)?(((www\.)?linkedin\.com)?\/)?)?in)?\/)?(?<username>[^\s\/\"\']+)\/?/g;
272                const result = regex.exec(txt);
273                return result ? result.groups.username : false;
274            }
275        }
276    }
277
278    $('[visaoi\\:typingFormatter]').each((i, el) => {
279        //check if ctrl v was pressed
280        let format = (e) => {
281            let $el = $(e.target);
282            let format = $el.attr('visaoi:typingFormatter');
283            let value = "";
284			
285			e.originalEvent.clipboardData ?
286				value = e.originalEvent.clipboardData.getData('text') :
287				value = $el.val() || $el.text();
288			
289			if (value === "") return ""; //não adiata checar
290
291            if (format) {
292                const [namespace, method] = format.split('.');
293
294                if (namespace && method) {
295                    value = formatter[namespace][method](value);
296                }
297
298                value ?
299                    value = value :
300                    value = e.originalEvent.clipboardData.getData('text');
301            }
302
303            e.preventDefault();
304            console.log("pasta: " + value);
305
306            //if is input...
307            if ($el.is('input')) {
308                $el.val(value);
309            } else {
310                $el.text(value);
311            }
312        }
313        
314        $(el).on('paste', format);
315        $(el).on('keyup', format);
316    });
317});

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.