aboutsummaryrefslogtreecommitdiffstats
path: root/src/static/js/fullcalendar-options.js
diff options
context:
space:
mode:
authorJeremy Plsek <jplsek@iol.unh.edu>2019-12-20 10:50:41 -0500
committerJeremy Plsek <jplsek@iol.unh.edu>2020-02-17 16:01:03 -0500
commitd63a08e56716358ea4daa30d3050fa01df65a837 (patch)
tree10873a809c29492efcc1988cc65ccf8cf054f7e7 /src/static/js/fullcalendar-options.js
parent80f9bb0bb514133363bd0a40edb8b10ddb8d3a51 (diff)
js: use npm instead of bower
Bower is considered deprecated, so switch to npm. - Update all dependencies - Use npm's version of mxgraph - Use npm's version of jquery - Use npm's version of plotly - Fix mxgraph to use styles and images from the correct location - Removed random csrf token input in nav bar and use js to get csrf token - Remove all calendar and some resource files since they were not used Change-Id: I30d6bd91cded9547caa4c0a5247cd9f214fe9798 Signed-off-by: Jeremy Plsek <jplsek@iol.unh.edu>
Diffstat (limited to 'src/static/js/fullcalendar-options.js')
-rw-r--r--src/static/js/fullcalendar-options.js101
1 files changed, 0 insertions, 101 deletions
diff --git a/src/static/js/fullcalendar-options.js b/src/static/js/fullcalendar-options.js
deleted file mode 100644
index a29103a..0000000
--- a/src/static/js/fullcalendar-options.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/*****************************************************************************
-* Copyright (c) 2016 Max Breitenfeldt and others.
-*
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Apache License, Version 2.0
-* which accompanies this distribution, and is available at
-* http://www.apache.org/licenses/LICENSE-2.0
-*****************************************************************************/
-
-
-var tmpevent;
-
-function sendEventToForm(event) {
- $('#starttimepicker').data("DateTimePicker").date(event.start);
- $('#endtimepicker').data("DateTimePicker").date(event.end);
-}
-
-var calendarOptions = {
- height: 600,
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'agendaWeek,month'
- },
- timezone: user_timezone, // set in booking_calendar.html
- defaultView: 'month',
- slotDuration: '00:60:00',
- slotLabelFormat: "HH:mm",
- firstDay: 1,
- allDaySlot: false,
- selectOverlap: false,
- eventOverlap: false,
- selectable: true,
- editable: false,
- eventLimit: true, // allow "more" link when too many events
- timeFormat: 'H(:mm)', // uppercase H for 24-hour clock
- unselectAuto: true,
- nowIndicator: true,
-
- // selectHelper is only working in the agendaWeek view, this is a workaround:
- // if an event is selected, the existing selection is removed and a temporary event is added
- // to the calendar
- select: function (start, end) {
- if (tmpevent != undefined) {
- $('#calendar').fullCalendar('removeEvents', tmpevent.id);
- $('#calendar').fullCalendar('rerenderEvents');
- tmpevent = undefined;
- }
- // the times need to be converted here to make them show up in the agendaWeek view if they
- // are created in the month view. If they are not converted, the tmpevent will only show
- // up in the (deactivated) allDaySlot
- start = moment(start);
- end = moment(end);
-
- tmpevent = {
- id: '537818f62bc63518ece15338fb86c8be',
- title: 'New Booking',
- start: start,
- end: end,
- editable: true
- };
-
- $('#calendar').fullCalendar('renderEvent', tmpevent, true);
- sendEventToForm(tmpevent);
- },
-
- eventClick: function (event) {
- if (tmpevent != undefined) {
- if (event.id != tmpevent.id) {
- $('#calendar').fullCalendar('removeEvents', tmpevent.id);
- $('#calendar').fullCalendar('rerenderEvents');
- tmpevent = undefined;
- }
- }
-
- // tmpevent is deleted if a real event is clicked, load event details
- if (tmpevent == undefined) {
- var booking_detail_url = booking_detail_prefix + event.id;
-
- $.ajax({
- url: booking_detail_url,
- type: 'get',
- success: function (data) {
- $('#booking_detail_content').html(data);
- },
- failure: function (data) {
- alert('Error loading booking details');
- }
- });
- $('#booking_detail_modal').modal('show');
- }
- },
-
- eventDrop: function (event) {
- sendEventToForm(event);
- },
-
- eventResize: function (event) {
- sendEventToForm(event);
- }
-};