var _Alerta = { visible: !1, variant: "success", message: "", location: "bottom" }; $("body").append('
'); var Alerta = new Proxy(_Alerta, { set: function(e, t, a) { e[t] = a; var i = $("#system-alerts"); 1 == e.visible ? i.css("display", "block") : 0 == e.visible && i.css("display", "none"), "variant" == t && (i.removeClass("danger success info warning light dark"), i.addClass(a)), "message" == t && i.text(e.message), "location" == t && i.text(e.location) } }); $("#system-alerts").click(function() { Alerta.visible = !1 }); var FormAjax = function(){ $('.ajax').ajaxForm({ dataType: 'json', success: function(retorno) { Alerta.message = retorno.response; Alerta.variant = retorno.status Alerta.visible = true; if (retorno.status == 'success') { if (retorno.clear=='yes') { $('.ajax').clearForm(); } if (retorno.reload == 'yes') { setTimeout(function(){ window.location.reload(); }, 5000); } } setTimeout(function(){ Alerta.visible = false; }, 5000); } }); }; FormAjax(); var _dominio = window.location.protocol+'//'+window.location.host; $('icon-chameleon').each(function(index, el) { var w = $(this).attr('width'); var h = $(this).attr('height'); var f = $(this).attr('fill'); var src = $(this).attr('src'); var template = ''+ ''; $(this).after(template); $(this).remove(); }); function busca_fotos(id) { $.ajax({ type: "GET", url: _dominio+'/busca_fotos/'+id, success: function(retorno) { $('#fotos_carousel').html(retorno); $('#carouselFotos').carousel(); } }); } function buscaCidade(){ var estado = $('#estado').val(); $.ajax({ type: "GET", url: _dominio+'/busca_cidades/'+estado, success: function(retorno) { $('#cidades').html(retorno); } }); } function buscaIgreja(){ var cidade = $('#cidades').val(); $.ajax({ type: "GET", url: _dominio+'/busca_igreja/'+cidade, success: function(retorno) { $('#igrejas').html(retorno); } }); } function exibeIgreja(){ var igreja = $('#igrejas').val(); $.ajax({ type: "GET", url: _dominio+'/exibe_igreja/'+igreja, success: function(retorno) { $('#igreja_descricao').html(retorno); } }); }