343
| <![CDATA[<script type="text/javascript">
(function($) {
"use strict";
var options = {
events_source: [
{
"id": 2,
"title": "Teste teste teste",
"url": "http://www.cmcastelo.es.gov.br/agenda/ler/2/teste-teste-teste",
"class": "event-info",
"start": 1625836508000, // Milliseconds
"end": 1625922913000 // Milliseconds
},{
"id": 1,
"title": "teste",
"url": "http://www.cmcastelo.es.gov.br/agenda/ler/1/teste",
"class": "event-info",
"start": 1624476424000, // Milliseconds
"end": 1624476426000 // Milliseconds
}, ],
view: 'month',
modal: "#events-modal",
modal_type: "ajax", // ajax | iframe | template
tmpl_path: 'http://www.cmcastelo.es.gov.br/statics/assets/plugins/bootstrapcalendar/tmpls/',
tmpl_cache: false,
language: 'pt-BR',
day: '2023-09-22',
onAfterEventsLoad: function(events) {
if (!events) {
return;
}
var list = $('#eventlist');
list.html('');
$.each(events, function(key, val) {
$(document.createElement('li'))
.html('<a href="' + val.url + '">' + val.title + '</a>')
.appendTo(list);
});
},
onAfterViewLoad: function(view) {
$('.page-header h3').text(this.getTitle());
$('.btn-group button').removeClass('active');
$('button[data-calendar-view="' + view + '"]').addClass('active');
},
classes: {
months: {
general: 'label'
}
}
};
var calendar = $('#calendar').calendar(options);
$('.btn-group button[data-calendar-nav]').each(function() {
var $this = $(this);
$this.click(function() {
calendar.navigate($this.data('calendar-nav'));
});
});
$('.btn-group button[data-calendar-view]').each(function() {
var $this = $(this);
$this.click(function() {
calendar.view($this.data('calendar-view'));
});
});
$('#first_day').change(function() {
var value = $(this).val();
value = value.length ? parseInt(value) : null;
calendar.setOptions({
first_day: value
});
calendar.view();
});
$('#language').change(function() {
calendar.setLanguage($(this).val());
calendar.view();
});
$('#events-in-modal').change(function() {
var val = $(this).is(':checked') ? $(this).val() : null;
calendar.setOptions({
modal: val
});
});
$('#events-modal .modal-header, #events-modal .modal-footer').click(function(e) {
//e.preventDefault();
//e.stopPropagation();
});
// $('.event-item').addClass('popup');
// $('.event-item').each(function( i, l ){
// console.log( l.arrt('class') )
// });
//alert('teste')
}(jQuery));
</script>]]>
|