diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 154b0a3b..f8635809 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -299,7 +299,7 @@ class calendar extends rcube_plugin
$this->rc->output->set_env('calendar_driver', $this->rc->config->get('calendar_driver'), false);
$this->rc->output->set_env('calendar_resources', (bool)$this->rc->config->get('calendar_resources_driver'));
$this->rc->output->set_env('mscolors', jqueryui::get_color_values());
- $this->rc->output->set_env('identities-selector', $this->ui->identity_select(array('id' => 'edit-identities-list')));
+ $this->rc->output->set_env('identities-selector', $this->ui->identity_select(array('id' => 'edit-identities-list', 'aria-label' => $this->gettext('roleorganizer'))));
$view = get_input_value('view', RCUBE_INPUT_GPC);
if (in_array($view, array('agendaWeek', 'agendaDay', 'month', 'table')))
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 68ae94f3..ff9e5b4d 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -237,32 +237,33 @@ function rcube_calendar_ui(settings)
if (edit) {
rcmail.env.attachments[elem.id] = elem;
// delete icon
- content = document.createElement('A');
- content.href = '#delete';
- content.title = rcmail.gettext('delete');
- content.className = 'delete';
- $(content).click({id: elem.id}, function(e) { remove_attachment(this, e.data.id); return false; });
+ content = $('')
+ .attr('title', rcmail.gettext('delete'))
+ .attr('aria-label', rcmail.gettext('delete') + ' ' + Q(elem.name))
+ .addClass('delete')
+ .click({id: elem.id}, function(e) { remove_attachment(this, e.data.id); return false; });
if (!rcmail.env.deleteicon)
- content.innerHTML = rcmail.gettext('delete');
+ content.html(rcmail.gettext('delete'));
else {
img = document.createElement('IMG');
img.src = rcmail.env.deleteicon;
img.alt = rcmail.gettext('delete');
- content.appendChild(img);
+ content.append(img);
}
- li.appendChild(content);
+ content.appendTo(li);
}
// name/link
- content = document.createElement('A');
- content.innerHTML = elem.name;
- content.className = 'file';
- content.href = '#load';
- $(content).click({event: event, att: elem}, function(e) {
- load_attachment(e.data.event, e.data.att); return false; });
- li.appendChild(content);
+ content = $('')
+ .html(Q(elem.name))
+ .addClass('file')
+ .click({event: event, att: elem}, function(e) {
+ load_attachment(e.data.event, e.data.att);
+ return false;
+ })
+ .appendTo(li);
ul.appendChild(li);
}
@@ -283,7 +284,7 @@ function rcube_calendar_ui(settings)
};
// event details dialog (show only)
- var event_show_dialog = function(event)
+ var event_show_dialog = function(event, ev)
{
var $dialog = $("#eventshow").attr('class', 'uidialog');
var calendar = event.calendar && me.calendars[event.calendar] ? me.calendars[event.calendar] : { editable:false };
@@ -424,24 +425,34 @@ function rcube_calendar_ui(settings)
$dialog.dialog('close');
};
}
-
+
// open jquery UI dialog
$dialog.dialog({
modal: false,
resizable: !bw.ie6,
closeOnEscape: (!bw.ie6 && !bw.ie7), // disable for performance reasons
- title: Q(me.event_date_text(event)),
+ title: me.event_date_text(event),
open: function() {
- $dialog.parent().find('.ui-button').first().focus();
+ $dialog.attr('aria-hidden', 'false');
+ setTimeout(function(){
+ $dialog.parent().find('.ui-button:not(.ui-dialog-titlebar-close)').first().focus();
+ }, 5);
},
close: function() {
- $dialog.dialog('destroy').hide();
+ $dialog.dialog('destroy').attr('aria-hidden', 'true').hide();
},
buttons: buttons,
minWidth: 320,
width: 420
}).show();
-
+
+ // remember opener element (to be focused on close)
+ $dialog.data('opener', ev && rcube_event.is_keyboard(ev) ? ev.target : null);
+
+ // set voice title on dialog widget
+ $dialog.dialog('widget').removeAttr('aria-labelledby')
+ .attr('aria-label', me.event_date_text(event, true) + ', ', event.title);
+
// set dialog size according to content
me.dialog_resize($dialog.get(0), $dialog.height(), 420);
/*
@@ -472,8 +483,11 @@ function rcube_calendar_ui(settings)
// bring up the event dialog (jquery-ui popup)
var event_edit_dialog = function(action, event)
{
+ // copy opener element from show dialog
+ var op_elem = $("#eventshow:ui-dialog").data('opener');
+
// close show dialog first
- $("#eventshow:ui-dialog").dialog('close');
+ $("#eventshow:ui-dialog").data('opener', null).dialog('close');
var $dialog = $('
');
var calendar = event.calendar && me.calendars[event.calendar] ? me.calendars[event.calendar] : { editable:action=='new' };
@@ -675,8 +689,8 @@ function rcube_calendar_ui(settings)
$('#edit-tab-attachments')[(calendar.attachments?'show':'hide')]();
// activate the first tab
- $('#eventtabs').tabs('select', 0);
-
+ $('#eventtabs').tabs('option', 'active', 0);
+
// hack: set task to 'calendar' to make all dialog actions work correctly
var comm_path_before = rcmail.env.comm_path;
rcmail.env.comm_path = comm_path_before.replace(/_task=[a-z]+/, '_task=calendar');
@@ -690,15 +704,18 @@ function rcube_calendar_ui(settings)
closeOnEscape: false,
title: rcmail.gettext((action == 'edit' ? 'edit_event' : 'new_event'), 'calendar'),
open: function() {
+ editform.attr('aria-hidden', 'false');
$dialog.parent().find('.ui-dialog-buttonset .ui-button').first().addClass('mainaction');
},
close: function() {
- editform.hide().appendTo(document.body);
+ editform.hide().attr('aria-hidden', 'true').appendTo(document.body);
$dialog.dialog("destroy").remove();
rcmail.ksearch_blur();
rcmail.ksearch_destroy();
freebusy_data = {};
rcmail.env.comm_path = comm_path_before; // restore comm_path
+ if (op_elem)
+ $(op_elem).focus();
},
buttons: buttons,
minWidth: 500,
@@ -843,12 +860,13 @@ function rcube_calendar_ui(settings)
closeOnEscape: (!bw.ie6 && !bw.ie7),
title: rcmail.gettext('scheduletime', 'calendar'),
open: function() {
- $dialog.parent().find('.ui-dialog-buttonset .ui-button').first().focus();
+ $dialog.attr('aria-hidden', 'false').find('#shedule-find-next, #shedule-find-prev').not(':disabled').first().focus();
},
close: function() {
if (bw.ie6)
$("#edit-attendees-table").css('visibility','visible');
- $dialog.dialog("destroy").hide();
+ $dialog.dialog("destroy").attr('aria-hidden', 'true').hide();
+ // TODO: focus opener button
},
resizeStop: function() {
render_freebusy_overlay();
@@ -1316,6 +1334,9 @@ function rcube_calendar_ui(settings)
var now = new Date();
$('#shedule-find-prev').button('option', 'disabled', (event.start.getTime() < now.getTime()));
+
+ // speak new selection
+ rcmail.display_message(rcmail.gettext('suggestedslot', 'calendar') + ': ' + me.event_date_text(event, true), 'voice');
}
else {
alert(rcmail.gettext('noslotfound','calendar'));
@@ -1407,7 +1428,7 @@ function rcube_calendar_ui(settings)
if (organizer && !readonly)
dispname = rcmail.env['identities-selector'];
- var select = '