http://www.mediawiki.org/wiki/Special:Code/MediaWiki/58253

Revision: 58253
Author:   catrope
Date:     2009-10-28 12:05:52 +0000 (Wed, 28 Oct 2009)

Log Message:
-----------
EditToolbar: (bug 21323) Clicking tabs makes browser jump to top of page; 
regression from r57836

Modified Paths:
--------------
    trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
    trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
    trunk/extensions/UsabilityInitiative/js/plugins.combined.js
    trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js

Modified: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
===================================================================
--- trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php  
2009-10-28 11:06:29 UTC (rev 58252)
+++ trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php  
2009-10-28 12:05:52 UTC (rev 58253)
@@ -70,15 +70,15 @@
                                array( 'src' => 
'js/plugins/jquery.suggestions.js', 'version' => 6 ),
                                array( 'src' => 
'js/plugins/jquery.textSelection.js', 'version' => 16 ),
                                array( 'src' => 
'js/plugins/jquery.wikiEditor.js', 'version' => 12 ),
-                               array( 'src' => 
'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 16 ),
+                               array( 'src' => 
'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 17 ),
                                array( 'src' => 
'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 6 ),
                                array( 'src' => 
'js/plugins/jquery.wikiEditor.toc.js', 'version' => 22 ),
                        ),
                        'combined' => array(
-                               array( 'src' => 'js/plugins.combined.js', 
'version' => 51 ),
+                               array( 'src' => 'js/plugins.combined.js', 
'version' => 52 ),
                        ),
                        'minified' => array(
-                               array( 'src' => 'js/plugins.combined.min.js', 
'version' => 51 ),
+                               array( 'src' => 'js/plugins.combined.min.js', 
'version' => 52 ),
                        ),
                ),
        );

Modified: 
trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
===================================================================
--- 
trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js    
    2009-10-28 11:06:29 UTC (rev 58252)
+++ 
trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js    
    2009-10-28 12:05:52 UTC (rev 58253)
@@ -488,8 +488,8 @@
                                                        'wikiEditor-' + 
$(this).data( 'context' ).instance + '-toolbar-section',
                                                        show ? $section.attr( 
'rel' ) : null
                                                );
-                                               return false;
                                        } )
+                                       .click( function() { return false; } )
                        );
        },
        buildSection : function( context, id, section ) {

Modified: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
===================================================================
--- trunk/extensions/UsabilityInitiative/js/plugins.combined.js 2009-10-28 
11:06:29 UTC (rev 58252)
+++ trunk/extensions/UsabilityInitiative/js/plugins.combined.js 2009-10-28 
12:05:52 UTC (rev 58253)
@@ -2118,8 +2118,8 @@
                                                        'wikiEditor-' + 
$(this).data( 'context' ).instance + '-toolbar-section',
                                                        show ? $section.attr( 
'rel' ) : null
                                                );
-                                               return false;
                                        } )
+                                       .click( function() { return false; } )
                        );
        },
        buildSection : function( context, id, section ) {

Modified: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
===================================================================
--- trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js     
2009-10-28 11:06:29 UTC (rev 58252)
+++ trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js     
2009-10-28 12:05:52 UTC (rev 58253)
@@ -134,7 +134,7 @@
 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]}}};}
 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');});}
 
if($.trackAction!=undefined){$.trackAction($section.attr('rel')+'.'+(show?'show':'hide'));}
-$.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]));}}
+$.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]));}}
 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]));}}
 $section=$('<div />').attr({'class':'booklet section 
section-'+id,'rel':id}).append($index).append($pages);$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,page,$pages,$index);break;}
 if($section!==null&&id!=='main'){var 
show=selected==id;$section.css('display',show?'block':'none');}



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to