r76511 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76510‎ | r76511 | r76512 >
Date:10:19, 11 November 2010
Author:catrope
Status:ok
Tags:
Comment:
1.16wmf4: MFT r76510
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Vector.combined.js (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Vector.combined.min.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js
@@ -61,7 +61,14 @@
6262 } )
6363 .parents( 'form' )
6464 .bind( 'submit', function() {
65 - $input.trigger( 'focus' );
 65+ // $input.trigger( 'focus' ); is problematic
 66+ // because it actually focuses $input, leading
 67+ // to nasty behavior in mobile browsers
 68+ if ( $input.hasClass( 'placeholder' ) ) {
 69+ $input
 70+ .val( '' )
 71+ .removeClass( 'placeholder' );
 72+ }
6673 } );
6774 if ( $input.val() == '' ) {
6875 $input.trigger( 'blur' );
Property changes on: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js
___________________________________________________________________
Added: svn:mergeinfo
6976 Merged /trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js:r56207,56209,56296,56333,56355,62041,62043,62127,62139,62142-62143,62145-62146,62256,62263,62266-63865,63867-63877,63879-64124,64129-64645,64647-64648,64650-66321,66324,66331-66335,66337-68736,68742-68841,68843-69725,71518
7077 Merged /trunk/phase3/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js:r56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816,65387,65391,65555,65590
7178 Merged /branches/wmf-deployment/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js:r60970
7279 Merged /trunk/phase3/resources/jquery/jquery.placeholder.js:r76510
7380 Merged /branches/REL1_15/phase3/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js:r51646
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -468,7 +468,14 @@
469469 } )
470470 .parents( 'form' )
471471 .bind( 'submit', function() {
472 - $input.trigger( 'focus' );
 472+ // $input.trigger( 'focus' ); is problematic
 473+ // because it actually focuses $input, leading
 474+ // to nasty behavior in mobile browsers
 475+ if ( $input.hasClass( 'placeholder' ) ) {
 476+ $input
 477+ .val( '' )
 478+ .removeClass( 'placeholder' );
 479+ }
473480 } );
474481 if ( $input.val() == '' ) {
475482 $input.trigger( 'blur' );
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -29,6 +29,6 @@
3030 $j('form').submit(function(){window.onbeforeunload=fallbackWindowOnBeforeUnload;});});var fallbackWindowOnBeforeUnload=null;if(wgVectorEnabledModules.simplesearch&&skin=='vector'&&typeof os_autoload_inputs!=='undefined'&&os_autoload_forms!=='undefined'){os_autoload_inputs=[];os_autoload_forms=[];}
3131 $j(document).ready(function(){if(!wgVectorEnabledModules.simplesearch||wgVectorPreferences.simplesearch.disablesuggest||skin!='vector'){return true;}
3232 var mod={'browsers':{'ltr':{'opera':[['>=',9.6]],'docomo':false,'blackberry':false,'ipod':false,'iphone':false},'rtl':{'opera':[['>=',9.6]],'docomo':false,'blackberry':false,'ipod':false,'iphone':false}}};if(!$j.wikiEditor.isSupported(mod)){return true;}
33 -if('placeholder'in document.createElement('input')){$j('div#simpleSearch > input#searchInput').attr('placeholder',mw.usability.getMsg('vector-simplesearch-search'));}else{$j('div#simpleSearch > input#searchInput').each(function(){var $input=$j(this);$input.bind('blur',function(){if($input.val().length==0){$input.val(mw.usability.getMsg('vector-simplesearch-search')).addClass('placeholder');}}).bind('focus',function(){if($input.hasClass('placeholder')){$input.val('').removeClass('placeholder');}}).parents('form').bind('submit',function(){$input.trigger('focus');});if($input.val()==''){$input.trigger('blur');}});}
 33+if('placeholder'in document.createElement('input')){$j('div#simpleSearch > input#searchInput').attr('placeholder',mw.usability.getMsg('vector-simplesearch-search'));}else{$j('div#simpleSearch > input#searchInput').each(function(){var $input=$j(this);$input.bind('blur',function(){if($input.val().length==0){$input.val(mw.usability.getMsg('vector-simplesearch-search')).addClass('placeholder');}}).bind('focus',function(){if($input.hasClass('placeholder')){$input.val('').removeClass('placeholder');}}).parents('form').bind('submit',function(){if($input.hasClass('placeholder')){$input.val('').removeClass('placeholder');}});if($input.val()==''){$input.trigger('blur');}});}
3434 $j('#searchInput, #searchInput2, #powerSearchText, #searchText').suggestions({fetch:function(query){var $this=$j(this);var request=$j.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':query,'namespace':0,'suggest':''},dataType:'json',success:function(data){$this.suggestions('suggestions',data[1]);}});$j(this).data('request',request);},cancel:function(){var request=$j(this).data('request');if(request&&typeof request.abort=='function'){request.abort();$j(this).removeData('request');}},result:{select:function($textbox){$textbox.closest('form').submit();}},delay:120,positionFromLeft:$j('body').is('.rtl'),highlightInput:true}).bind('paste cut',function(e){$j(this).trigger('keypress');});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){if($j(this).children().size()==0){$j(this).show()
3535 $label=$j('<div />').addClass('special-label').text(mw.usability.getMsg('vector-simplesearch-containing')).appendTo($j(this));$query=$j('<div />').addClass('special-query').text(query).appendTo($j(this));$query.autoEllipsis();}else{$j(this).find('.special-query').empty().text(query).autoEllipsis();}},select:function($textbox){$textbox.closest('form').append($j('<input />').attr({'type':'hidden','name':'fulltext','value':1}));$textbox.closest('form').submit();}},$region:$j('#simpleSearch')});});
\ No newline at end of file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76510(bug 25877) Don't focus search box when clicking SimpleSearch's magnifying cl...catrope10:15, 11 November 2010

Status & tagging log