r65556 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65555‎ | r65556 | r65557 >
Date:21:32, 26 April 2010
Author:tparscal
Status:ok
Tags:
Comment:
Fixed bug #23083 and an accessability issue brought to my attention in Berlin by Maria about toolbar items being links making screen readers go crazy - by changing sprited icons in the toolbar to use <span> instead of <a> elements.
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
@@ -109,12 +109,13 @@
110110 /* Sprited Buttons */
111111 .wikiEditor-toolbar-spritedButton {
112112 background: url(../images/wikiEditor/toolbar/button-sprite.png) 0 0 no-repeat;
113 - display:block;
114 - float:left;
115 - height:22px;
116 - text-indent:-9999px;
117 - width:22px;
 113+ display: block;
 114+ float: left;
 115+ height: 22px;
 116+ text-indent: -9999px;
 117+ width: 22px;
118118 padding: 2px;
 119+ cursor: pointer;
119120 }
120121 /* Tabs */
121122 .wikiEditor-ui-toolbar .tabs {
Index: trunk/extensions/UsabilityInitiative/css/combined.css
@@ -892,12 +892,13 @@
893893 /* Sprited Buttons */
894894 .wikiEditor-toolbar-spritedButton {
895895 background: url(../images/wikiEditor/toolbar/button-sprite.png) 0 0 no-repeat;
896 - display:block;
897 - float:left;
898 - height:22px;
899 - text-indent:-9999px;
900 - width:22px;
 896+ display: block;
 897+ float: left;
 898+ height: 22px;
 899+ text-indent: -9999px;
 900+ width: 22px;
901901 padding: 2px;
 902+ cursor: pointer;
902903 }
903904 /* Tabs */
904905 .wikiEditor-ui-toolbar .tabs {
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css
@@ -845,6 +845,7 @@
846846 text-indent:-9999px;
847847 width:22px;
848848 padding:2px;
 849+cursor:pointer;
849850 }
850851 .wikiEditor-ui-toolbar .tabs{
851852 list-style:none;
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
@@ -311,7 +311,7 @@
312312 var $button;
313313 if ( 'offset' in tool ) {
314314 var offset = $.wikiEditor.autoLang( tool.offset );
315 - $button = $( '<a href="#" />' )
 315+ $button = $( '<span />' )
316316 .attr( {
317317 'alt' : label,
318318 'title' : label,
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -11185,7 +11185,7 @@
1118611186 var $button;
1118711187 if ( 'offset' in tool ) {
1118811188 var offset = $.wikiEditor.autoLang( tool.offset );
11189 - $button = $( '<a href="#" />' )
 11189+ $button = $( '<span />' )
1119011190 .attr( {
1119111191 'alt' : label,
1119211192 'title' : label,
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -766,7 +766,7 @@
767767 var empty=true;if('tools'in group){for(tool in group.tools){var tool=$.wikiEditor.modules.toolbar.fn.buildTool(context,tool,group.tools[tool]);if(tool){empty=empty&&tool.css('display')=='none';$group.append(tool);}}}
768768 if(empty){$group.hide();}
769769 return $group;},buildTool:function(context,id,tool){if('filters'in tool){for(filter in tool.filters){if($(tool.filters[filter]).size()==0){return null;}}}
770 -var label=$.wikiEditor.autoMsg(tool,'label');switch(tool.type){case'button':var src=$.wikiEditor.autoIcon(tool.icon,$.wikiEditor.imgPath+'toolbar/');var $button;if('offset'in tool){var offset=$.wikiEditor.autoLang(tool.offset);$button=$('<a href="#" />').attr({'alt':label,'title':label,'rel':id,'class':'wikiEditor-toolbar-spritedButton'}).text(label).css('backgroundPosition',offset[0]+'px '+offset[1]+'px');}else{$button=$('<img />').attr({'src':src,'width':22,'height':22,'alt':label,'title':label,'rel':id,'class':'tool tool-button'});}
 770+var label=$.wikiEditor.autoMsg(tool,'label');switch(tool.type){case'button':var src=$.wikiEditor.autoIcon(tool.icon,$.wikiEditor.imgPath+'toolbar/');var $button;if('offset'in tool){var offset=$.wikiEditor.autoLang(tool.offset);$button=$('<span />').attr({'alt':label,'title':label,'rel':id,'class':'wikiEditor-toolbar-spritedButton'}).text(label).css('backgroundPosition',offset[0]+'px '+offset[1]+'px');}else{$button=$('<img />').attr({'src':src,'width':22,'height':22,'alt':label,'title':label,'rel':id,'class':'tool tool-button'});}
771771 if('action'in tool){$button.data('action',tool.action).data('context',context).mousedown(function(e){e.preventDefault();return false;}).click(function(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));e.preventDefault();return false;});if(tool.action.type=='dialog'&&!(tool.action.module in $.wikiEditor.modules.dialogs.modules)){$button.hide();context.$textarea.bind('wikiEditor-dialogs-loaded-'+tool.action.module,{button:$button},function(event){event.data.button.show().parent().show();});}}
772772 return $button;case'select':var $select=$('<div />').attr({'rel':id,'class':'tool tool-select'});var $options=$('<div />').addClass('options');if('list'in tool){for(option in tool.list){var optionLabel=$.wikiEditor.autoMsg(tool.list[option],'label');$options.append($('<a />').data('action',tool.list[option].action).data('context',context).mousedown(function(e){e.preventDefault();return false;}).click(function(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));if($(this).parent().is(':visible')){$(this).parent().animate({'opacity':'toggle'},'fast');}
773773 e.preventDefault();return false;}).text(optionLabel).addClass('option').attr({'rel':option,'href':'#'}));}}

Follow-up revisions

RevisionCommit summaryAuthorDate
r65959Merge Vector and UsabilityInitiative fixes from trunk: r64724, r65064, r65379...catrope19:03, 5 May 2010

Status & tagging log