mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-25 04:09:11 -04:00
ALPHA 3.0.1e
This commit is contained in:
99
public/assets/js/calendar/calendar.js
vendored
99
public/assets/js/calendar/calendar.js
vendored
@@ -8,34 +8,27 @@ function init() {
|
||||
$( document ).ajaxError(function() {
|
||||
$( ".log" ).text( "Triggered ajaxError handler." );
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
(function($) {
|
||||
var mycalendar = $('.calendar');
|
||||
|
||||
$.post('/api/calendar/generate', { month: "7", year: "2018" } , function(data) {
|
||||
mycalendar.replaceWith(data);
|
||||
|
||||
console.log('Calendar Initialised');
|
||||
});
|
||||
})(jQuery);
|
||||
})(jQuery);
|
||||
|
||||
var d = new Date();
|
||||
var m = d.getMonth() + 1;
|
||||
var y = d.getFullYear();
|
||||
|
||||
generate(m,y);
|
||||
|
||||
}
|
||||
|
||||
function calsetactive(myid) {
|
||||
if (lastid != 99) {
|
||||
document.getElementById(lastid).classList.toggle("calendar-btn-active");
|
||||
}
|
||||
var myDate = document.getElementById(myid);
|
||||
myDate.classList.toggle("calendar-btn-active");
|
||||
lastid = myid;
|
||||
function openCalendar(btnDate)
|
||||
{
|
||||
(function($) {
|
||||
var calendarModal = $('.modal-content');
|
||||
$.post('/api/calendar/loadDay', { date: btnDate } , function(data) {
|
||||
calendarModal.replaceWith(data);
|
||||
console.log('Test');
|
||||
});
|
||||
|
||||
if (myDate.classList.contains("calendar-nothing")) {
|
||||
calendarEmptyDay(myid);
|
||||
} else {
|
||||
calendarOpen(myid);
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
}
|
||||
|
||||
function calendarOpen(myid) {
|
||||
@@ -60,52 +53,14 @@ function calendarEmptyDay(myid) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Modal Calendar
|
||||
// When the user clicks on <span> (x), close the modal
|
||||
function calendarmodalClose() {
|
||||
document.getElementById('calendar-modal').style.display = "none";
|
||||
}
|
||||
|
||||
// When the user clicks anywhere outside of the modal, close it
|
||||
window.onclick = function(event) {
|
||||
if (event.target == document.getElementById('calendar-modal')) {
|
||||
document.getElementById('calendar-modal').style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
// Boutton Back and Next on calendar Head
|
||||
function calendarback() {
|
||||
console.log("click detect");
|
||||
lastid = 99;
|
||||
$(function() {
|
||||
var mycalendar = $('.calendar');
|
||||
varmonth = varmonth - 1;
|
||||
if (varmonth < 1) {
|
||||
varyear = varyear - 1;
|
||||
varmonth = 12;
|
||||
}
|
||||
$.get('/adminV2/assets/lib/calendar/calendar.php?month='+varmonth+'&year='+varyear, function(data) {
|
||||
mycalendar.replaceWith(data);
|
||||
console.log("Going next");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function calendarnext(){
|
||||
console.log("click detect");
|
||||
lastid = 99;
|
||||
$(function() {
|
||||
var mycalendar = $('.calendar');
|
||||
varmonth = varmonth + 1;
|
||||
if (varmonth > 12) {
|
||||
varyear = varyear + 1;
|
||||
varmonth = 1;
|
||||
}
|
||||
$.get('/adminV2/assets/lib/calendar/calendar.php?month='+varmonth+'&year='+varyear, function(data) {
|
||||
mycalendar.replaceWith(data);
|
||||
console.log("Going next");
|
||||
});
|
||||
});
|
||||
}
|
||||
function generate(pmonth,pyear){
|
||||
(function($) {
|
||||
var mycalendar = $('.calendar');
|
||||
|
||||
$.post('/api/calendar/generate', { month: pmonth, year: pyear } , function(data) {
|
||||
mycalendar.replaceWith(data);
|
||||
|
||||
console.log('Calendar Initialised');
|
||||
});
|
||||
})(jQuery);
|
||||
}
|
||||
Reference in New Issue
Block a user