-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.js
50 lines (43 loc) · 1.09 KB
/
app.js
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
(function($) {
"use strict";
var options = {
events_source: 'events.json',
view: 'month',
modal: '#events-modal',
tmpl_path: 'tmpls/',
tmpl_cache: false,
language: 'de-DE',
onAfterViewLoad: function(view) {
$('.page-header h3').text(this.getTitle());
$('.btn-group button').removeClass('active');
$('button[data-calendar-view="' + view + '"]').addClass('active');
},
classes: {
months: {
general: 'label'
}
},
modal_title: function(event) { return event.title }
};
var calendar = $('#calendar').calendar(options);
$('.btn-group button[data-calendar-nav]').each(function() {
var $this = $(this);
$this.click(function() {
calendar.navigate($this.data('calendar-nav'));
});
});
$('.btn-group button[data-calendar-view]').each(function() {
var $this = $(this);
$this.click(function() {
calendar.view($this.data('calendar-view'));
});
});
}(jQuery));
function enhance_event(event) {
data = event.split(": ", 2);
return data[0] + ": <strong>" + data[1] + "</strong>"
}
function short_event(event) {
data = event.split(": ", 2);
return data[1];
}