r67281 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67280‎ | r67281 | r67282 >
Date:16:22, 3 June 2010
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Do not collapse interwikis by default.
Fixes bug 23497, mail and wiki threads.
Note that language links should be easy to find by foreign
users. That's why they are in their own language, not in
the content language. Hiding them under a collapsible does
not favor foreign visitors.
Reportedly, now some people think they have been completely
removed, which is the opposite of an 'easy available link to
the article in your language'.
We might want to try guessing which interwikis may be relevant
to the reader and highlight them somehow, though.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleNav/CollapsibleNav.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleNav/CollapsibleNav.js
@@ -38,7 +38,7 @@
3939 $j( '#panel > div.portal:not(:first)' )
4040 .each( function( i ) {
4141 var state = $j.cookie( 'vector-nav-' + $j(this).attr( 'id' ) );
42 - if ( state == 'true' || ( state == null && i < 1 ) ) {
 42+ if ( state == 'true' || ( state == null && (i < 1 || ( $j(this).attr( 'id' ) == 'p-lang' ) ) ) ) {
4343 $j(this)
4444 .addClass( 'expanded' )
4545 .find( 'div.body' )
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php
@@ -12,7 +12,7 @@
1313
1414 static $scripts = array(
1515 'raw' => array(
16 - array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 14 ),
 16+ array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 15 ),
1717 array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 8 ),
1818 array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 2 ),
1919 array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 8 ),
@@ -20,10 +20,10 @@
2121 array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 15 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'Vector.combined.js', 'version' => 36 ),
 24+ array( 'src' => 'Vector.combined.js', 'version' => 37 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'Vector.combined.min.js', 'version' => 36 ),
 27+ array( 'src' => 'Vector.combined.min.js', 'version' => 37 ),
2828 ),
2929 );
3030 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -38,7 +38,7 @@
3939 $j( '#panel > div.portal:not(:first)' )
4040 .each( function( i ) {
4141 var state = $j.cookie( 'vector-nav-' + $j(this).attr( 'id' ) );
42 - if ( state == 'true' || ( state == null && i < 1 ) ) {
 42+ if ( state == 'true' || ( state == null && (i < 1 || ( $j(this).attr( 'id' ) == 'p-lang' ) ) ) ) {
4343 $j(this)
4444 .addClass( 'expanded' )
4545 .find( 'div.body' )
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -1,7 +1,7 @@
22
33 $j(document).ready(function(){if(!wgVectorEnabledModules.collapsiblenav){return true;}
44 var mod={'browsers':{'ltr':{'opera':[['>=',9.6]],'blackberry':false,'ipod':false,'iphone':false},'rtl':{'opera':[['>=',9.6]],'blackberry':false,'ipod':false,'iphone':false}}};if(!$j.wikiEditor.isSupported(mod)){return true;}
5 -$j('#panel').addClass('collapsible-nav');$j('#panel > div.portal:first').addClass('expanded').find('div.body').show();$j('#panel > div.portal:not(:first)').each(function(i){var state=$j.cookie('vector-nav-'+$j(this).attr('id'));if(state=='true'||(state==null&&i<1)){$j(this).addClass('expanded').find('div.body').show();}else{$j(this).addClass('collapsed');}
 5+$j('#panel').addClass('collapsible-nav');$j('#panel > div.portal:first').addClass('expanded').find('div.body').show();$j('#panel > div.portal:not(:first)').each(function(i){var state=$j.cookie('vector-nav-'+$j(this).attr('id'));if(state=='true'||(state==null&&(i<1||($j(this).attr('id')=='p-lang')))){$j(this).addClass('expanded').find('div.body').show();}else{$j(this).addClass('collapsed');}
66 if(state!=null){$j.cookie('vector-nav-'+$j(this).attr('id'),state,{expires:30});}});function toggle($element){$j.cookie('vector-nav-'+$element.parent().attr('id'),$element.parent().is('.collapsed'),{expires:30});$element.parent().toggleClass('expanded').toggleClass('collapsed').find('div.body').slideToggle('fast');}
77 var $headings=$j('#panel > div.portal > h5');var maxTI=0;$j('[tabindex]').each(function(){var ti=parseInt($j(this).attr('tabindex'));if(ti>maxTI)
88 maxTI=ti;});var tabIndex=maxTI+1;$j('#searchInput').attr('tabindex',tabIndex++);$headings.each(function(){$j(this).attr('tabindex',tabIndex++);});$headings.keydown(function(event){if(event.which==13||event.which==32){toggle($j(this));}}).mousedown(function(){toggle($j(this));$j(this).blur();return false;});});$j(document).ready(function(){if(!wgVectorEnabledModules.collapsibletabs){return true;}

Follow-up revisions

RevisionCommit summaryAuthorDate
r67299Revert r67281: This goes against an intentional design decision. To discuss t...tparscal21:35, 3 June 2010
r675681.16wmf4: Merge r67281 (show language links by default in CollapsibleNav) fro...catrope22:00, 7 June 2010

Comments

#Comment by Heldergeovane (talk | contribs)   20:18, 27 June 2010

Would it be possible to highlight the interwikis for the language of the homewiki of a user which has a global account?

I think this is a good guess of a language which is more relevant for those users. Or maybe using some global preference as in Bug 14950.

#Comment by Platonides (talk | contribs)   18:34, 30 June 2010

It would. Basically you would need to expose it to javascript and css in the header. You should open a bug for that.

#Comment by HeldergeovaneBot (talk | contribs)   21:18, 30 June 2010

Created bugzilla:24193.

Status & tagging log