r67728 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67727‎ | r67728 | r67729 >
Date:15:28, 9 June 2010
Author:catrope
Status:deferred
Tags:
Comment:
Declare some more vars, fix for r67548
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
@@ -102,8 +102,8 @@
103103 } );
104104 }
105105 // Shortcuts to the two lists
106 - $primary = $j( '#p-lang ul.primary' );
107 - $secondary = $j( '#p-lang ul.secondary' );
 106+ var $primary = $j( '#p-lang ul.primary' );
 107+ var $secondary = $j( '#p-lang ul.secondary' );
108108 // Adjust the limit based on the threshold
109109 if ( $secondary.children().length < limit + threshold ) {
110110 limit += threshold;
@@ -111,7 +111,7 @@
112112 // Move up to 5 of the links into the primary list, based on the priorities set forth in the languages list
113113 var count = 0;
114114 for ( var i = 0; i < languages.length; i++ ) {
115 - $link = $secondary.find( '.interwiki-' + languages[i] );
 115+ var $link = $secondary.find( '.interwiki-' + languages[i] );
116116 if ( $link.length ) {
117117 if ( count++ < limit ) {
118118 $link.appendTo( $primary );
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' => 22 ),
 16+ array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 23 ),
1717 array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 8 ),
1818 array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 3 ),
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' => 45 ),
 24+ array( 'src' => 'Vector.combined.js', 'version' => 46 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'Vector.combined.min.js', 'version' => 45 ),
 27+ array( 'src' => 'Vector.combined.min.js', 'version' => 46 ),
2828 ),
2929 );
3030 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -102,8 +102,8 @@
103103 } );
104104 }
105105 // Shortcuts to the two lists
106 - $primary = $j( '#p-lang ul.primary' );
107 - $secondary = $j( '#p-lang ul.secondary' );
 106+ var $primary = $j( '#p-lang ul.primary' );
 107+ var $secondary = $j( '#p-lang ul.secondary' );
108108 // Adjust the limit based on the threshold
109109 if ( $secondary.children().length < limit + threshold ) {
110110 limit += threshold;
@@ -111,7 +111,7 @@
112112 // Move up to 5 of the links into the primary list, based on the priorities set forth in the languages list
113113 var count = 0;
114114 for ( var i = 0; i < languages.length; i++ ) {
115 - $link = $secondary.find( '.interwiki-' + languages[i] );
 115+ var $link = $secondary.find( '.interwiki-' + languages[i] );
116116 if ( $link.length ) {
117117 if ( count++ < limit ) {
118118 $link.appendTo( $primary );
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -4,8 +4,8 @@
55 var version=1;if(wgCollapsibleNavForceNewVersion==true){version=2;}else{if(wgCollapsibleNavBucketTest==true){version=$j.cookie('vector-nav-pref-version');if(version==null){version=Math.round(Math.random()+1);$j.cookie('vector-nav-pref-version',version,{'expires':30,'path':'/'});}}}
66 if(version==2){var limit=5;var threshold=3;$j('#p-lang ul').addClass('secondary').before('<ul class="primary"></ul>');var languages=['en','fr','de','es','pt','it','ru','ja','nl','pl','zh','sv','ar','tr','uk','fi','no','ca','ro','hu','ksh','id','he','cs','vi','ko','sr','fa','da','eo','sk','th','lt','vo','bg','sl','hr','hi','et','mk','simple','new','ms','nn','gl','el','eu','ka','tl','bn','lv','ml','bs','te','la','az','sh','war','br','is','mr','be-x-old','sq','cy','lb','ta','zh-classical','an','jv','ht','oc','bpy','ceb','ur','zh-yue','pms','scn','be','roa-rup','qu','af','sw','nds','fy','lmo','wa','ku','hy','su','yi','io','os','ga','ast','nap','vec','gu','cv','bat-smg','kn','uz','zh-min-nan','si','als','yo','li','gan','arz','sah','tt','bar','gd','tg','kk','pam','hsb','roa-tara','nah','mn','vls','gv','mi','am','ia','co','ne','fo','nds-nl','glk','mt','ang','wuu','dv','km','sco','bcl','mg','my','diq','tk','szl','ug','fiu-vro','sc','rm','nrm','ps','nv','hif','bo','se','sa','pnb','map-bms','lad','lij','crh','fur','kw','to','pa','jbo','ba','ilo','csb','wo','xal','krc','ckb','pag','ln','frp','mzn','ce','nov','kv','eml','gn','ky','pdc','lo','haw','mhr','dsb','stq','tpi','arc','hak','ie','so','bh','ext','mwl','sd','ig','myv','ay','iu','na','cu','pi','kl','ty','lbe','ab','got','sm','as','mo','ee','zea','av','ace','kg','bm','cdo','cbk-zam','kab','om','chr','pap','udm','ks','zu','rmy','cr','ch','st','ik','mdf','kaa','aa','fj','srn','tet','or','pnt','bug','ss','ts','pcd','pih','za','sg','lg','bxr','xh','ak','ha','bi','ve','tn','ff','dz','ti','ki','ny','rw','chy','tw','sn','tum','ng','rn','mh','ii','cho','hz','kr','ho','mus','kj'];var acceptLangCookie=$j.cookie('accept-language');if(acceptLangCookie!=null){if(acceptLangCookie!=''){languages=acceptLangCookie.split(',').concat(languages);}}else{$j.getJSON(wgScriptPath+'/api.php?action=query&meta=userinfo&uiprop=acceptlang&format=json',function(data){var langs=[];if(typeof data.query!='undefined'&&typeof data.query.userinfo!='undefined'&&typeof data.query.userinfo.acceptlang!='undefined'){for(var j=0;j<data.query.userinfo.acceptlang.length;j++){if(data.query.userinfo.acceptlang[j].q!=0){langs.push(data.query.userinfo.acceptlang[j]['*']);}}}
77 $j.cookie('accept-language',langs.join(','),{'path':'/','expires':30});});}
8 -$primary=$j('#p-lang ul.primary');$secondary=$j('#p-lang ul.secondary');if($secondary.children().length<limit+threshold){limit+=threshold;}
9 -var count=0;for(var i=0;i<languages.length;i++){$link=$secondary.find('.interwiki-'+languages[i]);if($link.length){if(count++<limit){$link.appendTo($primary);}else{break;}}}
 8+var $primary=$j('#p-lang ul.primary');var $secondary=$j('#p-lang ul.secondary');if($secondary.children().length<limit+threshold){limit+=threshold;}
 9+var count=0;for(var i=0;i<languages.length;i++){var $link=$secondary.find('.interwiki-'+languages[i]);if($link.length){if(count++<limit){$link.appendTo($primary);}else{break;}}}
1010 if(count<limit){$secondary.children().each(function(){if(count++<limit){$j(this).appendTo($primary);}else{return false;}});}
1111 if($secondary.children().length==0){$secondary.remove();}else{$j('#p-lang').after('<div id="p-lang-more" class="portal"><h5></h5><div class="body"></div></div>');$j('#p-lang-more h5').text(mw.usability.getMsg('vector-collapsiblenav-more'));$secondary.appendTo($j('#p-lang-more div.body'));}
1212 $j('#p-lang').addClass('persistent');}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r67548Changed collapsible navigation to split languages into two portals, one that'...tparscal17:49, 7 June 2010

Status & tagging log