r74788 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74787‎ | r74788 | r74789 >
Date:18:05, 14 October 2010
Author:tparscal
Status:ok
Tags:
Comment:
Backported fix for Bug #23457 from r74114.
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -67,10 +67,10 @@
6868 array( 'src' => 'js/plugins/jquery.expandableField.js', 'version' => 17 ),
6969 array( 'src' => 'js/plugins/jquery.highlightText.js', 'version' => 1 ),
7070 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 33 ),
71 - array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 36 ),
 71+ array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 37 ),
7272 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 196 ),
7373 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 53 ),
74 - array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 72 ),
 74+ array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 73 ),
7575 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 28 ),
7676 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 98 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 12 ),
@@ -83,10 +83,10 @@
8484 array( 'src' => 'js/thirdparty/contentCollector.js', 'version' => 2 ),
8585 ),
8686 'combined' => array(
87 - array( 'src' => 'js/plugins.combined.js', 'version' => 454 ),
 87+ array( 'src' => 'js/plugins.combined.js', 'version' => 455 ),
8888 ),
8989 'minified' => array(
90 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 476 ),
 90+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 477 ),
9191 ),
9292 ),
9393 );
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
@@ -142,7 +142,7 @@
143143 // Save for later checking if empty
144144 group = target;
145145 // Tool
146 - target += ' div[rel=' + data.tool + '].tool';
 146+ target += ' span[rel=' + data.tool + '].tool';
147147 }
148148 } else if ( typeof data.page == 'string' ) {
149149 // Booklet page
@@ -327,7 +327,7 @@
328328 'alt' : label,
329329 'title' : label,
330330 'rel' : id,
331 - 'class' : 'wikiEditor-toolbar-spritedButton'
 331+ 'class' : 'tool tool-button wikiEditor-toolbar-spritedButton'
332332 } )
333333 .text( label )
334334 .css( 'backgroundPosition', offsetOrIcon[0] + 'px ' + offsetOrIcon[1] + 'px' );
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -4050,7 +4050,7 @@
40514051 // Save for later checking if empty
40524052 group = target;
40534053 // Tool
4054 - target += ' div[rel=' + data.tool + '].tool';
 4054+ target += ' span[rel=' + data.tool + '].tool';
