1function scrollForward() { 2 if(month<11) { 3 month = month + 1; 4 } else { 5 month = 0; 6 year = year + 1; 7 } 8} 9 10function scrollBackwards() { 11 if(month>0) { 12 month = month - 1; 13 }else { 14 month = 11; 15 year = year - 1; 16 } 17 18} 19 20function showNextMonth() { 21 scrollForward(); 22 updateCalendarAjax(month,year); 23} 24function showPreviousMonth() { 25 scrollBackwards(); 26 updateCalendarAjax(month,year); 27} 28 29function showNextMonthHP() { 30 scrollForward(); 31 updateCalendarHP(month,year); 32} 33function showPreviousMonthHP() { 34 scrollBackwards(); 35 updateCalendarHP(month,year); 36} 37 38function redirectToEventsPage(itemId) { 39 document.location.href = '/eventos?item='+itemId; 40// if(isModalModeEnabled() ){ 41// document.location.href = '/eventos?item='+itemId; 42// }else { 43// document.location.href = '/evento?item='+itemId; 44// } 45} 46 47 48function updateCalendarHP(month,year) { 49 $.ajax({ 50 type : "POST", 51 url : tripticoAjax, 52 cache:false, 53 dataType: "json", 54 data: {MONTH: month, 55 YEAR: year}, 56 success: function(obj) { 57 $("div#showCalendar").html(obj.msg); 58 events = obj.events; 59 $("div#showCalendar .has-events").each(function() { 60 $(this).tooltip({ 61 'placement': 'top', 62 'title': events[($(this).find('span').text())-1].title, 63 'container': 'body' 64 }); 65 $(this).click( function(){ 66 var itemId = ''; 67 if(events[($(this).find('span').text())-1].dayEvents.length == 1) { 68 itemId = events[($(this).find('span').text())-1].dayEvents[0].eventId; 69 } 70 redirectToEventsPage(itemId); 71 }); 72 }); 73 }, 74 error : function(XMLHttpRequest, textStatus, errorThrown) 75 { 76 //Write you error-handling logic here 77 78 } 79 }); 80} 81 82function updateCalendarAjax(month,year) { 83 $.ajax({ 84 type : "POST", 85 url : eventsAjax, 86 cache:false, 87 dataType: "json", 88 data: {MONTH: month, 89 YEAR: year}, 90 success: function(obj) { 91 $("div#showCalendar").html(obj.msg); 92 $("div#calendar-month-header").text(obj.monthHeader); 93 $(".eventostop .event-calendar tr").each(function() { 94 alinhaAlturas($(this).find("td")); 95 }); 96// $(".eventostop .event-calendar td").each(function() { 97// alinhaAlturas($(".eventostop .event-calendar td")); 98// }); 99 events = obj.events; 100 101 }, 102 error : function(XMLHttpRequest, textStatus, errorThrown) 103 { 104 //Write you error-handling logic here 105 106 } 107 }); 108} 109 110function updateNextEventsAjax(page) { 111 $.ajax({ 112 type : "POST", 113 url : nextEventsAjax, 114 cache:false, 115 dataType: "json", 116 data: {PAGE: page}, 117 beforeSend: function() { 118 scrollToDiv($('div.rescontrol')); 119 $("div#showEvents").html("<div class=\"loaderfundo\"><img src=\"/Public-theme/images/_img/ajax-loader.gif\" width=\"43\" height=\"11\" alt=\"a carregar\" class=\"gifloader\" /></div>"); 120 }, 121 success: function(obj) { 122 $("div#showEvents").html(obj.msg); 123 events = obj.events; 124 pageCount = obj.pageCount; 125 if(obj.totalItems > 0) { 126 $(".rescontrol h4").html("Eventos disponíveis <span>("+obj.totalItems+")</span>"); 127 } else { 128 $(".rescontrol h4").html("Não existem Eventos disponíveis."); 129 } 130 }, 131 error : function(XMLHttpRequest, textStatus, errorThrown) 132 { 133 //Write you error-handling logic here 134 135 } 136 }); 137} 138 139 140function updateModal(title, location, date, img, description, eventId, canRedirect){ 141 updateEventItem(title, location, date, img, description, eventId); 142 openModalOrRedirect('#eventsModal', eventId, title, '/evento'); 143} 144 145function updateEventItem(title, location, date, img, description, eventId) { 146 $('#eventsModalLabel').text(title); 147 $('#eventlocation').text(location); 148 $('#eventdate').text(date); 149 $('.eventimage img').attr("src",img); 150 $('.offcanvas-body .eventdesc').html(description); 151} 152 153 154function updateNextEventsModal(i){ 155 updateModal(nextEvents[i].title, 156 nextEvents[i].location, 157 nextEvents[i].date, 158 nextEvents[i].img, 159 htmlDecode(nextEvents[i].description), 160 nextEvents[i].eventId, true); 161} 162function updateCalendarEventsModal(dayOfMonth, j){ 163 updateModal(calendarEvents[dayOfMonth].dayEvents[j].title, 164 calendarEvents[dayOfMonth].dayEvents[j].location, 165 calendarEvents[dayOfMonth].dayEvents[j].date, 166 calendarEvents[dayOfMonth].dayEvents[j].img, 167 htmlDecode(calendarEvents[dayOfMonth].dayEvents[j].description), 168 calendarEvents[dayOfMonth].dayEvents[j].eventId, true); 169} 170 171$(document).ready(function () { 172 //homepage 173 174// var tooltipTriggerList = [].slice.call(document.querySelectorAll('div#showCalendar .has-events')) 175// var tooltipList = tooltipTriggerList.map(function (tooltipElement) { 176// 177// tooltipElement.title = events[($(tooltipElement).find('span').text())-1].title; 178// var tt = new bootstrap.Tooltip(tooltipElement); 179// return tt; 180// }) 181 182 183 $("div#showCalendar .has-events").each(function() { 184 $(this).tooltip({ 185 'placement': 'top', 186 'title': events[($(this).find('span').text())-1].title, 187 'container': 'body' 188 }); 189 $(this).click( function(){ 190 var itemId = '';
191 if(events[($(this).find('span').text())-1].dayEvents.length == 1) { 192 itemId = events[($(this).find('span').text())-1].dayEvents[0].eventId; 193 } 194 redirectToEventsPage(itemId); 195 }); 196 }); 197 198 $(".eventostop .event-calendar tr").each(function() { 199 alinhaAlturas($(this).find("td")); 200 }); 201 202 //calendario grande 203 //alinhaAlturas($(".eventostop .event-calendar td")); 204 205});
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.