kolab_delegation: accessibility improvements (#3086)

This commit is contained in:
Aleksander Machniak 2014-06-13 12:35:09 +02:00
parent dac282685d
commit 26a2dd01c4
6 changed files with 30 additions and 22 deletions

View file

@ -49,8 +49,8 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
if (rcmail.gui_objects.delegatelist) { if (rcmail.gui_objects.delegatelist) {
rcmail.delegatelist = new rcube_list_widget(rcmail.gui_objects.delegatelist, rcmail.delegatelist = new rcube_list_widget(rcmail.gui_objects.delegatelist,
{ multiselect:true, draggable:false, keyboard:true }); { multiselect:true, draggable:false, keyboard:true });
rcmail.delegatelist.addEventListener('select', function(o) { rcmail.select_delegate(o); }); rcmail.delegatelist.addEventListener('select', function(o) { rcmail.select_delegate(o); })
rcmail.delegatelist.init(); .init();
rcmail.enable_command('delegate-add', true); rcmail.enable_command('delegate-add', true);
} }
@ -77,14 +77,16 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
$('input.write', this.parentNode.parentNode).prop('checked', false); $('input.write', this.parentNode.parentNode).prop('checked', false);
}); });
$('.foldersblock thead td img').click(function(e) { var fn = function(elem) {
var $this = $(this), var classname = elem.className,
classname = $this.parent().get(0).className, list = $(elem).closest('table').find('input.' + classname),
list = $this.closest('table').find('input.'+classname),
check = list.not(':checked').length > 0; check = list.not(':checked').length > 0;
list.prop('checked', check).change(); list.prop('checked', check).change();
}); };
$('th.read,th.write').click(function() { fn(this); })
.keydown(function(e) { if (e.which == 13 || e.which == 32) fn(this); });
} }
} }
}); });

View file

@ -497,8 +497,8 @@ class kolab_delegation extends rcube_plugin
$write_ico = $attrib['writeicon'] ? html::img(array('src' => $path . $attrib['writeicon'], 'title' => $this->gettext('write'))) : ''; $write_ico = $attrib['writeicon'] ? html::img(array('src' => $path . $attrib['writeicon'], 'title' => $this->gettext('write'))) : '';
$table = new html_table(array('cellspacing' => 0)); $table = new html_table(array('cellspacing' => 0));
$table->add_header(array('class' => 'read', 'title' => $this->gettext('read')), $read_ico); $table->add_header(array('class' => 'read', 'title' => $this->gettext('read'), 'tabindex' => 0), $read_ico);
$table->add_header(array('class' => 'write', 'title' => $this->gettext('write')), $write_ico); $table->add_header(array('class' => 'write', 'title' => $this->gettext('write'), 'tabindex' => 0), $write_ico);
$table->add_header('foldername', $this->rc->gettext('folder')); $table->add_header('foldername', $this->rc->gettext('folder'));
$checkbox_read = new html_checkbox(array('name' => 'read[]', 'class' => 'read')); $checkbox_read = new html_checkbox(array('name' => 'read[]', 'class' => 'read'));

View file

@ -27,4 +27,7 @@ $labels['updateerror'] = 'Could not update delegate.';
$labels['createsuccess'] = 'The delegate was successfully added.'; $labels['createsuccess'] = 'The delegate was successfully added.';
$labels['createerror'] = 'Could not add delegate.'; $labels['createerror'] = 'Could not add delegate.';
$labels['arialabeldelegatedelete'] = 'Delegate deletion dialog';
$labels['arialabeldelegateform'] = 'Delegate properties form';
?> ?>

View file

@ -15,9 +15,9 @@
<email>machniak@kolabsys.com</email> <email>machniak@kolabsys.com</email>
<active>yes</active> <active>yes</active>
</lead> </lead>
<date>2013-06-25</date> <date>2014-06-13</date>
<version> <version>
<release>0.3</release> <release>0.4</release>
<api>0.1</api> <api>0.1</api>
</version> </version>
<stability> <stability>

