1$(document).ready(function () { 2 3 if ($('.portal-eventos').length === 0) { 4 return false; 5 } 6 7 var updatedElements = []; 8 var meses = ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 9 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro']; 10 11 function chekEventsOnLoad() { 12 13 if ($("#eventosListagem").html().trim() == "") { 14 filterEvents(false); 15 } 16 } 17 function filterEvents(byNav, id) { 18 //var year = "", month = "", categoria = "eventos"; 19 var req = {}; 20 currentNav = $(".calendar-month-header").text(); 21 currentNavSplited = currentNav.split(" "); 22 year = currentNavSplited[1]; 23 month = currentNavSplited[0]; 24 month = month.toLowerCase(); 25 if (byNav) { 26 currentNav = $("#" + id).data("to"); 27 year = currentNav.year; 28 month = currentNav.month; 29 filterByNavClick = true; 30 } else { 31 req.date = $("#" + id).data("date"); 32 } 33 //month = 01; 34 35 36 $.ajax({url: "/ws/eventosHome/eventos.home.php?month=" + month + "&year=" + year, 37 type: "POST", 38 dataType: 'json', 39 data: req, 40 success: function (eventos) { 41 if (id) { 42 $("#limparEventoHome").show(); 43 } else { 44 $("#limparEventoHome").hide(); 45 } 46 var ulEventoHome = $("#eventosListagem").empty(); 47 var template = ""; 48 if (eventos.length <= 0) { 49 if (byNav) { 50 try { 51 month = parseInt(month) - 1; 52 month = meses[month]; 53 } catch (err) { 54 } 55 } 56 template = '<div class="alert alert-danger" role="alert"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <span class="sr-only">Error:</span>Não existem evento para o mês de ' + month + ' de ' + year + '.</div>'; 57 } 58 59 $.each(eventos, function (index, evento) { 60 61 if (index % 2 === 0) { 62 template += '<div class="row linha margin-bottom-40">'; 63 } 64 template += '<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 evento-descricao ' + (index === 0 ? 'primeiro' : '') + '">'; 65 if (evento.imagem !== null) { 66 template += '<div class="row"><div class="col-md-4 col-lg-4 col-sm-4 col-xs-4 no-padding-left no-padding-right"><a href="' + evento.link + '" title="' + evento.titulo + '"><img src="' + evento.imagem + '" alt="Foto do evento" class="img-responsive" /></a></div>'; 67 } 68 template += '<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8"><h4><u>' + evento.titulo + '</u></h4>'; 69 template += '<p class="data-realizacao no-margin margin-top-15 margin-bottom-5"><span class="glyphicon glyphicon-calendar"></span> Data de realização:</p>'; 70 template += '<p class="data-inicial no-margin ">' + (evento.dataFinalFormatada !== null ? 'De ' : '') + evento.dataInicioFormatada + (evento.horaInicioFormatada !== '00:00' ? ' às ' + evento.horaInicioFormatada : '') + '</p>'; 71 72 if (evento.dataFinalFormatada !== null) { 73 template += '<p class="data-final no-margin">Até ' + evento.dataFinalFormatada + (evento.horaFinalFormatada !== '00:00' ? ' às ' + evento.horaFinalFormatada : '') + '</p>'; 74 } 75 76 if (evento.aconteceNoMomento === true) { 77 template += '<p class="margin-top-10"><mark class="aconteceNoMomento"><span class=" glyphicon glyphicon-bullhorn"></span>
77 Este evento já está acontecendo. Participe!</mark></p>'; 78 } 79 template += '<p class="local no-margin margin-top-10"><span class="glyphicon glyphicon-map-marker"></span> Local: <strong>' + evento.local + '</strong></p>'; 80 template += '<a href="' + evento.link + '" class="btn btn-plenus margin-top-10"><span class="glyphicon glyphicon-bullhorn" aria-hidden="true"></span> Saiba mais</a>'; 81 template += '</div></div>'; 82 83 if (evento.imagem !== null) { 84 template += '</div>'; 85 } 86 if ((index + 1) % 2 === 0 || index + 1 >= eventos.length) { 87 template += '</div>'; 88 } 89 90 }); 91 ulEventoHome.html(template); 92 }}); 93 } 94 95 $("#limparEventoHome").on("click", function () { 96 filterEvents(false); 97 }); 98 99 $("#my-calendar").zabuto_calendar({ 100 today: true, 101 action: function () { 102 filterEvents(false, this.id, 0); 103 }, 104 action_nav: function () { 105 filterEvents(true, this.id, 0); 106 }, 107 ajax: { 108 url: "/ws/eventosHome/eventos.home.php", 109 }, 110 language: "pt" 111 }); 112 chekEventsOnLoad(); 113 114}); 115
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.