r68103 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68102‎ | r68103 | r68104 >
Date:20:06, 15 June 2010
Author:tparscal
Status:ok (Comments)
Tags:
Comment:
Blacklisted mobile browsers and IE < 8 for ExpandableSearch
Modified paths:
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/ExpandableSearch/ExpandableSearch.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/ExpandableSearch/ExpandableSearch.js
@@ -5,6 +5,32 @@
66 if( !wgVectorEnabledModules.expandablesearch || skin != 'vector' ) {
77 return true;
88 }
 9+
 10+ /* Browser Support */
 11+
 12+ var map = {
 13+ // Left-to-right languages
 14+ 'ltr': {
 15+ // Collapsible Nav is broken in Opera < 9.6 and Konqueror < 4
 16+ 'msie': [['>=', 8]],
 17+ 'blackberry': false,
 18+ 'ipod': false,
 19+ 'iphone': false,
 20+ 'ps3': false
 21+ },
 22+ // Right-to-left languages
 23+ 'rtl': {
 24+ 'msie': [['>=', 8]],
 25+ 'blackberry': false,
 26+ 'ipod': false,
 27+ 'iphone': false,
 28+ 'ps3': false
 29+ }
 30+ };
 31+ if ( !mw.usability.testBrowser( map ) ) {
 32+ return true;
 33+ }
 34+
935 $j( '#searchInput' )
1036 .expandableField( {
1137 'beforeExpand': function( context ) {
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php
@@ -14,16 +14,16 @@
1515 'raw' => array(
1616 array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 25 ),
1717 array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 8 ),
18 - array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 4 ),
 18+ array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 5 ),
1919 array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 8 ),
2020 array( 'src' => 'Modules/FooterCleanup/FooterCleanup.js', 'version' => 5 ),
2121 array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 17 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'Vector.combined.js', 'version' => 52 ),
 24+ array( 'src' => 'Vector.combined.js', 'version' => 53 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'Vector.combined.min.js', 'version' => 53 ),
 27+ array( 'src' => 'Vector.combined.min.js', 'version' => 54 ),
2828 ),
2929 );
3030 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -347,6 +347,32 @@
348348 if( !wgVectorEnabledModules.expandablesearch || skin != 'vector' ) {
349349 return true;
350350 }
 351+
 352+ /* Browser Support */
 353+
 354+ var map = {
 355+ // Left-to-right languages
 356+ 'ltr': {
 357+ // Collapsible Nav is broken in Opera < 9.6 and Konqueror < 4
 358+ 'msie': [['>=', 8]],
 359+ 'blackberry': false,
 360+ 'ipod': false,
 361+ 'iphone': false,
 362+ 'ps3': false
 363+ },
 364+ // Right-to-left languages
 365+ 'rtl': {
 366+ 'msie': [['>=', 8]],
 367+ 'blackberry': false,
 368+ 'ipod': false,
 369+ 'iphone': false,
 370+ 'ps3': false
 371+ }
 372+ };
 373+ if ( !mw.usability.testBrowser( map ) ) {
 374+ return true;
 375+ }
 376+
351377 $j( '#searchInput' )
352378 .expandableField( {
353379 'beforeExpand': function( context ) {
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -19,6 +19,7 @@
2020 if(fallbackResult!==undefined){return fallbackResult;}
2121 if(wgAction=='submit'||$j('#wpTextbox1').data('origtext')!=$j('#wpTextbox1').val()||$j('#wpSummary').data('origtext')!=$j('#wpSummary').val()){return mw.usability.getMsg('vector-editwarning-warning');}}
2222 $j('form').submit(function(){window.onbeforeunload=fallbackWindowOnBeforeUnload;});});var fallbackWindowOnBeforeUnload=null;$j(document).ready(function(){if(!wgVectorEnabledModules.expandablesearch||skin!='vector'){return true;}
 23+var map={'ltr':{'msie':[['>=',8]],'blackberry':false,'ipod':false,'iphone':false,'ps3':false},'rtl':{'msie':[['>=',8]],'blackberry':false,'ipod':false,'iphone':false,'ps3':false}};if(!mw.usability.testBrowser(map)){return true;}
2324 $j('#searchInput').expandableField({'beforeExpand':function(context){$j(this).parent().animate({'borderTopColor':'#a0d8ff','borderLeftColor':'#a0d8ff','borderRightColor':'#a0d8ff','borderBottomColor':'#a0d8ff'},'fast');},'beforeCondense':function(context){$j(this).parent().animate({'borderTopColor':'#aaaaaa','borderLeftColor':'#aaaaaa','borderRightColor':'#aaaaaa','borderBottomColor':'#aaaaaa'},'fast');},'afterExpand':function(context){if(typeof $j.collapsibleTabs!='undefined'){$j.collapsibleTabs.handleResize();}},'afterCondense':function(context){if(typeof $j.collapsibleTabs!='undefined'){$j.collapsibleTabs.handleResize();}},'expandToLeft':!$j('body').is('.rtl')}).css('float',$j('body').is('.rtl')?'right':'left').siblings('button').css('float',$j('body').is('.rtl')?'left':'right');});$j(document).ready(function(){if(!wgVectorEnabledModules.footercleanup){return true;}
2425 $j('#editpage-copywarn').add('.editOptions').wrapAll('<div id="editpage-bottom"></div>');$j('#wpSummary').data('hint',$j('#wpSummaryLabel span small').remove().text().replace(/\)|\(/g,'')).change(function(){if($j(this).val().length==0){$j(this).addClass('inline-hint').val($j(this).data('hint'));}else{$j(this).removeClass('inline-hint');}}).focus(function(){if($j(this).val()==$j(this).data('hint')){$j(this).removeClass('inline-hint').val("");}}).blur(function(){$j(this).trigger('change');}).trigger('change');$j('#wpSummary').add('.editCheckboxes').wrapAll('<div id="editpage-summary-fields"></div>');$j('#editpage-specialchars').remove();var transclusionCount=$j('.templatesUsed ul li').size();$j('.templatesUsed ul').wrap('<div id="transclusions-list" class="collapsible-list collapsed"></div>').parent().prepend('<label>This page contains <a href="http://en.wikipedia.org/wiki/transclusion">transclusions</a> of <strong>'
2526 +transclusionCount

Comments

#Comment by Catrope (talk | contribs)   11:04, 16 June 2010

What about old versions of Firefox, Opera, Chrome and Safari? Also, why blacklist IE < 8 given that Adam fixed the display bug for IE 6 and 7 in r68108?

#Comment by Trevor Parscal (WMF) (talk | contribs)   16:48, 16 June 2010

We don't know for a fact they have issues - blacklisting is for when we cannot assume good faith, because we know for a fact a browser is acting up. His fix for those browsers was not in the repository at the time. If it is now, this should be lowered.

Status & tagging log