diff options
author | sijanec <sijanecantonluka@gmail.com> | 2020-09-30 10:24:05 +0200 |
---|---|---|
committer | sijanec <sijanecantonluka@gmail.com> | 2020-09-30 10:24:05 +0200 |
commit | 473486647475ee26470fc33f5eb95f51b00fdcc5 (patch) | |
tree | 826bb411d67818fdedae9ce2259f767908378076 /dist/js/timetable.js | |
parent | changelog (diff) | |
download | beziapp-473486647475ee26470fc33f5eb95f51b00fdcc5.tar beziapp-473486647475ee26470fc33f5eb95f51b00fdcc5.tar.gz beziapp-473486647475ee26470fc33f5eb95f51b00fdcc5.tar.bz2 beziapp-473486647475ee26470fc33f5eb95f51b00fdcc5.tar.lz beziapp-473486647475ee26470fc33f5eb95f51b00fdcc5.tar.xz beziapp-473486647475ee26470fc33f5eb95f51b00fdcc5.tar.zst beziapp-473486647475ee26470fc33f5eb95f51b00fdcc5.zip |
Diffstat (limited to 'dist/js/timetable.js')
-rwxr-xr-x | dist/js/timetable.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dist/js/timetable.js b/dist/js/timetable.js index 79539f6..aa73a9a 100755 --- a/dist/js/timetable.js +++ b/dist/js/timetable.js @@ -18,4 +18,4 @@ function displayTimetable(weekly_timetable,date_object){let transformed_timetabl let lesson_object={id:JSON.stringify(lesson_metadata),title:lesson["acronym"],start:date_string+" "+lesson_times[0],end:date_string+" "+lesson_times[1],backgroundColor:bg_color,textColor:fg_color};transformed_timetable.push(lesson_object);});} calendar_obj.removeAllEvents();calendar_obj.addEventSource(transformed_timetable);} function eventClickHandler(eventClickInfo){let lesson_metadata=JSON.parse(eventClickInfo.event.id);let lesson_subject=lesson_metadata["subject"];let lesson_teacher=lesson_metadata["teacher"];let lesson_classroom=lesson_metadata["classroom"];let lesson_class=lesson_metadata["class"];let lesson_duration=lesson_metadata["start"]+" - "+lesson_metadata["end"];$("#lesson-subject").text(lesson_subject);$("#lesson-teacher").text(lesson_teacher);$("#lesson-class").text(lesson_class);$("#lesson-classroom").text(lesson_classroom);$("#lesson-duration").text(lesson_duration);const modal=document.querySelectorAll(".side-modal")[0];M.Sidenav.getInstance(modal).open();} -document.addEventListener("DOMContentLoaded",()=>{checkLogin();let calendarEl=document.getElementById("calendar");calendar_obj=new FullCalendar.Calendar(calendarEl,{plugins:["timeGrid"],eventClick:eventClickHandler,defaultView:"timeGridWeek",contentHeight:"auto",height:"auto",width:"auto",timeGridEventMinHeight:35,nowIndicator:true,firstDay:1,weekends:false,minTime:"07:10:00",maxTime:"19:10:00"});calendar_obj.render();loadTimetable(new Date());$(".fc-today-button, .fc-prev-button, .fc-next-button").click(()=>{loadTimetable(calendar_obj.getDate());});$("#refresh-icon").click(()=>{loadTimetable(calendar_obj.getDate(),true);});const menus=document.querySelectorAll(".side-menu");M.Sidenav.init(menus,{edge:"right",draggable:true});const modals=document.querySelectorAll('.side-modal');M.Sidenav.init(modals,{edge:'left',draggable:false});});
\ No newline at end of file +document.addEventListener("DOMContentLoaded",()=>{checkLogin();let calendarEl=document.getElementById("calendar");calendar_obj=new FullCalendar.Calendar(calendarEl,{plugins:["timeGrid"],eventClick:eventClickHandler,defaultView:"timeGridWeek",contentHeight:"auto",height:"auto",width:"auto",timeGridEventMinHeight:35,nowIndicator:true,firstDay:1,weekends:false,timeFormat:'H(:mm)',minTime:"07:10:00",maxTime:"19:10:00"});calendar_obj.render();loadTimetable(new Date());$(".fc-today-button, .fc-prev-button, .fc-next-button").click(()=>{loadTimetable(calendar_obj.getDate());});$("#refresh-icon").click(()=>{loadTimetable(calendar_obj.getDate(),true);});const menus=document.querySelectorAll(".side-menu");M.Sidenav.init(menus,{edge:"right",draggable:true});const modals=document.querySelectorAll('.side-modal');M.Sidenav.init(modals,{edge:'left',draggable:false});});
\ No newline at end of file |