r65558 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65557‎ | r65558 | r65559 >
Date:21:59, 26 April 2010
Author:tparscal
Status:ok
Tags:
Comment:
Fixed another accesibility issue, now characters in the toolbar are rendered with spans, another move to make screen readers less angry.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/css/combined.css (modified) (history)
  • /trunk/extensions/UsabilityInitiative/css/combined.min.css (modified) (history)
  • /trunk/extensions/UsabilityInitiative/css/wikiEditor.toolbar.css (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/css/wikiEditor.toolbar.css
@@ -354,7 +354,7 @@
355355 width: 20%;
356356 }
357357 /* Characters Pages */
358 -.wikiEditor-ui-toolbar .page-characters div a {
 358+.wikiEditor-ui-toolbar .page-characters div span {
359359 border: solid 1px #DDDDDD;
360360 padding: 5px;
361361 padding-left: 8px;
@@ -366,15 +366,16 @@
367367 display: block;
368368 color: black;
369369 text-decoration: none;
 370+ cursor: pointer;
370371 }
371 -body.rtl .wikiEditor-ui-toolbar .page-characters > div > a,
372 -.wikiEditor-ui-toolbar .page-characters div[dir=rtl] a {
 372+body.rtl .wikiEditor-ui-toolbar .page-characters > div > span,
 373+.wikiEditor-ui-toolbar .page-characters div[dir=rtl] span {
373374 direction: rtl;
374375 float: right;
375376 margin-left: 0;
376377 margin-right: 5px;
377378 }
378 -.wikiEditor-ui-toolbar .page-characters div a:hover {
 379+.wikiEditor-ui-toolbar .page-characters div span:hover {
379380 background-color: white;
380381 text-decoration: none;
381382 border-color: #a8d7f9;
Index: trunk/extensions/UsabilityInitiative/css/combined.css
@@ -1137,7 +1137,7 @@
11381138 width: 20%;
11391139 }
11401140 /* Characters Pages */
1141 -.wikiEditor-ui-toolbar .page-characters div a {
 1141+.wikiEditor-ui-toolbar .page-characters div span {
11421142 border: solid 1px #DDDDDD;
11431143 padding: 5px;
11441144 padding-left: 8px;
@@ -1149,15 +1149,16 @@
11501150 display: block;
11511151 color: black;
11521152 text-decoration: none;
 1153+ cursor: pointer;
11531154 }
1154 -body.rtl .wikiEditor-ui-toolbar .page-characters > div > a,
1155 -.wikiEditor-ui-toolbar .page-characters div[dir=rtl] a {
 1155+body.rtl .wikiEditor-ui-toolbar .page-characters > div > span,
 1156+.wikiEditor-ui-toolbar .page-characters div[dir=rtl] span {
11561157 direction: rtl;
11571158 float: right;
11581159 margin-left: 0;
11591160 margin-right: 5px;
11601161 }
1161 -.wikiEditor-ui-toolbar .page-characters div a:hover {
 1162+.wikiEditor-ui-toolbar .page-characters div span:hover {
11621163 background-color: white;
11631164 text-decoration: none;
11641165 border-color: #a8d7f9;
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css
@@ -1072,7 +1072,7 @@
10731073 .wikiEditor-ui-toolbar .section-help .page-table td.description{
10741074 width:20%;
10751075 }
1076 -.wikiEditor-ui-toolbar .page-characters div a{
 1076+.wikiEditor-ui-toolbar .page-characters div span{
10771077 border:solid 1px #DDDDDD;
10781078 padding:5px;
10791079 padding-left:8px;
@@ -1084,15 +1084,16 @@
10851085 display:block;
10861086 color:black;
10871087 text-decoration:none;
 1088+cursor:pointer;
10881089 }
1089 -body.rtl .wikiEditor-ui-toolbar .page-characters > div > a,
1090 -.wikiEditor-ui-toolbar .page-characters div[dir=rtl] a{
 1090+body.rtl .wikiEditor-ui-toolbar .page-characters > div > span,
 1091+.wikiEditor-ui-toolbar .page-characters div[dir=rtl] span{
10911092 direction:rtl;
10921093 float:right;
10931094 margin-left:0;
10941095 margin-right:5px;
10951096 }
1096 -.wikiEditor-ui-toolbar .page-characters div a:hover{
 1097+.wikiEditor-ui-toolbar .page-characters div span:hover{
10971098 background-color:white;
10981099 text-decoration:none;
10991100 border-color:#a8d7f9;
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
@@ -547,7 +547,7 @@
548548 }
549549 if ( 'action' in character && 'label' in character ) {
550550 actions[character.label] = character.action;
551 - return '<a rel="' + character.label + '" href="#">' + character.label + '</a>';
 551+ return '<span rel="' + character.label + '">' + character.label + '</span>';
552552 }
553553 },
554554 buildTab : function( context, id, section ) {
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -11421,7 +11421,7 @@
1142211422 }
1142311423 if ( 'action' in character && 'label' in character ) {
1142411424 actions[character.label] = character.action;
11425 - return '<a rel="' + character.label + '" href="#">' + character.label + '</a>';
 11425+ return '<span rel="' + character.label + '">' + character.label + '</span>';
1142611426 }
1142711427 },
1142811428 buildTab : function( context, id, section ) {
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -782,7 +782,7 @@
783783 return html;},buildRow:function(context,row){var html='<tr>';for(cell in row){html+='<td class="cell cell-'+cell+'" valign="top"><span>'+
784784 $.wikiEditor.autoMsg(row[cell],['html','text'])+'</span></td>';}
785785 html+='</tr>';return html;},buildCharacter:function(character,actions){if(typeof character=='string'){character={'label':character,'action':{'type':'encapsulate','options':{'pre':character}}};}else if(0 in character&&1 in character){character={'label':character[0],'action':{'type':'encapsulate','options':{'pre':character[1]}}};}
786 -if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).mouseup(function(e){$(this).blur();}).mousedown(function(e){e.preventDefault();return false;}).click(function(e){var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section-visible');$previousSections.css('position','absolute');$previousSections.removeClass('section-visible');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.addClass('section-visible');$section.fadeIn('fast');$sections.css('display','block').animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');context.fn.trigger('resize');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':'hide'},$section.outerHeight()*2,function(){$(this).css({'overflow':'visible','height':0});context.fn.trigger('resize');});}
 786+if('action'in character&&'label'in character){actions[character.label]=character.action;return'<span rel="'+character.label+'">'+character.label+'</span>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).mouseup(function(e){$(this).blur();}).mousedown(function(e){e.preventDefault();return false;}).click(function(e){var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section-visible');$previousSections.css('position','absolute');$previousSections.removeClass('section-visible');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.addClass('section-visible');$section.fadeIn('fast');$sections.css('display','block').animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');context.fn.trigger('resize');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':'hide'},$section.outerHeight()*2,function(){$(this).css({'overflow':'visible','height':0});context.fn.trigger('resize');});}
787787 if($.trackAction!=undefined){$.trackAction($section.attr('rel')+'.'+(show?'show':'hide'));}
788788 $.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);e.preventDefault();return false;}));},buildSection:function(context,id,section){context.$textarea.trigger('wikiEditor-toolbar-buildSection-'+id,[section]);var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');var $section;switch(section.type){case'toolbar':var $section=$('<div />').attr({'class':'toolbar section section-'+id,'rel':id});if('groups'in section){for(group in section.groups){$section.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,section.groups[group]));}}
789789 break;case'booklet':var $pages=$('<div />').addClass('pages');var $index=$('<div />').addClass('index');if('pages'in section){for(page in section.pages){$pages.append($.wikiEditor.modules.toolbar.fn.buildPage(context,page,section.pages[page]));$index.append($.wikiEditor.modules.toolbar.fn.buildBookmark(context,page,section.pages[page]));}}

Follow-up revisions

RevisionCommit summaryAuthorDate
r65959Merge Vector and UsabilityInitiative fixes from trunk: r64724, r65064, r65379...catrope19:03, 5 May 2010
r73123Fixed API and test to work with characters as span elements rather than a ele...tparscal17:20, 16 September 2010

Status & tagging log