PageSourceSearch

https://coreconms.org.br/recursos/js/utils.js

js coreconms.org.br collected 2026-10-07 13:38:21 UTC 1,875 bytes, 87 lines download raw bytes

1$(function() {
2
3	// Pegando as cidades do estado selecionado
4	$('[target-cidade]').on('change',function(){
5
6		var $estado  = $(this);
7		var idEstado = $estado.val();
8		var target   = $estado.attr('target-cidade');
9
10		if ( $(target).length > 0 ) {
11
12			var $cidades = $(target);
13
14			$.ajax({
15			    beforeSend:function() {
16			       $cidades.children('option:first').text('Aguarde...');
17			    },
18			    type:'post',
19			    url:'ajax_buscacidades.php',
20			    data:{
21			    	'id_estado':idEstado
22			    },
23			    success:function( response ) {
24			      $cidades.html( response );
25			    }
26			});
27		}
28	});
29
30	$('.loading-text').on('click', function () {
31
32		$(this).button('loading');
33	});
34
35	$('[autofocus],.autofocus').focus();
36
37	// Ligtbox nas imagens
38	$('.fancybox, [rel="lightbox"]').fancybox();
39
40  // Máscaras
41  $('.maskCpf').mask('999.999.999-99');
42  $('.maskDate').mask('99/99/9999');
43  $('.maskCnpj').mask('99.999.999/9999-99');
44  $('.maskCep').mask('99999-999');
45
46  // Máscara customizada para números que possuem o nono dígito
47  $('input.maskFone').mask('(99) 9999-9999').focusout('change', function(event){
48
49    var target, phone, element;
50
51    target  = (event.target) ? event.target : event.srcElement;
52    phone   = target.value.toString().replace(/\D/g,'');
53    element = $(target);
54
55    element.unmask();
56
57    if ( phone.length == 11 ) {
58      element.mask('(99)99999-999?9');
59    }
60    else {
61      element.mask('(99)9999-9999?9');
62    }
63
64  }).trigger('focusout');
65
66  // Consultando o Cep
67  $('.requestCep').requestCep(
68    // Before Send
69    function(){},
70    // Success
71    function(res) {
72      // Responce Object
73      // res.bairro,
74      // res.logradouro,
75      // res.cep,
76      // res.uf,
77      // res.localidade
78
79      $('input#rua').val(res.logradouro);
80      $('input#bairro').val(res.bairro);
81    },
82    function() {
83    	// Error
84    }
85  );
86
87});

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.