Elastic support for new fullCalendar
This commit is contained in:
parent
3efc8d0389
commit
7cc525e4e9
8 changed files with 1546 additions and 971 deletions
|
@ -374,14 +374,15 @@ class calendar extends rcube_plugin
|
|||
}
|
||||
|
||||
$field_id = 'rcmfd_default_view';
|
||||
$view = $this->rc->config->get('calendar_default_view', $this->defaults['calendar_default_view']);
|
||||
$select = new html_select(array('name' => '_default_view', 'id' => $field_id));
|
||||
$select->add($this->gettext('day'), "agendaDay");
|
||||
$select->add($this->gettext('week'), "agendaWeek");
|
||||
$select->add($this->gettext('month'), "month");
|
||||
$select->add($this->gettext('agenda'), "table");
|
||||
$select->add($this->gettext('agenda'), "list");
|
||||
$p['blocks']['view']['options']['default_view'] = array(
|
||||
'title' => html::label($field_id, rcube::Q($this->gettext('default_view'))),
|
||||
'content' => $select->show($this->rc->config->get('calendar_default_view', $this->defaults['calendar_default_view'])),
|
||||
'content' => $select->show($view == 'table' ? 'list' : $view),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -89,9 +89,11 @@ function rcube_calendar_ui(settings)
|
|||
start: settings.work_start + ':00',
|
||||
end: settings.work_end + ':00'
|
||||
},
|
||||
scrollTime: settings.work_start + ':00',
|
||||
views: {
|
||||
list: {
|
||||
titleFormat: settings.dates_long,
|
||||
listDayFormat: settings.date_long,
|
||||
visibleRange: function(currentDate) {
|
||||
return {
|
||||
start: currentDate.clone(),
|
||||
|
@ -102,7 +104,7 @@ function rcube_calendar_ui(settings)
|
|||
month: {
|
||||
columnFormat: 'ddd', // Mon
|
||||
titleFormat: 'MMMM YYYY',
|
||||
eventLimit: 6
|
||||
eventLimit: 4
|
||||
},
|
||||
week: {
|
||||
columnFormat: 'ddd ' + settings.date_short, // Mon 9/7
|
||||
|
@ -114,7 +116,7 @@ function rcube_calendar_ui(settings)
|
|||
}
|
||||
},
|
||||
timeFormat: settings.time_format,
|
||||
axisFormat : settings.time_format,
|
||||
slotLabelFormat: settings.time_format,
|
||||
defaultView: rcmail.env.view || settings.default_view,
|
||||
allDayText: rcmail.gettext('all-day', 'calendar'),
|
||||
buttonText: {
|
||||
|
@ -159,8 +161,8 @@ function rcube_calendar_ui(settings)
|
|||
loc.text(event.location);
|
||||
element.find('.fc-list-item-title').after(loc);
|
||||
}
|
||||
else if (event.location && view.name != 'month') {
|
||||
element.find('div.fc-title').after('<div class="fc-event-location">').html('@ ' + Q(event.location));
|
||||
else if (event.location) {
|
||||
element.find('div.fc-title').after($('<div class="fc-event-location">').html('@ ' + Q(event.location)));
|
||||
}
|
||||
var time_element = element.find('div.fc-time');
|
||||
if (event.sensitivity && event.sensitivity != 'public')
|
||||
|
@ -3492,15 +3494,16 @@ function rcube_calendar_ui(settings)
|
|||
|
||||
// choose black text color when background is bright, white otherwise
|
||||
if (color = settings.event_coloring % 2 ? '' : '#' + cal.color) {
|
||||
me.calendars[id].color = color;
|
||||
me.calendars[id].textColor = 'white';
|
||||
|
||||
if (/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i.test(color)) {
|
||||
// use information about brightness calculation found at
|
||||
// http://javascriptrules.com/2009/08/05/css-color-brightness-contrast-using-javascript/
|
||||
brightness = (parseInt(RegExp.$1, 16) * 299 + parseInt(RegExp.$2, 16) * 587 + parseInt(RegExp.$3, 16) * 114) / 1000;
|
||||
if (brightness > 125)
|
||||
me.calendars[id].textColor = 'black';
|
||||
me.calendars[id].textColor = '#222';
|
||||
}
|
||||
|
||||
me.calendars[id].color = color;
|
||||
}
|
||||
|
||||
if (fc && (cal.active || cal.subscribed)) {
|
||||
|
@ -4314,13 +4317,13 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
|||
});
|
||||
|
||||
$.each(['prev', 'today', 'next'], function() {
|
||||
var btn = $('.fc-header-toolbar > .fc-right').find('.fc-button-' + this);
|
||||
$('<button>').attr({'class': 'btn btn-secondary', type: 'button'})
|
||||
var btn = $('.fc-header-toolbar > .fc-right').find('.fc-' + this + '-button');
|
||||
$('<button>').attr({'class': 'btn btn-secondary ' + this, type: 'button'})
|
||||
.text(btn.text()).appendTo(nav).on('click', function() { btn.click(); });
|
||||
});
|
||||
|
||||
$('#timezone-display').appendTo($('.fc-header-toolbar > .fc-center')).removeClass('hidden');
|
||||
$('#agendaoptions').detach().insertAfter('table.fc-header');
|
||||
$('#agendaoptions').detach().insertAfter('.fc-header-toolbar');
|
||||
|
||||
$('.content-frame-navigation a.button.date').appendTo('.content > .searchbar');
|
||||
|
||||
|
|
|
@ -368,7 +368,7 @@ class calendar_ui
|
|||
html::span('input-group-text', $this->cal->gettext('listrange')))
|
||||
. $select_range->show($this->rc->config->get('calendar_agenda_range', $this->cal->defaults['calendar_agenda_range']))
|
||||
);
|
||||
|
||||
/*
|
||||
$select_sections = new html_select(array('name' => 'listsections', 'id' => 'agenda-listsections', 'class' => 'form-control custom-select'));
|
||||
$select_sections->add('---', '');
|
||||
foreach (array('day' => 'libcalendaring.days', 'week' => 'libcalendaring.weeks', 'month' => 'libcalendaring.months', 'smart' => 'calendar.smartsections') as $val => $label)
|
||||
|
@ -379,7 +379,7 @@ class calendar_ui
|
|||
html::span('input-group-text', $this->cal->gettext('listsections')))
|
||||
. $select_sections->show($this->rc->config->get('calendar_agenda_sections', $this->cal->defaults['calendar_agenda_sections']))
|
||||
);
|
||||
|
||||
*/
|
||||
return html::div($attrib, $html);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
|||
|
||||
// create list of event sources AKA calendars
|
||||
var id, src, event_sources = [];
|
||||
var add_url = (rcmail.env.search ? '&q='+escape(rcmail.env.search) : '');
|
||||
var add_url = '&mode=print' + (rcmail.env.search ? '&q='+escape(rcmail.env.search) : '');
|
||||
for (id in rcmail.env.calendars) {
|
||||
if (!rcmail.env.calendars[id].active)
|
||||
continue;
|
||||
|
@ -93,6 +93,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
|||
views: {
|
||||
list: {
|
||||
titleFormat: settings.dates_long,
|
||||
listDayFormat: settings.date_long,
|
||||
visibleRange: function(currentDate) {
|
||||
return {
|
||||
start: currentDate.clone(),
|
||||
|
@ -103,7 +104,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
|||
month: {
|
||||
columnFormat: 'ddd', // Mon
|
||||
titleFormat: 'MMMM YYYY',
|
||||
eventLimit: 6
|
||||
eventLimit: 10
|
||||
},
|
||||
week: {
|
||||
columnFormat: 'ddd ' + settings.date_short, // Mon 9/7
|
||||
|
@ -115,7 +116,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
|||
}
|
||||
},
|
||||
timeFormat: settings.time_format,
|
||||
axisFormat : settings.time_format,
|
||||
slotLabelFormat: settings.time_format,
|
||||
allDayText: rcmail.gettext('all-day', 'calendar'),
|
||||
defaultDate: viewdate,
|
||||
defaultView: rcmail.env.view,
|
||||
|
@ -186,7 +187,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
|||
if (selector) {
|
||||
selector = $('#' + selector);
|
||||
|
||||
$('.fc-right > button').each(function() {
|
||||
$('.fc-right button').each(function() {
|
||||
var cl = 'btn btn-secondary', btn = $(this);
|
||||
|
||||
if (btn.is('.fc-state-active')) {
|
||||
|
|
File diff suppressed because it is too large
Load diff
1246
plugins/libkolab/skins/elastic/include/fullcalendar.less
Normal file
1246
plugins/libkolab/skins/elastic/include/fullcalendar.less
Normal file
File diff suppressed because it is too large
Load diff
|
@ -265,6 +265,7 @@
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
td.invite {
|
||||
label:before {
|
||||
line-height: 1.6;
|
||||
|
@ -337,9 +338,8 @@
|
|||
}
|
||||
|
||||
select {
|
||||
padding: 0 .5rem;
|
||||
padding-left: .5rem;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
@skin: "elastic";
|
||||
@skin-path: "../../../../skins/@{skin}";
|
||||
@root: "../@{skin}";
|
||||
|
||||
@import (reference) "@{skin-path}/styles/variables";
|
||||
@import (reference) "@{skin-path}/styles/mixins";
|
||||
|
|
Loading…
Add table
Reference in a new issue