View file

@ -115,10 +115,12 @@ div.foldersblock h3.note {
background: url(read.png) center no-repeat; background: url(read.png) center no-repeat;
width: 18px; width: 18px;
height: 20px; height: 20px;
cursor: pointer;
} }
.foldersblock th.write { .foldersblock th.write {
background: url(write.png) center no-repeat; background: url(write.png) center no-repeat;
width: 18px; width: 18px;
height: 20px; height: 20px;
cursor: pointer;
} }

View file

@ -10,11 +10,13 @@
<div id="mainscreen" class="offset"> <div id="mainscreen" class="offset">
<h1 class="voice"><roundcube:label name="settings" /> : <roundcube:label name="kolab_delegation.tabtitle" /></h1>
<roundcube:include file="/includes/settingstabs.html" /> <roundcube:include file="/includes/settingstabs.html" />
<div id="settings-right"> <div id="settings-right">
<div id="sectionslist" class="uibox listbox"> <div id="sectionslist" class="uibox listbox" role="navigation" aria-labelledby="delegatelist-title">
<h2 id="delegatelist-title" class="boxtitle"><roundcube:label name="kolab_delegation.delegates" /></h2> <h2 id="delegatelist-title" class="boxtitle"><roundcube:label name="kolab_delegation.delegates" /></h2>
<div class="boxlistcontent"> <div class="boxlistcontent">
<roundcube:object name="plugin.delegatelist" id="delegate-table" class="listing" cellspacing="0" /> <roundcube:object name="plugin.delegatelist" id="delegate-table" class="listing" cellspacing="0" />
@ -24,30 +26,29 @@
</div> </div>
</div> </div>
<div id="prefs-box" class="uibox contentbox"> <div id="prefs-box" class="uibox contentbox" role="main">
<div class="iframebox"> <div class="iframebox">
<roundcube:frame contentframe="delegation-frame" id="delegation-frame" style="width:100%; height:100%" frameborder="0" src="/watermark.html" /> <roundcube:frame contentframe="delegation-frame" id="delegation-frame" style="width:100%; height:100%" frameborder="0" src="/watermark.html" title="arialabeldelegateform" />
</div> </div>
<roundcube:object name="message" id="message" class="statusbar" />
</div> </div>
</div>
</div> </div>
<div id="delegate-delete-dialog" role="dialog" aria-labelledby="aria-label-delegatedeletedialog" aria-hidden="true">
<h3 id="aria-label-delegatedeletedialog" class="voice"><roundcube:label name="kolab_delegation.arialabeldelegatedelete" /></h3>
<p><roundcube:label name="kolab_delegation.delegatedeleteconfirm" /></p>
<span><input type="checkbox" value="1" checked="checked" /><roundcube:label name="kolab_delegation.delegateremoveacl" /></span>
</div> </div>
<roundcube:include file="/includes/footer.html" /> <roundcube:include file="/includes/footer.html" />
<script type="text/javascript"> <script type="text/javascript">
var viewsplit = new rcube_splitter({ id:'delegatelistsplitter', p1:'#sectionslist', p2:'#prefs-box', orientation:'v', relative:true, start:266, min:150, size:12 }); var viewsplit = new rcube_splitter({ id:'delegatelistsplitter', p1:'#sectionslist', p2:'#prefs-box', orientation:'v', relative:true, start:266, min:150, size:12 });
rcmail.add_onload('viewsplit.init()'); rcmail.add_onload('viewsplit.init()');
</script> </script>
<div id="delegate-delete-dialog">
<p><roundcube:label name="kolab_delegation.delegatedeleteconfirm" /></p>
<span><input type="checkbox" value="1" checked="checked" /><roundcube:label name="kolab_delegation.delegateremoveacl" /></span>
</div>
</body> </body>
</html> </html>