-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkalender.html
executable file
·119 lines (101 loc) · 3.34 KB
/
kalender.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
title: Kalender
heading: Kalender
subtitle: Finde unsere aktuellen Termine.
---
<link href='{{ site.baseurl }}/fullcalendar/packages/core/main.css' rel='stylesheet' />
<link href='{{ site.baseurl }}/fullcalendar/packages/daygrid/main.min.css' rel='stylesheet' />
<link href='{{ site.baseurl }}/fullcalendar/packages/list/main.min.css' rel='stylesheet' />
<script src='{{ site.baseurl }}/fullcalendar/packages/core/main.js'></script>
<script src='{{ site.baseurl }}/fullcalendar/packages/daygrid/main.js'></script>
<script src='{{ site.baseurl }}/fullcalendar/packages/list/main.js'></script>
<script src='{{ site.baseurl }}/fullcalendar/packages/google-calendar/main.js'></script>
<script src='{{ site.baseurl }}/fullcalendar/packages/core/locales-all.min.js'></script>
<script src='https://unpkg.com/popper.js/dist/umd/popper.min.js'></script>
<script src='https://unpkg.com/tooltip.js/dist/umd/tooltip.min.js'></script>
<script>
function tempAlert(msg, duration) {
var el = document.createElement("div");
el.setAttribute("class", "notification");
el.innerHTML = msg;
var wrapper = document.createElement("div");
wrapper.setAttribute("class", "notificationWrapper");
wrapper.appendChild(el);
setTimeout(function () {
wrapper.parentNode.removeChild(wrapper);
}, duration);
document.body.appendChild(wrapper);
}
document.addEventListener('DOMContentLoaded', function () {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: ['dayGrid', 'list', 'googleCalendar'],
eventLimit: true, // for all non-TimeGrid views
locale: 'de',
header: {
left: 'title',
center: '',
right: 'today prevYear,prev,next,nextYear'
},
footer: {
left: 'dayGridMonth,listMonth iCal',
center: '',
right: ''
},
customButtons: {
iCal: {
text: 'iCal',
click: function () {
const el = document.createElement('textarea');
el.value = '{{ site.google_calendar.ical }}';
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
tempAlert("Copied!", 2000);
}
}
},
eventRender: function(info) {
console.log(info);
var location = info.event.extendedProps.location || '-';
var time = info.event.start.toLocaleString();
var tooltip = new Tooltip(info.el, {
title: '<strong>' + info.event.title + '</strong><br><br><strong>Wann:</strong> ' + time + ' Uhr<br><strong>Wo:</strong> ' + location,
placement: 'top',
trigger: 'hover',
container: 'body',
html: 'true'
});
},
/* renew? */
/**
* TODOs
* - change theme (colors and radius of elements)
* - elements company colory
* - current day -> footer grey
* - radius of buttons
* - list view?
* - make ist globally configurable
* - use .min.* versions
*/
googleCalendarApiKey: '{{ site.google_calendar.api_key }}',
// US Holidays
events: {
googleCalendarId: '{{ site.google_calendar.calendar_id }}'
}
/* eventClick: function(event) {
// opens events in a popup window
window.open(event.url, '_blank', 'width=700,height=600');
return false;
} */
});
calendar.render();
});
</script>
<section class="diagonal patterned">
<div class="container">
<div id="calendar">
</div>
</div>
</section>