Skip to content

Commit

Permalink
Merge branch 'dev-accessibility'
Browse files Browse the repository at this point in the history
Conflicts:
	program/include/rcmail_output_html.php
	program/js/app.js
	program/js/treelist.js
	program/lib/Roundcube/html.php
	skins/larry/styles.css
	skins/larry/templates/compose.html
  • Loading branch information
thomascube committed Jun 5, 2014
2 parents 17a76c3 + 3412e50 commit 99cdca4
Show file tree
Hide file tree
Showing 49 changed files with 1,886 additions and 1,027 deletions.
1 change: 1 addition & 0 deletions plugins/legacy_browser/skins/larry/ie7hacks.css
Expand Up @@ -37,6 +37,7 @@ input.button {
a.iconbutton,
a.deletebutton,
.boxpagenav a.icon,
a.button span.icon,
.pagenav a.button span.inner,
.boxfooter .listbutton .inner,
.attachmentslist li a.delete,
Expand Down
8 changes: 5 additions & 3 deletions plugins/managesieve/skins/larry/managesieve.css
Expand Up @@ -417,11 +417,13 @@ body.iframe.mail #filter-form


/* vacation form */
#settings-sections span.vacation a {
background: url(images/vacation_icons.png) no-repeat 7px 1px;
#settings-sections .vacation a {
background-image: url(images/vacation_icons.png);
background-repeat: no-repeat;
background-position: 7px 1px;
}

#settings-sections span.vacation.selected a {
#settings-sections .vacation.selected a {
background-position: 7px -23px;
}

Expand Down
25 changes: 5 additions & 20 deletions plugins/zipdownload/zipdownload.js
Expand Up @@ -43,21 +43,10 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
link.html('').append(span);
}

span.addClass('folder-selector-link').text(rcmail.gettext('zipdownload.download'));

span.text(rcmail.gettext('zipdownload.download'));
rcmail.env.download_link = link;
});

// hide menu on click out of menu element
var fn = function(e) {
var menu = $('#zipdownload-menu');
if (e.target != menu.get(0))
menu.hide();
};
$(document.body).on('mouseup', fn);
$('iframe').contents().on('mouseup', fn)
.load(function(e) { try { $(this).contents().on('mouseup', fn); } catch(e) {}; });
});
});


function rcmail_zipdownload(mode)
Expand Down Expand Up @@ -100,14 +89,10 @@ function rcmail_zipdownload(mode)
}