40554055 }
40564056 } else if ( typeof data.page == 'string' ) {
40574057 // Booklet page
@@ -4235,7 +4235,7 @@
42364236 'alt' : label,
42374237 'title' : label,
42384238 'rel' : id,
4239 - 'class' : 'wikiEditor-toolbar-spritedButton'
 4239+ 'class' : 'tool tool-button wikiEditor-toolbar-spritedButton'
42404240 } )
42414241 .text( label )
42424242 .css( 'backgroundPosition', offsetOrIcon[0] + 'px ' + offsetOrIcon[1] + 'px' );
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -276,7 +276,7 @@
277277 var $table=context.modules.toolbar.$toolbar.find('div[rel='+data.section+'].section '+'div[rel='+data.page+'].page table');for(row in data[type]){$table.append($.wikiEditor.modules.toolbar.fn.buildRow(context,data[type][row]));}
278278 break;case'characters':if(!('section'in data&&'page'in data)){continue;}
279279 $characters=context.modules.toolbar.$toolbar.find('div[rel='+data.section+'].section '+'div[rel='+data.page+'].page div');var actions=$characters.data('actions');for(character in data[type]){$characters.append($($.wikiEditor.modules.toolbar.fn.buildCharacter(data[type][character],actions)).mousedown(function(e){context.fn.saveStuffForIE();e.preventDefault();return false;}).click(function(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).parent().data('context'),$(this).parent().data('actions')[$(this).attr('rel')]);e.preventDefault();return false;}));}
280 -break;default:break;}}},removeFromToolbar:function(context,data){if(typeof data.section=='string'){var tab='div.tabs span[rel='+data.section+'].tab';var target='div[rel='+data.section+'].section';var group=null;if(typeof data.group=='string'){target+=' div[rel='+data.group+'].group';if(typeof data.tool=='string'){group=target;target+=' div[rel='+data.tool+'].tool';}}else if(typeof data.page=='string'){var index=target+' div.index div[rel='+data.page+']';target+=' div.pages div[rel='+data.page+'].page';if(typeof data.character=='string'){target+=' a[rel='+data.character+']';}else if(typeof data.row=='number'){target+=' table tr:not(:has(th)):eq('+data.row+')';}else{context.modules.toolbar.$toolbar.find(index).remove();$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,null,context.modules.toolbar.$toolbar.find(target),context.modules.toolbar.$toolbar.find(index));}}else{context.modules.toolbar.$toolbar.find(tab).remove();}
 280+break;default:break;}}},removeFromToolbar:function(context,data){if(typeof data.section=='string'){var tab='div.tabs span[rel='+data.section+'].tab';var target='div[rel='+data.section+'].section';var group=null;if(typeof data.group=='string'){target+=' div[rel='+data.group+'].group';if(typeof data.tool=='string'){group=target;target+=' span[rel='+data.tool+'].tool';}}else if(typeof data.page=='string'){var index=target+' div.index div[rel='+data.page+']';target+=' div.pages div[rel='+data.page+'].page';if(typeof data.character=='string'){target+=' a[rel='+data.character+']';}else if(typeof data.row=='number'){target+=' table tr:not(:has(th)):eq('+data.row+')';}else{context.modules.toolbar.$toolbar.find(index).remove();$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,null,context.modules.toolbar.$toolbar.find(target),context.modules.toolbar.$toolbar.find(index));}}else{context.modules.toolbar.$toolbar.find(tab).remove();}
281281 context.modules.toolbar.$toolbar.find(target).remove();if(group){$group=context.modules.toolbar.$toolbar.find(group);if($group.children().length==0){$group.hide();}}}}},evt:{resize:function(context,event){context.$ui.find('.sections').height(context.$ui.find('.sections .section-visible').outerHeight());},tocCollapse:function(context,event){$.wikiEditor.modules.toolbar.evt.resize(context,event);},tocExpand:function(context,event){$.wikiEditor.modules.toolbar.evt.resize(context,event);}},fn:{create:function(context,config){if('$toolbar'in context.modules.toolbar){return;}
282282 context.modules.toolbar.$toolbar=$('<div />').addClass('wikiEditor-ui-toolbar').attr('id','wikiEditor-ui-toolbar');$.wikiEditor.modules.toolbar.fn.build(context,config);context.$ui.find('.wikiEditor-ui-top').append(context.modules.toolbar.$toolbar);},doAction:function(context,action,source){if($.trackAction!=undefined&&source.closest('.wikiEditor-ui-toolbar').size()){var rels=[];var step=source;var i=0;while(!step.hasClass('wikiEditor-ui-toolbar')){if(i>25){break;}
283283 i++;var rel=step.attr('rel');if(rel){rels.push(step.attr('rel'));}
@@ -289,7 +289,7 @@
290290 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);}}}
291291 if(empty){$group.hide();}
292292 return $group;},buildTool:function(context,id,tool){if('filters'in tool){for(filter in tool.filters){if($(tool.filters[filter]).size()==0){return null;}}}
293 -var label=$.wikiEditor.autoMsg(tool,'label');switch(tool.type){case'button':var src=$.wikiEditor.autoIcon(tool.icon,$.wikiEditor.imgPath+'toolbar/');var $button=null;if('offset'in tool){var offsetOrIcon=$.wikiEditor.autoIconOrOffset(tool.icon,tool.offset,$.wikiEditor.imgPath+'toolbar/');if(typeof offsetOrIcon=='object'){$button=$('<span />').attr({'alt':label,'title':label,'rel':id,'class':'wikiEditor-toolbar-spritedButton'}).text(label).css('backgroundPosition',offsetOrIcon[0]+'px '+offsetOrIcon[1]+'px');}}
 293+var label=$.wikiEditor.autoMsg(tool,'label');switch(tool.type){case'button':var src=$.wikiEditor.autoIcon(tool.icon,$.wikiEditor.imgPath+'toolbar/');var $button=null;if('offset'in tool){var offsetOrIcon=$.wikiEditor.autoIconOrOffset(tool.icon,tool.offset,$.wikiEditor.imgPath+'toolbar/');if(typeof offsetOrIcon=='object'){$button=$('<span />').attr({'alt':label,'title':label,'rel':id,'class':'tool tool-button wikiEditor-toolbar-spritedButton'}).text(label).css('backgroundPosition',offsetOrIcon[0]+'px '+offsetOrIcon[1]+'px');}}
294294 if(!$button){$button=$('<img />').attr({'src':src,'width':22,'height':22,'alt':label,'title':label,'rel':id,'class':'tool tool-button'});}
295295 if('action'in tool){$button.data('action',tool.action).data('context',context).mousedown(function(e){context.fn.saveStuffForIE();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-setup-'+tool.action.module,{button:$button},function(event){event.data.button.show().parent().show();});}}
296296 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){context.fn.saveStuffForIE();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');}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r74114* Fixed the toolbar, where sprited buttons weren't receiving the correct clas...tparscal21:58, 1 October 2010

Status & tagging log