r58253 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58252‎ | r58253 | r58254 >
Date:12:05, 28 October 2009
Author:catrope
Status:ok
Tags:
Comment:
EditToolbar: (bug 21323) Clicking tabs makes browser jump to top of page; regression from r57836
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (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/UsabilityInitiative.hooks.php
@@ -70,15 +70,15 @@
7171 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 6 ),
7272 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 16 ),
7373 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 12 ),
74 - array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 16 ),
 74+ array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 17 ),
7575 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 6 ),
7676 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 22 ),
7777 ),
7878 'combined' => array(
79 - array( 'src' => 'js/plugins.combined.js', 'version' => 51 ),
 79+ array( 'src' => 'js/plugins.combined.js', 'version' => 52 ),
8080 ),
8181 'minified' => array(
82 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 51 ),
 82+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 52 ),
8383 ),
8484 ),
8585 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
@@ -488,8 +488,8 @@
489489 'wikiEditor-' + $(this).data( 'context' ).instance + '-toolbar-section',
490490 show ? $section.attr( 'rel' ) : null
491491 );
492 - return false;
493492 } )
 493+ .click( function() { return false; } )
494494 );
495495 },
496496 buildSection : function( context, id, section ) {
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -2118,8 +2118,8 @@
21192119 'wikiEditor-' + $(this).data( 'context' ).instance + '-toolbar-section',
21202120 show ? $section.attr( 'rel' ) : null
21212121 );
2122 - return false;
21232122 } )
 2123+ .click( function() { return false; } )
21242124 );
21252125 },
21262126 buildSection : function( context, id, section ) {
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -134,7 +134,7 @@
135135 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]}}};}
136136 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).bind('mousedown',function(){var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));$(this).blur();var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section:visible');$previousSections.css('position','absolute');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.fadeIn('fast');$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':0},$section.outerHeight()*2,function(){$(this).css('overflow','visible');});}
137137 if($.trackAction!=undefined){$.trackAction($section.attr('rel')+'.'+(show?'show':'hide'));}
138 -$.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);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]));}}
 138+$.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);}).click(function(){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]));}}
139139 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]));}}
140140 $section=$('<div />').attr({'class':'booklet section section-'+id,'rel':id}).append($index).append($pages);$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,page,$pages,$index);break;}
141141 if($section!==null&&id!=='main'){var show=selected==id;$section.css('display',show?'block':'none');}

Follow-up revisions

RevisionCommit summaryAuthorDate
r59204wmf-deployment: Merging usability changes from trunk...catrope18:53, 18 November 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r57836Changed click handlers to mousedown - improves precieved performance.tparscal23:46, 16 October 2009

Status & tagging log