progress indicators, bug fixes, after a while
This commit is contained in:
132
public/assets/js/dashboard.js
vendored
132
public/assets/js/dashboard.js
vendored
@@ -1,113 +1,25 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
/*
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: base_url + '/dashboard/get_events',
|
||||
// data : formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
async: false,
|
||||
success: function (data){
|
||||
init_calendar(data);
|
||||
},
|
||||
error: function(error){
|
||||
var output = $.parseJSON(error.responseText);
|
||||
console.log(output.errors);
|
||||
$('#ipNotifyArea').removeClass('hidden');
|
||||
$('#ipNotifyArea').addClass('alert alert-danger');
|
||||
$.each(output.errors, function (key, value) {
|
||||
console.log(value[0]);
|
||||
$('#ipNotifyArea').text(value[0]);
|
||||
});
|
||||
}
|
||||
type: "get",
|
||||
url: base_url + '/dashboard/get_events',
|
||||
// data : formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
async: false,
|
||||
success: function (data){
|
||||
//init_calendar(data);
|
||||
},
|
||||
error: function(error){
|
||||
var output = $.parseJSON(error.responseText);
|
||||
console.log(output.errors);
|
||||
$('#ipNotifyArea').removeClass('hidden');
|
||||
$('#ipNotifyArea').addClass('alert alert-danger');
|
||||
$.each(output.errors, function (key, value) {
|
||||
//console.log(value[0]);
|
||||
$('#ipNotifyArea').text(value[0]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function init_calendar(theData) {
|
||||
console.log(theData);
|
||||
$.each(theData, function (key, value) {
|
||||
console.log(value);
|
||||
});
|
||||
if( typeof ($.fn.fullCalendar) === 'undefined'){ return; }
|
||||
// console.log('init_calendar');
|
||||
|
||||
var date = new Date(),
|
||||
d = date.getDate(),
|
||||
m = date.getMonth(),
|
||||
y = date.getFullYear(),
|
||||
started,
|
||||
categoryClass;
|
||||
|
||||
var calendar = $('#calendar').fullCalendar({
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month,agendaWeek,agendaDay,listMonth'
|
||||
},
|
||||
selectable: true,
|
||||
selectHelper: true,
|
||||
select: function(start, end, allDay) {
|
||||
$('#fc_create').click();
|
||||
|
||||
started = start;
|
||||
ended = end;
|
||||
|
||||
$(".antosubmit").on("click", function() {
|
||||
var title = $("#title").val();
|
||||
if (end) {
|
||||
ended = end;
|
||||
}
|
||||
|
||||
categoryClass = $("#event_type").val();
|
||||
|
||||
if (title) {
|
||||
calendar.fullCalendar('renderEvent', {
|
||||
title: title,
|
||||
start: started,
|
||||
end: end,
|
||||
allDay: allDay
|
||||
},
|
||||
true // make the event "stick"
|
||||
);
|
||||
}
|
||||
|
||||
$('#title').val('');
|
||||
|
||||
calendar.fullCalendar('unselect');
|
||||
|
||||
$('.antoclose').click();
|
||||
|
||||
return false;
|
||||
});
|
||||
},
|
||||
eventClick: function(calEvent, jsEvent, view) {
|
||||
$('#fc_edit').click();
|
||||
$('#title2').val(calEvent.title);
|
||||
|
||||
categoryClass = $("#event_type").val();
|
||||
|
||||
$(".antosubmit2").on("click", function() {
|
||||
calEvent.title = $("#title2").val();
|
||||
|
||||
calendar.fullCalendar('updateEvent', calEvent);
|
||||
$('.antoclose2').click();
|
||||
});
|
||||
|
||||
calendar.fullCalendar('unselect');
|
||||
},
|
||||
editable: true,
|
||||
events: [
|
||||
{
|
||||
title: 'All Day Event',
|
||||
start: new Date(y, m, 1)
|
||||
}
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
*/
|
||||
});
|
||||
Reference in New Issue
Block a user