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';
|
$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 = new html_select(array('name' => '_default_view', 'id' => $field_id));
|
||||||
$select->add($this->gettext('day'), "agendaDay");
|
$select->add($this->gettext('day'), "agendaDay");
|
||||||
$select->add($this->gettext('week'), "agendaWeek");
|
$select->add($this->gettext('week'), "agendaWeek");
|
||||||
$select->add($this->gettext('month'), "month");
|
$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(
|
$p['blocks']['view']['options']['default_view'] = array(
|
||||||
'title' => html::label($field_id, rcube::Q($this->gettext('default_view'))),
|
'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',
|
start: settings.work_start + ':00',
|
||||||
end: settings.work_end + ':00'
|
end: settings.work_end + ':00'
|
||||||
},
|
},
|
||||||
|
scrollTime: settings.work_start + ':00',
|
||||||
views: {
|
views: {
|
||||||
list: {
|
list: {
|
||||||
titleFormat: settings.dates_long,
|
titleFormat: settings.dates_long,
|
||||||
|
listDayFormat: settings.date_long,
|
||||||
visibleRange: function(currentDate) {
|
visibleRange: function(currentDate) {
|
||||||
return {
|
return {
|
||||||
start: currentDate.clone(),
|
start: currentDate.clone(),
|
||||||
|
@ -102,7 +104,7 @@ function rcube_calendar_ui(settings)
|
||||||
month: {
|
month: {
|
||||||
columnFormat: 'ddd', // Mon
|
columnFormat: 'ddd', // Mon
|
||||||
titleFormat: 'MMMM YYYY',
|
titleFormat: 'MMMM YYYY',
|
||||||
eventLimit: 6
|
eventLimit: 4
|
||||||
},
|
},
|
||||||
week: {
|
week: {
|
||||||
columnFormat: 'ddd ' + settings.date_short, // Mon 9/7
|
columnFormat: 'ddd ' + settings.date_short, // Mon 9/7
|
||||||
|
@ -114,7 +116,7 @@ function rcube_calendar_ui(settings)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
timeFormat: settings.time_format,
|
timeFormat: settings.time_format,
|
||||||
axisFormat : settings.time_format,
|
slotLabelFormat: settings.time_format,
|
||||||
defaultView: rcmail.env.view || settings.default_view,
|
defaultView: rcmail.env.view || settings.default_view,
|
||||||
allDayText: rcmail.gettext('all-day', 'calendar'),
|
allDayText: rcmail.gettext('all-day', 'calendar'),
|
||||||
buttonText: {
|
buttonText: {
|
||||||
|
@ -159,8 +161,8 @@ function rcube_calendar_ui(settings)
|
||||||
loc.text(event.location);
|
loc.text(event.location);
|
||||||
element.find('.fc-list-item-title').after(loc);
|
element.find('.fc-list-item-title').after(loc);
|
||||||
}
|
}
|
||||||
else if (event.location && view.name != 'month') {
|
else if (event.location) {
|
||||||
element.find('div.fc-title').after('<div class="fc-event-location">').html('@ ' + Q(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');
|
var time_element = element.find('div.fc-time');
|
||||||
if (event.sensitivity && event.sensitivity != 'public')
|
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
|
// choose black text color when background is bright, white otherwise
|
||||||
if (color = settings.event_coloring % 2 ? '' : '#' + cal.color) {
|
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)) {
|
if (/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i.test(color)) {
|
||||||
// use information about brightness calculation found at
|
// use information about brightness calculation found at
|
||||||
// http://javascriptrules.com/2009/08/05/css-color-brightness-contrast-using-javascript/
|
// 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;
|
brightness = (parseInt(RegExp.$1, 16) * 299 + parseInt(RegExp.$2, 16) * 587 + parseInt(RegExp.$3, 16) * 114) / 1000;
|
||||||
if (brightness > 125)
|
if (brightness > 125)
|
||||||
me.calendars[id].textColor = 'black';
|
me.calendars[id].textColor = '#222';
|
||||||
}
|
}
|
||||||
|
|
||||||
me.calendars[id].color = color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fc && (cal.active || cal.subscribed)) {
|
if (fc && (cal.active || cal.subscribed)) {
|
||||||
|
@ -4314,13 +4317,13 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
});
|
});
|
||||||
|
|
||||||
$.each(['prev', 'today', 'next'], function() {
|
$.each(['prev', 'today', 'next'], function() {
|
||||||
var btn = $('.fc-header-toolbar > .fc-right').find('.fc-button-' + this);
|
var btn = $('.fc-header-toolbar > .fc-right').find('.fc-' + this + '-button');
|
||||||
$('<button>').attr({'class': 'btn btn-secondary', type: 'button'})
|
$('<button>').attr({'class': 'btn btn-secondary ' + this, type: 'button'})
|
||||||
.text(btn.text()).appendTo(nav).on('click', function() { btn.click(); });
|
.text(btn.text()).appendTo(nav).on('click', function() { btn.click(); });
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#timezone-display').appendTo($('.fc-header-toolbar > .fc-center')).removeClass('hidden');
|
$('#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');
|
$('.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')))
|
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_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 = new html_select(array('name' => 'listsections', 'id' => 'agenda-listsections', 'class' => 'form-control custom-select'));
|
||||||
$select_sections->add('---', '');
|
$select_sections->add('---', '');
|
||||||
foreach (array('day' => 'libcalendaring.days', 'week' => 'libcalendaring.weeks', 'month' => 'libcalendaring.months', 'smart' => 'calendar.smartsections') as $val => $label)
|
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')))
|
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']))
|
. $select_sections->show($this->rc->config->get('calendar_agenda_sections', $this->cal->defaults['calendar_agenda_sections']))
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
return html::div($attrib, $html);
|
return html::div($attrib, $html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
|
|
||||||
// create list of event sources AKA calendars
|
// create list of event sources AKA calendars
|
||||||
var id, src, event_sources = [];
|
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) {
|
for (id in rcmail.env.calendars) {
|
||||||
if (!rcmail.env.calendars[id].active)
|
if (!rcmail.env.calendars[id].active)
|
||||||
continue;
|
continue;
|
||||||
|
@ -93,6 +93,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
views: {
|
views: {
|
||||||
list: {
|
list: {
|
||||||
titleFormat: settings.dates_long,
|
titleFormat: settings.dates_long,
|
||||||
|
listDayFormat: settings.date_long,
|
||||||
visibleRange: function(currentDate) {
|
visibleRange: function(currentDate) {
|
||||||
return {
|
return {
|
||||||
start: currentDate.clone(),
|
start: currentDate.clone(),
|
||||||
|
@ -103,7 +104,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
month: {
|
month: {
|
||||||
columnFormat: 'ddd', // Mon
|
columnFormat: 'ddd', // Mon
|
||||||
titleFormat: 'MMMM YYYY',
|
titleFormat: 'MMMM YYYY',
|
||||||
eventLimit: 6
|
eventLimit: 10
|
||||||
},
|
},
|
||||||
week: {
|
week: {
|
||||||
columnFormat: 'ddd ' + settings.date_short, // Mon 9/7
|
columnFormat: 'ddd ' + settings.date_short, // Mon 9/7
|
||||||
|
@ -115,7 +116,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
timeFormat: settings.time_format,
|
timeFormat: settings.time_format,
|
||||||
axisFormat : settings.time_format,
|
slotLabelFormat: settings.time_format,
|
||||||
allDayText: rcmail.gettext('all-day', 'calendar'),
|
allDayText: rcmail.gettext('all-day', 'calendar'),
|
||||||
defaultDate: viewdate,
|
defaultDate: viewdate,
|
||||||
defaultView: rcmail.env.view,
|
defaultView: rcmail.env.view,
|
||||||
|
@ -186,7 +187,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
if (selector) {
|
if (selector) {
|
||||||
selector = $('#' + selector);
|
selector = $('#' + selector);
|
||||||
|
|
||||||
$('.fc-right > button').each(function() {
|
$('.fc-right button').each(function() {
|
||||||
var cl = 'btn btn-secondary', btn = $(this);
|
var cl = 'btn btn-secondary', btn = $(this);
|
||||||
|
|
||||||
if (btn.is('.fc-state-active')) {
|
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 {
|
td.invite {
|
||||||
label:before {
|
label:before {
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
|
@ -337,9 +338,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
padding: 0 .5rem;
|
padding-left: .5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
@skin: "elastic";
|
@skin: "elastic";
|
||||||
@skin-path: "../../../../skins/@{skin}";
|
@skin-path: "../../../../skins/@{skin}";
|
||||||
|
@root: "../@{skin}";
|
||||||
|
|
||||||
@import (reference) "@{skin-path}/styles/variables";
|
@import (reference) "@{skin-path}/styles/variables";
|
||||||
@import (reference) "@{skin-path}/styles/mixins";
|
@import (reference) "@{skin-path}/styles/mixins";
|
||||||
|
|
Loading…
Add table
Reference in a new issue