summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-05-07 17:34:28 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-05-07 17:34:28 +0200
commitb2992dd2283c3d0ac95f3293497dfaed0493f607 (patch)
tree038053fb7e932450abb4151ceb053be2a8311b8a /program
parent184ed2efe2258579c886de337446fcbb05f5faf4 (diff)
Further accessibility improvements regarding keyboard navigation and document structure
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js14
-rw-r--r--program/steps/mail/compose.inc5
-rw-r--r--program/steps/mail/func.inc21
-rw-r--r--program/steps/mail/show.inc7
4 files changed, 34 insertions, 13 deletions
diff --git a/program/js/app.js b/program/js/app.js
index fecd5a0ee..11236d0cb 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -197,7 +197,7 @@ function rcube_webmail()
// enable general commands
this.enable_command('close', 'logout', 'mail', 'addressbook', 'settings', 'save-pref',
- 'compose', 'undo', 'about', 'switch-task', 'menu-open', 'menu-save', true);
+ 'compose', 'undo', 'about', 'switch-task', 'menu-open', 'menu-close', 'menu-save', true);
// set active task button
this.set_button(this.task, 'sel');
@@ -711,7 +711,8 @@ function rcube_webmail()
}
case 'menu-save':
- this.triggerEvent(command, {props:props, e:event});
+ case 'menu-close':
+ this.triggerEvent(command, {props:props, originalEvent:event});
return false;
case 'open':
@@ -2316,6 +2317,7 @@ function rcube_webmail()
url._page = page;
this.http_request('list', url, lock);
+ this.update_state({ _mbox: mbox, _page: (page && page > 1 ? page : null) });
};
// removes messages that doesn't exists from list selection array
@@ -3592,6 +3594,7 @@ function rcube_webmail()
$('<a>').addClass('insertresponse active')
.attr('href', '#')
.attr('rel', key)
+ .attr('tabindex', '0')
.html(this.quote_html(response.name))
.appendTo(li)
.mousedown(function(e){
@@ -6940,6 +6943,13 @@ function rcube_webmail()
this.start_keepalive();
};
+ // update browser location to remember current view
+ this.update_state = function(query)
+ {
+ if (window.history.replaceState)
+ window.history.replaceState({}, document.title, rcmail.url('', query));
+ };
+
// send a http request to the server
this.http_request = function(action, query, lock)
{
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 2b717d673..b56938596 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -977,7 +977,7 @@ function rcmail_compose_body($attrib)
$OUTPUT->set_env('spellcheck_langs', join(',', $editor_lang_set));
}
- $out .= "\n".'<iframe name="savetarget" src="program/resources/blank.gif" style="width:0;height:0;border:none;visibility:hidden;"></iframe>';
+ $out .= "\n".'<iframe name="savetarget" src="program/resources/blank.gif" style="width:0;height:0;border:none;visibility:hidden;" aria-hidden="true"></iframe>';
return $out;
}
@@ -1864,9 +1864,10 @@ function rcmail_compose_responses_list($attrib)
foreach ($RCMAIL->get_compose_responses(true) as $response) {
$key = $response['key'];
$item = html::a(array(
- 'href '=> '#'.urlencode($response['name']),
+ 'href' => '#'.urlencode($response['name']),
'class' => rtrim('insertresponse ' . $attrib['itemclass']),
'unselectable' => 'on',
+ 'tabindex' => '0',
'rel' => $key,
), rcube::Q($response['name']));
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index b9971ce0c..811e8782d 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -507,14 +507,19 @@ function rcmail_message_list_head($attrib, $a_show_cols)
$a_sort_cols = array('subject', 'date', 'from', 'to', 'fromto', 'size', 'cc');
if (!empty($attrib['optionsmenuicon'])) {
- $onclick = 'return ' . rcmail_output::JS_OBJECT_NAME . ".command('menu-open', 'messagelistmenu')";
- if ($attrib['optionsmenuicon'] === true || $attrib['optionsmenuicon'] == 'true')
- $list_menu = html::div(array('onclick' => $onclick, 'class' => 'listmenu',
- 'id' => 'listmenulink', 'title' => $RCMAIL->gettext('listoptions')));
- else
- $list_menu = html::a(array('href' => '#', 'onclick' => $onclick),
- html::img(array('src' => $skin_path . $attrib['optionsmenuicon'],
- 'id' => 'listmenulink', 'title' => $RCMAIL->gettext('listoptions'))));
+ $onclick = 'return ' . rcmail_output::JS_OBJECT_NAME . ".command('menu-open', 'messagelistmenu', null, event)";
+ $inner = 'v';
+ if (is_string($attrib['optionsmenuicon']) && $attrib['optionsmenuicon'] != 'true') {
+ $inner = html::img(array('src' => $skin_path . $attrib['optionsmenuicon'], 'alt' => $RCMAIL->gettext('listoptions')));
+ }
+ $list_menu = html::a(array(
+ 'href' => '#list-options',
+ 'onclick' => $onclick,
+ 'class' => 'listmenu',
+ 'id' => 'listmenulink',
+ 'title' => $RCMAIL->gettext('listoptions'),
+ 'tabindex' => '0',
+ ), $inner);
}
else {
$list_menu = '';
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 9498d1dc5..7f9a23e7d 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -198,6 +198,7 @@ function rcmail_message_attachments($attrib)
if (sizeof($MESSAGE->attachments)) {
foreach ($MESSAGE->attachments as $attach_prop) {
$filename = rcmail_attachment_name($attach_prop, true);
+ $size = '';
if ($PRINT_MODE) {
$size = $RCMAIL->message_part_size($attach_prop);
@@ -212,6 +213,10 @@ function rcmail_message_attachments($attrib)
$title = '';
}
+ if ($attach_prop->size) {
+ $size = ' ' . html::span('attachment-size', '(' . $RCMAIL->show_bytes($attach_prop->size) . ')');
+ }
+
$mimetype = rcmail_fix_mimetype($attach_prop->mimetype);
$class = rcube_utils::file2class($mimetype, $filename);
$id = 'attach' . $attach_prop->mime_id;
@@ -221,7 +226,7 @@ function rcmail_message_attachments($attrib)
rcmail_output::JS_OBJECT_NAME, $attach_prop->mime_id),
'onmouseover' => $title ? '' : 'rcube_webmail.long_subject_title_ex(this, 0)',
'title' => rcube::Q($title),
- ), rcube::Q($filename));
+ ), rcube::Q($filename) . $size);
$ol .= html::tag('li', array('class' => $class, 'id' => $id), $link);