// display download options menu
function rcmail_zipdownload_menu()
function rcmail_zipdownload_menu(e)
{
// fix menu style and display menu
var z_index = rcmail.env.download_link.parents('.popupmenu').css('z-index'),
menu = $('#zipdownload-menu').css({'max-height': 'none', 'z-index': z_index + 1}).show();

// position menu on the screen
rcmail.element_position(menu, rcmail.env.download_link);
// show (sub)menu for download selection
rcmail.command('menu-open', 'zipdownload-menu', e && e.target ? e.target : rcmail.env.download_link, e);

// abort default download action
return false;
Expand Down
8 changes: 6 additions & 2 deletions plugins/zipdownload/zipdownload.php
Expand Up @@ -96,7 +96,10 @@ public function download_menu()

$rcmail = rcmail::get_instance();
$menu = array();
$ul_attr = $rcmail->config->get('skin') == 'classic' ? null : array('class' => 'toolbarmenu');
$ul_attr = array('role' => 'menu', 'aria-labelledby' => 'aria-label-zipdownloadmenu');
if ($rcmail->config->get('skin') != 'classic') {
$ul_attr['class'] = 'toolbarmenu';
}

foreach (array('eml', 'mbox', 'maildir') as $type) {
$menu[] = html::tag('li', null, $rcmail->output->button(array(
Expand All @@ -106,7 +109,8 @@ public function download_menu()
)));
}

$rcmail->output->add_footer(html::div(array('id' => 'zipdownload-menu', 'class' => 'popupmenu'),
$rcmail->output->add_footer(html::div(array('id' => 'zipdownload-menu', 'class' => 'popupmenu', 'aria-hidden' => 'true'),
html::tag('h2', array('class' => 'voice', 'id' => 'aria-label-zipdownloadmenu'), "Message Download Options Menu") .
html::tag('ul', $ul_attr, implode('', $menu))));
}

Expand Down
9 changes: 6 additions & 3 deletions program/include/rcmail.php
Expand Up @@ -1077,14 +1077,17 @@ public function table_output($attrib, $table_data, $a_show_cols, $id_col)
}
else {
foreach ($table_data as $row_data) {
$class = !empty($row_data['class']) ? $row_data['class'] : '';
$class = !empty($row_data['class']) ? $row_data['class'] : null;
if (!empty($attrib['rowclass']))
$class = trim($class . ' ' . $attrib['rowclass']);
$rowid = 'rcmrow' . rcube_utils::html_identifier($row_data[$id_col]);

$table->add_row(array('id' => $rowid, 'class' => $class));

// format each col
foreach ($a_show_cols as $col) {
$table->add($col, $this->Q(is_array($row_data[$col]) ? $row_data[$col][0] : $row_data[$col]));
$val = is_array($row_data[$col]) ? $row_data[$col][0] : $row_data[$col];
$table->add($col, empty($attrib['ishtml']) ? $this->Q($val) : $val);
}
}
}
Expand Down Expand Up @@ -1490,7 +1493,7 @@ public function render_folder_tree_html(&$arrFolders, &$mbox_name, &$jslist, $at
$html_name = $this->Q($foldername) . ($unread ? html::span('unreadcount', sprintf($attrib['unreadwrap'], $unread)) : '');
$link_attrib = $folder['virtual'] ? array() : array(
'href' => $this->url(array('_mbox' => $folder['id'])),
'onclick' => sprintf("return %s.command('list','%s',this)", rcmail_output::JS_OBJECT_NAME, $js_name),
'onclick' => sprintf("return %s.command('list','%s',this,event)", rcmail_output::JS_OBJECT_NAME, $js_name),
'rel' => $folder['id'],
'title' => $title,
);
Expand Down
33 changes: 33 additions & 0 deletions program/include/rcmail_output_html.php
Expand Up @@ -893,6 +893,14 @@ protected function xml_command($matches)
return '';
}

// localize title and summary attributes
if ($command != 'button' && !empty($attrib['title']) && $this->app->text_exists($attrib['title'])) {
$attrib['title'] = $this->app->gettext($attrib['title']);
}
if ($command != 'button' && !empty($attrib['summary']) && $this->app->text_exists($attrib['summary'])) {
$attrib['summary'] = $this->app->gettext($attrib['summary']);
}

// execute command
switch ($command) {
// return a button
Expand Down Expand Up @@ -1165,6 +1173,17 @@ public function button($attrib)
$attrib['alt'] = html::quote($this->app->gettext($attrib['alt'], $attrib['domain']));
}

// set accessibility attributes
if (!$attrib['role']) {
$attrib['role'] = 'button';
}
if (!empty($attrib['class']) && !empty($attrib['classact']) || !empty($attrib['imagepas']) && !empty($attrib['imageact'])) {
if (array_key_exists('tabindex', $attrib))
$attrib['data-tabindex'] = $attrib['tabindex'];
$attrib['tabindex'] = '-1'; // disable button by default
$attrib['aria-disabled'] = 'true';
}

// set title to alt attribute for IE browsers
if ($this->browser->ie && !$attrib['title'] && $attrib['alt']) {
$attrib['title'] = $attrib['alt'];
Expand Down Expand Up @@ -1353,6 +1372,20 @@ public function _write($templ = '', $base_path = '')
$is_empty = true;
}

// set default page title
if (empty($this->pagetitle)) {
$this->pagetitle = 'Roundcube Mail';
}

// declare page language
if (!empty($_SESSION['language'])) {
$lang = substr($_SESSION['language'], 0, 2);
$output = preg_replace('/<html/', '<html lang="' . html::quote($lang) . '"', $output, 1);
if (!headers_sent()) {
header('Content-Language: ' . $lang);
}
}

// replace specialchars in content
$page_title = html::quote($this->pagetitle);
$page_header = '';
Expand Down

0 comments on commit 99cdca4

Please sign in to comment.